{% extends "crud/tab_view.html" %} {% from 'crud/_macros.html' import shown %} {% block tab_content %} {%- set is_advanced_filter = request.args.get('advanced_filter') if filter_enabled else none -%} {%- set tab_list_url = url_for(view.endpoint + '.' + list_ep, id=parent_id) -%}
{% if rct.permits('add', construct) %} {{ icon("add", style="font-size: 14px;") }} {{ construct.t("crud-add-new-item") }} {% else %}{% endif %} {%- if search_enabled %}
{%- if filter_enabled %} {{ icon("filter", style="font-size: 16px;", label=construct.t("crud-advanced-filter")) }} {%- endif %}
{%- elif filter_enabled and not is_advanced_filter %} {{ icon("filter", style="font-size: 16px;", label=construct.t("crud-advanced-filter")) }} {%- endif %}
{# The filter form sits outside the table (a
child of is invalid and gets hoisted out by the parser, orphaning these inputs). The controls stay in their cells and join it via `form=`. #} {%- if filter_enabled %}
{%- endif %}
{% for fld, type in fields %} {% endfor %} {%- if filter_enabled %} {% for fld, type in fields %} {% endfor %} {%- endif %} {% for row in data %} {% for field, type in fields %} {% endfor %} {% endfor %} {% if not data %} {% endif %}
{{ construct.t(view.name) }}
{{ construct.t(type.name).capitalize() }} {{ construct.t("crud-action-title") }}
{% if not type.skipfilter %} {% if type.field_type == 'enum' %} {% else %} {% endif %} {% endif %}
{{ icon("search", style="font-size: 16px;", label=construct.t("crud-simple-search")) }}
{% if type.field_type == 'bool' %} {% if type.format_value(field, row) %} {{ 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' %} {% set val = type.format_value(field, row) %} {% if val %}
{% for item in val %} {% if item in type.sets %} {{ construct.t(type.sets[item]) }} {% endif %} {% endfor %}
{% endif %} {% elif type.field_type == 'manyrelated' %}
{% for item in type.format_value(field, row) %} {{ item }} {% endfor %}
{% else %} {# Blank, not the word "None" — see `shown`. #} {{ shown(type.format_value(field, row)) }} {% endif %}
{% if rct.permits('edit', construct, row) %} {{ icon("edit", label=construct.t("crud-edit-button")) }} {% endif %} {% if rct.permits('view', construct, row) %} {{ icon("view", label=construct.t("crud-view-button")) }} {% endif %} {% for action in list_actions %} {{ icon(action.icon, label=construct.t(action.name)) }} {% endfor %} {% if rct.permits('delete', construct, row) %} {# nosemgrep: django-no-csrf-token — Flask app; CSRF is handled by {{ csrf_field() }} below, not Django's {% csrf_token %}. #}
{{ csrf_field() }}
{% endif %}
{{ construct.t("crud-no-items-found") }}
{% if pagination and pagination.pages > 1 %}
{% endif %} {% endblock %}