Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show the number of results returned in search #383

Merged
merged 3 commits into from
May 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 21 additions & 3 deletions qgis-app/templates/search/search.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ <h2>Search</h2>
</div>

{% if query %}
<h3>Search results</h3>
<h3>Search results for "{{query}}" ({{paginator.count}} items found)</h3>

{% for result in page.object_list %}
<p class="search-item">
Expand All @@ -58,9 +58,27 @@ <h3>Search results</h3>

{% if page.has_previous or page.has_next %}
<div class="pagination">
{% if page.has_previous %}<a href="?q={{ query }}&amp;page={{ page.previous_page_number }}">{% endif %}&laquo; Previous{% if page.has_previous %}</a>{% endif %}
{% if page.has_previous %}
<a href="?q={{ query }}&amp;page=1">
{% endif %}&laquo; First
{% if page.has_previous %}</a>{% endif %}
|
{% if page.has_next %}<a href="?q={{ query }}&amp;page={{ page.next_page_number }}">{% endif %}Next &raquo;{% if page.has_next %}</a>{% endif %}
{% if page.has_previous %}
<a href="?q={{ query }}&amp;page={{ page.previous_page_number }}">
{% endif %}Previous
{% if page.has_previous %}</a>{% endif %}
|
Page {{ page.number }} of {{ paginator.num_pages }}
|
{% if page.has_next %}
<a href="?q={{ query }}&amp;page={{ page.next_page_number }}">
{% endif %}Next
{% if page.has_next %}</a>{% endif %}
|
{% if page.has_next %}
<a href="?q={{ query }}&amp;page={{ paginator.num_pages }}">
{% endif %}Last &raquo;
{% if page.has_next %}</a>{% endif %}
</div>
{% endif %}
{% else %}
Expand Down