changed work_list page to clearly communicate that it's staff picks when facet = recommended
parent
ce468f2bbc
commit
6e1aa4dfd0
|
@ -27,12 +27,24 @@
|
|||
<div class="js-topnews3">
|
||||
<div class="user-block">
|
||||
<div id="user-block1">
|
||||
<div id="block-intro-text"><span class="special-user-name">{{ facet|capfirst }}</span></div>
|
||||
</div>
|
||||
<div class="user-block2"><span class="user-short-info">With your help we're raising money to buy the rights to give these books to the world.</span>
|
||||
</div>
|
||||
<div class="user-block3">
|
||||
</div>
|
||||
{% if facet == 'recommended' %}
|
||||
<div id="block-intro-text"><span class="special-user-name">Staff Picks</span></div>
|
||||
</div>
|
||||
<div class="user-block2"><span class="user-short-info">Here are the books {% for staffer in unglue_staff %}{% if not forloop.last %}<a href="{% url supporter '{{ staffer }}' %}">{{ staffer }}</a>, {% else %} and <a href="{% url supporter '{{ staffer }}' %}">{{ staffer }}</a>{% endif %}{% endfor %} are loving lately.</span>
|
||||
</div>
|
||||
<div class="user-block3 recommended">
|
||||
{% for staffer in unglue_staff %}
|
||||
<img class="user-avatar" src="{{ staffer.profile.pic_url }}" height="50" width="50" alt="Picture of {{ supporter }}" title="{{ supporter }}" />
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% else %}
|
||||
<div id="block-intro-text"><span class="special-user-name">{{ facet|capfirst }}</span></div>
|
||||
</div>
|
||||
<div class="user-block2"><span class="user-short-info">With your help we're raising money to buy the rights to give these books to the world.</span>
|
||||
</div>
|
||||
<div class="user-block3">
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -82,7 +94,11 @@
|
|||
</div>
|
||||
<div id="content-block-content">
|
||||
{% ifequal work_list.count 0 %}
|
||||
{% if facet == 'recommended' %}
|
||||
Check back soon to see what we're recommending.
|
||||
{% else %}
|
||||
There aren't any works in this list yet. Why not add your favorite books to your wishlist, so we can feature them here?
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{% lazy_paginate 20 works_unglued using "works_unglued" %}
|
||||
{% for work in works_unglued %}
|
||||
|
|
|
@ -343,7 +343,7 @@ class WorkListView(ListView):
|
|||
context = super(WorkListView, self).get_context_data(**kwargs)
|
||||
qs=self.get_queryset()
|
||||
context['ungluers'] = userlists.work_list_users(qs,5)
|
||||
context['facet'] =self.kwargs['facet']
|
||||
context['facet'] = self.kwargs['facet']
|
||||
context['works_unglued'] = qs.filter(editions__ebooks__isnull=False).distinct()
|
||||
context['works_active'] = qs.exclude(editions__ebooks__isnull=False).filter(Q(campaigns__status='ACTIVE') | Q(campaigns__status='SUCCESSFUL')).distinct()
|
||||
context['works_wished'] = qs.exclude(editions__ebooks__isnull=False).exclude(campaigns__status='ACTIVE').exclude(campaigns__status='SUCCESSFUL').distinct()
|
||||
|
@ -355,6 +355,11 @@ class WorkListView(ListView):
|
|||
counts['unglueing'] = context['works_active'].count()
|
||||
counts['wished'] = context['works_wished'].count()
|
||||
context['counts'] = counts
|
||||
|
||||
if (self.kwargs['facet'] == 'recommended'):
|
||||
unglue_staff = models.User.objects.filter(is_staff=True)
|
||||
context['unglue_staff'] = unglue_staff
|
||||
|
||||
return context
|
||||
|
||||
class UngluedListView(ListView):
|
||||
|
|
|
@ -163,6 +163,9 @@
|
|||
float: left;
|
||||
width: 25%;
|
||||
}
|
||||
.user-block3.recommended, .user-block4.recommended {
|
||||
margin-top: auto;
|
||||
}
|
||||
.user-block3 {
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
|
|
@ -91,6 +91,10 @@
|
|||
.user-block4 {
|
||||
float:left;
|
||||
width:25%;
|
||||
|
||||
&.recommended {
|
||||
margin-top: auto;
|
||||
}
|
||||
}
|
||||
|
||||
.user-block3 {
|
||||
|
|
Loading…
Reference in New Issue