Source

django-swingcms / swingcms / cms / templates / cms / form.html

Full commit
{% load i18n %}



<div id='form'>

    {% if introduction %}
	    {{ introduction }}
        <br/>
    {% else %}
    {% endif %}

    {% blocktrans %}Fields marked with <img src='{{ STATIC_URL }}cms/icons/asterix.png' alt="required"> are required.{% endblocktrans %}<br/>

    {% if form.non_field_errors %}
        <br/>
        <div class='error'>{{ form.non_field_errors }}</div>
        <br/>
    {% else %}

        {% if form.errors %}
            <br/>
	        <div class='error'>{% trans 'Please correct the error below.' %}</div>
        {% else %}
        {% endif %}

    {% endif %}



    <br/>
    <form enctype="multipart/form-data" method="post" action="" onsubmit="js_single_submit();">

        {% csrf_token %}

	    <table>

		    {% for f in form %}

                <tr><td></td><td>{{ f.errors }}</td></tr>

                <tr>
                    <th>{% if f.label %}<label{% if 'required' in f.css_classes %} class='required' {% endif %}>{{ f.label }}</label>{% endif %}</th>
                    <td>{{ f.as_widget }}</td>
                </tr>

                <tr><td></td><td class='help_text'>{{ f.help_text }}<br /><br /></td></tr>

            {% endfor %}

	        <tr><td></td><td>
                <input type="submit" name="submit" value="Submit"
                {% if require_submit_confirm %}
                    onclick="return confirm('{% trans "Are you sure?" %}')"
                {% endif %}>
            </td></tr>
            <tr><td></td><td><input type="hidden" name='next' value="{{ next }}"></td></tr>

	    </table>

    </form>

    {% if notes %}
        <br/>
	    {{ notes }}
    {% else %}
    {% endif %}

</div>