lexeme_edit_form.html 6.13 KB
{% load dictionary_extras i18n %}
<form action="" method="post" id="lexeme-edit-form">
    <p class="lexeme-save">
        <button type="submit" disabled="disabled" class="lexeme-edit-submit">
            {% trans 'Save' %}
        </button>
        <button type="reset" disabled="disabled" class="lexeme-edit-cancel">
            {% trans 'Cancel' %}
        </button>
        <button type="button" class="lexeme-edit-delete"
                {% if not editable %}disabled="disabled"{% endif %}>
            {% trans 'Delete lexeme' %}
        </button>
    </p>
    <table id="vocab-list">
        <tr>
            <th>{% trans 'Owner dictionary' %}</th>
            <th>{% trans 'Using dictionaries' %}</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 class="main-field">
        {{ form.status.label_tag }} {{ form.status.as_widget }}
    </p>
    <p class="main-field">
        {{ form.part_of_speech.label_tag }} {{ form.part_of_speech.as_widget }}
        <span id="homonym-count"></span>
    </p>
    <p class="main-field">
        {{ form.entry.label_tag }} {{ form.entry.as_widget }}
        {% if homonym %}#{{ homonym }}{% endif %}
    </p>
    <p class="main-field">
        {{ form.pronunciation.label_tag }} {{ form.pronunciation.as_widget }}
    </p>
    <p class="main-field">
        {{ form.valence.label_tag }} {{ form.valence.as_widget }}
    </p>
    <p class="main-field">
        {{ form.gloss.label_tag }} {{ form.gloss.as_widget }}
    </p>
    <p class="main-field">
        {{ form.note.label_tag }} {{ form.note.as_widget }}
    </p>
    <p class="main-field">
        {{ form.freq.label_tag }} {{ form.freq.as_widget }}
    </p>
    <p class="main-field">
        {{ form.source.label_tag }} {{ form.source.as_widget }}
    </p>
    <p>
        {{ form.borrowing_source.label_tag }}
        {{ form.borrowing_source.as_widget }}
    </p>
    <div id="extra-attributes">
        {% for form in attribute_forms %}
            {{ form.as_p }}
        {% endfor %}
    </div>
    <p>
        {% trans 'Inflections' %}:
        <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 inflection_form, ro_qualifiers in inflection_forms %}
            {% include 'lexeme_edit_form_row.html' %}
        {% endfor %}
    </ul>
    <p>{% trans 'Qualifiers' %}:</p>
    <p>
        {% if ro_qualifiers %}
{% comment %}            {{ owner.id }}: {{ ro_qualifiers|join:", " }}; {% endcomment %}
            {{ ro_qualifiers|join_with_vocab }};
        {% endif %}
    </p>
    <p>
        {% trans 'stylistic qualifiers' %}: {{ form.style_qualifiers.as_widget }}
    </p>
    <p>
        {% trans 'scope qualifiers' %}: {{ form.scope_qualifiers.as_widget }}
    </p>
    <p id="specialist" style="display: none;">
        {{ form.specialist.as_widget }} {% trans 'specialist' %}
    </p>
    <p class="main-field">
        {{ form.qualifiers_dor.label_tag }} {{ form.qualifiers_dor.as_widget }}
    </p>
    {% comment %}
    <p class="main-field">
        {{ form.qualifiers_style.label_tag }}
        {{ form.qualifiers_style.as_widget }}
    </p>
    <p class="main-field">
        {{ form.qualifiers_scope.label_tag }}
        {{ form.qualifiers_scope.as_widget }}
    </p>
    {% endcomment %}
    <div id="classifications">
        {% include "classification_forms.html" %}
    </div>
    <p>
        <strong>{{ form.extended_note.label_tag }}</strong>
    </p>
    <p>
        {{ form.extended_note.as_widget }}
    </p>
    <p>
        <strong>{{ form.comment.label_tag }}</strong>
    </p>
    <p>
        {{ form.comment.as_widget }}
    </p>
    {% if editable or cross_references %}
        <p>
            {% trans 'Cross-references' %}:
            {% 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="entry">{{ cr.to_lexeme.entry }}</span>
                    <span class="hom">
                        {% if cr.to_lexeme.homonym_count > 1 %}
                            #{{ cr.to_lexeme.homonym_number }}
                        {% endif %}
                    </span>
                    <span class="gender">
                        {{ cr.to_lexeme.inflection_data.genders }}
                        {{ cr.to_lexeme|attribute:"aspekt" }}
                    </span>
                </li>
            {% endfor %}
        </ul>
    {% endif %}
    <p class="lexeme-save">
        <button type="submit" disabled="disabled" class="lexeme-edit-submit">
            {% trans 'Save' %}
        </button>
        <button type="reset" disabled="disabled" class="lexeme-edit-cancel">
            {% trans 'Cancel' %}
        </button>
        <button type="button" class="lexeme-edit-delete"
                {% if not editable %}disabled="disabled"{% endif %}>
            {% trans 'Delete lexeme' %}
        </button>
    </p>
</form>
<div id="table-preview">
</div>