{% comment %}
Partial Search Results.
{% endcomment %}

<div id="content-wrapper" class="search-results" data-doc-type="{{doc_type}}">
    {% for warning in warnings %}
    <div class="error">{{ warning }}</div>
    {% endfor %}

    <section data-page-type="search-results" data-base-version="{{ version|default:"" }}">
        <h2 class="search-term">Searching for “{{ q }}”</h2>
        {% if not skip_count %}
        <span id="result-count">{{ results.total_hits }} result{{ results.results|pluralize }}</span>
        {% endif %}
        </p>
        <ul class="result-list">
        {% for result in results.results %}
            <li>
            <h3><a href="{{result.url}}" class="internal" data-linked-section="{{result.section_id}}" data-linked-version="{{version}}" data-linked-subsection="{{result.label|join:'-'}}">{{result.header}}</a></h3>
              {% if result.subheader %}<h4>{{ result.subheader }}</h4>{% endif %}
              {% if result.subsubheader %}<h5>{{ result.subsubheader }}</h5>{% endif %}
              {% if result.text %}<p>{{result.text}}</p>{% endif %}
            </li>
        {% empty %}
            <span class="no-results">Sorry, there are no results in the regulation effective {{version_by_date|date:"n/j/Y"}}.</span>
        {% endfor %}
        </ul>
    </section>

    {% if results.results %}
    <footer class="search-nav">
    {% if previous %}
    <a class="previous" href="{% url url_rule regulation %}?q={{ q|urlencode }}&version={{ version|urlencode }}&page={{ previous.page }}"><span class="cf-icon cf-icon-left"></span>Previous {{ previous.length }} Results</a>
    {% endif %}

    {% if next %}
    <a class="next" href="{% url url_rule regulation %}?q={{ q|urlencode }}&version={{ version|urlencode }}&page={{ next.page }}"><span class="cf-icon cf-icon-right"></span>Next {{ next.length }} Results</a>
    {% endif %}

    <div class="pager">Page {{ current.page }} of {{ current.total }}</div>
    </footer>
    {% endif %}
</div>
