{% extends "base_template.html" %} {# action is a logic value ("Create"/"Edit") coming from the route; translate it only where it is shown. #} {% set action_label = _('Edit') if action == 'Edit' else _('Create') %} {% block title %}{{ action_label }} {{ model_name }} - {{ _('Admin') }}{% endblock %} {% block breadcrumb %} {% endblock %} {% block content %}

{{ action_label }} {{ model_name }}

{% with messages = get_flashed_messages(with_categories=true) %} {% if messages %} {% for category, message in messages %} {% endfor %} {% endif %} {% endwith %}
{# A bare test app has no CSRFProtect, so the global may not exist; every real product initialises it and emits the token. #} {% if csrf_token is defined %}{% endif %}
{% for col in columns %}
{% set col_type = col.type.upper().split('(')[0] %} {% if col_type in ('TEXT', 'LONGTEXT', 'MEDIUMTEXT') %} {% elif col_type == 'BOOLEAN' or col_type == 'TINYINT' %}
{% else %} {% endif %}
{% endfor %}
{{ _('Cancel') }}
{% endblock %}