{% extends "todo/base.html" %}

{% block title %}Search results{% endblock %}

{% block content_title %}
    <h2 class="page_title">Search</h2>
{% endblock %}

{% block content %}
    {% if found_items %}
        <h2>{{found_items.count}} search results for term: "{{ query_string }}"</h2>
        <div class="post_list">
            {% for f in found_items %}
                <p><strong><a href="{% url 'todo-task_detail' f.id %}">{{ f.title }}</a></strong><br />
                    <span class="minor">
                        On list: <a href="{% url 'todo-incomplete_tasks' f.list.id f.list.slug %}">{{ f.list.name }}</a><br />
                        Assigned to: {% if f.assigned_to %}{{ f.assigned_to }}{% else %}Anyone{% endif %} (created by: {{ f.created_by }})<br />
                        Complete: {{ f.completed|yesno:"Yes,No" }}
                    </span>
                </p>
            {% endfor %}
        </div>
    {% else %}
        <h2> No results to show, sorry.</h2>
    {% endif %}
{% endblock %}
