{% load nearbeach_extras %}
{% if active_task_results %}
    <table id="Active_Projects_Table" class="table table-hover">
        <thead>
            <tr>
                <td width="10%">Task</td>
                <td width="70%;">Description</td>
                <td width="20%;">End Date</td>
            </tr>
        </thead>

        {% for row in active_task_results %}
            <tr
                    {% if row.task_end_date|hours_ago:24 %}
                        class="table-danger"
                    {% elif row.task_start_date|in_future:24 %}
                        class="table-success"
                    {% endif %}
            >
                <td><a href="{% url 'task_information' row.task_id %}">TASK{{ row.task_id }}</a></td>
                <td>
                    {% if not row.organisations_id == Null %}
                        <a href="{% url 'organisation_information' row.organisation_id.organisation_id %}">{{ row.organistaion_id }}</a><br/><br/>
                    {% endif %}
                    {{ row.task_short_description }}</td>
                <td>{{ row.task_end_date }}</td>
            </tr>
        {% endfor %}
    </table>

{% else %}
    <p>There are currently no active projects.</p>
{% endif %}