Browse Source

[fix] pageno param of search reqs in form

Noémi Ványi 8 years ago
parent
commit
247534be76
1 changed files with 7 additions and 7 deletions
  1. 7
    7
      searx/templates/oscar/results.html

+ 7
- 7
searx/templates/oscar/results.html View File

1
 {% extends "oscar/base.html" %}
1
 {% extends "oscar/base.html" %}
2
-{% macro search_form_attrs() -%}
2
+{% macro search_form_attrs(pageno) -%}
3
     {% for category in selected_categories %}<input type="hidden" name="category_{{ category }}" value="1"/>{% endfor %}
3
     {% for category in selected_categories %}<input type="hidden" name="category_{{ category }}" value="1"/>{% endfor %}
4
     <input type="hidden" name="q" value="{{ q|e }}" />
4
     <input type="hidden" name="q" value="{{ q|e }}" />
5
-    <input type="hidden" name="pageno" value="{{ pageno+1 }}" />
5
+    <input type="hidden" name="pageno" value="{{ pageno }}" />
6
     <input type="hidden" name="time_range" value="{{ time_range }}" />
6
     <input type="hidden" name="time_range" value="{{ time_range }}" />
7
     <input type="hidden" name="language" value="{{ current_language }}" />
7
     <input type="hidden" name="language" value="{{ current_language }}" />
8
 {%- endmacro %}
8
 {%- endmacro %}
58
             <div id="pagination">
58
             <div id="pagination">
59
                 <div class="pull-left">
59
                 <div class="pull-left">
60
                   <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" class="pull-left">
60
                   <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" class="pull-left">
61
-                        {{ search_form_attrs() }}
61
+                        {{ search_form_attrs(pageno+1) }}
62
                         <button type="submit" class="btn btn-default"><span class="glyphicon glyphicon-backward"></span> {{ _('next page') }}</button>
62
                         <button type="submit" class="btn btn-default"><span class="glyphicon glyphicon-backward"></span> {{ _('next page') }}</button>
63
                     </form>
63
                     </form>
64
                 </div>
64
                 </div>
65
                 <div class="pull-right">
65
                 <div class="pull-right">
66
                     <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}"  class="pull-left">
66
                     <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}"  class="pull-left">
67
-                        {{ search_form_attrs() }}
67
+                        {{ search_form_attrs(pageno-1) }}
68
                         <button type="submit" class="btn btn-default" {% if pageno == 1 %}disabled{% endif %}><span class="glyphicon glyphicon-forward"></span> {{ _('previous page') }}</button>
68
                         <button type="submit" class="btn btn-default" {% if pageno == 1 %}disabled{% endif %}><span class="glyphicon glyphicon-forward"></span> {{ _('previous page') }}</button>
69
                     </form>
69
                     </form>
70
                 </div>
70
                 </div>
74
             <div id="pagination">
74
             <div id="pagination">
75
                 <div class="pull-left">
75
                 <div class="pull-left">
76
                     <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" class="pull-left">
76
                     <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" class="pull-left">
77
-                        {{ search_form_attrs() }}
77
+                        {{ search_form_attrs(pageno-1) }}
78
                         <button type="submit" class="btn btn-default" {% if pageno == 1 %}disabled{% endif %}><span class="glyphicon glyphicon-backward"></span> {{ _('previous page') }}</button>
78
                         <button type="submit" class="btn btn-default" {% if pageno == 1 %}disabled{% endif %}><span class="glyphicon glyphicon-backward"></span> {{ _('previous page') }}</button>
79
                     </form>
79
                     </form>
80
                 </div>
80
                 </div>
81
                 <div class="pull-right">
81
                 <div class="pull-right">
82
                     <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}"  class="pull-left">
82
                     <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}"  class="pull-left">
83
-                        {{ search_form_attrs() }}
83
+                        {{ search_form_attrs(pageno+1) }}
84
                         <button type="submit" class="btn btn-default"><span class="glyphicon glyphicon-forward"></span> {{ _('next page') }}</button>
84
                         <button type="submit" class="btn btn-default"><span class="glyphicon glyphicon-forward"></span> {{ _('next page') }}</button>
85
                     </form>
85
                     </form>
86
                 </div>
86
                 </div>
132
                     <div class="clearfix"></div>
132
                     <div class="clearfix"></div>
133
                     {% for output_type in ('csv', 'json', 'rss') %}
133
                     {% for output_type in ('csv', 'json', 'rss') %}
134
                     <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" class="form-inline pull-{% if rtl %}right{% else %}left{% endif %} result_download">
134
                     <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" class="form-inline pull-{% if rtl %}right{% else %}left{% endif %} result_download">
135
-                        {{ search_form_attrs() }}
135
+                        {{ search_form_attrs(pageno) }}
136
                         <input type="hidden" name="format" value="{{ output_type }}">
136
                         <input type="hidden" name="format" value="{{ output_type }}">
137
                         <button type="submit" class="btn btn-default">{{ output_type }}</button>
137
                         <button type="submit" class="btn btn-default">{{ output_type }}</button>
138
                     </form>
138
                     </form>