{% extends "flask_deck/base.html" %} {% block breadcrumbs %} / {{ view.plural_label }} / {{ "New " ~ view.label if mode == 'create' else "Edit #" ~ pk_str }} {% endblock %} {% block content %}

{{ "Create " ~ view.label if mode == 'create' else "Edit " ~ view.label }}

All mutations are CSRF-protected and recorded to the Audit Ledger.

{{ deck_icon("arrow-left", 13) }} Back
1 %} data-deck-wizard{% endif %}> {% if errors.get('__all__') %} {% endif %} {% set use_tabs = (view.form_layout == 'tabs' and fieldsets | length > 1) %} {% set use_wizard = (view.form_layout == 'wizard' and fieldsets | length > 1) %} {% if use_tabs %}
{% for fs_title, fs_cols in fieldsets %} {% set ns = namespace(err_cnt=0) %} {% for c in fs_cols %}{% if errors.get(c) %}{% set ns.err_cnt = ns.err_cnt + 1 %}{% endif %}{% endfor %} {% endfor %}
{% elif use_wizard %}
{% for fs_title, fs_cols in fieldsets %} {% set ns = namespace(err_cnt=0) %} {% for c in fs_cols %}{% if errors.get(c) %}{% set ns.err_cnt = ns.err_cnt + 1 %}{% endif %}{% endfor %} {% endfor %}
{% endif %} {% for fs_title, fs_cols in fieldsets %} {% endfor %} {% for inline in inlines %}

{{ inline.label }}

Inline child records saved atomically with parent

{% if inline.can_create %} {% endif %}
{% set inl_ns = namespace(errs=[]) %} {% for ek, emsgs in errors.items() %} {% if ek == inline.slug or ek.startswith(inline.slug ~ '[') %} {% for m in emsgs %}{% set _ = inl_ns.errs.append(ek ~ ': ' ~ m) %}{% endfor %} {% endif %} {% endfor %} {% if inl_ns.errs %}
{% endif %}
{% for col in inline.columns %}{% endfor %} {% if inline.can_delete %}{% endif %} {% for row in inline.rows %} {% set idx = loop.index0 %} {% for col in inline.columns %} {% endfor %} {% if inline.can_delete %} {% endif %} {% endfor %}
{{ col.label }}Remove
{% if loop.first %} {% endif %} {% if col.kind == 'fk' %} {% elif col.kind == 'enum' %} {% else %} {% endif %}
{% endfor %}
{% if use_wizard %} {% endif %} {{ _("Cancel") }}
{% endblock %}