{#
    This template is displayed after user clicks the rename link on an Item Views.
    User may add a comment for change log.
    The item's meta data and rendered content is displayed for user review.
#}

{% import "forms.html" as forms with context %}
{% extends theme("show.html") %}

{% set title = _("Rename '{item_name}'").format(item_name=item.fqname|shorten_fqname) %}
{% block content %}
    <h1>{{ title }}</h1>

    {% if len(item_names) > 1 %}
        {{ forms.list_subitems(item_names, _("This item has multiple names:")) }}
        {{ forms.list_subitems(subitem_names, _("If a parent name of the subitems below is removed, that parent's subitems will become subitems of the first name in the target field:")) }}
    {% else %}
        {{ forms.list_subitems(subitem_names, _("The following subitems will be renamed:")) }}
    {% endif %}

    <div class="moin-form">
        {{ gen.form.open(form, method="post", action=url_for('frontend.rename_item', item_name=fqname)) }}
            {{ forms.render_errors(form) }}
            <dl>
                {{ forms.render(form['target']) }}
                {{ forms.render(form['comment']) }}
            </dl>
            {{ forms.render_submit(form) }}
        {{ gen.form.close() }}
    </div>

    <div class="tip">
        {{ _('Use commas (,) to separate multiple names in the Target field.') }}

    </div>

    <h2> {{ _("Meta data of item to be renamed:") }} </h2>
    {{ utils.meta_info(item.meta) }}
    {% if data_rendered %}
        <h2> {{ _("Content of item to be renamed:") }} </h2>
        <div id="moin-content-data">
            {{ data_rendered | safe }}
        </div>
    {% endif %}
{% endblock %}
