lexeme_edit_form.html 4 KB
<form action="" method="post" id="lexeme-edit-form">
    {% for field in form %}
        {% if field.name != 'comment' and field.name != 'vocabularies' and field.name != 'style_qualifiers' and field.name != 'scope_qualifiers' and field.name != 'new_owner' %}
            <p class="main-field">
                {{ field.label_tag }} {{ field.as_widget }}
                {% if field.name == 'part_of_speech' %}
                    <span id="homonym-count"></span>
                {% endif %}
            </p>
        {% endif %}
    {% endfor %}
    <div id="extra-attributes">
        {% for form in attribute_forms %}
            {{ form.as_p }}
        {% endfor %}
    </div>
    <p>
        Sposoby odmiany:
        <input type="hidden" name="id" value="{{ id }}"/>
        {% if editable %}
            <button type="button" id="add-row">
                <span class="ui-icon ui-icon-plus"></span>
            </button>
        {% endif %}
    </p>
    <ul id="pattern-list" {{ editable|yesno:'class="editable",'|safe }}>
        {% for lip_form, ro_qualifiers in lip_forms %}
            {% include 'lexeme_edit_form_row.html' %}
        {% endfor %}
    </ul>
    <table id="vocab-list">
        <tr>
            <th>Słownik właściciel</th>
            <th>Słowniki używające</th>
        </tr>
        <tr>
            <td>
                {% if multiple_editable %}
                    {{ form.new_owner.as_widget }}
                {% else %}
                    <strong id="owner-vocabulary">{{ owner.id }}</strong>
                {% endif %}
            </td>
            <td>
                <ul>
                    {% for v in ro_vocabularies %}
                        <li>
                            {{ v.id }}
                        </li>
                    {% endfor %}
                    <li>
                        {{ form.vocabularies.as_widget }}
                    </li>
                </ul>
            </td>
        </tr>
    </table>
    <p>Kwalifikatory:</p>

    <p>
        {% if ro_qualifiers %}
            {{ owner.id }}: {{ ro_qualifiers|join:", " }};
        {% endif %}
    </p>
    <p>
        stylistyczne: {{ form.style_qualifiers.as_widget }}
    </p>
    <p>
        zakresowe: {{ form.scope_qualifiers.as_widget }}
    </p>
    {% if classification_forms %}
        <h4>Klasyfikacje</h4>
        <div id="classifications">
            {% for form in classification_forms %}
                {{ form.as_p }}
            {% endfor %}
        </div>
    {% endif %}
    <p>
        <strong>{{ form.comment.label_tag }}</strong>
    </p>

    <p>
        {{ form.comment.as_widget }}
    </p>
    {% if editable or cross_references %}
        <p>
            Odsyłacze:
            {% if editable %}
                <button type="button" id="add-cr-row">
                    <span class="ui-icon ui-icon-plus"></span>
                </button>
            {% endif %}
        </p>
        <ul id="cr-list">
            {% for cr in cross_references %}
                <li class="cr-row ui-state-default ui-corner-all"
                    id="cr-{{ cr.pk }}">
                    {% if editable %}
                        <span class="remove ui-icon ui-icon-closethick"></span>
                    {% endif %}
                    <span class="type">{{ cr.type.desc }}</span>
                    <span class="id">{{ cr.to_lexeme.pk }}</span>
                    <span class="entry">{{ cr.to_lexeme.entry }}</span>
                    <span class="gender">{{ cr.to_lexeme.lip_data.genders }}</span>
                </li>
            {% endfor %}
        </ul>
    {% endif %}
    <p class="lexeme-save">
        <button type="submit" disabled="disabled" id="lexeme-edit-submit">
            Zapisz
        </button>
        <button type="reset" disabled="disabled" id="lexeme-edit-cancel">
            Anuluj
        </button>
        <button type="button" id="lexeme-edit-delete"
                {% if not editable %}disabled="disabled"{% endif %}>
            Usuń leksem
        </button>
    </p>
</form>
<div id="table-preview">
</div>