Browse Source

Display num of results when searching/filtering tags

merge-requests/142/head
kencx 2 years ago
parent
commit
4d88ff77f1
  1. 3
      tildes/tildes/templates/search.jinja2
  2. 5
      tildes/tildes/templates/topic_listing.jinja2

3
tildes/tildes/templates/search.jinja2

@ -5,6 +5,7 @@
{% from 'macros/forms.jinja2' import search_form %}
{% from 'macros/links.jinja2' import link_to_group with context %}
{% from 'macros/utils.jinja2' import pluralize %}
{% block title %}Search results: {{ search }}{% endblock %}
@ -29,7 +30,7 @@
{% block sidebar %}
{{ search_form(search, group) }}
<h2>Search results</h2>
<h2>Found {{ pluralize(topics|length, "result") }}</h2>
<p><a href="/">Back to home page</a></p>

5
tildes/tildes/templates/topic_listing.jinja2

@ -104,7 +104,8 @@
<div class="topic-listing-filter">
{% if tag %}
{% if is_single_group %}
Showing only topics in {{ link_to_group(group) }} with the tag "{{ tag|replace('_', ' ') }}".
Showing only topics in {{ link_to_group(group) }} with the tag "{{ tag|replace('_', ' ') }}" ({{ topics|length }} total).
<h2>{{ pluralize(topic.num_comments, "comment") }}</h2>
<a href="{{ request.current_listing_normal_url() }}">Back to normal view</a> /
<a href="{{ request.route_url("home", _query={"tag": tag}) }}">
{% if request.user %}
@ -114,7 +115,7 @@
{% endif %}
</a>
{% else %}
Showing only topics with the tag "{{ tag|replace('_', ' ') }}".
Showing only topics with the tag "{{ tag|replace('_', ' ') }}" ({{ topics|length }} total).
<a href="{{ request.current_listing_normal_url() }}">Back to normal view</a>
{% endif %}

Loading…
Cancel
Save