diff options
author | Zachary Ware <zachary.ware@gmail.com> | 2016-09-09 20:11:27 (GMT) |
---|---|---|
committer | Zachary Ware <zachary.ware@gmail.com> | 2016-09-09 20:11:27 (GMT) |
commit | a3090a4b79aa16f742d465aea894f148a00ae2c5 (patch) | |
tree | 3630ba9da7486420d2c252a3a033b21ca119d9b2 /Doc/tools/templates | |
parent | 1140a0342613c30feaedfe96b9e09ad7248de490 (diff) | |
download | cpython-a3090a4b79aa16f742d465aea894f148a00ae2c5.zip cpython-a3090a4b79aa16f742d465aea894f148a00ae2c5.tar.gz cpython-a3090a4b79aa16f742d465aea894f148a00ae2c5.tar.bz2 |
Issue #19489: Move the search box from sidebar to header and footer.
Diffstat (limited to 'Doc/tools/templates')
-rw-r--r-- | Doc/tools/templates/customsourcelink.html | 10 | ||||
-rw-r--r-- | Doc/tools/templates/layout.html | 30 |
2 files changed, 30 insertions, 10 deletions
diff --git a/Doc/tools/templates/customsourcelink.html b/Doc/tools/templates/customsourcelink.html new file mode 100644 index 0000000..243d810 --- /dev/null +++ b/Doc/tools/templates/customsourcelink.html @@ -0,0 +1,10 @@ +{%- if show_source and has_source and sourcename %} + <div role="note" aria-label="source link"> + <h3>{{ _('This Page') }}</h3> + <ul class="this-page-menu"> + <li><a href="{{ pathto('bugs') }}">{% trans %}Report a Bug{% endtrans %}</a></li> + <li><a href="{{ pathto('_sources/' + sourcename, true)|e }}" + rel="nofollow">{{ _('Show Source') }}</a></li> + </ul> + </div> +{%- endif %} diff --git a/Doc/tools/templates/layout.html b/Doc/tools/templates/layout.html index 1887b85..8923d9a 100644 --- a/Doc/tools/templates/layout.html +++ b/Doc/tools/templates/layout.html @@ -12,8 +12,28 @@ {%- endif %} </li> {% endblock %} +{%- macro searchbox() %} +{# modified from sphinx/themes/basic/searchbox.html #} + <div class="inline-search" style="display: none" role="search"> + <form class="inline-search" action="{{ pathto('search') }}" method="get"> + <input placeholder="{{ _('Quick search') }}" type="text" name="q" /> + <input type="submit" value="{{ _('Go') }}" /> + <input type="hidden" name="check_keywords" value="yes" /> + <input type="hidden" name="area" value="default" /> + </form> + </div> + <script type="text/javascript">$('.inline-search').show(0);</script> +{%- endmacro %} {% block relbar1 %} {% if builder != 'qthelp' %} {{ relbar() }} {% endif %} {% endblock %} {% block relbar2 %} {% if builder != 'qthelp' %} {{ relbar() }} {% endif %} {% endblock %} +{% block relbaritems %} + {%- if pagename != "search" and builder != "singlehtml" %} + <li class="right"> + {{ searchbox() }} + {{ reldelim2 }} + </li> + {%- 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 %} @@ -90,13 +110,3 @@ {% trans sphinx_version=sphinx_version|e %}Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> {{ sphinx_version }}.{% endtrans %} </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') }}">{% trans %}Report a Bug{% endtrans %}</a></li> - <li><a href="{{ pathto('_sources/' + sourcename, true)|e }}" - rel="nofollow">{% trans %}Show Source{% endtrans %}</a></li> -</ul> -{%- endif %} -{% endblock %} |