From: jordan Date: Sat, 25 Jun 2011 11:49:04 +0000 (+0000) Subject: Jira OSQA-618, adding a setting that allows to remove the interesting and ignored... X-Git-Tag: live~235 X-Git-Url: https://git.openstreetmap.org/osqa.git/commitdiff_plain/68b08ed5442bf968f91fed8c3339adcd324c4864 Jira OSQA-618, adding a setting that allows to remove the interesting and ignored tags tool from the sidebar, removing the old tag_selector.html template git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@1078 0cfe37f9-358a-4d5e-be75-b63607b5c754 --- diff --git a/forum/settings/sidebar.py b/forum/settings/sidebar.py index 7814594..4e5ad39 100644 --- a/forum/settings/sidebar.py +++ b/forum/settings/sidebar.py @@ -11,6 +11,11 @@ label = _("Show the Welcome box"), help_text = _("Do you want to show the welcome box when a user first visits your site."), required=False)) +SHOW_INTERESTING_TAGS_BOX = Setting('SHOW_INTERESTING_TAGS_BOX', True, SIDEBAR_SET, dict( +label = _("Show interesting tags in the sidebar"), +help_text = _("Check this if you want to see the interesting tags container in the sidebar."), +required=False)) + APP_INTRO = Setting('APP_INTRO', u'

Ask and answer questions, make the world better!

', SIDEBAR_SET, dict( label = _("Application intro"), help_text = _("The introductory page that is visible in the sidebar for anonymous users."), diff --git a/forum/skins/default/templates/question_list/tag_selector.html b/forum/skins/default/templates/question_list/tag_selector.html index f507d64..89817a9 100644 --- a/forum/skins/default/templates/question_list/tag_selector.html +++ b/forum/skins/default/templates/question_list/tag_selector.html @@ -1,6 +1,7 @@ {% load i18n %} {% load extra_tags %} +{% if show_interesting_tags %} {% if user_authenticated %}

{% trans "Interesting tags" %}

@@ -47,3 +48,4 @@ {% endcomment %}
{% endif %} +{% endif %} diff --git a/forum/skins/default/templates/tag_selector.html b/forum/skins/default/templates/tag_selector.html deleted file mode 100644 index 91967b2..0000000 --- a/forum/skins/default/templates/tag_selector.html +++ /dev/null @@ -1,42 +0,0 @@ -{% load i18n %} -{% load extra_tags %} -
-

{% trans "Interesting tags" %}

-
- {% for tag_name in interesting_tag_names %} - {% spaceless %} - - - - - {% endspaceless %} - {% endfor %} -
- - -

{% trans "Ignored tags" %}

-
- {% for tag_name in ignored_tag_names %} - {% spaceless %} - - - - - {% endspaceless %} - {% endfor %} -
- - -

- - -

-

diff --git a/forum/templatetags/question_list_tags.py b/forum/templatetags/question_list_tags.py index 8cef6fc..642a5a3 100644 --- a/forum/templatetags/question_list_tags.py +++ b/forum/templatetags/question_list_tags.py @@ -65,6 +65,7 @@ def question_list_related_tags(questions): @register.inclusion_tag('question_list/tag_selector.html', takes_context=True) def tag_selector(context): request = context['request'] + show_interesting_tags = settings.SHOW_INTERESTING_TAGS_BOX if request.user.is_authenticated(): pt = MarkedTag.objects.filter(user=request.user) @@ -73,6 +74,7 @@ def tag_selector(context): "interesting_tag_names": pt.filter(reason='good').values_list('tag__name', flat=True), 'ignored_tag_names': pt.filter(reason='bad').values_list('tag__name', flat=True), 'user_authenticated': True, + 'show_interesting_tags' : show_interesting_tags, } else: - return { 'request' : request, 'user_authenticated': False} + return { 'request' : request, 'user_authenticated': False, 'show_interesting_tags' : show_interesting_tags }