{# Header Macros ============= Reusable page header and navigation components. Usage: {% from 'shared/macros/headers.html' import page_header, section_header, breadcrumbs %} {{ page_header('User Management', action_label='Create User', action_url='/users/create') }} {{ section_header('Account Settings') }} {{ breadcrumbs([{'label': 'Home', 'url': '/'}, {'label': 'Users'}]) }} #} {# Page Header =========== A page header with title, optional subtitle, and action button. Parameters: - title: Page title - subtitle: Page subtitle (optional) - action_label: Action button text (optional) - action_url: Action button URL (optional) - action_icon: Action button icon (default: 'plus') - action_onclick: JavaScript onclick handler (optional, instead of URL) - back_url: Back button URL (optional) - back_label: Back button text (default: 'Back') #} {% macro page_header(title, subtitle=none, action_label=none, action_url=none, action_icon='plus', action_onclick=none, back_url=none, back_label='Back') %}

{{ title }}

{% if subtitle %}

{{ subtitle }}

{% endif %}
{% if back_url %} {{ back_label }} {% endif %} {% if action_label and (action_url or action_onclick) %} {% if action_url %} {{ action_label }} {% else %} {% endif %} {% endif %}
{% endmacro %} {# Page Header (Dynamic) ===================== A page header where the title comes from Alpine.js. Parameters: - title_var: Alpine.js variable for the title - subtitle_var: Alpine.js variable for subtitle (optional) - ... other params same as page_header #} {% macro page_header_dynamic(title_var, subtitle_var=none, action_label=none, action_url=none, action_icon='plus', back_url=none, back_label='Back') %}

{% if subtitle_var %}

{% endif %}
{% if back_url %} {{ back_label }} {% endif %} {% if action_label and action_url %} {{ action_label }} {% endif %}
{% endmacro %} {# Section Header ============== A section header within a page. Parameters: - title: Section title - subtitle: Section subtitle (optional) - action_label: Action button text (optional) - action_onclick: Action button onclick (optional) - icon: Section icon (optional) #} {% macro section_header(title, subtitle=none, action_label=none, action_onclick=none, icon=none) %}
{% if icon %} {% endif %}

{{ title }}

{% if subtitle %}

{{ subtitle }}

{% endif %}
{% if action_label and action_onclick %} {% endif %}
{% endmacro %} {# Breadcrumbs =========== Navigation breadcrumbs. Parameters: - items: List of breadcrumb items [{'label': '', 'url': ''}] Last item (without url) is treated as current page - separator: Separator character (default: '/') #} {% macro breadcrumbs(items, separator='/') %} {% endmacro %} {# Card Header =========== A header for card sections. Parameters: - title: Card header title - subtitle: Card header subtitle (optional) - class_extra: Additional CSS classes #} {% macro card_header(title, subtitle=none, class_extra='') %}

{{ title }}

{% if subtitle %}

{{ subtitle }}

{% endif %}
{% endmacro %} {# Tab Header ========== A tab navigation header. Parameters: - tabs: List of tab items [{'id': '', 'label': '', 'icon': ''}] - active_var: Alpine.js variable for active tab #} {% macro tab_header(tabs, active_var='activeTab') %}
{% endmacro %}