-
Notifications
You must be signed in to change notification settings - Fork 0
/
search.html
78 lines (74 loc) · 3 KB
/
search.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
{#
basic/search.html
~~~~~~~~~~~~~~~~~
Template for the search page.
:copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
#}
{%- extends "layout.html" %}
{% set title = _('Search') %}
{% set script_files = script_files + ['_static/searchtools.js'] %}
{% block extrahead %}
<script type="text/javascript">
window.onload = function() {
$('#fallback').hide();
Search.loadIndex("{{ pathto('searchindex.js', 1) }}");
}
</script>
{# this is used when loading the search index using $.ajax fails,
such as on Chrome for documents on localhost #}
<script type="text/javascript" id="searchindexloader"></script>
{{ super() }}
{% endblock %}
{% block body %}
<h1 id="search-documentation">{{ _('Search') }}</h1>
<div id="fallback" class="admonition warning">
<h2 class="admonition-title">{{ _('Search') }}</h2>
<p>
{% trans %}Please activate JavaScript to enable the search functionality.{% endtrans %}
</p>
</div>
<p>
{% trans %}From here you can search these documents. Enter your search
words into the box below and click "search". Note that the search
function will automatically search for all of the words. Pages
containing fewer words won't appear in the result list.{% endtrans %}
</p>
<form class="search am-form am-form-horizontal" action="" method="get">
<fieldset>
<div class="am-form-group">
<label class="am-u-sm-2 am-form-label" for="#search-query">{{ _('Search query') }}</label>
<div class="am-u-sm-10">
<input id="search-query" type="text" name="q" />
</div>
</div>
<div class="am-form-group">
<div class="am-u-sm-offset-2 am-u-sm-5">
<input type="submit" class="am-btn am-btn-default" value="{{ _('search') }}" />
</div>
<span id="search-progress" class="am-u-sm-4"></span>
</div>
</fieldset>
</form>
{# NOTE: the following doesn't actually render because searchtools.js replaces it #}
<div id="search-results">
{% if search_performed %}
{% if search_results %}
<h2>{{ _('Search Results') }}</h2>
<ul>
{% for href, caption, context in search_results %}
<li>
<a href="{{ pathto(item.href) }}">{{ caption }}</a>
<div class="context">{{ context|e }}</div>
</li>
{% endfor %}
</ul>
{% else %}
<div class="admonition note">
<h2 class="admonition-title">{{ _('Search Results') }}</h2>
<p>{{ _('Your search did not match any documents. Please make sure that all words are spelled correctly and that you\'ve selected enough categories.') }}</p>
</div>
{% endif %}
{% endif %}
</div>
{% endblock %}