{% extends 'task/default.html' %}

{% block task-content %}
  <dl class="task__data">
    {% if task.category %}
      <dt>Category</dt>
      <dd>{{ task.get_category_display }}</dd>
    {% endif %}
    {% if task.text %}
      <dt>Message</dt>
      <dd>{{task.text}}</dd>
    {% endif %}
    {% if task.user %}
      <dt>User</dt>
      <dd><a href="{% url 'admin:auth_user_change' task.user.pk %}">{{task.user.profile.full_name}}</a></dd>
    {% endif %}
    {% if task.foia %}
      <dt>Request</dt>
      <dd><a href="{{task.foia.get_absolute_url}}">{{task.foia}}</a> (<a href="{% url 'admin:foia_foiarequest_change' task.foia.pk %}">admin</a>) - MR #{{task.foia.pk}}</dd>
    {% elif task.agency %}
      <dt>Agency</dt>
      <dd><a href="{% url 'admin:agency_agency_change' task.agency.pk %}">{{task.agency}}</a></dd>
    {% elif task.jurisdiction %}
      <dt>Jurisdiction</dt>
      <dd><a href="{% url 'admin:jurisdiction_jurisdiction_change' task.jurisdiction.pk %}">{{task.jurisdiction}}</a></dd>
    {% endif %}
  </dl>
  <form method="POST" action="{{ endpoint }}" class="collapsable flag-reply">
    <header>
      <p>&crarr; Reply to {{task.user.profile.full_name}} &lt;<a href="mailto:{{task.user.email}}">{{task.user.email}}</a>&gt;</p>
    </header>
    {% csrf_token %}
    <input type="hidden" name="task" value="{{task.pk}}">
    {{ flag_form.text }}
    <footer class="submission-control">
      <button type="submit" name="reply" value="true" class="primary button">Reply</button>
      <div class="checkbox-field">
        <input type="checkbox" name="resolve" id="resolve-with-reply" checked>
        <label for="resolve-with-reply">Resolve after sending</label>
      </div>
    </footer>
  </form>
{% endblock %}
