diff --git a/apps/editors/templates/editors/base.html b/apps/editors/templates/editors/base.html index 051739a1ba..71ba6e0d54 100644 --- a/apps/editors/templates/editors/base.html +++ b/apps/editors/templates/editors/base.html @@ -23,13 +23,13 @@ {{ _('Queues') }}
  • diff --git a/apps/editors/tests/test_views.py b/apps/editors/tests/test_views.py index 3f12a3faf4..7140d5ffaa 100644 --- a/apps/editors/tests/test_views.py +++ b/apps/editors/tests/test_views.py @@ -310,6 +310,14 @@ class TestQueueBasics(QueueTest): eq_(doc('.data-grid-bottom .num-results').text(), u'Results 1 \u2013 1 of 2') + def test_navbar_queue_counts(self): + r = self.client.get(reverse('editors.home')) + eq_(r.status_code, 200) + doc = pq(r.content) + eq_(doc('#navbar li.top ul').eq(0).text(), + 'Full Reviews (2) Pending Updates (2) ' + 'Preliminary Reviews (2) Moderated Reviews (0)') + class TestPendingQueue(QueueTest): diff --git a/apps/editors/views.py b/apps/editors/views.py index 4794007688..7cfa2cd8eb 100644 --- a/apps/editors/views.py +++ b/apps/editors/views.py @@ -39,7 +39,8 @@ def editor_required(func): def context(**kw): - ctx = dict(motd=get_config('editors_review_motd')) + ctx = dict(motd=get_config('editors_review_motd'), + queue_counts=_queue_counts()) ctx.update(kw) return ctx @@ -128,7 +129,6 @@ def _queue(request, TableObj, tab): pass order_by = request.GET.get('sort', '-waiting_time_min') table = TableObj(qs, order_by=order_by) - queue_counts = _queue_counts() default = 100 per_page = request.GET.get('per_page', default) try: @@ -141,8 +141,7 @@ def _queue(request, TableObj, tab): table.set_page(page) return jingo.render(request, 'editors/queue.html', context(table=table, page=page, tab=tab, - search_form=search_form, - queue_counts=queue_counts)) + search_form=search_form)) def _queue_counts(type=None): @@ -197,7 +196,7 @@ def queue_moderated(request): return jingo.render(request, 'editors/queue.html', context(reviews_formset=reviews_formset, tab='moderated', page=page, flags=flags, - queue_counts=_queue_counts(), search_form=None)) + search_form=None)) @editor_required