blob: 5c180e7d01643acadddf2a9b7d50d4c8b7a07c87 [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 #}
Steve Dowerfb4a96a2016-09-22 17:07:56 -070017 {%- if builder != "htmlhelp" %}
Zachary Warea3090a42016-09-09 13:11:27 -070018 <div class="inline-search" style="display: none" role="search">
19 <form class="inline-search" action="{{ pathto('search') }}" method="get">
20 <input placeholder="{{ _('Quick search') }}" type="text" name="q" />
21 <input type="submit" value="{{ _('Go') }}" />
22 <input type="hidden" name="check_keywords" value="yes" />
23 <input type="hidden" name="area" value="default" />
24 </form>
25 </div>
26 <script type="text/javascript">$('.inline-search').show(0);</script>
Steve Dowerfb4a96a2016-09-22 17:07:56 -070027 {%- endif %}
Zachary Warea3090a42016-09-09 13:11:27 -070028{%- endmacro %}
Georg Brandl1afe2af2014-03-25 10:12:47 +010029{% block relbar1 %} {% if builder != 'qthelp' %} {{ relbar() }} {% endif %} {% endblock %}
30{% block relbar2 %} {% if builder != 'qthelp' %} {{ relbar() }} {% endif %} {% endblock %}
Zachary Warea3090a42016-09-09 13:11:27 -070031{% block relbaritems %}
Steve Dowerfb4a96a2016-09-22 17:07:56 -070032 {%- if pagename != "search" and builder != "singlehtml" and builder != "htmlhelp" %}
Zachary Warea3090a42016-09-09 13:11:27 -070033 <li class="right">
34 {{ searchbox() }}
35 {{ reldelim2 }}
36 </li>
37 {%- endif %}
38{% endblock %}
Georg Brandlaf265f42008-12-07 15:06:20 +000039{% block extrahead %}
40 <link rel="shortcut icon" type="image/png" href="{{ pathto('_static/py.png', 1) }}" />
Steve Dowerfb4a96a2016-09-22 17:07:56 -070041 {% if builder != "htmlhelp" %}
Ezio Melotti43427222012-02-25 19:24:24 +020042 {% if not embedded %}<script type="text/javascript" src="{{ pathto('_static/copybutton.js', 1) }}"></script>{% endif %}
Ezio Melotti380ce652012-10-27 22:09:16 +030043 {% 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 -080044 {% if pagename == 'whatsnew/changelog' and not embedded %}
Georg Brandl2cac28b2012-09-30 15:10:06 +020045 <script type="text/javascript">
Ezio Melotti7eb03dd2012-10-02 01:43:42 +030046 $(document).ready(function() {
47 // add the search form and bind the events
48 $('h1').after([
49 '<p>Filter entries by content:',
50 '<input type="text" value="" id="searchbox" style="width: 50%">',
51 '<input type="submit" id="searchbox-submit" value="Filter"></p>'
52 ].join('\n'));
53
54 function dofilter() {
55 try {
56 var query = new RegExp($('#searchbox').val(), 'i');
57 }
58 catch (e) {
59 return; // not a valid regex (yet)
60 }
61 // find headers for the versions (What's new in Python X.Y.Z?)
62 $('#changelog h2').each(function(index1, h2) {
63 var h2_parent = $(h2).parent();
64 var sections_found = 0;
65 // find headers for the sections (Core, Library, etc.)
66 h2_parent.find('h3').each(function(index2, h3) {
67 var h3_parent = $(h3).parent();
68 var entries_found = 0;
69 // find all the entries
70 h3_parent.find('li').each(function(index3, li) {
71 var li = $(li);
72 // check if the query matches the entry
73 if (query.test(li.text())) {
74 li.show();
75 entries_found++;
76 }
77 else {
78 li.hide();
79 }
80 });
81 // if there are entries, show the section, otherwise hide it
82 if (entries_found > 0) {
83 h3_parent.show();
84 sections_found++;
85 }
86 else {
87 h3_parent.hide();
88 }
89 });
90 if (sections_found > 0)
91 h2_parent.show();
92 else
93 h2_parent.hide();
94 });
Georg Brandl2cac28b2012-09-30 15:10:06 +020095 }
Ezio Melotti7eb03dd2012-10-02 01:43:42 +030096 $('#searchbox').keyup(dofilter);
97 $('#searchbox-submit').click(dofilter);
98 });
Georg Brandl2cac28b2012-09-30 15:10:06 +020099 </script>
100 {% endif %}
Steve Dowerfb4a96a2016-09-22 17:07:56 -0700101 {% endif %}
Georg Brandlaf265f42008-12-07 15:06:20 +0000102{{ super() }}
Georg Brandle7570052008-05-03 20:52:18 +0000103{% endblock %}
Georg Brandl3eb562b2009-08-04 20:25:54 +0000104{% block footer %}
105 <div class="footer">
Victor Stinner875f29a2016-01-22 18:00:05 +0100106 &copy; <a href="{{ pathto('copyright') }}">{% trans %}Copyright{% endtrans %}</a> {{ copyright|e }}.
Georg Brandl3eb562b2009-08-04 20:25:54 +0000107 <br />
Victor Stinner875f29a2016-01-22 18:00:05 +0100108 {% trans %}The Python Software Foundation is a non-profit corporation.{% endtrans %}
109 <a href="https://www.python.org/psf/donations/">{% trans %}Please donate.{% endtrans %}</a>
Georg Brandl3eb562b2009-08-04 20:25:54 +0000110 <br />
Victor Stinner875f29a2016-01-22 18:00:05 +0100111 {% trans last_updated=last_updated|e %}Last updated on {{ last_updated }}.{% endtrans %}
112 {% trans pathto_bugs=pathto('bugs') %}<a href="{{ pathto_bugs }}">Found a bug</a>?{% endtrans %}
Georg Brandl582c0a62010-04-22 23:20:19 +0000113 <br />
Victor Stinner875f29a2016-01-22 18:00:05 +0100114 {% 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 +0000115 </div>
116{% endblock %}