view MoinMoin/themes/basic/templates/modify.html @ 2851:5a49eeb1f307

add spaces to jinja2 expressions, add tests for missing spaces to coding_std.py
author RogerHaase <haaserd@gmail.com>
date Wed, 19 Nov 2014 11:51:19 -0700
parents 1f7d8cc15805
children cfdec0c11e3d
line wrap: on
line source
{% extends theme("layout.html") %}
{% import "forms.html" as forms %}
{% import "utils.html" as utils %}
{% from theme(form.meta_template) import basic_meta_editor %}
{% import theme("itemviews.html") as itemviews with context %}
{% import theme(form['content_form'].template) as content_template %}
{% set extra_head = content_template.extra_head %}
{% if content_template.basic_data_editor is defined %}
    {% set data_editor = content_template.basic_data_editor %}
{% else %}
    {% set data_editor = content_template.data_editor %}
{% endif %}
{% set title = _("Modifying '%(item_name)s'", item_name=item_name) %}

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

{% block views %}
    {{ itemviews }}
{% endblock %}

{% block content %}
    <h1>{{ title }}</h1>
    <div id="moin-modify" class="moin-form">
        {{ gen.form.open(form, method='post', enctype='multipart/form-data') }}
            {{ forms.render_errors(form) }}
            {{ forms.render_errors(form['meta_form']['acl']) }}
            {#
               Workaround:
               For *Draw content, hide submit button and form['comment'], since *Draw
               POSTs originate from their respective applets.
            #}
            <ul class="moin-nav nav-tabs moin-shadow">
                <li class="active"><a href="#editor" data-toggle="tab">Edit Content</a></li>
                <li><a href="#meta" data-toggle="tab">Edit Meta</a></li>
                {% if user.may.admin(fqname) %}
                    <li><a href="#acl" data-toggle="tab">Edit ACL</a></li>
                {% endif %}
                <li><a href="#help" data-toggle="tab">Help</a></li>
            </ul>
            <div class="tab-content">
                <div class="tab-pane active" id="editor">
                    {{ data_editor(form['content_form'], item_name) }}
                </div>
                <div class="tab-pane active" id="meta">
                    <div class="row">
                        <div class="col-md-6">
                            {{ basic_meta_editor(form['meta_form']) }}
                        </div>
                        {% set field = form['extra_meta_text'] %}
                        <div class="col-md-6">
                            <div class="form-group">
                                {{ gen.label(field) }}
                                {{ gen.textarea(field, rows=field.properties.rows|string, cols=field.properties.cols|string, class='form-control') }}
                            </div>
                        </div>
                    </div>
                </div>

                {% set field = form['meta_form']['acl'] %}
                {% if user.may.admin(fqname) %}
                    <div class="tab-pane active" id="acl">
                        <div class="row">
                            <div class="col-md-6">
                                <div class="form-group">
                                    {{ gen.label(field) }}
                                    {{ gen.textarea(field, rows='1', class='form-control') }}
                                </div>
                            </div>
                        </div>
                    </div>
                {% else %}
                    {{ gen.input(field, type='hidden', class='form-control') }}
                {% endif %}
                <div class="tab-pane active" id="help">
                    {% if form['content_form'].help %}
                        <pre id="moin-editor-help">{{ form['content_form'].help }}</pre>
                    {% endif %}
                </div>
            </div>
            {#
            {{ gen.textarea(form['meta_text'], lang='en', dir='ltr', rows=rows_meta, cols=cols) }}
            <br />
            {{ forms.render_errors(form['meta_text']) }}
            #}
            {% if not form['content_form'].is_draw %}
                <div class="form-group">
                    {{ forms.render_textcha(gen, form) }}
                    {{ gen.input(form['comment'], type="text", class="form-control") }}
                </div>
                <div class="form-group">
                    {{ forms.render_submit(form, value='Save', class='btn btn-primary', id='moin-save-text-button') }}
                </div>
            {% endif %}

        {{ gen.form.close() }}
    </div>
{% endblock %}