byceps/byceps

View on GitHub
byceps/blueprints/admin/shop/storefront/templates/admin/shop/storefront/create_form.html

Summary

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

{% block before_body %}
{{ render_backlink(url_for('.index_for_shop', shop_id=shop.id), _('Storefronts')) }}
{%- endblock %}

{% block body %}

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

  {%- if not order_number_sequence_available %}
  <div class="notification color-warning">
    {{ _('No order number sequences are defined for this shop. No storefronts can be created without a sequence.') }}<br><br>
    <a class="button color-primary" href="{{ url_for('shop_order_admin.create_number_sequence_form', shop_id=shop.id) }}">{{ _('Create order number sequence') }}</a>
  </div>
  {%- else %}
  <form action="{{ url_for('.create', shop_id=shop.id) }}" method="post">
    <div class="box">
      {{ form_field(form.id, maxlength=80, autofocus='autofocus') }}
      {{ form_field(form.catalog_id) }}
      {{ form_field(form.order_number_sequence_id, caption='<a href="%s">%s</a>'|format(url_for('shop_order_admin.create_number_sequence_form', shop_id=shop.id),  _('Create new sequence'))|safe) }}
    </div>

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

{%- endblock %}