{% extends base %}
{% from 'macro.html' import breadcrumbs with context %}
{% from 'macro.html' import form_fields with context %}
{% block content %}

<div class="row">
    <div class="span12">
        {{- breadcrumbs([
            [url_for('admin_index.index'), _('Administration')],
            [url_for('admin_htmlblocks.index'), _('HTML Blocks')]
        ]) }}
        <h1>{{ page_title }}</h1>

        {% if saved %}<div class="alert-mini green">{{ _('Saved!') }}</div>{% endif %}

        <form class="form-horizontal" method="POST" enctype="multipart/form-data">
        {{ form_fields(form) }}
        <div class="controls">
            {% if not edit or can_edit %}
            <input type="submit" value="{{ _('Save') }}" class="btn btn-primary" />
            {% if edit %}<a href="{{ url_for('admin_htmlblocks.delete', name=htmlblock.name, lang=htmlblock.lang) }}" class="btn">{{ _('Delete') }}</a>{% endif %}
            {% else %}
            {{ _("You don't have access to edit this Jinja2 template.") }}
            {% endif %}
        </div>
        </form>

        {{- breadcrumbs([
            [url_for('admin_index.index'), _('Administration')],
            [url_for('admin_htmlblocks.index'), _('HTML Blocks')]
        ]) }}
    </div>
</div>
{% endblock %}
