{% extends "base.html" %} {% from "macros/list.html" import filter_toggle_button %} {% from "macros/url.html" import prepend_bu_prefix %} {# Base template for CRUD list pages with server-side DataTables. Extended by page-specific list templates (keys, servers, tags, userlog). Variables to set: - entity_name: Title-cased entity label (e.g. "Server", "Key", "API Key"). Used for buttons, page title (entity_name + "s"), and Create label. - wide_table: Break table out of container for full-width display (default: false) - no_create: Set to true to hide the "Create" button (default: false) - no_delete: Set to true to hide the "Delete" buttons (default: false) Blocks to override: - page_css: Additional page-specific CSS files - page_title: Override title markup (default: entity_name + "s") - action_buttons: Action buttons in header (Create, Export, etc.) - filters_section: Filter controls (collapsible panel) - table_content: The element with DataTables data attributes - page_scripts: Additional page-specific JS files #} {% set _title = (entity_name ~ 's') if entity_name is defined else 'List' %} {% set _base_path = prepend_bu_prefix(request.path.rstrip('/') or request.path) %} {% block title %}{{ _title }} - ePortal{% if current_unit() %} [{{ current_unit().title }}]{% endif %}{% endblock %} {% block head_css %} {{ super() }} {% block page_css %}{% endblock %} {% endblock %} {% set _wide = wide_table | default(false) %} {% block body %} {# Error alert #} {# Success alert #} {% if success is defined and success %} {% endif %} {# Header with title and action buttons #}

{% block page_title %}{{ _title }}{% endblock %}

{% block action_buttons %} {% if entity_name is defined and not no_delete | default(false) %} {% endif %} {% if entity_name is defined and not no_create | default(false) %} Create {{ entity_name }} {% endif %} {% if entity_name is defined %} Export CSV {% endif %} {% block extra_action_buttons %}{% endblock %} {% if entity_name is defined %} {{ filter_toggle_button() }} {% endif %} {% endblock %}
{# Filters section #} {% block filters_section %}{% endblock %} {% if not _wide %} {% block table_content %}{% endblock %} {% endif %} {% if _wide %}
{{ self.table_content() }}
{% endif %} {% endblock %} {% block tail %} {{ super() }} {% block page_scripts %}{% endblock %} {% endblock %}