view MoinMoin/templates/modify.html @ 2910:86df79fae350 fix-205

Add download link to modify view (fixes #205)
author Aviral Dasgupta <me@aviraldg.com>
date Mon, 16 Mar 2015 17:00:30 +0530
parents cfdec0c11e3d
children 72c5a7d688b5
line wrap: on
line source
{% import "forms.html" as forms %}
{% import "utils.html" as utils %}
{% extends theme("show.html") %}

{% from form.meta_template import meta_editor %}
{# Import macros data_editor and extra_head from content_form's template.
   extra_head is optional, so instead of a simple "import from" we need to do
   this manually #}
{% import form['content_form'].template as content_template %}
{% set extra_head = content_template.extra_head %}
{% set data_editor = content_template.data_editor %}

{% set title = _("Modifying '%(item_name)s'", item_name=fqname.value) %}

{% block head %}
    {{ super() }}
    {% if extra_head %}
        {{ extra_head() }}
    {% endif %}
{% endblock %}

{% block subitem_navigation %}
    {% call(fullname, shortname, contenttype, has_children) utils.render_subitem_navigation(fqname, True) %}
        {% set shortname = shortname|json_dumps %}
        <button class="moin-insertname-action" data-name="{{ fullname }}"
            title="{{ _('Insert Name') }}">{{ _('Insert Name') }}</button>
    {% endcall %}
{% endblock %}


{% block content %}
    <h1>{{ title }}</h1>
    <div id="moin-modify" class="moin-form">
        <a class="btn btn-success" style="float: right" href="{{ url_for('.download_item', item_name=item_name, mimetype='application/x.moin.download') }}">
        <span class="fa fa-download"></span> {{ _('Download') }}
        </a>
        {{ gen.form.open(form, method='post', enctype='multipart/form-data') }}
            {{ forms.render_errors(form) }}
            {#
               Workaround:
               For *Draw content, hide submit button and form['comment'], since *Draw
               POSTs originate from their respective applets.
            #}
            {% if not form['content_form'].is_draw %}
                {{ forms.render_submit(form, id='moin-save-text-button') }}
                <dl>
                    {{ forms.render_textcha(gen, form) }}
                    {{ forms.render(form['comment']) }}
                </dl>
            {% endif %}
            {{ data_editor(form['content_form'], item_name) }}
            {{ utils.help_on_editing(help) }}
            {% set may_admin = user.may.admin(fqname) %}
            {{ meta_editor(form['meta_form'], may_admin) }}
            <dl>
                {{ forms.render(form['extra_meta_text']) }}
            </dl>
            {#
            {{ gen.textarea(form['meta_text'], lang='en', dir='ltr', rows=rows_meta, cols=cols) }}
            <br />
            {{ forms.render_errors(form['meta_text']) }}
            #}
        {{ gen.form.close() }}
    </div>
{% endblock %}

{% block options_for_javascript %}
    {%- if user.scroll_page_after_edit -%}
        <br id="moin-scroll-page-after-edit" />
    {%- endif %}
{% endblock %}