{% comment %} Enhanced Park Card Component - Django Cotton Version A modern, responsive park card component with improved layouts for both grid and list views. Features enhanced visual design, better mobile optimization, and rich interactive elements. Usage Examples: Grid View: List View: Compact Grid View: Parameters: - park: Park object (required) - view_mode: "list" or "grid" (default: "grid") - size: "normal" or "compact" (default: "normal") - show_stats: Whether to show ride/coaster stats (default: True) - show_rating: Whether to show rating (default: True) - class: Additional CSS classes (optional) Features: - Modern card design with enhanced visual hierarchy - Responsive image handling with CloudFlare Images - Interactive hover effects and animations - Accessibility improvements with ARIA labels - Status badges with improved styling - Rating display with star visualization - Optimized for both mobile and desktop - Support for compact grid layout - Enhanced typography and spacing {% endcomment %} {% if park %} {% if view_mode == 'list' %} {# Enhanced List View Layout #}
{# Enhanced Image Section for List View #}
{% if park.card_image.image or park.photos.first.image %} {% with image=park.card_image.image|default:park.photos.first.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 %}

No Image Available

{% endif %} {# Enhanced Status Badge #}
{{ park.get_status_display }}
{# Rating Badge (if enabled) #} {% if show_rating == "true" and park.average_rating %}
{{ park.average_rating|floatformat:1 }}
{% endif %}
{# Enhanced Content Section #}
{# Title and Operator #}

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

{% if park.operator %}
{{ park.operator.name }}
{% endif %}
{# Description #} {% if park.description %}

{{ park.description|truncatewords:40 }}

{% endif %} {# Location Info #} {% if park.location %}
{% if park.location.city %}{{ park.location.city }}{% endif %}{% if park.location.city and park.location.state %}, {% endif %}{% if park.location.state %}{{ park.location.state }}{% endif %}{% if park.location.country and park.location.country != "United States" %}, {{ park.location.country }}{% endif %}
{% endif %}
{# Stats Section #} {% if show_stats == "true" and park.ride_count or park.coaster_count %}
{% if park.ride_count %} {% endif %} {% if park.coaster_count %} {% endif %}
{# View Details Arrow #}
{% endif %}
{% else %} {# Enhanced Grid View Layout #}
{# Enhanced Image Section for Grid View #}
{% if park.card_image.image or park.photos.first.image %} {% with image=park.card_image.image|default:park.photos.first.image %} {% if size == "compact" %} {% else %} {% endif %} {{ 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 %}

No Image Available

{{ park.name }}

{% endif %} {# Enhanced Status Badge #}
{{ park.get_status_display }}
{# Rating Badge (if enabled) #} {% if show_rating == "true" and park.average_rating %}
{{ park.average_rating|floatformat:1 }}
{% endif %}
{# Enhanced Content Area #}
{# Title #}

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

{# Operator #} {% if park.operator %}
{{ park.operator.name }}
{% endif %}
{# Description #} {% if park.description and size != "compact" %}

{{ park.description|truncatewords:20 }}

{% endif %} {# Stats Footer #} {% if show_stats == "true" and park.ride_count or park.coaster_count %}
{% if park.ride_count %} {% endif %} {% if park.coaster_count %} {% endif %}
{# View Details Arrow #}
{% else %} {# Show arrow even when no stats for consistent layout #}
{% endif %}
{% endif %} {% endif %}