inflection_table.html 3.04 KB
<div class="scheme{{ color_scheme }}">
    <table class="inflection-table">
        {% if tables and tables|length > 1 %}
            <caption>
                {{ gender.symbol }}:
                {% if pronunciations %}
                    <span class="lip-pronunciation">[{{ pronunciations|join:"/"|safe }}]{% if gender_qualifiers %};{% endif %}</span>
                {% endif %}
                <span class="qualifiers">{{ gender_qualifiers|join:" " }}</span>
                {% include "pattern_list.html" %}
            </caption>
        {% endif %}
        {% for row in table %}
            <tr>
                {% for cell in row %}
                    {% if cell.type != "span" %}
                        {% if cell.type == "empty" %}
                            <td class="empty"></td>
                        {% else %}
                            {% if cell.type == "forms" %}
                                <td rowspan="{{ cell.rowspan }}"
                                    colspan="{{ cell.colspan }}"
                                    {% if cell.colspan > 1 %}class="data-c"{% endif %}>
                                    <ul class="form-list">
                                        {% for entry in cell.forms %}
                                            <li>
                                                <span class="form {% for p in entry.patterns %}p{{ p.id }} {% endfor %}">
                                                    {{ entry.form|safe }}
                                                </span>
                                                <span class="qualifiers">
                                                  {% for q in entry.qualifiers %}
                                                      {{ q.label }}
                                                  {% endfor %}
                                                </span>
                                            </li>
                                        {% endfor %}
                                    </ul>
                                </td>
                            {% else %}
                                <td rowspan="{{ cell.rowspan }}"
                                    colspan="{{ cell.colspan }}"
                                    {% if cell.colspan > 1 and cell.css_class == 'data' %}
                                    class="data-c"
                                    {% else %}class="{{ cell.css_class }}"{% endif %}>
                                    <ul class="form-list">
                                        {% for label in cell.label %}
                                            <li>
                                                <span class="header-label">{{ label|safe }}</span>
                                            </li>
                                        {% endfor %}
                                    </ul>
                                </td>
                            {% endif %}
                        {% endif %}
                    {% endif %}
                {% endfor %}
            </tr>
        {% endfor %}
    </table>
</div>