{% extends "vellum/base_vellum.html" %}
{% load i18n %}

{% block title %}{% trans "Search" %} | {{ block.super }}{% endblock %}
{% block description %}{% trans "Search all blog posts" %}{% endblock %}
{% block body_id %}post-search{% endblock %}


{% block content %}
    <h1>{% trans "Blog Search" %}</h1>

    <form action="." method="get" id="post-search-form">
        <input type="text" name="q" value="{{ search_term }}">
        <input type="submit" class="button" value="{% trans "Search" %}">
    </form>

    {% if message %}
    <p class="message">{{ message }}</p>
    {% endif %}
  
    {% if object_list %}
    <h2>{% trans "Results for" %}: <span class="query">{{ search_term }}</span></h2>
    <ul class="post-list">
        {% for post in object_list %}
        <li>
            <h3 class="title"><a href="{{ post.get_absolute_url }}" title="{% trans "View this post" %}">{{ post.title }}</a></h3>
            <time pubdate datetime="{{ post.publish|date:"c" }}">{{ post.publish|date }}</time>
        </li>
        {% endfor %}
    </ul>
    {% endif %}
{% endblock %}
