Georg Brandl | e757005 | 2008-05-03 20:52:18 +0000 | [diff] [blame] | 1 | {% extends "!layout.html" %} |
| 2 | {% block rootrellink %} |
Georg Brandl | af265f4 | 2008-12-07 15:06:20 +0000 | [diff] [blame] | 3 | <li><img src="{{ pathto('_static/py.png', 1) }}" alt="" |
| 4 | style="vertical-align: middle; margin-top: -1px"/></li> |
Georg Brandl | 46761ec | 2014-10-29 08:36:15 +0100 | [diff] [blame] | 5 | <li><a href="https://www.python.org/">Python</a>{{ reldelim1 }}</li> |
Ezio Melotti | 380ce65 | 2012-10-27 22:09:16 +0300 | [diff] [blame] | 6 | <li> |
| 7 | {%- if versionswitcher is defined %} |
| 8 | <span class="version_switcher_placeholder">{{ release }}</span> |
Victor Stinner | 875f29a | 2016-01-22 18:00:05 +0100 | [diff] [blame] | 9 | <a href="{{ pathto('index') }}">{% trans %}Documentation {% endtrans %}</a>{{ reldelim1 }} |
Ezio Melotti | 380ce65 | 2012-10-27 22:09:16 +0300 | [diff] [blame] | 10 | {%- else %} |
| 11 | <a href="{{ pathto('index') }}">{{ shorttitle }}</a>{{ reldelim1 }} |
| 12 | {%- endif %} |
| 13 | </li> |
Georg Brandl | af265f4 | 2008-12-07 15:06:20 +0000 | [diff] [blame] | 14 | {% endblock %} |
Zachary Ware | a3090a4 | 2016-09-09 13:11:27 -0700 | [diff] [blame] | 15 | {%- macro searchbox() %} |
| 16 | {# modified from sphinx/themes/basic/searchbox.html #} |
Steve Dower | fb4a96a | 2016-09-22 17:07:56 -0700 | [diff] [blame^] | 17 | {%- if builder != "htmlhelp" %} |
Zachary Ware | a3090a4 | 2016-09-09 13:11:27 -0700 | [diff] [blame] | 18 | <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 Dower | fb4a96a | 2016-09-22 17:07:56 -0700 | [diff] [blame^] | 27 | {%- endif %} |
Zachary Ware | a3090a4 | 2016-09-09 13:11:27 -0700 | [diff] [blame] | 28 | {%- endmacro %} |
Georg Brandl | 1afe2af | 2014-03-25 10:12:47 +0100 | [diff] [blame] | 29 | {% block relbar1 %} {% if builder != 'qthelp' %} {{ relbar() }} {% endif %} {% endblock %} |
| 30 | {% block relbar2 %} {% if builder != 'qthelp' %} {{ relbar() }} {% endif %} {% endblock %} |
Zachary Ware | a3090a4 | 2016-09-09 13:11:27 -0700 | [diff] [blame] | 31 | {% block relbaritems %} |
Steve Dower | fb4a96a | 2016-09-22 17:07:56 -0700 | [diff] [blame^] | 32 | {%- if pagename != "search" and builder != "singlehtml" and builder != "htmlhelp" %} |
Zachary Ware | a3090a4 | 2016-09-09 13:11:27 -0700 | [diff] [blame] | 33 | <li class="right"> |
| 34 | {{ searchbox() }} |
| 35 | {{ reldelim2 }} |
| 36 | </li> |
| 37 | {%- endif %} |
| 38 | {% endblock %} |
Georg Brandl | af265f4 | 2008-12-07 15:06:20 +0000 | [diff] [blame] | 39 | {% block extrahead %} |
| 40 | <link rel="shortcut icon" type="image/png" href="{{ pathto('_static/py.png', 1) }}" /> |
Steve Dower | fb4a96a | 2016-09-22 17:07:56 -0700 | [diff] [blame^] | 41 | {% if builder != "htmlhelp" %} |
Ezio Melotti | 4342722 | 2012-02-25 19:24:24 +0200 | [diff] [blame] | 42 | {% if not embedded %}<script type="text/javascript" src="{{ pathto('_static/copybutton.js', 1) }}"></script>{% endif %} |
Ezio Melotti | 380ce65 | 2012-10-27 22:09:16 +0300 | [diff] [blame] | 43 | {% if versionswitcher is defined and not embedded %}<script type="text/javascript" src="{{ pathto('_static/version_switch.js', 1) }}"></script>{% endif %} |
Benjamin Peterson | c836f71 | 2016-01-20 22:02:30 -0800 | [diff] [blame] | 44 | {% if pagename == 'whatsnew/changelog' and not embedded %} |
Georg Brandl | 2cac28b | 2012-09-30 15:10:06 +0200 | [diff] [blame] | 45 | <script type="text/javascript"> |
Ezio Melotti | 7eb03dd | 2012-10-02 01:43:42 +0300 | [diff] [blame] | 46 | $(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 Brandl | 2cac28b | 2012-09-30 15:10:06 +0200 | [diff] [blame] | 95 | } |
Ezio Melotti | 7eb03dd | 2012-10-02 01:43:42 +0300 | [diff] [blame] | 96 | $('#searchbox').keyup(dofilter); |
| 97 | $('#searchbox-submit').click(dofilter); |
| 98 | }); |
Georg Brandl | 2cac28b | 2012-09-30 15:10:06 +0200 | [diff] [blame] | 99 | </script> |
| 100 | {% endif %} |
Steve Dower | fb4a96a | 2016-09-22 17:07:56 -0700 | [diff] [blame^] | 101 | {% endif %} |
Georg Brandl | af265f4 | 2008-12-07 15:06:20 +0000 | [diff] [blame] | 102 | {{ super() }} |
Georg Brandl | e757005 | 2008-05-03 20:52:18 +0000 | [diff] [blame] | 103 | {% endblock %} |
Georg Brandl | 3eb562b | 2009-08-04 20:25:54 +0000 | [diff] [blame] | 104 | {% block footer %} |
| 105 | <div class="footer"> |
Victor Stinner | 875f29a | 2016-01-22 18:00:05 +0100 | [diff] [blame] | 106 | © <a href="{{ pathto('copyright') }}">{% trans %}Copyright{% endtrans %}</a> {{ copyright|e }}. |
Georg Brandl | 3eb562b | 2009-08-04 20:25:54 +0000 | [diff] [blame] | 107 | <br /> |
Victor Stinner | 875f29a | 2016-01-22 18:00:05 +0100 | [diff] [blame] | 108 | {% 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 Brandl | 3eb562b | 2009-08-04 20:25:54 +0000 | [diff] [blame] | 110 | <br /> |
Victor Stinner | 875f29a | 2016-01-22 18:00:05 +0100 | [diff] [blame] | 111 | {% 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 Brandl | 582c0a6 | 2010-04-22 23:20:19 +0000 | [diff] [blame] | 113 | <br /> |
Victor Stinner | 875f29a | 2016-01-22 18:00:05 +0100 | [diff] [blame] | 114 | {% trans sphinx_version=sphinx_version|e %}Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> {{ sphinx_version }}.{% endtrans %} |
Georg Brandl | 3eb562b | 2009-08-04 20:25:54 +0000 | [diff] [blame] | 115 | </div> |
| 116 | {% endblock %} |