addons-server/templates/search.html

66 строки
2.5 KiB
HTML
Исходник Обычный вид История

{% 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 %}">
<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"
{% 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">
{% 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 }}"
{% if value in (search_form.cat.data, search_cat) %}selected{% endif %}>
{{ title }}</option>
{%- endfor %}
2009-10-22 01:56:43 +04:00
</select>
<button type="submit">
<img src="{{ MEDIA_URL}}img/amo2009/blank.gif">
</button>
</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>
<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"
data-version="{{ request.REQUEST.get('lver', 'any') }}">
</span>
2010-02-26 23:18:12 +03:00
{{ search_form.advanced|safe }}
</div> {# advanced-search #}
2009-10-22 01:56:43 +04:00
</form>
</div>