summaryrefslogtreecommitdiffstats
path: root/Doc/tools/templates/layout.html
blob: 5abff1b3989f06260793ecc804c680aa89f270f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
{% extends "!layout.html" %}
{% block rootrellink %}
        <li><img src="{{ pathto('_static/py.png', 1) }}" alt=""
                 style="vertical-align: middle; margin-top: -1px"/></li>
        <li><a href="https://www.python.org/">Python</a>{{ reldelim1 }}</li>
        <li>
          {%- if versionswitcher is defined %}
          <span class="version_switcher_placeholder">{{ release }}</span>
          <a href="{{ pathto('index') }}">Documentation</a>{{ reldelim1 }}
          {%- else %}
          <a href="{{ pathto('index') }}">{{ shorttitle }}</a>{{ reldelim1 }}
          {%- endif %}
        </li>
{% endblock %}
{% block relbar1 %} {% if builder != 'qthelp' %} {{ relbar() }} {% endif %} {% endblock %}
{% block relbar2 %} {% if builder != 'qthelp' %} {{ relbar() }} {% endif %} {% endblock %}
{% block extrahead %}
    <link rel="shortcut icon" type="image/png" href="{{ pathto('_static/py.png', 1) }}" />
    {% if not embedded %}<script type="text/javascript" src="{{ pathto('_static/copybutton.js', 1) }}"></script>{% endif %}
    {% if versionswitcher is defined and not embedded %}<script type="text/javascript" src="{{ pathto('_static/version_switch.js', 1) }}"></script>{% endif %}
    {% if pagename == 'whatsnew/changelog' %}
    <script type="text/javascript">
      $(document).ready(function() {
          // add the search form and bind the events
          $('h1').after([
            '<p>Filter entries by content:',
            '<input type="text" value="" id="searchbox" style="width: 50%">',
            '<input type="submit" id="searchbox-submit" value="Filter"></p>'
          ].join('\n'));

          function dofilter() {
              try {
                  var query = new RegExp($('#searchbox').val(), 'i');
              }
              catch (e) {
                  return; // not a valid regex (yet)
              }
              // find headers for the versions (What's new in Python X.Y.Z?)
              $('#changelog h2').each(function(index1, h2) {
                  var h2_parent = $(h2).parent();
                  var sections_found = 0;
                  // find headers for the sections (Core, Library, etc.)
                  h2_parent.find('h3').each(function(index2, h3) {
                      var h3_parent = $(h3).parent();
                      var entries_found = 0;
                      // find all the entries
                      h3_parent.find('li').each(function(index3, li) {
                          var li = $(li);
                          // check if the query matches the entry
                          if (query.test(li.text())) {
                              li.show();
                              entries_found++;
                          }
                          else {
                              li.hide();
                          }
                      });
                      // if there are entries, show the section, otherwise hide it
                      if (entries_found > 0) {
                          h3_parent.show();
                          sections_found++;
                      }
                      else {
                          h3_parent.hide();
                      }
                  });
                  if (sections_found > 0)
                      h2_parent.show();
                  else
                      h2_parent.hide();
              });
          }
          $('#searchbox').keyup(dofilter);
          $('#searchbox-submit').click(dofilter);
      });
    </script>
    {% endif %}
{{ super() }}
{% endblock %}
{% block footer %}
    <div class="footer">
    &copy; <a href="{{ pathto('copyright') }}">Copyright</a> {{ copyright|e }}.
    <br />
    The Python Software Foundation is a non-profit corporation.
    <a href="https://www.python.org/psf/donations/">Please donate.</a>
    <br />
    Last updated on {{ last_updated|e }}.
    <a href="{{ pathto('bugs') }}">Found a bug</a>?
    <br />
    Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> {{ sphinx_version|e }}.
    </div>
{% endblock %}
{% block sidebarsourcelink %}
{%- if show_source and has_source and sourcename %}
<h3>{{ _('This Page') }}</h3>
<ul class="this-page-menu">
  <li><a href="{{ pathto('bugs') }}">Report a Bug</a></li>
  <li><a href="{{ pathto('_sources/' + sourcename, true)|e }}"
         rel="nofollow">Show Source</a></li>
</ul>
{%- endif %}
{% endblock %}