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 | ab71214 | 2012-03-25 20:31:57 +0200 | [diff] [blame] | 5 | <li><a href="http://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> |
| 9 | <a href="{{ pathto('index') }}">Documentation</a>{{ reldelim1 }} |
| 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 %} |
| 15 | {% block extrahead %} |
| 16 | <link rel="shortcut icon" type="image/png" href="{{ pathto('_static/py.png', 1) }}" /> |
Ezio Melotti | 4342722 | 2012-02-25 19:24:24 +0200 | [diff] [blame] | 17 | {% 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] | 18 | {% if versionswitcher is defined and not embedded %}<script type="text/javascript" src="{{ pathto('_static/version_switch.js', 1) }}"></script>{% endif %} |
Georg Brandl | 4524b46 | 2012-10-01 19:38:34 +0200 | [diff] [blame] | 19 | {% if pagename == 'whatsnew/changelog' %} |
Georg Brandl | 2cac28b | 2012-09-30 15:10:06 +0200 | [diff] [blame] | 20 | <script type="text/javascript"> |
Ezio Melotti | 7eb03dd | 2012-10-02 01:43:42 +0300 | [diff] [blame] | 21 | $(document).ready(function() { |
| 22 | // add the search form and bind the events |
| 23 | $('h1').after([ |
| 24 | '<p>Filter entries by content:', |
| 25 | '<input type="text" value="" id="searchbox" style="width: 50%">', |
| 26 | '<input type="submit" id="searchbox-submit" value="Filter"></p>' |
| 27 | ].join('\n')); |
| 28 | |
| 29 | function dofilter() { |
| 30 | try { |
| 31 | var query = new RegExp($('#searchbox').val(), 'i'); |
| 32 | } |
| 33 | catch (e) { |
| 34 | return; // not a valid regex (yet) |
| 35 | } |
| 36 | // find headers for the versions (What's new in Python X.Y.Z?) |
| 37 | $('#changelog h2').each(function(index1, h2) { |
| 38 | var h2_parent = $(h2).parent(); |
| 39 | var sections_found = 0; |
| 40 | // find headers for the sections (Core, Library, etc.) |
| 41 | h2_parent.find('h3').each(function(index2, h3) { |
| 42 | var h3_parent = $(h3).parent(); |
| 43 | var entries_found = 0; |
| 44 | // find all the entries |
| 45 | h3_parent.find('li').each(function(index3, li) { |
| 46 | var li = $(li); |
| 47 | // check if the query matches the entry |
| 48 | if (query.test(li.text())) { |
| 49 | li.show(); |
| 50 | entries_found++; |
| 51 | } |
| 52 | else { |
| 53 | li.hide(); |
| 54 | } |
| 55 | }); |
| 56 | // if there are entries, show the section, otherwise hide it |
| 57 | if (entries_found > 0) { |
| 58 | h3_parent.show(); |
| 59 | sections_found++; |
| 60 | } |
| 61 | else { |
| 62 | h3_parent.hide(); |
| 63 | } |
| 64 | }); |
| 65 | if (sections_found > 0) |
| 66 | h2_parent.show(); |
| 67 | else |
| 68 | h2_parent.hide(); |
| 69 | }); |
Georg Brandl | 2cac28b | 2012-09-30 15:10:06 +0200 | [diff] [blame] | 70 | } |
Ezio Melotti | 7eb03dd | 2012-10-02 01:43:42 +0300 | [diff] [blame] | 71 | $('#searchbox').keyup(dofilter); |
| 72 | $('#searchbox-submit').click(dofilter); |
| 73 | }); |
Georg Brandl | 2cac28b | 2012-09-30 15:10:06 +0200 | [diff] [blame] | 74 | </script> |
| 75 | {% endif %} |
Georg Brandl | af265f4 | 2008-12-07 15:06:20 +0000 | [diff] [blame] | 76 | {{ super() }} |
Georg Brandl | e757005 | 2008-05-03 20:52:18 +0000 | [diff] [blame] | 77 | {% endblock %} |
Georg Brandl | 3eb562b | 2009-08-04 20:25:54 +0000 | [diff] [blame] | 78 | {% block footer %} |
| 79 | <div class="footer"> |
| 80 | © <a href="{{ pathto('copyright') }}">Copyright</a> {{ copyright|e }}. |
| 81 | <br /> |
Ezio Melotti | 7eb03dd | 2012-10-02 01:43:42 +0300 | [diff] [blame] | 82 | The Python Software Foundation is a non-profit corporation. |
Georg Brandl | 3eb562b | 2009-08-04 20:25:54 +0000 | [diff] [blame] | 83 | <a href="http://www.python.org/psf/donations/">Please donate.</a> |
| 84 | <br /> |
| 85 | Last updated on {{ last_updated|e }}. |
Georg Brandl | 582c0a6 | 2010-04-22 23:20:19 +0000 | [diff] [blame] | 86 | <a href="{{ pathto('bugs') }}">Found a bug</a>? |
| 87 | <br /> |
Georg Brandl | 3eb562b | 2009-08-04 20:25:54 +0000 | [diff] [blame] | 88 | Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> {{ sphinx_version|e }}. |
| 89 | </div> |
| 90 | {% endblock %} |
Georg Brandl | 582c0a6 | 2010-04-22 23:20:19 +0000 | [diff] [blame] | 91 | {% block sidebarsourcelink %} |
| 92 | {%- if show_source and has_source and sourcename %} |
| 93 | <h3>{{ _('This Page') }}</h3> |
| 94 | <ul class="this-page-menu"> |
| 95 | <li><a href="{{ pathto('bugs') }}">Report a Bug</a></li> |
| 96 | <li><a href="{{ pathto('_sources/' + sourcename, true)|e }}" |
| 97 | rel="nofollow">Show Source</a></li> |
| 98 | </ul> |
| 99 | {%- endif %} |
| 100 | {% endblock %} |