{% extends "nsclc/base.html" %}

{% block content %}
    <h2>Patient List</h2>
    <table>
    	<thead>
        <tr>
            <th>病患姓名</th>
            <th>病歷號碼</th>
            <th>出生年月日</th>
            <th>性別</th>
            <th>診斷日期</th>
            <th>組織學型態</th>
            <th>初次腦轉移日期</th>
            <th>醫師</th>
            <th>Last Modified</th>
    	</tr>
    	</thead>
        {% for patient in object_list %}
        <tr>
            <td>{{ patient.Patient.name }}</td>
            <td>{{ patient.Patient.medical_records }}</td>
            <td>{{ patient.Patient.birthday }}</td>
            <td>{{ patient.Patient.get_gender_display }}</td>
            <td>{{ patient.DxDate }}</td>
            <td>{{ patient.get_Histology_display }}</td>
            <td>{{ patient.BMDate }}</td>
            {% ifequal patient.Physician.dept 'surg' %}
            <td style="background-color:red;">
            {% else %}
            <td style="background-color:green;">
			{% endifequal %}
            {{ patient.Physician.name }}</td>
            <td>{{ patient.LastModified }}</td>
            
			<td><a href='{{patient.Patient.id}}/'><img src='{{open_icon_library}}/icons/png/24x24/actions/view-list-details.png' /></a></td>
			<td><a href='{{patient.Patient.id}}/update/'><img src='{{open_icon_library}}/icons/png/24x24/actions/edit.png' /></a></td>
			<td><a href='{{patient.Patient.id}}/delete/'><img src='{{open_icon_library}}/icons/png/24x24/actions/edit-delete.png' /></a></td>

        </tr>
        {% endfor %}
    </table>
{% endblock %}