pattern_edit_form.html 1.75 KB
{% load i18n %}
<form action="" method="post" id="pattern-edit-form">
    <p><input type="hidden" name="id" value="{{ pattern.id }}"/></p>

    <div id="pattern-properties">
        {{ type_form.as_p }}
        {% for field in form %}
            {% if field.name != 'basic_form_ending' %}
                <p class="main-field">
                    {{ field.label_tag }} {{ field.as_widget }}
                    {% if field.name == 'example' %}
                        {{ form.basic_form_ending.as_widget }}
                    {% endif %}
                    {% if field.name == 'name' and pattern.old_name %}
                        {% trans 'Old name' %}: {{ pattern.old_name }}
                    {% endif %}
                </p>
            {% endif %}
        {% endfor %}
        {% if pattern.patternexample_set.all %}
            <h3>{% trans "Examples" %}</h3>
            {% for example in pattern.patternexample_set.all %}
                <p>
                    {{ example.gender.symbol }}:
                    <input class="example-input" data-id="{{ example.id }}" value="{{ example.lexeme.entry }}"/>
                </p>
            {% endfor %}
        {% endif %}
        <p class="pattern-save">
            <button type="submit" disabled="disabled" class="pattern-edit-submit">
                Zapisz
            </button>
            <button type="reset" disabled="disabled" class="pattern-edit-cancel">
                Anuluj
            </button>
        </p>
    </div>
    <table id="ending-list" {{ editable|yesno:'class="editable",'|safe }}
           data-bfl-id="{{ base_form_label.id }}">
        {% for base_form_label, ending_group in ending_groups.iteritems %}
            {% include "ending_table_row.html" %}
        {% endfor %}
    </table>
</form>