byceps/byceps

View on GitHub
byceps/blueprints/admin/snippet/templates/admin/snippet/create_form.html

Summary

Maintainability
Test Coverage
{% extends 'layout/admin/snippet.html' %}
{% from 'macros/admin.html' import render_backlink %}
{% from 'macros/forms.html' import form_buttons, form_field %}
{% set page_title = _('Create snippet') %}

{% block before_body %}
{{ render_backlink(url_for('.index_for_scope', scope_type=scope.type_, scope_name=scope.name), _('Snippets')) }}
{%- endblock %}

{% block body %}

  <h1 class="title">{{ page_title }}</h1>

  <form action="{{ url_for('.create', scope_type=scope.type_, scope_name=scope.name) }}" method="post">
    <div class="box">
      {{ form_field(form.name, maxlength=40, autofocus='autofocus') }}
      {{ form_field(form.language_code) }}
      {{ form_field(form.body, class='monospace') }}
    </div>

    {{ form_buttons(_('Create')) }}
  </form>

{%- endblock %}