{% extends "structure/base.html" %} {% from 'crud/_macros.html' import shown %} {% block title %}{{ construct.compose_title(construct.t(view.name)) }}{% endblock %} {# This view renders its own visible

, so suppress the layout default. #} {% block page_heading %}{% endblock %} {% block content %} {% set is_advanced_filter = request.args.get('advanced_filter') %} {% set return_here = request.full_path.rstrip('?') %}

{{ construct.t(view.name) }}

{% if view.permits('add') %} {{ icon("add", style="font-size: 14px;") }} {{ construct.t("crud-create-rec", {'recname': construct.t(view.name, {'count': 1}) }) }} {% endif %}
{# The advanced-filter form lives OUTSIDE the table: a
as a direct child of is invalid, and the parser hoists it out of the table, orphaning these inputs from it. Binding by `form=` keeps the controls in their cells while belonging to a well-formed form (same approach as components/grid.html). #}
{% for fld, type in fields %} {% endfor %} {% for fld, type in fields %} {% endfor %} {% for row in data %} {% for field, type in fields %} {% endfor %} {% endfor %}
{{ construct.t(view.name) }}
{{ construct.t(type.name).capitalize() }}{{ construct.t("crud-action-title") }}
{% if not type.skipfilter %} {% if type.field_type == 'enum' %} {% else %} {# placeholder is not an accessible name: it disappears as soon as the user types. #} {% endif %} {% endif %}
{{ icon("search", style="font-size: 16px;", label=construct.t("crud-simple-search")) }}
{% if type.field_type == 'bool' %} {# The glyph is the whole cell value, so it needs a text equivalent — colour alone does not distinguish it. #} {% if row[field] %} {{ icon("check", style="color: var(--fcu-success-fg); font-size: 20px; font-variation-settings: 'FILL' 1", label=construct.t("crud-bool-true")) }} {% else %} {{ icon("cancel", style="color: var(--fcu-danger-fg); font-size: 20px; font-variation-settings: 'FILL' 1", label=construct.t("crud-bool-false")) }} {% endif %} {% elif type.field_type == 'set' %} {% if row[field] %}
{% for item in row[field] %} {% if item in type.sets %} {{ construct.t(type.sets[item]) }} {% endif %} {% endfor %}
{% endif %} {% elif type.field_type == 'manyrelated' %} {% set items = type.format_value(field, row) %} {% if items %}
{% for item in items %} {{ item }} {% endfor %}
{% endif %} {% else %} {# Blank, not the word "None" — see `shown`. #} {{ shown(type.format_value(field,row)) }} {% endif %}
{% if view.permits('edit', row) %} {{ icon("edit", label=construct.t("crud-edit-button")) }} {% endif %} {% if view.permits('view', row) %} {{ icon("view", label=construct.t("crud-view-button")) }} {% endif %} {% if list_actions %} {% for action in list_actions %} {{ icon(action.icon, label=construct.t(action.name)) }} {% endfor %} {% endif %} {# nosemgrep: django-no-csrf-token — Flask app; CSRF is handled by {{ csrf_field() }} below, not Django's {% csrf_token %}. #} {% if view.permits('delete', row) %}
{{ csrf_field() }}
{% endif %}
{% if pagination and pagination.pages > 1 %} {% endif %}
{% endblock content %}