add optional request with GET method for search and results pages

This commit is contained in:
Matej Cotman 2014-03-29 16:45:22 +01:00
parent 879bac8adb
commit 32e98967b7
4 changed files with 21 additions and 5 deletions

View file

@ -43,6 +43,15 @@
</select>
</p>
</fieldset>
<fieldset>
<legend>{{ _('Method') }}</legend>
<p>
<select name='method'>
<option value="POST" {% if method == 'POST' %}selected="selected"{% endif %}>POST</option>
<option value="GET" {% if method == 'GET' %}selected="selected"{% endif %}>GET</option>
</select>
</p>
</fieldset>
<fieldset>
<legend>{{ _('Currently used search engines') }}</legend>

View file

@ -10,7 +10,7 @@
{% if suggestions %}
<div id="suggestions"><span>{{ _('Suggestions') }}</span>
{% for suggestion in suggestions %}
<form method="post" action="{{ url_for('index') }}">
<form method="{{ method or 'POST' }}" action="{{ url_for('index') }}">
<input type="hidden" name="q" value="{{ suggestion }}">
<input type="submit" value="{{ suggestion }}" />
</form>
@ -25,7 +25,7 @@
<div id="apis">
{{ _('Download results') }}
{% for output_type in ('csv', 'json', 'rss') %}
<form method="post" action="{{ url_for('index') }}">
<form method="{{ method or 'POST' }}" action="{{ url_for('index') }}">
<div class="left">
<input type="hidden" name="q" value="{{ q }}" />
<input type="hidden" name="format" value="{{ output_type }}" />
@ -52,7 +52,7 @@
{% if paging %}
<div id="pagination">
{% if pageno > 1 %}
<form method="post" action="{{ url_for('index') }}">
<form method="{{ method or 'POST' }}" action="{{ url_for('index') }}">
<div class="left">
<input type="hidden" name="q" value="{{ q }}" />
{% for category in selected_categories %}
@ -63,7 +63,7 @@
</div>
</form>
{% endif %}
<form method="post" action="{{ url_for('index') }}">
<form method="{{ method or 'POST' }}" action="{{ url_for('index') }}">
<div class="left">
{% for category in selected_categories %}
<input type="hidden" name="category_{{ category }}" value="1"/>

View file

@ -1,4 +1,4 @@
<form method="post" action="{{ url_for('index') }}" id="search_form">
<form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" id="search_form">
<div id="search_wrapper">
<input type="text" placeholder="{{ _('Search for...') }}" id="q" class="q" name="q" tabindex="1" autocomplete="off" {% if q %}value="{{ q }}"{% endif %}/>
<input type="submit" value="search" id="search_submit" />