forked from Ponysearch/Ponysearch
Merge pull request #856 from kvch/fix-search-form-paging
eliminate pagination bug in search forms
This commit is contained in:
commit
9436f86e7d
1 changed files with 7 additions and 7 deletions
|
@ -1,8 +1,8 @@
|
||||||
{% extends "oscar/base.html" %}
|
{% extends "oscar/base.html" %}
|
||||||
{% macro search_form_attrs() -%}
|
{% macro search_form_attrs(pageno) -%}
|
||||||
{% for category in selected_categories %}<input type="hidden" name="category_{{ category }}" value="1"/>{% endfor %}
|
{% for category in selected_categories %}<input type="hidden" name="category_{{ category }}" value="1"/>{% endfor %}
|
||||||
<input type="hidden" name="q" value="{{ q|e }}" />
|
<input type="hidden" name="q" value="{{ q|e }}" />
|
||||||
<input type="hidden" name="pageno" value="{{ pageno+1 }}" />
|
<input type="hidden" name="pageno" value="{{ pageno }}" />
|
||||||
<input type="hidden" name="time_range" value="{{ time_range }}" />
|
<input type="hidden" name="time_range" value="{{ time_range }}" />
|
||||||
<input type="hidden" name="language" value="{{ current_language }}" />
|
<input type="hidden" name="language" value="{{ current_language }}" />
|
||||||
{%- endmacro %}
|
{%- endmacro %}
|
||||||
|
@ -58,13 +58,13 @@
|
||||||
<div id="pagination">
|
<div id="pagination">
|
||||||
<div class="pull-left">
|
<div class="pull-left">
|
||||||
<form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" class="pull-left">
|
<form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" class="pull-left">
|
||||||
{{ search_form_attrs() }}
|
{{ search_form_attrs(pageno+1) }}
|
||||||
<button type="submit" class="btn btn-default"><span class="glyphicon glyphicon-backward"></span> {{ _('next page') }}</button>
|
<button type="submit" class="btn btn-default"><span class="glyphicon glyphicon-backward"></span> {{ _('next page') }}</button>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<div class="pull-right">
|
<div class="pull-right">
|
||||||
<form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" class="pull-left">
|
<form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" class="pull-left">
|
||||||
{{ search_form_attrs() }}
|
{{ search_form_attrs(pageno-1) }}
|
||||||
<button type="submit" class="btn btn-default" {% if pageno == 1 %}disabled{% endif %}><span class="glyphicon glyphicon-forward"></span> {{ _('previous page') }}</button>
|
<button type="submit" class="btn btn-default" {% if pageno == 1 %}disabled{% endif %}><span class="glyphicon glyphicon-forward"></span> {{ _('previous page') }}</button>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
@ -74,13 +74,13 @@
|
||||||
<div id="pagination">
|
<div id="pagination">
|
||||||
<div class="pull-left">
|
<div class="pull-left">
|
||||||
<form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" class="pull-left">
|
<form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" class="pull-left">
|
||||||
{{ search_form_attrs() }}
|
{{ search_form_attrs(pageno-1) }}
|
||||||
<button type="submit" class="btn btn-default" {% if pageno == 1 %}disabled{% endif %}><span class="glyphicon glyphicon-backward"></span> {{ _('previous page') }}</button>
|
<button type="submit" class="btn btn-default" {% if pageno == 1 %}disabled{% endif %}><span class="glyphicon glyphicon-backward"></span> {{ _('previous page') }}</button>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<div class="pull-right">
|
<div class="pull-right">
|
||||||
<form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" class="pull-left">
|
<form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" class="pull-left">
|
||||||
{{ search_form_attrs() }}
|
{{ search_form_attrs(pageno+1) }}
|
||||||
<button type="submit" class="btn btn-default"><span class="glyphicon glyphicon-forward"></span> {{ _('next page') }}</button>
|
<button type="submit" class="btn btn-default"><span class="glyphicon glyphicon-forward"></span> {{ _('next page') }}</button>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
@ -132,7 +132,7 @@
|
||||||
<div class="clearfix"></div>
|
<div class="clearfix"></div>
|
||||||
{% for output_type in ('csv', 'json', 'rss') %}
|
{% for output_type in ('csv', 'json', 'rss') %}
|
||||||
<form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" class="form-inline pull-{% if rtl %}right{% else %}left{% endif %} result_download">
|
<form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" class="form-inline pull-{% if rtl %}right{% else %}left{% endif %} result_download">
|
||||||
{{ search_form_attrs() }}
|
{{ search_form_attrs(pageno) }}
|
||||||
<input type="hidden" name="format" value="{{ output_type }}">
|
<input type="hidden" name="format" value="{{ output_type }}">
|
||||||
<button type="submit" class="btn btn-default">{{ output_type }}</button>
|
<button type="submit" class="btn btn-default">{{ output_type }}</button>
|
||||||
</form>
|
</form>
|
||||||
|
|
Loading…
Reference in a new issue