layerindex-web/layerindex/context_processors.py
Paul Eggleton 46e579b6e6 Show count of layers to be reviewed next to Review link
Add a badge next to the Review link (when shown for users with the
publish permission) on all pages showing how many layers need to be
reviewed, if any.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-03-06 09:16:19 +00:00

17 lines
531 B
Python

# layerindex-web - custom context processor
#
# Copyright (C) 2013 Intel Corporation
#
# Licensed under the MIT license, see COPYING.MIT for details
from layerindex.models import Branch, LayerItem
def layerindex_context(request):
current_branch = request.session.get('branch', None)
if not current_branch:
current_branch = 'master'
return {
'all_branches': Branch.objects.all(),
'current_branch': current_branch,
'unpublished_count': LayerItem.objects.filter(status='N').count(),
}