{% load tz i18n %}
<div>
{#  {% unicorn "patient-search-input" parent=view %}#}
  <div class="table-responsive" id="patient-search-results">
    <table class="table table-striped table-sm table-hover">
      <thead>
      <tr>
        <th></th>
        <th>{% trans 'Last name' %}</th>
        <th>{% trans 'First name' %}</th>
        <th>{% trans 'Birth date' %}</th>
        <th><i class="bi-phone"></i></th>
        <th><i class="bi-envelope-open"></i></th>
      </tr>
      </thead>

      <tbody>
      {% for patient in patient_list %}
        <tr title="ID: {{ patient.id }}"
            id="patient-{{ patient.id }}"
            {% if not patient.active %}
            class="disabled"
            {% endif %}
            onclick="location.href='/patient/file/{{ patient.id }}'">
          <td><i class="bi bi-gender-male"></i></td>
          <td>
            <strong>{{ patient.names.first.last_name | upper }}</strong>{% if patient.title %}, <i>{{ patient.title }}</i>{% endif %}
          </td>
          <td>{{ patient.first_name }}</td>
          <td>{{ patient.birth_date | date:"d.m.Y" }}</td>
          <td>{% if patient.phone %}
            <a href="tel:{{ patient.phone }}">{{ patient.phone }}</a>
          {% endif %}</td>
          <td><a title="{{ patient.email }}"
                 href="mailto:{{ patient.email }}">{{ patient.email | ljust:10 }}</a>
          </td>
        </tr>
      {% endfor %}
      </tbody>
    </table>
  </div>
</div>