From 98e2189014159ffce81a55cd6d2dbabcd89b08f4 Mon Sep 17 00:00:00 2001 From: Andromeda Yelton Date: Fri, 3 Feb 2012 10:22:53 -0500 Subject: [PATCH 1/9] now there is a latest comments page --- frontend/templates/comments.html | 97 ++++++++++++++++++++++++++++++++ frontend/urls.py | 1 + frontend/views.py | 4 ++ static/css/comments.css | 49 ++++++++++++++++ static/less/comments.less | 62 ++++++++++++++++++++ 5 files changed, 213 insertions(+) create mode 100644 frontend/templates/comments.html create mode 100644 static/css/comments.css create mode 100644 static/less/comments.less diff --git a/frontend/templates/comments.html b/frontend/templates/comments.html new file mode 100644 index 00000000..214aefd6 --- /dev/null +++ b/frontend/templates/comments.html @@ -0,0 +1,97 @@ +{% extends "base.html" %} +{% comment %} +need to style the rest of the way.... +explore bar +look at other elements of site -- popular, who's ungluing what, ?? -- for design ideas +ponder width of items once sidebars are in +realtime updating? +comments rss? +make link go directly to comments tab +{% endcomment %} + +{% block title %} Comments {% endblock %} +{% block extra_css %} + + +{% endblock %} +{% block extra_head %} + + + + + + +{% endblock %} +{% block topsection %} + +
+
+
+
+
+
+
+
+
Latest Comments
+
+
With your help we're raising money to buy the right to give these books to the world. +
+
+
+
+
+
+
+
+ +
+
+ +{% endblock %} + +{% block content %} +
+
+
+ {% include "explore.html" %} +
+ +
+
+
+
+
+ {% for comment in latest_comments %} + {% with comment.content_object.id as id %} + + {% endwith %} + {% endfor %} + +
+
+
+
+
+
+{% endblock %} diff --git a/frontend/urls.py b/frontend/urls.py index ee0609fb..b1f86abe 100644 --- a/frontend/urls.py +++ b/frontend/urls.py @@ -60,6 +60,7 @@ urlpatterns = patterns( name="press"), url(r"^about/$", TemplateView.as_view(template_name="about.html"), name="about"), + url(r"^comments/$", "comment", name="comment"), ) if not settings.IS_PREVIEW: diff --git a/frontend/views.py b/frontend/views.py index 88a7f0ce..1794770f 100755 --- a/frontend/views.py +++ b/frontend/views.py @@ -20,6 +20,7 @@ from django.core.urlresolvers import reverse from django.core.exceptions import ObjectDoesNotExist from django.core.mail import send_mail from django.contrib import messages +from django.contrib.comments import Comment from django.forms import Select from django.forms.models import modelformset_factory from django.http import HttpResponseRedirect @@ -1299,3 +1300,6 @@ def feedback(request): return render(request, "feedback.html", {'form':form, 'num1':num1, 'num2':num2}) +def comment(request): + latest_comments = Comment.objects.all()[:20] + return render(request, "comments.html", {'latest_comments': latest_comments}) \ No newline at end of file diff --git a/static/css/comments.css b/static/css/comments.css new file mode 100644 index 00000000..a7d02fd6 --- /dev/null +++ b/static/css/comments.css @@ -0,0 +1,49 @@ +.comments { + clear: both; + padding: 5px; + margin: 0 5px 0 0; + width: 95%; +} +.comments.row1 { + background: #f6f9f9; +} +.comments.row2 { + background: #fff; +} +.comments div { + float: left; +} +.comments div img { + margin: 0 5px; +} +.comments .image img { + height: 100px; +} +.comments:after { + content: "."; + display: block; + height: 0; + clear: both; + visibility: hidden; +} +.comments .nonavatar { + width: 620px; +} +.comments .nonavatar span { + padding-right: 5px; +} +.comments .nonavatar span.text:before { + content: "\201C"; + font-size: 17px; + font-weight: bold; +} +.comments .nonavatar span.text:after { + content: "\201D"; + font-size: 17px; + font-weight: bold; +} +.comments .avatar { + float: right; + margin: 0 auto; + padding-top: 5px; +} diff --git a/static/less/comments.less b/static/less/comments.less new file mode 100644 index 00000000..9fa7fce6 --- /dev/null +++ b/static/less/comments.less @@ -0,0 +1,62 @@ +.comments { + clear: both; + padding: 5px; + margin: 0 5px 0 0; + //min-height: 105px; + width: 95%; + + &.row1 { + background: #f6f9f9; + } + + &.row2 { + background: #fff; + } + + div { + float: left; + + img { + margin: 0 5px; + } + } + + .image img { + height: 100px; + } + + // so div will stretch to height of content + &:after { + content: "."; + display: block; + height: 0; + clear: both; + visibility: hidden; + } + + .nonavatar { + width: 620px; + + span { + padding-right: 5px; + + &.text:before { + content: "\201C"; + font-size: 17px; + font-weight: bold; + } + + &.text:after { + content: "\201D"; + font-size: 17px; + font-weight: bold; + } + } + } + + .avatar { + float: right; + margin: 0 auto; + padding-top: 5px; + } +} \ No newline at end of file From 762eabeaf4e93c6b9d0ab2666099d9e92d99a062 Mon Sep 17 00:00:00 2001 From: Andromeda Yelton Date: Fri, 3 Feb 2012 12:03:34 -0500 Subject: [PATCH 2/9] awesomeifying aesthetically --- frontend/templates/comments.html | 5 ----- 1 file changed, 5 deletions(-) diff --git a/frontend/templates/comments.html b/frontend/templates/comments.html index 214aefd6..61f8001b 100644 --- a/frontend/templates/comments.html +++ b/frontend/templates/comments.html @@ -1,12 +1,7 @@ {% extends "base.html" %} {% comment %} -need to style the rest of the way.... -explore bar -look at other elements of site -- popular, who's ungluing what, ?? -- for design ideas -ponder width of items once sidebars are in realtime updating? comments rss? -make link go directly to comments tab {% endcomment %} {% block title %} Comments {% endblock %} From 808a46a9e7535eb595ab1b079e54639c19e5baae Mon Sep 17 00:00:00 2001 From: Andromeda Yelton Date: Fri, 3 Feb 2012 12:04:09 -0500 Subject: [PATCH 3/9] clicking X ungluers are wishing now activates supporter tab --- frontend/templates/work.html | 8 +++++--- static/js/tabs4.js | 9 +++++++++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/frontend/templates/work.html b/frontend/templates/work.html index 805642e9..1d1f97ac 100644 --- a/frontend/templates/work.html +++ b/frontend/templates/work.html @@ -46,17 +46,19 @@ jQuery(document).ready(function(){ {% else %}{% if status == 'WITHDRAWN' %} Campaign withdrawn.
See FAQ. {% else %}{% if wishers == 1 %} - {{ wishers }} Ungluer is WISHING + {{ wishers }} Ungluer is WISHING {% else %} - {{ wishers }} Ungluers are WISHING + {{ wishers }} Ungluers are WISHING {% endif %}{% endif %}{% endif %}{% endif %}{% endif %} {% endif %} {% else %} + {% if wishers == 1 %} {{ wishers }} Ungluer is WISHING {% else %} {{ wishers }} Ungluers are WISHING {% endif %} + {% endif %}{% endif %}  
 
@@ -163,7 +165,7 @@ jQuery(document).ready(function(){ diff --git a/static/js/tabs4.js b/static/js/tabs4.js index d426b247..337f2ee4 100644 --- a/static/js/tabs4.js +++ b/static/js/tabs4.js @@ -37,4 +37,13 @@ $j('#tabs-1').hide(200); $j('#tabs-3').hide(200); }); + $j('.findtheungluers').click(function(){ + $j('#tabs').find('.active').removeClass('active'); + $j('#supporters').addClass('active'); + $j('.content-block-content').find('.active').removeClass('active'); + $j('#tabs-3').addClass('active').show(300); + $j('#tabs-2').hide(200); + $j('#tabs-1').hide(200); + $j('#tabs-4').hide(200); + }); }); \ No newline at end of file From 0653cfb648b861170989de285b855d7f7635eb1b Mon Sep 17 00:00:00 2001 From: Andromeda Yelton Date: Fri, 3 Feb 2012 12:04:24 -0500 Subject: [PATCH 4/9] minor wording tweak --- frontend/templates/work_list.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/templates/work_list.html b/frontend/templates/work_list.html index 4b3cfb01..4840b433 100644 --- a/frontend/templates/work_list.html +++ b/frontend/templates/work_list.html @@ -80,7 +80,7 @@
{% ifequal work_list.count 0 %} - There aren't any works in this list. Why don't you add some? + There aren't any works in this list yet. Why not add your favorite books to your wishlist, so we can feature them here? {% else %} {% paginate 20 work_list %} {% for work in work_list %} From 607191fba9402c8bd91b76c67d9db01b0806d147 Mon Sep 17 00:00:00 2001 From: Andromeda Yelton Date: Fri, 3 Feb 2012 12:04:54 -0500 Subject: [PATCH 5/9] add and remove wishlist now provide immediate feedback --- static/js/wishlist.js | 44 +++++++++++++++++++++++++++++++------------ 1 file changed, 32 insertions(+), 12 deletions(-) diff --git a/static/js/wishlist.js b/static/js/wishlist.js index 99fbf766..a9a1a06f 100644 --- a/static/js/wishlist.js +++ b/static/js/wishlist.js @@ -7,12 +7,19 @@ $j(document).ready(function() { var span = $j(element).find("span"); var gb_id = span.attr('id') if (!gb_id) return; + + // give immediate feedback that action is in progress + newSpan = $j('Adding...').hide(); + span.replaceWith(newSpan); + newSpan.show(); + + // actually perform action jQuery.post('/wishlist/', {'googlebooks_id': gb_id}, function(data) { - span.fadeOut(); - var newSpan = $j('On Wishlist!').hide(); - span.replaceWith(newSpan); - newSpan.fadeIn('slow'); - newSpan.removeAttr("id"); + newSpan.fadeOut(); + var nextSpan = $j('On Wishlist!').hide(); + newSpan.replaceWith(nextSpan); + nextSpan.fadeIn('slow'); + nextSpan.removeAttr("id"); }); }); }); @@ -45,10 +52,17 @@ $j(document).ready(function() { $j(element).click(function() { var span = $j(element).find("span"); var work_id = span.attr('id') + + // provide feedback + var newSpan = $j('Removing...').hide(); + span.replaceWith(newSpan); + newSpan.show(); + + // perform action jQuery.post('/wishlist/', {'remove_work_id': work_id}, function(data) { - span.parent().fadeOut(); + newSpan.parent().fadeOut(); var newDiv = $j('
Add to Wishlist
').hide(); - span.parent().replaceWith(newDiv); + newSpan.parent().replaceWith(newDiv); newDiv.fadeIn('slow'); }); }); @@ -64,12 +78,18 @@ $k(document).delegate(".add-wishlist-workpage span", "click", function() { var span = $k(this); var work_id = span.attr("class"); if (!work_id) return; + + // give immediate feedback that action is in progress + newSpan = $j('Adding...').hide(); + span.replaceWith(newSpan); + newSpan.show(); + jQuery.post('/wishlist/', {'add_work_id': work_id}, function(data) { - span.fadeOut(); - var newSpan = $k('On Wishlist!').hide(); - span.replaceWith(newSpan); - newSpan.fadeIn('slow'); - newSpan.removeAttr("id"); + newSpan.fadeOut(); + var nextSpan = $k('On Wishlist!').hide(); + newSpan.replaceWith(nextSpan); + nextSpan.fadeIn('slow'); + nextSpan.removeAttr("id"); }); }); From 8d17e2d0d606cd25aa6fb173f62c1d034d39bc93 Mon Sep 17 00:00:00 2001 From: Andromeda Yelton Date: Fri, 3 Feb 2012 12:05:02 -0500 Subject: [PATCH 6/9] tweak all the things --- frontend/views.py | 2 ++ static/css/campaign.css | 3 +++ static/less/campaign.less | 13 +++++++++---- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/frontend/views.py b/frontend/views.py index 1794770f..62a4edb2 100755 --- a/frontend/views.py +++ b/frontend/views.py @@ -116,6 +116,8 @@ def work(request, work_id, action='display'): try: activetab = request.GET['tab'] + if activetab not in ['1', '2', '3', '4']: + activetab = '1'; except: activetab = '1'; diff --git a/static/css/campaign.css b/static/css/campaign.css index 1472bf37..b2b47abd 100755 --- a/static/css/campaign.css +++ b/static/css/campaign.css @@ -92,6 +92,9 @@ #js-leftcol .jsmodule.rounded .jsmod-content span.spacer { visibility: none; } +#js-leftcol .jsmodule.rounded .jsmod-content span.findtheungluers { + cursor: pointer; +} .book-detail { float: left; width: 100%; diff --git a/static/less/campaign.less b/static/less/campaign.less index 3649fbea..26623688 100644 --- a/static/less/campaign.less +++ b/static/less/campaign.less @@ -64,11 +64,16 @@ span { display: inline-block; vertical-align: middle; + + &.spacer { + visibility: none; + } + + &.findtheungluers { + cursor: pointer; + } } - - span.spacer { - visibility: none; - } + } } From 73e11c67b34c1dbcc3f520482c2c512565f56916 Mon Sep 17 00:00:00 2001 From: Andromeda Yelton Date: Fri, 3 Feb 2012 12:20:32 -0500 Subject: [PATCH 7/9] making signup arrow in learn more section more closely coupled with signup call-to-action --- frontend/templates/learn_more.html | 2 +- static/css/documentation.css | 11 +++++++++-- static/css/landingpage.css | 11 +++++++++-- static/css/learnmore.css | 11 +++++++++-- static/less/learnmore.less | 13 +++++++++++-- 5 files changed, 39 insertions(+), 9 deletions(-) diff --git a/frontend/templates/learn_more.html b/frontend/templates/learn_more.html index 920cf4bd..93f7bbc3 100644 --- a/frontend/templates/learn_more.html +++ b/frontend/templates/learn_more.html @@ -29,7 +29,7 @@
Unglue.it offers a win-win solution: Crowdfunding. We run pledge campaigns for books; you chip in. When, together, we've reached the goal, we'll reward the book's creators and issue an unglued ebook.
-
Creative Commons licensing means everyone, everywhere can read and share the unglued book — freely and legally. You've given your favorite book to the world.
+
Creative Commons licensing means everyone, everywhere can read and share the unglued book — freely and legally. You've given your favorite book to the world.
diff --git a/static/css/documentation.css b/static/css/documentation.css index 9582b62a..436aa37c 100644 --- a/static/css/documentation.css +++ b/static/css/documentation.css @@ -131,8 +131,15 @@ .user-block-hide .quicktour.last { padding-right: 0px; width: 270px; - background: url("/static/images/landingpage/signmeup-arrow.png") no-repeat center bottom; - padding-bottom: 42px; +} +.user-block-hide .quicktour.last .signup { + color: #8dc63f; + font-weight: bold; + margin-top: 10px; +} +.user-block-hide .quicktour.last .signup img { + margin-left: 5px; + vertical-align: middle; } .user-block-hide .movingrightalong { background: url("/static/images/landingpage/quicktour-arrow.png") no-repeat center; diff --git a/static/css/landingpage.css b/static/css/landingpage.css index 462e22ab..6a6fe232 100644 --- a/static/css/landingpage.css +++ b/static/css/landingpage.css @@ -131,8 +131,15 @@ .user-block-hide .quicktour.last { padding-right: 0px; width: 270px; - background: url("/static/images/landingpage/signmeup-arrow.png") no-repeat center bottom; - padding-bottom: 42px; +} +.user-block-hide .quicktour.last .signup { + color: #8dc63f; + font-weight: bold; + margin-top: 10px; +} +.user-block-hide .quicktour.last .signup img { + margin-left: 5px; + vertical-align: middle; } .user-block-hide .movingrightalong { background: url("/static/images/landingpage/quicktour-arrow.png") no-repeat center; diff --git a/static/css/learnmore.css b/static/css/learnmore.css index 32c4ddef..fb32cb11 100644 --- a/static/css/learnmore.css +++ b/static/css/learnmore.css @@ -68,8 +68,15 @@ .user-block-hide .quicktour.last { padding-right: 0px; width: 270px; - background: url("/static/images/landingpage/signmeup-arrow.png") no-repeat center bottom; - padding-bottom: 42px; +} +.user-block-hide .quicktour.last .signup { + color: #8dc63f; + font-weight: bold; + margin-top: 10px; +} +.user-block-hide .quicktour.last .signup img { + margin-left: 5px; + vertical-align: middle; } .user-block-hide .movingrightalong { background: url("/static/images/landingpage/quicktour-arrow.png") no-repeat center; diff --git a/static/less/learnmore.less b/static/less/learnmore.less index c91b8a2c..69aaa50c 100644 --- a/static/less/learnmore.less +++ b/static/less/learnmore.less @@ -22,8 +22,17 @@ &.last { padding-right:0px; width:270px; - background: url("@{image-base}landingpage/signmeup-arrow.png") no-repeat center bottom; - padding-bottom: 42px; + + .signup { + color: @call-to-action; + font-weight: bold; + margin-top: 10px; + + img { + margin-left: 5px; + vertical-align: middle; + } + } } } From 0e92aae0b5c1092c1f0875ef0eeecff6647038fb Mon Sep 17 00:00:00 2001 From: Andromeda Yelton Date: Fri, 3 Feb 2012 12:28:48 -0500 Subject: [PATCH 8/9] crowdfunding graphic now links to faq item --- frontend/templates/faq.html | 2 +- frontend/templates/home.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/templates/faq.html b/frontend/templates/faq.html index b46b6a2e..f83843af 100644 --- a/frontend/templates/faq.html +++ b/frontend/templates/faq.html @@ -17,7 +17,7 @@
TBA
-
What is Crowdfunding?
+
What is Crowdfunding?
Crowdfunding is working together to support something you believe in. By pooling donations, big and small, from all over the world, we can make huge things happen.
diff --git a/frontend/templates/home.html b/frontend/templates/home.html index d9a8353b..e82393ea 100755 --- a/frontend/templates/home.html +++ b/frontend/templates/home.html @@ -101,7 +101,7 @@ var $j = jQuery.noConflict();

Give ebooks to the world.

- How does it work? + How does it work?
From baa7c054002cd9a326b020dddf35f40fbaa30a9e Mon Sep 17 00:00:00 2001 From: Andromeda Yelton Date: Fri, 3 Feb 2012 12:32:09 -0500 Subject: [PATCH 9/9] you are now returned to the comments tab after posting a comment --- frontend/templates/comments/form.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/templates/comments/form.html b/frontend/templates/comments/form.html index a719f999..0744fe7c 100644 --- a/frontend/templates/comments/form.html +++ b/frontend/templates/comments/form.html @@ -14,7 +14,7 @@ {% endif %} {% endfor %} - +