diff options
author | obfuscated-loop <codemailbox@protonmail.com> | 2023-11-22 10:49:45 +0000 |
---|---|---|
committer | Markus Heiser <markus.heiser@darmarIT.de> | 2023-11-27 14:07:04 +0100 |
commit | 99fb565b391b04d10bd2f41fe6ecebb438fc4240 (patch) | |
tree | 7823c0c1e9502142e6cb1a8b964bc62462fa7c83 /searx/templates | |
parent | c3cc24be125564b3ab27b8cdc217bf1e9ffdcd48 (diff) | |
download | searxng-99fb565b391b04d10bd2f41fe6ecebb438fc4240.tar.gz searxng-99fb565b391b04d10bd2f41fe6ecebb438fc4240.zip |
[mod] Retain page numbers even when there are no results
Diffstat (limited to 'searx/templates')
-rw-r--r-- | searx/templates/simple/results.html | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/searx/templates/simple/results.html b/searx/templates/simple/results.html index 42ad3fa3d..7d97c9e06 100644 --- a/searx/templates/simple/results.html +++ b/searx/templates/simple/results.html @@ -124,22 +124,24 @@ </div> </form> {% endif %} - <form method="{{ method or 'POST' }}" action="{{ url_for('search') }}" class="next_page"> - <div class="{% if rtl %}left{% else %}right{% endif %}"> - <input type="hidden" name="q" value="{{ q|e }}" > - {% for category in selected_categories %} - <input type="hidden" name="category_{{ category }}" value="1" > - {% endfor %} - <input type="hidden" name="pageno" value="{{ pageno+1 }}" > - <input type="hidden" name="language" value="{{ current_language }}" > - <input type="hidden" name="time_range" value="{{ time_range }}" > - <input type="hidden" name="safesearch" value="{{ safesearch }}" > - <input type="hidden" name="theme" value="{{ theme }}" > - {% if timeout_limit %}<input type="hidden" name="timeout_limit" value="{{ timeout_limit|e }}" >{% endif %} - {{- engine_data_form(engine_data) -}} - <button role="link" type="submit">{{ _('Next page') }} {{ icon_small('chevron-right') }}</button> - </div> - </form> + {%- if results | count > 0 -%} + <form method="{{ method or 'POST' }}" action="{{ url_for('search') }}" class="next_page"> + <div class="{% if rtl %}left{% else %}right{% endif %}"> + <input type="hidden" name="q" value="{{ q|e }}" > + {% for category in selected_categories %} + <input type="hidden" name="category_{{ category }}" value="1" > + {% endfor %} + <input type="hidden" name="pageno" value="{{ pageno+1 }}" > + <input type="hidden" name="language" value="{{ current_language }}" > + <input type="hidden" name="time_range" value="{{ time_range }}" > + <input type="hidden" name="safesearch" value="{{ safesearch }}" > + <input type="hidden" name="theme" value="{{ theme }}" > + {% if timeout_limit %}<input type="hidden" name="timeout_limit" value="{{ timeout_limit|e }}" >{% endif %} + {{- engine_data_form(engine_data) -}} + <button role="link" type="submit">{{ _('Next page') }} {{ icon_small('chevron-right') }}</button> + </div> + </form> + {%- endif -%} {% set pstart = 1 %} {% set pend = 11 %} {% if pageno > 5 %} |