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