{% extends edc_listboard_template %}
{% load edc_dashboard_extras %}

{% block listboard_panel %}

    <a id="followup_comm_button"
        title="Home"
        class="btn btn-sm btn-default" role="button"
        href="{{ followup_url }}">Home</a>
    <a id="patientgroup_changelist"
        title="{% if perms.intecomm_screening.change_patientlog %}patient groups{% else %}check your permissions{% endif %}"
        class="btn btn-sm btn-default" role="button"
        {% if not perms.intecomm_group.change_patientgroup %}disabled{% endif %}
        href="{% if perms.intecomm_group.add_patientgroup %}{% url "intecomm_group_admin:intecomm_group_patientgroup_changelist" %}{% endif %}">
            Groups
    </a>

{% endblock %}

{% block listboard_table_header %}

    <!-- begin results header -->
    <th>#</th>
    <th></th>
    <th>Identifier</th>
    <th>Subject</th>
    <th>Age / Born</th>
    <th>Consented</th>
    <th>Group</th>
    <th>Modified</th>
    <!-- end results header -->

{% endblock listboard_table_header %}

{% block listboard_table_columns %}
    <td>{{ result.subject_identifier }}</td>
    <td>
       {% if result.gender == MALE %}
           <i class="fas fa-male fa-lg"></i>
       {% else %}
           <i class="fas fa-female fa-lg"></i>
       {% endif %}
       {% if perms.edc_registration.display_firstname %}{{ result.familiar_name }}{% else %}******{% endif %} {% if perms.edc_registration.display_lastname %}{{ result.initials }}{% else %}******{% endif %}
    </td>
    <td>{% age_in_years result.object.dob %}yrs {% if perms.edc_registration.display_dob %}{{ result.object.dob|date:"SHORT_DATE_FORMAT" }}{% else %}**/**/****{% endif %}</td>
    <td>{{ result.object.consent_datetime|date:"SHORT_DATE_FORMAT" }}</td>
    <td><a href="{% url "intecomm_group_admin:intecomm_group_patientgroup_changelist" %}?q={{result.group_identifier}}">{{ result.group_identifier }}</a></td>
    <td>{{ result.object.modified|date:"SHORT_DATETIME_FORMAT" }}</td>
{% endblock listboard_table_columns %}
