{% extends "base.html" %}

{% block title %}
Long time no see
{% endblock %}

{% block content %}
    <h2>Long time no see</h2>
    <table>
    <thead>
          <tr>
              <th>Last visit</th>
              <th>姓名</th>
              <th>病歷號</th>
              <th>性別</th>
              <th>生日</th>
              <th>地址</th>
              <th>電話</th>
              <th>身份證號</th>
              <th>Memo</th>
              <th>Detail</th>
              <th>New Follow</th>
              <th>Edit</th>
              <!-- <th>Print</th> -->
          </td>
    </thead>
    <tbody>
        {% for patient, date in results %}
        <tr>
            <td>{{ date }}</td>
            <td>{{ patient.name }}</td>
            <td>{{ patient.medical_records }}</td>
            <td>{{ patient.get_gender_display }}</td>
            <td>{{ patient.birthday }}</td>
            <td>{{ patient.address }}</td>
            <td>{{ patient.phone }}</td>
            <td>{{ patient.id_cards }}</td>
            <td>
              {{ patient.memo }}
              {% if patient.dead %}
              <em>{{patient.dead}}已死亡</em>
              {% endif %}
            </td>
            <td><a href='/patient/detail/{{patient.id}}/'><img 
              src="http://ck.ntuh.net/site_media/open_icon_library-full/icons/png/24x24/actions/view-list-details.png" 
              alt="Detail" border=0 title="{{patient.name}}'s detail"/></a></td>
            <td><a href='/followup/create/{{patient.id}}/'><img 
              src="http://ck.ntuh.net/site_media/open_icon_library-full/icons/png/24x24/actions/new-tab.png" 
              alt="New Followup" border=0 title="Add New followup"/></a></td>
            <td><a href='/patient/update/{{patient.id}}/'><img 
              src="http://ck.ntuh.net/site_media/open_icon_library-full/icons/png/24x24/actions/edit.png" 
              alt="Edit" border=0 title="Edit {{patient.name}}"/></a></td>
            <!-- <td>{{form.dead}}</td> -->
       </tr>
        {% endfor %}
    </tbody>
    </table>
{% endblock %}