2010-03-01 22:42:24 +03:00
|
|
|
{% set search_form = SearchForm(request) %}
|
2010-02-26 23:18:12 +03:00
|
|
|
{% set show_advanced = search_form.advanced.data == 'on' %}
|
|
|
|
<div class="search-form expanded-search-form {% if show_advanced %}expanded{% endif %}">
|
2010-02-25 22:17:53 +03:00
|
|
|
<form method="get" id="search-form" action="{{ url('search.search') }}">
|
2009-10-22 01:56:43 +04:00
|
|
|
<div class="basic" id="search-query">
|
|
|
|
<input id="query" type="text" title="search" name="q"
|
2010-02-25 22:17:53 +03:00
|
|
|
{% if not search_form.q.data %}class="placeholder"{% endif %}
|
|
|
|
value="{{ search_form.q.data or '' }}"
|
|
|
|
placeholder="{{ _('search for add-ons') }}">
|
2009-10-22 01:56:43 +04:00
|
|
|
<label for="cat">{{ _('within') }}</label>
|
|
|
|
<select name="cat" id="cat">
|
2010-02-25 22:17:53 +03:00
|
|
|
{% for value, title in search_form.fields['cat'].choices -%}
|
|
|
|
{% if value in search_form.top_level_cat %}
|
|
|
|
{% set class = 'cat-all' %}
|
|
|
|
{% else %}
|
|
|
|
{% set class = '' %}
|
|
|
|
{% endif %}
|
|
|
|
<option class="{{ class }}" value="{{ value }}"
|
2010-05-17 18:34:35 +04:00
|
|
|
{% if value in (search_form.cat.data, search_cat) %}selected{% endif %}>
|
2010-02-25 22:17:53 +03:00
|
|
|
{{ title }}</option>
|
|
|
|
{%- endfor %}
|
2009-10-22 01:56:43 +04:00
|
|
|
</select>
|
|
|
|
<button type="submit">
|
|
|
|
<img src="{{ MEDIA_URL}}img/amo2009/blank.gif">
|
|
|
|
</button>
|
2010-02-25 22:17:53 +03:00
|
|
|
</div> {# search-query #}
|
|
|
|
<div id="advanced-link" title="{{ _('Toggle advanced search mode') }}">
|
2010-02-26 23:18:12 +03:00
|
|
|
<a class="asopen" href="?advanced=on">{{ _('Advanced') }}</a>
|
2009-10-22 01:56:43 +04:00
|
|
|
</div>
|
2010-02-25 22:17:53 +03:00
|
|
|
<div id="advanced-search" class="advanced">
|
|
|
|
<fieldset class="important">
|
|
|
|
<div class="container">
|
|
|
|
{{ search_form.lver.label_tag()|safe }}
|
|
|
|
{{ search_form.lver|safe }}
|
|
|
|
</div>
|
|
|
|
</fieldset>
|
|
|
|
<fieldset class="subsidiary">
|
|
|
|
<div class="container">
|
|
|
|
{{ search_form.atype.label_tag()|safe }}
|
|
|
|
{{ search_form.atype|safe }}
|
|
|
|
</div>
|
|
|
|
<div class="container">
|
|
|
|
{{ search_form.sort.label_tag()|safe }}
|
|
|
|
{{ search_form.sort|safe }}
|
|
|
|
</div>
|
|
|
|
<div class="container">
|
|
|
|
{{ search_form.pid.label_tag()|safe }}
|
|
|
|
{{ search_form.pid|safe }}
|
|
|
|
</div>
|
|
|
|
<div class="container">
|
|
|
|
{{ search_form.pp.label_tag()|safe }}
|
|
|
|
{{ search_form.pp|safe }}
|
|
|
|
</div>
|
|
|
|
<div class="container">
|
|
|
|
{{ search_form.lup.label_tag()|safe }}
|
|
|
|
{{ search_form.lup|safe }}
|
|
|
|
</div>
|
|
|
|
</fieldset>
|
|
|
|
<span id="search-data"
|
2010-05-13 02:39:31 +04:00
|
|
|
data-version="{{ request.REQUEST.get('lver', 'any') }}">
|
2010-04-20 21:44:44 +04:00
|
|
|
</span>
|
2010-02-26 23:18:12 +03:00
|
|
|
{{ search_form.advanced|safe }}
|
2010-02-25 22:17:53 +03:00
|
|
|
</div> {# advanced-search #}
|
2009-10-22 01:56:43 +04:00
|
|
|
</form>
|
|
|
|
</div>
|