Give more prominence to CC books on landing page

pull/1/head
eric 2014-03-05 14:02:12 -05:00
parent 8af7dfcb88
commit 7fba1a212b
2 changed files with 19 additions and 1 deletions

View File

@ -80,6 +80,18 @@ function put_un_in_cookie2(){
{% endfor %}
<a class="more_featured_books" href="{% url unglued_list '' %}"></a>
</div>
<div class="spacer"></div>
<h3 class="featured_books">Latest Creative Commons</h3>
<div>
{% for work in cc_books %}
{% with work.googlebooks_id as googlebooks_id %}
{% with "ACTIVE" as status %}
{% with work.last_campaign.deadline as deadline %}
{% include "book_panel.html" %}
{% endwith %}{% endwith %}{% endwith %}
{% endfor %}
<a class="more_featured_books" href="{% url cc_list %}"></a>
</div>
<div class="spacer"></div>
<h3 class="featured_books">Site Faves</h3>

View File

@ -228,6 +228,11 @@ def home(request, landing=False):
most_wished = models.Work.objects.order_by('-num_wishes')[:4]
unglued_books = models.Work.objects.filter(campaigns__status="SUCCESSFUL").order_by('-campaigns__deadline')[:4]
cc_books = models.Work.objects.filter(
editions__ebooks__isnull=False,
editions__ebooks__rights__in=['CC BY', 'CC BY-NC-SA', 'CC BY-NC-ND', 'CC BY-NC', 'CC BY-ND', 'CC BY-SA']
).distinct().order_by('-created')[:4]
"""
get various recent types of site activity
@ -290,7 +295,8 @@ def home(request, landing=False):
'top_campaigns': top_campaigns,
'coming_soon': coming_soon,
'unglued_books': unglued_books,
'most_wished': most_wished
'cc_books': cc_books,
'most_wished': most_wished,
}
)