search.html 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. {#
  2. basic/search.html
  3. ~~~~~~~~~~~~~~~~~
  4. Template for the search page.
  5. :copyright: Copyright 2007-2015 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 extrahead %}
  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. <h1 id="search-documentation">{{ _('Search') }}</h1>
  22. <div id="fallback" class="admonition warning">
  23. <script type="text/javascript">$('#fallback').hide();</script>
  24. <p>
  25. {% trans %}Please activate JavaScript to enable the search
  26. functionality.{% endtrans %}
  27. </p>
  28. </div>
  29. <p>
  30. {% trans %}From here you can search these documents. Enter your search
  31. words into the box below and click "search". Note that the search
  32. function will automatically search for all of the words. Pages
  33. containing fewer words won't appear in the result list.{% endtrans %}
  34. </p>
  35. {{ searchform('form-inline', True) }}
  36. {% if search_performed %}
  37. <h2>{{ _('Search Results') }}</h2>
  38. {% if not search_results %}
  39. <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>
  40. {% endif %}
  41. {% endif %}
  42. <div id="search-results">
  43. {% if search_results %}
  44. <ul>
  45. {% for href, caption, context in search_results %}
  46. <li><a href="{{ pathto(item.href) }}">{{ caption }}</a>
  47. <div class="context">{{ context|e }}</div>
  48. </li>
  49. {% endfor %}
  50. </ul>
  51. {% endif %}
  52. </div>
  53. {% endblock %}