search.html 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. {#
  2. basic/search.html
  3. ~~~~~~~~~~~~~~~~~
  4. Template for the search page.
  5. :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS.
  6. :license: BSD, see https://github.com/sphinx-doc/sphinx/blob/master/LICENSE for details.
  7. #}
  8. {%- extends "layout.html" %}
  9. {% set title = _('Search') %}
  10. {% set display_vcs_links = False %}
  11. {%- block scripts %}
  12. {{ super() }}
  13. <script src="{{ pathto('_static/searchtools.js', 1) }}"></script>
  14. <script src="{{ pathto('_static/language_data.js', 1) }}"></script>
  15. {%- endblock %}
  16. {% block footer %}
  17. <script>
  18. jQuery(function() { Search.loadIndex("{{ pathto('searchindex.js', 1) }}"); });
  19. </script>
  20. {# this is used when loading the search index using $.ajax fails,
  21. such as on Chrome for documents on localhost #}
  22. <script id="searchindexloader"></script>
  23. {{ super() }}
  24. {% endblock %}
  25. {% block body %}
  26. <noscript>
  27. <div id="fallback" class="admonition warning">
  28. <p class="last">
  29. {% trans trimmed %}Please activate JavaScript to enable the search
  30. functionality.{% endtrans %}
  31. </p>
  32. </div>
  33. </noscript>
  34. {% if search_performed %}
  35. {# Translators: Search is a noun, not a verb #}
  36. <h2>{{ _('Search Results') }}</h2>
  37. {% if not search_results %}
  38. <p>{{ _('Your search did not match any documents. Please make sure that all words are spelled correctly and that you\'ve selected enough categories.') }}</p>
  39. {% endif %}
  40. {% endif %}
  41. <div id="search-results">
  42. {% if search_results %}
  43. <ul>
  44. {% for href, caption, context in search_results %}
  45. <li>
  46. <a href="{{ pathto(item.href) }}">{{ caption }}</a>
  47. <p class="context">{{ context|e }}</p>
  48. </li>
  49. {% endfor %}
  50. </ul>
  51. {% endif %}
  52. </div>
  53. {% endblock %}