Merge pull request #178 from Gluejar/pubs_default_to_active
work lists with active campaigns should highlight thempull/1/head
commit
a7a176ca3c
|
@ -616,14 +616,19 @@ class WorkListView(FilterableListView):
|
|||
context['works_active'] = qs.filter(campaigns__status='ACTIVE').distinct()[:self.max_works]
|
||||
context['works_wished'] = qs.exclude(editions__ebooks__isnull=False).exclude(campaigns__status='ACTIVE').exclude(campaigns__status='SUCCESSFUL').distinct()[:self.max_works]
|
||||
|
||||
context['activetab'] = "#3"
|
||||
|
||||
counts={}
|
||||
counts['unglued'] = context['works_unglued'].count()
|
||||
counts['unglueing'] = context['works_active'].count()
|
||||
counts['wished'] = context['works_wished'].count()
|
||||
context['counts'] = counts
|
||||
|
||||
if counts['unglueing']:
|
||||
context['activetab'] = "#2"
|
||||
elif counts['unglued']:
|
||||
context['activetab'] = "#1"
|
||||
else:
|
||||
context['activetab'] = "#3"
|
||||
|
||||
return context
|
||||
|
||||
class ByPubView(WorkListView):
|
||||
|
|
Loading…
Reference in New Issue