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

{% block listboard_panel %}
  <div class="btn-group">
  <a id="followup_inte_button"
       title="Home"
       class="btn btn-sm btn-primary" role="button"
       href="{{ followup_url }}"><i class="fa-solid fa-reply fa-1x fa-fw" aria-hidden="true"></i> Home</a>
    {% if patient_group and arm == COMM_INTERVENTION %}
      <a id="patient_group"
         title="Back to group"
         class="btn btn-sm btn-primary" role="button"
         href="{{ patient_group_url }}"><i class="fa-solid fa-reply fa-1x fa-fw" aria-hidden="true"></i> Group</a>
      <a id="group_appointment"
         title="Back to group"
         class="btn btn-sm btn-default" role="button"
         href="{{ patient_group_appointment_url }}">Appointment</a>
      <a id="group_meeting"
         title="Back to group"
         class="btn btn-sm btn-default" role="button"
         href="{{ patient_group_meeting_url }}">Meeting</a>
    {% endif %}
  </div>
  <span class="badge"><i class="fas fa-users-between-lines fa-fw"></i>  {{ patient_group.name }} {{ patient_group.group_identifier }}</span>

{% endblock %}

{% block listboard_table_header %}

    <!-- begin results header -->
    <th>#</th>
    <th></th>
    <th>Identifier</th>
    <th>Subject</th>
    <th>Age</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>{{result.object.age_in_years}}yrs</td>
    <td>{{ result.object.consent_datetime|date:"SHORT_DATE_FORMAT" }}</td>
    <td><a href="{% url "intecomm_dashboard:comm_subject_listboard_url" %}?q={{result.group_identifier}}">{{ result.object.patient_group.name }}</a></td>
    <td>{{ result.object.modified|date:"SHORT_DATETIME_FORMAT" }}</td>
{% endblock listboard_table_columns %}
