{# Jinja Macros for Team Tryouts Application This file contains reusable HTML components to reduce code duplication across templates. Import with {% import 'layouts/macros.html' as macros %} #} {# Page Header Macro - renders title and breadcrumb #} {% macro page_header(title, breadcrumb) %} {% block title %}{{ title }} - TryoutPro{% endblock %} {% block page_title %}{{ title }}{% endblock %} {% block breadcrumb %}{{ breadcrumb }}{% endblock %} {% endmacro %} {# Card Header Macro - renders card with optional actions #} {% macro card_header(title, icon_class, actions=None) %}

{{ title }}

{% if actions %}
{{ actions }}
{% endif %}
{% endmacro %} {# Stat Card Macro - renders statistics card #} {% macro stat_card(value, label, icon_class, bg_class) %}

{{ value }}

{{ label }}

{% endmacro %} {# Badge Macro - renders status/role badges with appropriate styling #} {% macro badge(text, type='default') %} {{ text }} {% endmacro %} {# User Avatar Macro - renders user avatar with name #} {% macro user_avatar(user, size='sm') %}
{{ user.username[:2] | upper }}
{{ user.username }}
{% endmacro %} {# Form Field Macro - renders labeled form input #} {% macro form_field(label, type, name, value='', placeholder='', required=false, extra_classes='') %}
{% endmacro %} {# Form Row Macro - renders a row of form fields #} {% macro form_row(fields) %}
{% for field in fields %}
{% if field.type == 'select' %} {% else %} {% endif %}
{% endfor %}
{% endmacro %} {# Table Macro - renders a table with headers and optional empty state #} {% macro table(headers, rows, empty_message='No records found') %}
{% for header in headers %} {% endfor %} {% if rows %} {{ rows }} {% else %} {% endif %}
{{ header }}

{{ empty_message }}

{% endmacro %} {# Modal Macro - renders a modal dialog #} {% macro modal(id, title, content, footer_buttons=None) %} {% endmacro %} {# Detail Item Macro - renders a key-value pair in detail view #} {% macro detail_item(label, value) %}
{{ label }} {{ value }}
{% endmacro %} {# Action Button Macro - renders a button link #} {% macro action_button(url, text, icon, style='outline', size='sm') %} {% if icon %}{% endif %} {{ text }} {% endmacro %}