{% extends 'spirit/_base.html' %}

{% load spirit_tags i18n %}

{% block title %}{% trans "Search" %}{% endblock %}

{% block content %}

        {% if not query %}
            <h1 class="headline">{% trans "Search" %}</h1>

            <form method="get" action="{% url "spirit:search:search" %}">
                {% include "spirit/_form.html" %}

                <input class="button" type="submit" value="{% trans "Search" %}" />
            </form>

        {% else %}
            <h1 class="headline">{% trans "Results" %}</h1>

            {% get_topics_from_search_result results=page as topics_page %}

            {% if topics_page %}
                {% include "spirit/topic/_render_list.html" with topics=topics_page %}
                {% render_paginator page %}
            {% else %}
                <p>{% trans "There are no search results." %}</p>
            {% endif %}

        {% endif %}

{% endblock %}
