From ec4f043363f5a71483cbd8c143c84cb8ca78fc02 Mon Sep 17 00:00:00 2001
From: =?utf8?q?Aleksander=20=C5=81ukasz?=
Date: Thu, 9 May 2013 15:36:20 +0200
Subject: [PATCH] Tag clouds: Hiding "uncategorized" category if no
uncategorized tags exist
---
questions/templates/questions/question_list.html | 2 ++
questions/views.py | 1 +
2 files changed, 3 insertions(+)
diff --git a/questions/templates/questions/question_list.html b/questions/templates/questions/question_list.html
index f279208..ccf2ad7 100755
--- a/questions/templates/questions/question_list.html
+++ b/questions/templates/questions/question_list.html
@@ -32,7 +32,9 @@ doÅwiadczenie doradcze w tej tematyce.
Filtruj pytania
Wybierz kategoriÄ tematów:
+ {% if has_uncategorized_tags %}
bez kategorii
+ {% endif %}
{% for category in tag_categories %}
{{category}}
{% endfor %}
diff --git a/questions/views.py b/questions/views.py
index 076a2e0..f35f5fe 100644
--- a/questions/views.py
+++ b/questions/views.py
@@ -65,5 +65,6 @@ class QuestionListView(ListView):
category_click_count = uncategorized_tags_click_count
tag.cloud_size = get_cloud_size(tag.click_count, category_click_count)
context['tag_lists'].setdefault(tag.category.id if tag.category else 0, []).append(tag)
+ context['has_uncategorized_tags'] = 0 in context['tag_lists']
return context
--
2.20.1