search.html 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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 LICENSE for details.
  7. #}
  8. {%- extends "layout.html" %}
  9. {% set title = _('Search') %}
  10. {% set script_files = script_files + ['_static/searchtools.js'] %}
  11. {% block footer %}
  12. <script type="text/javascript">
  13. jQuery(function() { Search.loadIndex("{{ pathto('searchindex.js', 1) }}"); });
  14. </script>
  15. {# this is used when loading the search index using $.ajax fails,
  16. such as on Chrome for documents on localhost #}
  17. <script type="text/javascript" id="searchindexloader"></script>
  18. {{ super() }}
  19. {% endblock %}
  20. {% block body %}
  21. <noscript>
  22. <div id="fallback" class="admonition warning">
  23. <p class="last">
  24. {% trans %}Please activate JavaScript to enable the search
  25. functionality.{% endtrans %}
  26. </p>
  27. </div>
  28. </noscript>
  29. {% if search_performed %}
  30. <h2>{{ _('Search Results') }}</h2>
  31. {% if not search_results %}
  32. <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>
  33. {% endif %}
  34. {% endif %}
  35. <div id="search-results">
  36. {% if search_results %}
  37. <ul>
  38. {% for href, caption, context in search_results %}
  39. <li>
  40. <a href="{{ pathto(item.href) }}">{{ caption }}</a>
  41. <p class="context">{{ context|e }}</p>
  42. </li>
  43. {% endfor %}
  44. </ul>
  45. {% endif %}
  46. </div>
  47. {% endblock %}