{% extends 'print_base.html' %}
{% comment %}
html template for a single panelist history
{% endcomment %}
{% block content %}
    <body>

    <button style="margin-bottom: 5px; display: inline-block;" class="noprint" onclick="window.print()">Print</button>
    <br/>

    <h2>Winose Evolution</h2>

    <h3>panel member reference gas history</h3>
    <table class="header_table">
        <thead>
        <tr>
            <th>{{ current_substance }}</th>
        </tr>
        </thead>
        <tbody>
        <tr>
            <td>panel member</td>
            <td>{{ panelist.shorthand }}
            </td>
        </tr>
        <tr>
            <td>date of birth</td>
            <td>{{ panelist.date_of_birth }}</td>
        </tr>
        <tr>
            <td>gender</td>
            <td>{{ panelist.get_gender_display }}</td>
        </tr>
        </tbody>
    </table>


    <table class="header_table">
        <thead>
        <tr>
            <th>criteria</th>
        </tr>
        </thead>
        <tbody>
        <tr>
            <td>10<sup>&sigma;</sup> &le; 2.3</td>
        </tr>
        <tr>
            <td>0.02 &le; 10<sup>Y<sub>ITE</sub></sup> &le; 0.08</td>
        </tr>
        </tbody>
    </table>


    <table class="history_table">
        <thead>
        <tr>
            <th>Date</th>
            <th>ITE</th>
            <th>PPM</th>
            <th>&mu;mol/mol</th>
            <th>10<sup>&sigma;</sup></th>
            <th>10<sup>Y<sub>ite</sub></sup></th>
        </tr>
        </thead>

        <tbody>
        {% for h in history %}
            <tr>
                <td>
                    {{ h.date|date:"d.m.y" }}
                </td>
                <td>
                    {{ h.ite|floatformat:1 }}
                </td>
                <td>
                    {{ h.concentration|floatformat:1 }}
                </td>
                <td>
                    {{ h.ppm|floatformat:4 }}
                </td>

                <td>
                <span>
                    {% if h.site_10 and not h.site_ok %}
                        ({{ h.site_10|floatformat:4 }})
                    {% else %}
                        {{ h.site_10|floatformat:4 }}
                    {% endif %}
                </span>
                </td>

                <td>
            <span>
                {% if h.y_ite_10 and not h.y_ite_ok %}
                    ({{ h.y_ite_10|floatformat:4 }})
                {% else %}
                    {{ h.y_ite_10|floatformat:4 }}
                {% endif %}
            </span>
                </td>

            </tr>
        {% empty %}
            no data yet.
        {% endfor %}
        </tbody>

        <tfoot></tfoot>
    </table>
{% endblock content %}