pattern_history_table.html 1.45 KB
<table class="transaction-table">
    <tr>
        <th>atrybut</th>
        <th>przed</th>
        <th>po</th>
    </tr>
    {% for header, values in table.rows %}
        <tr>
            <td>{{ header }}</td>
            <td>
                {% if values.0 == None %}
                    <em>dodano</em>
                {% else %}
                    {{ values.0 }}
                {% endif %}
            </td>
            <td>
                {% if values.1 == None %}
                    <em>usunięto</em>
                {% else %}
                    {{ values.1 }}
                {% endif %}
            </td>
        </tr>
    {% endfor %}
    {% for header, ending_rows in table.ending_tables %}
        <tr>
            <th colspan="3" class="ending-header">zakończenie {{ header }}:</th>
        </tr>
        {% for header, values in ending_rows %}
            <tr>
                {# fuj, copypasta #}
                <td>{{ header }}</td>
                <td>
                    {% if values.0 == None %}
                        <em>dodano</em>
                    {% else %}
                        {{ values.0 }}
                    {% endif %}
                </td>
                <td>
                    {% if values.1 == None %}
                        <em>usunięto</em>
                    {% else %}
                        {{ values.1 }}
                    {% endif %}
                </td>
            </tr>
        {% endfor %}
    {% endfor %}
</table>