{% extends "data_explorer/table_entries_base.html" %}
{% block table_headers %}
    {% table_header "discipline" min_width=125 %}
    {% table_header "name" "Project" min_width=125 %}
    {% table_header "status" min_width=150 %}
    <th style="min-width:150px">Leader(s)</th>
    <th style="min-width:150px">Members (#)</th>
    {% table_header "description" min_width=300 %}
    {% table_header "created_at" "Created" min_width=115 %}
    {% table_header "updated_at" "Updated" min_width=115 %}
{% endblock %}
{% block table_rows %}
    <td>{{ entry.discipline }}</td>
    <td>{% foreign_key_link entry "name" %}</td>
    <td>
        {% if entry.status == "Under Review" %}
            {% status_bar "Under Review" "secondary" %}
        {% elif entry.status == "Active" %}
            {% status_bar "Active" "success" %}
        {% elif entry.status == "Requires Update" %}
            {% status_bar "Requires Update" "warning" %}
        {% elif entry.status == "Inactive" %}
            {% status_bar "Inactive" "danger" %}
        {% elif entry.status == "Staged for Deletion" %}
            {% status_bar "Staged for Deletion" "dark" %}
        {% endif %}
    </td>
    <td>
        {% for leader in entry.leaders.all %}
            <div>
                {{ leader.username }}
                {% if leader.first_name %}({{ leader.first_name }} {{ leader.last_name }}){% endif %}
            </div>
        {% endfor %}
    </td>
    <td>{{ entry.members.count }}</td>
    <td>{{ entry.description|truncatechars:40 }}</td>
    <td>{{ entry.created_at|date:"Y-m-d" }}</td>
    <td>{{ entry.updated_at|date:"Y-m-d" }}</td>
{% endblock %}
