-
Notifications
You must be signed in to change notification settings - Fork 2k
/
search_form.html
63 lines (60 loc) · 2.04 KB
/
search_form.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<form id="dataset-search" class="dataset-search clearfix" method="GET" data-module="select-switch">
{% block search_form_input %}
<span class="control-group search-giant">
<input type="text" class="search" name="q" value="{{ c.q }}" autocomplete="off" placeholder="{{ _('Search...') }}" />
<button type="submit" value="{{ _('Search') }}">Submit</button>
</span>
{% endblock %}
{% block search_form_sortby %}
{% snippet 'snippets/sort_by.html', sort=c.sort_by_selected %}
{% endblock %}
{% block search_form_fields %}
{% if c.fields %}
<span>
{% for key, value in c.fields %}
<input type="hidden" name="{{ key }}" value="{{ value }}" />
{% endfor %}
</span>
{% endif %}
{% endblock %}
<div id="dataset-search-ext"></div>
</form>
{% block search_form_results %}
<div class="results">
<strong>
{% block search_form_result_text %}
{% snippet 'snippets/search_result_text.html', query=c.q, count=c.page.item_count, type='dataset' %}
{% endblock %}
</strong>
{% block search_form_filter_list %}
<div class="filter-list">
{% for field in c.fields_grouped %}
<span class="facet">{{ c.facet_titles.get(field) }}:</span>
{% for value in c.fields_grouped[field] %}
<span class="filtered pill">
{% if c.translated_fields and c.translated_fields.has_key((field,value)) %}
{{ c.translated_fields[(field,value)] }}
{% else %}
{{ value }}
{% endif %}
<a href="${c.remove_field(field, value)}" class="remove" title="{{ _('Remove') }}"><i class="icon-remove"></i></a>
</span>
{% endfor %}
{% endfor %}
</div>
{% endblock %}
</div>
{% endblock %}
{% block search_form_package_list %}
{% if c.query_error %}
<p>
{% trans %}
<strong>There was an error while searching.</strong> Please try again.
{% endtrans %}
</p>
{% else %}
{% if c.page.items %}
{{ h.snippet('snippets/package_list.html', packages=c.page.items, bulk_processing=c.bulk_processing) }}
{% endif %}
{% endif %}
{% endblock %}