{% extends "sphene/sphsearchboard/base.html" %}
{% load i18n %}
{% load sph_extras %}
{% load sphsearch_extras %}
{% load sphboard_extras %}

{% block content %}

  <p>{% sphboard_displayBreadcrumbsForCategory category 1 1 %} &gt;&gt; {% trans "Search" %}</p>


  <form method="get" action=".">
    <input type="hidden" name="category_id" value="{{ category.id }}" />
    <input type="text" name="query" value="{{ query }}" />
    <input type="submit" value="Search" />
  </form>

  {% if results %}
    <h2>{% blocktrans %}Search Results for {{ query }}{% endblocktrans %}</h2>

    <ul class="sphsearch">
      {% for result in results %}
        <li>
          {% with result.instance as post %}
            <a href="{{ post.get_absolute_url }}">{% highlight terms %}{{ post.subject }}{% endhighlight %}</a>
            <p>
              {% highlight terms %}
                {% searchexcerpt terms 3 %}
                  {{ post.body_rendered_without_signature|striptags }}
                {% endsearchexcerpt %}
              {% endhighlight %}
            </p>
            <div class="sphsearch_meta">
            {% blocktrans with result.get_score as result_score and post.author|sph_html_user as post_author and post.postdate|sph_date as postdate %}{{ result_score }} - Posted by {{ post_author }} at {{ postdate }}{% endblocktrans %}
            </div>
          {% endwith %}
        </li>
      {% endfor %}
      <p>{% blocktrans %}Displaying {{ start }} - {{ end }} (Of about {{ count }}){% endblocktrans %}</p>
      <p>{% if prev %}<a href="{{ prev }}">{% trans "Previous" %} {% endif %}{% if next %}<a href="{{ next }}">{% trans "Next" %}{% endif %}</p>
    </ul>
  {% endif %}

{% endblock %}
