{% load i18n %}

    <h2>{% trans 'Tasks' %}</h2>

    {% if tasks %}

    <table class="table">
        <thead>
            <th style="width: 20%">{% trans 'Task' %}</th>
            <th style="width: 60%">{% trans 'Description' %}</th>
            <th style="width: 20%">{% trans 'Time frame' %}</th>
        </thead>
        <tbody>
            {% for task in tasks %}
            <tr>
                <td>{{ task.title }}</td>
                <td>{{ task.text }}</td>
                <td>
                {% for dates in task.dates %}
                    {% if dates|length > 1 %}
                    <p>{{ dates.0 | date:"DATE_FORMAT" }}<br /> - {{ dates.1 | date:"DATE_FORMAT" }}</p>
                    {% else %}
                    <p>{{ dates.0 | date:"DATE_FORMAT" }}</p>
                    {% endif %}
                {% endfor %}
                </td>
            </tr>
            {% endfor %}
        </tbody>
    </table>

    {% else %}

    <p>{% trans 'No active tasks found.' %}</p>

    {% endif %}
