# HG changeset patch # User neko259 # Date 2013-09-13 17:55:32 # Node ID 434bf3b1f3b5008b755ddd2d78b2348b782640c8 # Parent 3569fa99b0b1b8d56af1b82407d90ad35e8bec9b Added star for tag subscribe link. Show the link on the tag view. diff --git a/boards/static/css/md/base_page.css b/boards/static/css/md/base_page.css --- a/boards/static/css/md/base_page.css +++ b/boards/static/css/md/base_page.css @@ -292,3 +292,12 @@ li { input[type="submit"]:hover { background: #555; } + + +.fav { + color: yellow; +} + +.not_fav { + color: #ccc; +} \ No newline at end of file diff --git a/boards/static/css/sw/base_page.css b/boards/static/css/sw/base_page.css --- a/boards/static/css/sw/base_page.css +++ b/boards/static/css/sw/base_page.css @@ -273,3 +273,11 @@ li { padding: 0.5em; display: table; } + +.fav { + color: blue; +} + +.not_fav { + color: #ccc; +} \ No newline at end of file diff --git a/boards/templates/boards/posting_general.html b/boards/templates/boards/posting_general.html --- a/boards/templates/boards/posting_general.html +++ b/boards/templates/boards/posting_general.html @@ -5,7 +5,7 @@ {% block head %} {% if tag %} - Neboard - {{ tag }} + Neboard - {{ tag.name }} {% else %} Neboard {% endif %} @@ -15,7 +15,15 @@ {% if tag %}
-

{% trans 'Tag: ' %}{{ tag }}

+

{% trans 'Tag: ' %}{{ tag.name }} + {% if tag in user.fav_tags.all %} + + {% else %} + + {% endif %} +

{% endif %} diff --git a/boards/templates/boards/tags.html b/boards/templates/boards/tags.html --- a/boards/templates/boards/tags.html +++ b/boards/templates/boards/tags.html @@ -16,11 +16,11 @@ {{ tag.name }} ({{ tag.get_post_count }} {% trans 'threads' %}) {% if tag in user.fav_tags.all %} - [{% trans 'Remove' %}] + {% else %} - [{% trans 'Add' %}] + {% endif %}
{% endfor %} diff --git a/boards/views.py b/boards/views.py --- a/boards/views.py +++ b/boards/views.py @@ -120,7 +120,7 @@ def tag(request, tag_name, page=0): context = _init_default_context(request) context['threads'] = None if len(threads) == 0 else threads - context['tag'] = tag_name + context['tag'] = tag context['pages'] = range(Post.objects.get_thread_page_count(tag=tag)) context['form'] = form @@ -273,7 +273,7 @@ def tag_subscribe(request, tag_name): if not tag in user.fav_tags.all(): user.fav_tags.add(tag) - return redirect(all_tags) + return _redirect_to_next(request) def tag_unsubscribe(request, tag_name): @@ -283,7 +283,7 @@ def tag_unsubscribe(request, tag_name): if tag in user.fav_tags.all(): user.fav_tags.remove(tag) - return redirect(all_tags) + return _redirect_to_next(request) def static_page(request, name):