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

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

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