Skip to content

Commit d0ce8b9

Browse files
committed
Update templates, refactor search page
1 parent 2998693 commit d0ce8b9

20 files changed

+228
-3837
lines changed

_theme/tarantool/_less/design.less

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
@import (less, once) "page-try.less";
1111
@import (less, once) "page-doc.less";
1212
@import (less, once) "page-benchmark.less";
13+
@import (less, once) "page-search.less";
1314

1415
@import (less, once) "pygmentize.less";
1516
@import (less, once) "dropdown.less";
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
.b-two-cols {
2+
min-width: 100%;
3+
display: table-row;
4+
.b-two-cols-left {
5+
display: table-cell;
6+
}
7+
.b-two-cols-right {
8+
display: table-cell;
9+
padding: 0px 20px;
10+
vertical-align: middle;
11+
}
12+
}
13+
p:last-child {
14+
padding-bottom: 0px;
15+
}

_theme/tarantool/defindex.html

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{#
2+
basic/defindex.html
3+
~~~~~~~~~~~~~~~~~~~
4+
5+
Default template for the "index" page.
6+
7+
:copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS.
8+
:license: BSD, see LICENSE for details.
9+
#}
10+
{%- extends "layout.html" %}
11+
{% set title = _('Overview') %}
12+
{% block body %}
13+
<h1>{{ docstitle|e }}</h1>
14+
<p>
15+
{{ _('Welcome! This is') }}
16+
{% block description %}{{ _('the documentation for') }} {{ project|e }}
17+
{{ release|e }}{% if last_updated %}, {{ _('last updated') }} {{ last_updated|e }}{% endif %}{% endblock %}.
18+
</p>
19+
{% block tables %}
20+
<p><strong>{{ _('Indices and tables:') }}</strong></p>
21+
<table class="contentstable" align="center"><tr>
22+
<td width="50%">
23+
<p class="biglink"><a class="biglink" href="{{ pathto("contents") }}">{{ _('Complete Table of Contents') }}</a><br>
24+
<span class="linkdescr">{{ _('lists all sections and subsections') }}</span></p>
25+
<p class="biglink"><a class="biglink" href="{{ pathto("search") }}">{{ _('Search Page') }}</a><br>
26+
<span class="linkdescr">{{ _('search this documentation') }}</span></p>
27+
</td><td width="50%">
28+
<p class="biglink"><a class="biglink" href="{{ pathto("modindex") }}">{{ _('Global Module Index') }}</a><br>
29+
<span class="linkdescr">{{ _('quick access to all modules') }}</span></p>
30+
<p class="biglink"><a class="biglink" href="{{ pathto("genindex") }}">{{ _('General Index') }}</a><br>
31+
<span class="linkdescr">{{ _('all functions, classes, terms') }}</span></p>
32+
</td></tr>
33+
</table>
34+
{% endblock %}
35+
{% endblock %}

_theme/tarantool/domainindex.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ <h1>{{ indextitle }}</h1>
3030
{%- endfor %}
3131
</div>
3232

33-
<table class="indextable modindextable">
33+
<table class="indextable modindextable" cellspacing="0" cellpadding="2">
3434
{%- for letter, entries in content %}
3535
<tr class="pcap"><td></td><td>&#160;</td><td></td></tr>
3636
<tr class="cap" id="cap-{{ letter }}"><td></td><td>

_theme/tarantool/genindex-single.html

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
:license: BSD, see LICENSE for details.
99
#}
1010
{% macro indexentries(firstname, links) %}
11+
<dt>
1112
{%- if links -%}
1213
<a href="{{ links[0][1] }}">
1314
{%- if links[0][0] %}<strong>{% endif -%}
@@ -24,6 +25,7 @@
2425
{%- else %}
2526
{{ firstname|e }}
2627
{%- endif %}
28+
</dt>
2729
{% endmacro %}
2830

2931
{%- extends "layout.html" %}
@@ -34,18 +36,18 @@ <h1 id="index">{% trans key=key %}Index &ndash; {{ key }}{% endtrans %}</h1>
3436

3537
<table style="width: 100%" class="indextable"><tr>
3638
{%- for column in entries|slice(2) if column %}
37-
<td style="width: 33%; vertical-align: top;"><ul>
39+
<td style="width: 33%" valign="top"><dl>
3840
{%- for entryname, (links, subitems, _) in column %}
39-
<li>{{ indexentries(entryname, links) }}
41+
{{ indexentries(entryname, links) }}
4042
{%- if subitems %}
41-
<ul>
43+
<dd><dl>
4244
{%- for subentryname, subentrylinks in subitems %}
43-
<li>{{ indexentries(subentryname, subentrylinks) }}</li>
45+
{{ indexentries(subentryname, subentrylinks) }}
4446
{%- endfor %}
45-
</ul>
46-
{%- endif -%}</li>
47+
</dl></dd>
48+
{%- endif -%}
4749
{%- endfor %}
48-
</ul></td>
50+
</dl></td>
4951
{%- endfor %}
5052
</tr></table>
5153

_theme/tarantool/genindex.html

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
:license: BSD, see LICENSE for details.
99
#}
1010
{% macro indexentries(firstname, links) %}
11+
<dt>
1112
{%- if links -%}
1213
<a href="{{ links[0][1] }}">
1314
{%- if links[0][0] %}<strong>{% endif -%}
@@ -24,6 +25,7 @@
2425
{%- else %}
2526
{{ firstname|e }}
2627
{%- endif %}
28+
</dt>
2729
{% endmacro %}
2830

2931
{%- extends "layout.html" %}
@@ -43,18 +45,18 @@ <h1 id="index">{{ _('Index') }}</h1>
4345
<h2 id="{{ key }}">{{ key }}</h2>
4446
<table style="width: 100%" class="indextable genindextable"><tr>
4547
{%- for column in entries|slice_index(2) if column %}
46-
<td style="width: 33%; vertical-align: top;"><ul>
48+
<td style="width: 33%" valign="top"><dl>
4749
{%- for entryname, (links, subitems, _) in column %}
48-
<li>{{ indexentries(entryname, links) }}
50+
{{ indexentries(entryname, links) }}
4951
{%- if subitems %}
50-
<ul>
52+
<dd><dl>
5153
{%- for subentryname, subentrylinks in subitems %}
52-
<li>{{ indexentries(subentryname, subentrylinks) }}</li>
54+
{{ indexentries(subentryname, subentrylinks) }}
5355
{%- endfor %}
54-
</ul>
55-
{%- endif -%}</li>
56+
</dl></dd>
57+
{%- endif -%}
5658
{%- endfor %}
57-
</ul></td>
59+
</dl></td>
5860
{%- endfor %}
5961
</tr></table>
6062
{% endfor %}

_theme/tarantool/layout.html

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@
22
{% from 'elements.html' import i_footer with context %}
33

44
{% set page = {"slug": "documentation"} %}
5-
{% set script_files = [
6-
'_static/js/jquery.min.js',
7-
'_static/js/underscore.min.js',
8-
'_static/js/doctools.js',
5+
{% set script_files = script_files + [
6+
'_static/searchtools.js',
97
'_static/js/menu.js',
108
'_static/js/mobile_menu.js',
119
'_static/js/stacktable.min.js',

_theme/tarantool/opensearch.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
3+
<ShortName>{{ project|e }}</ShortName>
4+
<Description>{% trans docstitle=docstitle|e %}Search {{ docstitle }}{% endtrans %}</Description>
5+
<InputEncoding>utf-8</InputEncoding>
6+
<Url type="text/html" method="get"
7+
template="{{ use_opensearch }}/{{ pathto('search') }}?q={searchTerms}&amp;check_keywords=yes&amp;area=default"/>
8+
<LongName>{{ docstitle|e }}</LongName>
9+
{% block extra %} {# Put e.g. an <Image> element here. #} {% endblock %}
10+
</OpenSearchDescription>

_theme/tarantool/relations.html

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{#
2+
basic/relations.html
3+
~~~~~~~~~~~~~~~~~~~~
4+
5+
Sphinx sidebar template: relation links.
6+
7+
:copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS.
8+
:license: BSD, see LICENSE for details.
9+
#}
10+
{%- if prev %}
11+
<h4>{{ _('Previous topic') }}</h4>
12+
<p class="topless"><a href="{{ prev.link|e }}"
13+
title="{{ _('previous chapter') }}">{{ prev.title }}</a></p>
14+
{%- endif %}
15+
{%- if next %}
16+
<h4>{{ _('Next topic') }}</h4>
17+
<p class="topless"><a href="{{ next.link|e }}"
18+
title="{{ _('next chapter') }}">{{ next.title }}</a></p>
19+
{%- endif %}

_theme/tarantool/search.html

Lines changed: 57 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -4,65 +4,79 @@
44
55
Template for the search page.
66
7-
:copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS.
7+
:copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS.
88
:license: BSD, see LICENSE for details.
99
#}
1010
{%- extends "layout.html" %}
1111

1212
{% set title = _('Search') %}
13-
{% set script_files = script_files + ['_static/searchtools.js'] %}
1413

1514
{% block extrahead %}
1615
<script type="text/javascript">
17-
jQuery(function() {
18-
Search.loadIndex("{{ pathto('searchindex.js', 1) }}");
19-
});
20-
</script>
21-
{#
22-
# this is used when loading the search index using $.ajax fails,
23-
# such as on Chrome for documents on localhost
24-
#}
25-
<script type="text/javascript" id="searchindexloader">
16+
jQuery(function() { Search.loadIndex("{{ pathto('searchindex.js', 1) }}"); });
2617
</script>
18+
{# this is used when loading the search index using $.ajax fails,
19+
such as on Chrome for documents on localhost #}
20+
<script type="text/javascript" id="searchindexloader"></script>
2721
{{ super() }}
2822
{% endblock %}
2923

3024
{% block body %}
31-
<!--h1 id="search-documentation">{{ _('Search') }}</h1--!>
32-
<div id="fallback" class="admonition warning">
33-
<script type="text/javascript">$('#fallback').hide();</script>
34-
<p>
35-
{% trans %}
36-
Please activate JavaScript to enable the search functionality.
37-
{% endtrans %}
38-
</p>
25+
<section class="b-block-lightgray b-search-block-top">
26+
<div class="b-block-wrapper">
27+
<h1 class="b-section-title" id="search-documentation">{{ _('Search') }}</h1>
28+
<div class="b-two-cols">
29+
<div class="b-two-cols-left">
30+
<div id="fallback" class="admonition warning">
31+
<script type="text/javascript">$('#fallback').hide();</script>
32+
<p>
33+
{% trans %}
34+
Please activate JavaScript to enable the search functionality.
35+
{% endtrans %}
36+
</p>
37+
</div>
38+
<p>
39+
{% trans %}
40+
From here you can search these documents. Enter your search words into
41+
the box below and click "search". Note that the search function will
42+
automatically search for all of the words. Pages containing fewer words
43+
won't appear in the result list.
44+
{% endtrans %}
45+
</p>
46+
</div>
47+
<div class="b-two-cols-right">
48+
{% include "searchbox.html" %}
49+
</div>
50+
</div>
3951
</div>
40-
<p>
41-
{% trans %}
42-
From here you can search these documents. Enter your search words into the
43-
box below and click "search". Note that the search function will automatically
44-
search for all of the words. Pages containing fewer words won't appear in the
45-
result list.
46-
{% endtrans %}
47-
</p>
48-
{% if search_performed %}
49-
<h2>{{ _('Search Results') }}</h2>
50-
{% if not search_results %}
51-
<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>
52+
</section>
53+
<section class="b-block b-search-block">
54+
<div class="b-block-wrapper">
55+
{% if search_performed %}
56+
<h1 class="b-section-title">{{ _('Search Results') }}</h2>
57+
{% if not search_results %}
58+
<p>
59+
{% trans %}
60+
Your search did not match any documents. Please make sure that all
61+
words are spelled correctly and that you've selected enough
62+
categories.
63+
{% endtrans %}
64+
</p>
65+
{% endif %}
66+
{% endif %}
67+
<div id="search-results">
68+
{% if search_results %}
69+
<ul>
70+
{% for href, caption, context in search_results %}
71+
<li><a href="{{ pathto(item.href) }}">{{ caption }}</a>
72+
<div class="context">{{ context|e }}</div>
73+
</li>
74+
{% endfor %}
75+
</ul>
5276
{% endif %}
53-
{% endif %}
54-
<div id="search-results">
55-
{% if search_results %}
56-
<ul>
57-
{% for href, caption, context in search_results %}
58-
<li>
59-
<a href="{{ pathto(item.href) }}">{{ caption }}</a>
60-
<div class="context">{{ context | e }}</div>
61-
</li>
62-
{% endfor %}
63-
</ul>
64-
{% endif %}
77+
</div>
6578
</div>
79+
</section>
6680
{% endblock %}
6781

6882
{# vim: syntax=htmldjango ts=2 sts=2 sw=2 expandtab #}

_theme/tarantool/searchresults.html

Lines changed: 32 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -4,37 +4,38 @@
44

55
Template for the body of the search results page.
66

7-
:copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS.
7+
:copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS.
88
:license: BSD, see LICENSE for details.
99
#}
10-
{%- extends "layout.html" %}
1110

12-
<h1 id="search-documentation">{{ _('Search') }}</h1>
13-
<p>
14-
From here you can search these documents. Enter your search
15-
words into the box below and click "search".
16-
</p>
17-
<form action="" method="get">
18-
<input type="text" name="q" value="" />
19-
<input type="submit" value="{{ _('search') }}" />
20-
<span id="search-progress" style="padding-left: 10px"></span>
21-
</form>
22-
{%- if search_performed %}
23-
<h2>{{ _('Search Results') }}</h2>
24-
{%- if not search_results %}
25-
<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>
26-
{%- endif %}
27-
{%- endif %}
28-
<div id="search-results">
29-
{%- if search_results %}
30-
<ul class="search">
31-
{% for href, caption, context in search_results %}
32-
<li><a href="{{ docroot }}{{ href }}/?highlight={{ q }}">{{ caption }}</a>
33-
<div class="context">{{ context|e }}</div>
34-
</li>
35-
{% endfor %}
36-
</ul>
37-
{%- endif %}
38-
</div>
39-
40-
{# vim: syntax=htmldjango ts=2 sts=2 sw=2 expandtab #}
11+
<section class="b-block b-search-block">
12+
<div class="b-block-wrapper">
13+
<h1 id="search-documentation">{{ _('Search') }}</h1>
14+
<p>
15+
From here you can search these documents. Enter your search
16+
words into the box below and click "search".
17+
</p>
18+
<form action="" method="get">
19+
<input type="text" name="q" value="" />
20+
<input type="submit" value="{{ _('search') }}" />
21+
<span id="search-progress" style="padding-left: 10px"></span>
22+
</form>
23+
{%- if search_performed %}
24+
<h2>{{ _('Search Results') }}</h2>
25+
{%- if not search_results %}
26+
<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>
27+
{%- endif %}
28+
{%- endif %}
29+
<div id="search-results">
30+
{%- if search_results %}
31+
<ul class="search">
32+
{% for href, caption, context in search_results %}
33+
<li><a href="{{ docroot }}{{ href }}/?highlight={{ q }}">{{ caption }}</a>
34+
<div class="context">{{ context|e }}</div>
35+
</li>
36+
{% endfor %}
37+
</ul>
38+
{%- endif %}
39+
</div>
40+
</div>
41+
</section>

0 commit comments

Comments
 (0)