Просмотр исходного кода

Different no threads message when filtering list

Rafał Pitoń 10 лет назад
Родитель
Сommit
8caa209eba

+ 1 - 1
misago/templates/misago/threads/base.html

@@ -95,7 +95,7 @@
         </li>
         </li>
         {% empty %}
         {% empty %}
         <li class="list-group-item message-row">
         <li class="list-group-item message-row">
-          {% trans "No threads were posted in this forum, or you don't have permission to see them." %}
+          {% block no-threads %}{% endblock no-threads %}
         </li>
         </li>
         {% endfor %}
         {% endfor %}
       </ul>
       </ul>

+ 12 - 0
misago/templates/misago/threads/forum.html

@@ -63,6 +63,18 @@
 {% endblock threads-panel %}
 {% endblock threads-panel %}
 
 
 
 
+{% block no-threads %}
+{% if is_filtering %}
+{% trans "No threads matching criteria exist, or you don't have permission to see them." %}
+<a href="{{ forum.get_absolute_url }}" class="btn btn-primary">
+  {% trans "See all threads" %}
+</a>
+{% else %}
+{% trans "No threads were posted in this forum, or you don't have permission to see them." %}
+{% endif %}
+{% endblock no-threads %}
+
+
 {% block javascripts %}
 {% block javascripts %}
 {{ block.super }}
 {{ block.super }}
 {% include "misago/forums/js.html" %}
 {% include "misago/forums/js.html" %}

+ 1 - 0
misago/threads/views/generic/forum.py

@@ -217,6 +217,7 @@ class ForumView(FilterThreadsMixin, OrderThreadsMixin, ThreadsView):
             'threads': threads,
             'threads': threads,
             'link_name': self.link_name,
             'link_name': self.link_name,
             'links_params': links_params,
             'links_params': links_params,
+            'is_filtering': bool(filter_by),
             'filter_name': self.get_filter_name(available_filters, filter_by),
             'filter_name': self.get_filter_name(available_filters, filter_by),
             'filters': self.get_filters_dicts(
             'filters': self.get_filters_dicts(
                 available_filters, filter_by, links_params),
                 available_filters, filter_by, links_params),