{# vim: set ts=2 et sts=2 sw=2: #}
{% extends "search/base.html" %}
{% set meta = (('WT.oss', q),
               ('WT.oss_r', num_results)) %}

{% block content %}
<section id="content">
  <div class="wrap">
    <div id="content-main" class="full">
<article id="search-results" class="main">
  <div id="basic-search" class="search-refine">
    <form role="search" method="get" action="search">
    {% for name, field in search_form.fields.items() if not name in ('q',) %}
      {% set list = request.GET.getlist(name) %}
      {% for value in list %}
        <input type="hidden" name="{{ name }}" value="{{ value }}" />
      {% endfor %}
    {% endfor %}
      <input type="text" class="search-query search-refine-query" value="{{ q }}" name="q">
      <input type="submit" class="search-refine-submit btn-large" value="{{ _('Search') }}">
    </form>
    <a class="show-search-tabs" href="{{ url('search') }}{{ refine_query }}">{{ _('Refine your search') }}</a>
  </div>

  <div class="search-count">
    {# L10n: {n} is the number of search results, {q} is the search query, {l} is the language searched. #}
    {{ ngettext('Found <strong>{n}</strong> result for <strong>{q}</strong> in <strong>{l}</strong>',
                'Found <strong>{n}</strong> results for <strong>{q}</strong> in <strong>{l}</strong>',
                num_results)|fe(n=num_results, q=q, l=lang_name) }}
  </div>

  <div class="search-results">

    {% for doc in results %}
      <div class="result {{ doc.type }}">
        <a class="title" href="{{ doc.url|urlparams(s=q,as='s') }}">{{ doc.title }}</a>
        <p>
          <a href="{{ doc.url|urlparams(s=q,as='s') }}">
            {{ doc.search_summary|safe }}
          </a>
        </p>
      </div>
    {% endfor %}

    {{ pages|paginator }}

  </div>

</article>
    </div>
   </div>
</section>
{% endblock %}
