{% comment %} Statistics Card Component ========================= A reusable card component for displaying statistics and metrics. Purpose: Renders a consistent statistics card with label, value, optional icon, and optional link. Used for displaying metrics on detail pages. Usage Examples: Basic stat: {% include 'components/stats_card.html' with label='Total Rides' value=park.ride_count %} Stat with icon: {% include 'components/stats_card.html' with label='Rating' value='4.5/5' icon='fas fa-star' %} Clickable stat: {% include 'components/stats_card.html' with label='Total Rides' value=42 link=rides_url %} Priority stat (highlighted): {% include 'components/stats_card.html' with label='Operator' value=park.operator.name priority=True %} Stat with subtitle: {% include 'components/stats_card.html' with label='Height' value='250 ft' subtitle='76 meters' %} Parameters: Required: - label: Stat label/title - value: Stat value to display Optional: - icon: Font Awesome icon class (e.g., 'fas fa-star') - link: URL to link to (makes card clickable) - subtitle: Secondary text below value - priority: Boolean to highlight as priority card (default: False) - size: Size variant 'sm', 'md', 'lg' (default: 'md') - value_class: Additional CSS classes for value Dependencies: - Tailwind CSS for styling - Font Awesome icons (optional) Accessibility: - Uses semantic dt/dd structure for label/value - Clickable cards use proper link semantics - Priority cards use visual emphasis, not just color {% endcomment %} {% with priority=priority|default:False size=size|default:'md' %} {% if link %} {% else %}
{% endif %}
{# Label #}
{% if icon %} {% endif %} {{ label }}
{# Value #} {# Subtitle (optional) #} {% if subtitle %}
{{ subtitle }}
{% endif %}
{% if link %}
{% else %}
{% endif %} {% endwith %}