{%- extends "layout.html" %}

{% set title = _('Search') %}
{% set script_files = script_files + ['_static/searchtools.js'] %}

{% block footer %}
  <script type="text/javascript">
    jQuery(function() { Search.loadIndex("{{ pathto('searchindex.js', 1) }}"); });
  </script>
  <script type="text/javascript" src="{{ pathto('_static/language_data.js', 1) }}"></script>
  {{ super() }}
{% endblock %}

{% block body %}
  <noscript>
    <p>Documentation searching relies on Javascript. Please enable it.</p>
  </noscript>

    {% if search_performed %}
    <h2>{{ _('Search Results') }}</h2>
    {% if not search_results %}
      <p>{{ _('Your search did not match any results.') }}</p>
    {% endif %}
  {% endif %}
  <div id="search-results">
  {% if search_results %}
    <ul>
    {% for href, caption, context in search_results %}
      <li class="card">
        <div class="card-block">
          <h3 class="card-title"><a href="{{ pathto(item.href) }}">{{ caption }}</a></h3>
          <div class="context">{{ context|e }}</div>
        </div>
      </li>
    {% endfor %}
    </ul>
  {% endif %}
  </div>

{% endblock %}