{% 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 %} {% from 'components/_page_header.html' import page_header %} {% 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 %} {#- One header for both layouts, above the card (the page_header macro, components/_page_header.html): title, back to the list, and the record's actions. #} {% call page_header(construct.t('crud-edit-rec', {'recname': construct.t(view.name, {'count': 1}) }), back_url=view.url, back_label=construct.t('crud-back-button'), back_target="#main-content", css_class="fcu-crud-header") %} {%- for action in edit_actions or [] %} {{ action_control(construct, action, url_for(view.endpoint + '.' + action.endpoint, id=data[primary_key]), action.variant or "icon", target="#main-content") }} {%- endfor %} {% endcall %}
{% if tab_actions %}
{{ 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 %}
{{ 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 %}