diff --git a/snipts/views.py b/snipts/views.py index eff4aab..83b0af5 100644 --- a/snipts/views.py +++ b/snipts/views.py @@ -27,6 +27,7 @@ def list_public(request, tag_slug=None): snipts = snipts.filter(tags__name__in=[tag_slug]) return { + 'has_snipts': True, 'public': True, 'snipts': snipts, 'tags': tags, @@ -60,6 +61,7 @@ def list_user(request, username, tag_slug=None): snipts = snipts.filter(tags__name__in=[tag_slug]) return { + 'has_snipts': True, 'public': public, 'snipts': snipts, 'tags': tags, @@ -94,6 +96,7 @@ def detail(request, username, snipt_slug): tags = tags.order_by('-count', 'name') return { + 'has_snipts': True, 'public': public, 'snipt': snipt, 'tags': tags, diff --git a/templates/base.html b/templates/base.html index b61a6ce..f63bb40 100644 --- a/templates/base.html +++ b/templates/base.html @@ -139,7 +139,7 @@
- {% if snipts or snipt %} + {% if has_snipts %} {% endif %} - {% if snipts or snipt %} + {% if has_snipts %} {% verbatim %}