diff --git a/boards/models/tag.py b/boards/models/tag.py --- a/boards/models/tag.py +++ b/boards/models/tag.py @@ -25,7 +25,7 @@ class TagManager(models.Manager): """ return self.annotate(num_threads=Count('thread_tags')).filter(num_threads__gt=0)\ - .order_by('-required', 'name') + .order_by('name') def get_tag_url_list(self, tags: list) -> str: """ diff --git a/boards/templates/boards/all_threads.html b/boards/templates/boards/all_threads.html --- a/boards/templates/boards/all_threads.html +++ b/boards/templates/boards/all_threads.html @@ -176,7 +176,6 @@
{% trans 'Text syntax' %}
-
{% trans 'Tags' %}
diff --git a/boards/templates/boards/base.html b/boards/templates/boards/base.html --- a/boards/templates/boards/base.html +++ b/boards/templates/boards/base.html @@ -41,7 +41,7 @@ {{ tags_str|safe }}, {% endif %} - {% trans "tags" %}, + {% trans "tags" %}, {% trans 'search' %}, {% trans 'feed' %}, {% trans 'images' %}{% if has_fav_threads %}, 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 @@ -3,31 +3,16 @@ {% load i18n %} {% block head %} - Neboard - {% trans "Tags" %} + {{ site_name }} - {% trans "Tags" %} {% endblock %} {% block content %} -{% regroup section_tags by get_first_letter as section_tag_list %} {% regroup all_tags by get_first_letter as other_tag_list %}
- {% if section_tags %} -
- {% trans 'Sections:' %} - {% for letter in section_tag_list %} -
({{ letter.grouper|upper }}) - {% for tag in letter.list %} - {% autoescape off %} - {{ tag.get_view }}{% if not forloop.last %},{% endif %} - {% endautoescape %} - {% endfor %} - {% endfor %} -
- {% endif %} {% if all_tags %}
- {% trans 'Other tags:' %} {% for letter in other_tag_list %}
({{ letter.grouper|upper }}) {% for tag in letter.list %} @@ -38,10 +23,6 @@ {% endfor %}
{% endif %} - - {% if query %} -
{% trans 'All tags...' %}
- {% endif %}
{% endblock %} diff --git a/boards/urls.py b/boards/urls.py --- a/boards/urls.py +++ b/boards/urls.py @@ -42,7 +42,7 @@ urlpatterns = [ url(r'^settings/$', settings.SettingsView.as_view(), name='settings'), url(r'^aliases/(?P\w+)/$', alias.AliasesView.as_view(), name='aliases'), - url(r'^tags/(?P\w+)?/?$', all_tags.AllTagsView.as_view(), name='tags'), + url(r'^tags/$', all_tags.AllTagsView.as_view(), name='tags'), url(r'^authors/$', AuthorsView.as_view(), name='authors'), url(r'^banned/$', views.banned.BannedView.as_view(), name='banned'), diff --git a/boards/views/all_tags.py b/boards/views/all_tags.py --- a/boards/views/all_tags.py +++ b/boards/views/all_tags.py @@ -4,20 +4,14 @@ from boards.views.base import BaseBoardV from boards.models.tag import Tag -PARAM_SECTION_TAGS = 'section_tags' PARAM_TAGS = 'all_tags' -PARAM_QUERY = 'query' class AllTagsView(BaseBoardView): - def get(self, request, query=None): + def get(self, request): params = dict() - params[PARAM_SECTION_TAGS] = Tag.objects.filter(required=True) - if query != 'required': - params[PARAM_TAGS] = Tag.objects.get_not_empty_tags().filter( - required=False) - params[PARAM_QUERY] = query + params[PARAM_TAGS] = Tag.objects.get_not_empty_tags() return render(request, 'boards/tags.html', params)