{% extends ":/org.kde.pim/kcalutils/template_base.html" %}


{% block body %}
{% with _("Todo") as type %}
{% include ":/org.kde.pim/kcalutils/incidence_header.html" %}
{% endwith %}

<table class="main">

    <!-- Calendar -->
    {% if incidence.calendar %}
    <tr>
        <th valign="top">{% i18n "Calendar:" %}</th>
        <td>{{ incidence.calendar }}</td>
    </tr>
    {% endif %}

    <!-- Location -->
    {% if incidence.location %}
    <tr>
        <th valign="top">{% i18n "Location:" %}</th>
        <td>{{ incidence.location|safe }}</td>
    </tr>
    {% endif %}

    <!-- Start date -->
    {% if incidence.startDate %}
    <tr>
        <th valign="top">{% i18nc "to-do start date/time" "Start:" %}</th>
        {% if incidence.allDay %}
        <td>{{ incidence.startDate|kdatetime:"dateonly" }}</td>
        {% else %}
        <td>{{ incidence.startDate|kdatetime }}</td>
        {% endif %}
    </tr>
    {% endif %}

    <!-- Due date -->
    {% if incidence.dueDate %}
    <tr>
        <th valign="top">{% i18nc "to-do due date/time" "Due:" %}</th>
        {% if incidence.allDay %}
        <td>{{ incidence.dueDate|kdatetime:"dateonly" }}</td>
        {% else %}
        <td>{{ incidence.dueDate|kdatetime }}</td>
        {% endif %}
    </tr>
    {% endif %}

    <!-- Duration -->
    {% if incidence.duration %}
    <tr>
        <th valign="top">{% i18n "Duration:" %}</th>
        <td>{{ incidence.duration }}</td>
    </tr>
    {% endif %}

    <!-- Recurrence -->
    {% if incidence.recurs or incidence.isException %}
    <tr>
        <th valign="top">{% i18n "Recurrence:" %}</th>
        {% if incidence.isException %}
        <td>{% i18n "Exception" %}</td>
        {% else %}
        <td>{{ incidence.recurrence }}</td>
        {% endif %}
    </tr>
    {% endif %}

    <!-- Description -->
    {% if incidence.description %}
    <tr>
        <th valign="top">{% i18n "Description:" %}</th>
        <td>{{ incidence.description|safe }}</td>
    </tr>
    {% endif %}

    <!-- Comments -->
    {# TODO #}

    <!-- Reminders -->
    {% if incidence.reminders %}
    <tr>
        <th valign="top">{% i18np "Reminder:" "Reminders:" incidence.reminders|length %}</th>
        <td>{{ incidence.reminders|join:"<br/>" }}</td>
    </tr>
    {% endif %}

    <!-- Organizer -->
    {% if incidence.organizer %}
    <tr>
        <th valign="top">{% i18n "Organizer:" %}</th>
        <td>
        {% with incidence.organizer as attendee %}
        {% include ":/org.kde.pim/kcalutils/attendee_row.html" %}
        {% endwith %}
        </td>
    </tr>
    {% endif %}

    <!-- Attendees - Chair -->
    {% if incidence.chairs %}
    <tr>
        <th valign="top">{% i18n "Chair:" %}</th>
        <td>
        {% for attendee in incidence.chair %}
            {% include ":/org.kde.pim/kcalutils/attendee_row.html" %}
            {% if not forloop.last %}<br/>{% endif %}
        {% endfor %}
        </td>
    </tr>
    {% endif %}

    <!-- Attendees - Required Participants -->
    {% if incidence.requiredParticipants %}
    <tr>
        <th valign="top">{% i18n "Required Participants:" %}</th>
        <td>
        {% for attendee in incidence.requiredParticipants %}
            {% include ":/org.kde.pim/kcalutils/attendee_row.html" %}
            {% if not forloop.last %}<br/>{% endif %}
        {% endfor %}
        </td>
    </tr>
    {% endif %}

    <!-- Attendees - Optional Participants -->
    {% if incidence.optionalParticipants %}
    <tr>
        <th valign="top">{% i18n "Optional participants:" %}</th>
        <td>
        {% for attendee in incidence.optionalParticipants %}
            {% include ":/org.kde.pim/kcalutils/attendee_row.html" %}
            {% if not forloop.last %}<br/>{% endif %}
        {% endfor %}
        </td>
    </tr>
    {% endif %}

    <!-- Attendees - Observers -->
    {% if incidence.observers %}
    <tr>
        <th valign="top">{% i18n "Observers:" %}</th>
        <td>
        {% for attendee in incidence.chair %}
            {% include ":/org.kde.pim/kcalutils/attendee_row.html" %}
            {% if not forloop.last %}<br/>{% endif %}
        {% endfor %}
        </td>
    </tr>
    {% endif %}

    <!-- Categories -->
    {% if incidence.categories %}
    <tr>
        <th valign="top">{% i18np "Tag:" "Tags:" incidence.categories|length %}</th>
        <td>{{ incidence.categories|join:", " }}</td>
    </tr>
    {% endif %}

    <!-- Priority -->
    {% ifnotequal incidence.priority 0 %}
    <tr>
        <th valign="top">{% i18n "Priority:" %}</th>
        <td>{{ incidence.priority }}</td>
    </tr>
    {% endifnotequal %}

    <!-- Completed -->
    {% if incidence.completedDate %}
    <tr>
        <th valign="top">{% i18nc "Completed: date" "Completed:" %}</th>
        <td>{{ incidence.completedDate|kdatetime }}</td>
    </tr>
    {% else %}
    <tr>
        <th valign="top">{% i18n "Percent done:" %}</th>
        <td>{% i18n "%1%" incidence.percent %}</td>
    </tr>
    {% endif %}

    <!-- Attachments -->
    {% if incidence.attachments %}
    <tr>
        <th valign="top">{% i18np "Attachment:" "Attachments:" incidence.attachments|length %}</th>
        <td>{% for attachment in incidence.attachments %}
            <a href="{{ attachment.uri }}">{{ attachment.label }}</a>
            {% if not forloop.last %}
            <br/>
            {% endif %}
            {% endfor %}
        </td>
    </tr>
    {% endif %}
</table>

<!-- Creation date -->
<p>
<em>{% i18n "Created: %1" incidence.creationDate|kdatetime %}</em><br/>
<em>{% i18n "Modified: %1" incidence.modificationDate|kdatetime %}</em><br/>
<em>{% i18n "Revision: %1" incidence.revision %}</em>
</p>

{% endblock body %}
