{% extends "structure/base.html" %} {% from 'crud/_macros.html' import render_field, render_form_errors, render_layout, version_inputs, conflict_notice, conflict_mark, form_enctype %} {% from 'crud/_actions.html' import action_control %} {% block title %}{{ construct.compose_title(construct.t("crud-edit-rec", {'recname': construct.t(view.name, {'count': 1})})) }}{% endblock %} {# This view renders its own visible

, so suppress the layout default. #} {% block page_heading %}{% endblock %} {% block content %}
{% if tab_actions %}
{% if edit_actions %}
{% for action in edit_actions %} {{ action_control(construct, action, url_for(view.endpoint + '.' + action.endpoint, id=data[primary_key]), action.variant or "button", target="#main-content") }} {% endfor %}
{% endif %}
{{ csrf_field() }} {{ version_inputs(version_state | default(none)) }} {% block presence %}{% if view.presence_in("edit") %}{{ presence_notice(view.presence_key(data[primary_key]), "editing") }}{% endif %}{% endblock %} {{ conflict_notice(construct, conflict | default(none), fields, conflict_reload_url | default('')) }} {{ render_form_errors(construct, errors) }} {% call(field, type) render_layout(construct, form_layout | default(none), fields, errors) %} {{ conflict_mark(construct, field, type, conflict | default(none)) }} {{ render_field(construct, field, type, view, data, ds, errors=errors) }} {% endcall %}
{{ icon("cancel", size="sm") }} {{ construct.t("crud-cancel-button") }}
{% else %}
{{ icon("back", label=construct.t("crud-back-button")) }}

{{ construct.t('crud-edit-rec',{'recname': construct.t(view.name, {'count': 1}) }) }}

{% if edit_actions %}
{% for action in edit_actions %} {{ action_control(construct, action, url_for(view.endpoint + '.' + action.endpoint, id=data[primary_key]), action.variant or "icon", target="#main-content") }} {% endfor %}
{% endif %}
{{ csrf_field() }} {{ version_inputs(version_state | default(none)) }} {% block form_body %} {{ render_form_errors(construct, errors) }}
{{ self.presence() }} {{ conflict_notice(construct, conflict | default(none), fields, conflict_reload_url | default('')) }} {% call(field, type) render_layout(construct, form_layout | default(none), fields, errors) %} {{ conflict_mark(construct, field, type, conflict | default(none)) }} {{ render_field(construct, field, type, view, data, ds, errors=errors) }} {% endcall %}
{% endblock %}
{% endif %}
{% block form_scripts %}{{ form_scripts | default('') | safe }}{% endblock %} {% endblock %}