{% extends 'print_base.html' %}
{% load i18n %}
{% comment %}
print view for lab history
{% endcomment %}
{% block content %}

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

    <h2>Winose Evolution</h2>

    <h3>{% trans 'laboratory reference gas history' %}</h3>

    <table class="header_table">
        <thead>
        <tr>
            <td colspan="2">{% trans 'criteria' %}</td>
        </tr>
        </thead>
        <tbody>
        <tr>
            <td colspan="2">r &le; 0.477</td>
        </tr>
        <tr>
            <td colspan="2">A &le; 0.217</td>
        </tr>
        </tbody>
    </table>

    {% if history_data %}
        <table class="history_table">
            <thead>
            <tr>
                <th>{% trans 'date' %}</th>
                <th>ITE</th>
                <th>n-Butanol (ppm)</th>
                <th>&mu;mol/mol</th>
                <th>&sigma;</th>
                <th>y<sub>ite</sub></th>
                <th>r</th>
                <th>d<sub>w</sub></th>
                <th>A<sub>od</sub></th>
            </tr>
            </thead>
            {% for data in history_data %}
                <tr>
                    <td>{{ data.date|date:"SHORT_DATE_FORMAT" }}</td>
                    <td>
                        {{ data.ite|floatformat:2 }}
                    </td>
                    <td>
                        {{ data.concentration|floatformat:2 }}
                    </td>
                    <td>{{ data.ppm|floatformat:4 }}</td>
                    <td>{{ data.site|floatformat:4 }}</td>
                    <td>{{ data.y_ite|floatformat:4 }}</td>
                    <td>
                        {% if not data.r_ok %}
                            ({{ data.r|floatformat:4 }})
                        {% else %}
                            {{ data.r|floatformat:4 }}
                        {% endif %}
                    </td>
                    <td>{{ data.dw|floatformat:4 }}</td>
                    <td>
                        {% if not data.A_ok %}
                            ({{ data.A|floatformat:4 }})
                        {% else %}
                            {{ data.A|floatformat:4 }}
                        {% endif %}
                    </td>
                </tr>
            {% endfor %}
        </table>
    {% else %}
        no results yet.
    {% endif %}
{% endblock %}