blob: 8923d9a09dc1c820908027837afc66c8707132a3 [file] [log] [blame]
Georg Brandle7570052008-05-03 20:52:18 +00001{% extends "!layout.html" %}
2{% block rootrellink %}
Georg Brandlaf265f42008-12-07 15:06:20 +00003 <li><img src="{{ pathto('_static/py.png', 1) }}" alt=""
4 style="vertical-align: middle; margin-top: -1px"/></li>
Georg Brandl46761ec2014-10-29 08:36:15 +01005 <li><a href="https://www.python.org/">Python</a>{{ reldelim1 }}</li>
Ezio Melotti380ce652012-10-27 22:09:16 +03006 <li>
7 {%- if versionswitcher is defined %}
8 <span class="version_switcher_placeholder">{{ release }}</span>
Victor Stinner875f29a2016-01-22 18:00:05 +01009 <a href="{{ pathto('index') }}">{% trans %}Documentation {% endtrans %}</a>{{ reldelim1 }}
Ezio Melotti380ce652012-10-27 22:09:16 +030010 {%- else %}
11 <a href="{{ pathto('index') }}">{{ shorttitle }}</a>{{ reldelim1 }}
12 {%- endif %}
13 </li>
Georg Brandlaf265f42008-12-07 15:06:20 +000014{% endblock %}
Zachary Warea3090a42016-09-09 13:11:27 -070015{%- macro searchbox() %}
16{# modified from sphinx/themes/basic/searchbox.html #}
17 <div class="inline-search" style="display: none" role="search">
18 <form class="inline-search" action="{{ pathto('search') }}" method="get">
19 <input placeholder="{{ _('Quick search') }}" type="text" name="q" />
20 <input type="submit" value="{{ _('Go') }}" />
21 <input type="hidden" name="check_keywords" value="yes" />
22 <input type="hidden" name="area" value="default" />
23 </form>
24 </div>
25 <script type="text/javascript">$('.inline-search').show(0);</script>
26{%- endmacro %}
Georg Brandl1afe2af2014-03-25 10:12:47 +010027{% block relbar1 %} {% if builder != 'qthelp' %} {{ relbar() }} {% endif %} {% endblock %}
28{% block relbar2 %} {% if builder != 'qthelp' %} {{ relbar() }} {% endif %} {% endblock %}
Zachary Warea3090a42016-09-09 13:11:27 -070029{% block relbaritems %}
30 {%- if pagename != "search" and builder != "singlehtml" %}
31 <li class="right">
32 {{ searchbox() }}
33 {{ reldelim2 }}
34 </li>
35 {%- endif %}
36{% endblock %}
Georg Brandlaf265f42008-12-07 15:06:20 +000037{% block extrahead %}
38 <link rel="shortcut icon" type="image/png" href="{{ pathto('_static/py.png', 1) }}" />
Ezio Melotti43427222012-02-25 19:24:24 +020039 {% if not embedded %}<script type="text/javascript" src="{{ pathto('_static/copybutton.js', 1) }}"></script>{% endif %}
Ezio Melotti380ce652012-10-27 22:09:16 +030040 {% if versionswitcher is defined and not embedded %}<script type="text/javascript" src="{{ pathto('_static/version_switch.js', 1) }}"></script>{% endif %}
Benjamin Petersonc836f712016-01-20 22:02:30 -080041 {% if pagename == 'whatsnew/changelog' and not embedded %}
Georg Brandl2cac28b2012-09-30 15:10:06 +020042 <script type="text/javascript">
Ezio Melotti7eb03dd2012-10-02 01:43:42 +030043 $(document).ready(function() {
44 // add the search form and bind the events
45 $('h1').after([
46 '<p>Filter entries by content:',
47 '<input type="text" value="" id="searchbox" style="width: 50%">',
48 '<input type="submit" id="searchbox-submit" value="Filter"></p>'
49 ].join('\n'));
50
51 function dofilter() {
52 try {
53 var query = new RegExp($('#searchbox').val(), 'i');
54 }
55 catch (e) {
56 return; // not a valid regex (yet)
57 }
58 // find headers for the versions (What's new in Python X.Y.Z?)
59 $('#changelog h2').each(function(index1, h2) {
60 var h2_parent = $(h2).parent();
61 var sections_found = 0;
62 // find headers for the sections (Core, Library, etc.)
63 h2_parent.find('h3').each(function(index2, h3) {
64 var h3_parent = $(h3).parent();
65 var entries_found = 0;
66 // find all the entries
67 h3_parent.find('li').each(function(index3, li) {
68 var li = $(li);
69 // check if the query matches the entry
70 if (query.test(li.text())) {
71 li.show();
72 entries_found++;
73 }
74 else {
75 li.hide();
76 }
77 });
78 // if there are entries, show the section, otherwise hide it
79 if (entries_found > 0) {
80 h3_parent.show();
81 sections_found++;
82 }
83 else {
84 h3_parent.hide();
85 }
86 });
87 if (sections_found > 0)
88 h2_parent.show();
89 else
90 h2_parent.hide();
91 });
Georg Brandl2cac28b2012-09-30 15:10:06 +020092 }
Ezio Melotti7eb03dd2012-10-02 01:43:42 +030093 $('#searchbox').keyup(dofilter);
94 $('#searchbox-submit').click(dofilter);
95 });
Georg Brandl2cac28b2012-09-30 15:10:06 +020096 </script>
97 {% endif %}
Georg Brandlaf265f42008-12-07 15:06:20 +000098{{ super() }}
Georg Brandle7570052008-05-03 20:52:18 +000099{% endblock %}
Georg Brandl3eb562b2009-08-04 20:25:54 +0000100{% block footer %}
101 <div class="footer">
Victor Stinner875f29a2016-01-22 18:00:05 +0100102 &copy; <a href="{{ pathto('copyright') }}">{% trans %}Copyright{% endtrans %}</a> {{ copyright|e }}.
Georg Brandl3eb562b2009-08-04 20:25:54 +0000103 <br />
Victor Stinner875f29a2016-01-22 18:00:05 +0100104 {% trans %}The Python Software Foundation is a non-profit corporation.{% endtrans %}
105 <a href="https://www.python.org/psf/donations/">{% trans %}Please donate.{% endtrans %}</a>
Georg Brandl3eb562b2009-08-04 20:25:54 +0000106 <br />
Victor Stinner875f29a2016-01-22 18:00:05 +0100107 {% trans last_updated=last_updated|e %}Last updated on {{ last_updated }}.{% endtrans %}
108 {% trans pathto_bugs=pathto('bugs') %}<a href="{{ pathto_bugs }}">Found a bug</a>?{% endtrans %}
Georg Brandl582c0a62010-04-22 23:20:19 +0000109 <br />
Victor Stinner875f29a2016-01-22 18:00:05 +0100110 {% trans sphinx_version=sphinx_version|e %}Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> {{ sphinx_version }}.{% endtrans %}
Georg Brandl3eb562b2009-08-04 20:25:54 +0000111 </div>
112{% endblock %}