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

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

{% block content %}
    <h1> {{ _("Revert '{item_name}' to Revision Number '{rev_number}'").format(item_name=item.meta['name'] | join('|'), rev_number=item.meta.rev_number) }} </h1>
    <div class="moin-form">
        {{ gen.form.open(form, method="post", action=url_for('frontend.revert_item', item_name=item.fqname, rev=rev_id)) }}
            {{ forms.render_errors(form) }}
            <dl>
                {{ forms.render(form['comment']) }}
            </dl>
            {{ forms.render_submit(form) }}
        {{ gen.form.close() }}
    </div>

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