{% comment %} Park Card Component - Django Cotton Version A reusable park card component that supports both list and grid view modes. Includes status badges, operator information, description, and ride/coaster statistics. Usage Examples: List View: Grid View: With custom CSS classes: Parameters: - park: Park object (required) - view_mode: "list" or "grid" (default: "grid") - class: Additional CSS classes (optional) Features: - Responsive design with hover effects - Status badge with proper color coding - Operator information display - Description with automatic truncation (30 words for list, 15 for grid) - Ride and coaster count statistics with icons - Gradient effects and modern styling - Links to park detail pages {% endcomment %} {% if park %} {% if view_mode == 'list' %} {# Enhanced List View Item with CloudFlare Images and Accessibility #}
{# Enhanced List View Image Section #}
{% if park.card_image.image or park.photos.first.image %} {% with image=park.card_image.image|default:park.photos.first.image %} {# List View CloudFlare Images Optimization #} {# Mobile list view (full width, 16:9) #} {# Tablet/Desktop list view (smaller thumbnail) #} {# Fallback image #} {{ park.name }} - {% if park.card_image.alt_text %}{{ park.card_image.alt_text }}{% elif park.photos.first.alt_text %}{{ park.photos.first.alt_text }}{% else %}Theme park exterior view{% endif %} {% endwith %} {% else %} {# Enhanced List View Fallback #}
{% endif %} {# List View Status Badge Overlay with Accessibility #}
{# Enhanced Main Content Section with Better Mobile Layout #}
{# Enhanced Title with Better Mobile Typography and Accessibility #}

{% if park.slug %} {{ park.name }} {% else %} {{ park.name }} {% endif %}

{# View Details Arrow for Mobile #}
{# Enhanced Operator Display #} {% if park.operator %}
{{ park.operator.name }}
{% endif %} {# Enhanced Description with Accessibility #} {% if park.description %}

{{ park.description|truncatewords:30 }}

{% endif %}
{# Enhanced Stats Section with Better Mobile Layout #} {% if park.ride_count or park.coaster_count %}
{% if park.ride_count %} {% endif %} {% if park.coaster_count %} {% endif %}
{# View Details Arrow for Desktop #}
{% else %} {# Show arrow even when no stats for consistent layout #} {% endif %}
{% else %} {# Enhanced Grid View Item with Accessibility #}
{# Enhanced Park Image with CloudFlare Images Integration #}
{% if park.card_image.image or park.photos.first.image %} {% with image=park.card_image.image|default:park.photos.first.image %} {# CloudFlare Images Responsive Picture Element #} {# Mobile optimization (320-767px) - thumbnail variant with mobile-specific transformations #} {# Tablet optimization (768-1023px) - medium variant #} {# Desktop optimization (1024px+) - large variant #} {# Fallback image with progressive enhancement #} {{ park.name }} - {% if park.card_image.alt_text %}{{ park.card_image.alt_text }}{% elif park.photos.first.alt_text %}{{ park.photos.first.alt_text }}{% else %}Theme park exterior view{% endif %} {# Image Overlay Effects #}
{% endwith %} {% else %} {# Enhanced Fallback with Better UX #}

No Image Available

{{ park.name }}

{% endif %} {# Enhanced Status Badge Overlay with Better Mobile Touch Targets and Accessibility #}
{# Loading Placeholder with Skeleton Effect #}
{# Enhanced Content Area with Better Mobile Optimization #}
{# Enhanced Title with Better Mobile Typography and Accessibility #}

{% if park.slug %} {{ park.name }} {% else %} {{ park.name }} {% endif %}

{# Enhanced Operator Display with Better Mobile Layout #} {% if park.operator %}
{{ park.operator.name }}
{% endif %} {# Enhanced Description with Better Mobile Readability and Accessibility #} {% if park.description %}

{{ park.description|truncatewords:15 }}

{% endif %} {# Enhanced Stats Footer with Better Mobile Layout #} {% if park.ride_count or park.coaster_count %}
{% if park.ride_count %} {% endif %} {% if park.coaster_count %} {% endif %}
{# Enhanced View Details Arrow with Better Mobile Touch Target #}
{% else %} {# Show arrow even when no stats for consistent layout #}
{% endif %}
{% endif %} {% endif %}