From 97bf980e45c5be1061259aa4327eb25a30df2754 Mon Sep 17 00:00:00 2001 From: pac7 <47831526-pac7@users.noreply.replit.com> Date: Mon, 22 Sep 2025 03:30:23 +0000 Subject: [PATCH] Standardize park and ride display cards using django-cotton Replace custom park and ride card templates with django-cotton components, ensuring a consistent UI and enforcing its usage. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 0bdea3fb-49ea-4863-b501-fa6f5af0cbf0 Replit-Commit-Checkpoint-Type: intermediate_checkpoint --- .replit | 2 +- .../parks/partials/park_list_item.html | 136 +--------------- templates/cotton/ride_card.html | 2 +- .../rides/partials/ride_list_results.html | 154 +----------------- 4 files changed, 7 insertions(+), 287 deletions(-) diff --git a/.replit b/.replit index 809f821d..1a513a3c 100644 --- a/.replit +++ b/.replit @@ -55,7 +55,7 @@ localPort = 5000 externalPort = 80 [[ports]] -localPort = 32933 +localPort = 35685 externalPort = 3002 [[ports]] diff --git a/apps/parks/templates/parks/partials/park_list_item.html b/apps/parks/templates/parks/partials/park_list_item.html index ccc89c84..b1007c18 100644 --- a/apps/parks/templates/parks/partials/park_list_item.html +++ b/apps/parks/templates/parks/partials/park_list_item.html @@ -1,4 +1,5 @@ {% load static %} +{% load cotton %} {% if error %}
@@ -11,140 +12,7 @@
{% else %} {% for park in object_list|default:parks %} - {% if view_mode == 'list' %} - {# Enhanced List View Item #} -
-
-
- {# Main Content Section #} -
-
-

- - {{ park.name }} - -

- - {# Status Badge #} - - {{ park.get_status_display }} - -
- - {% if park.operator %} -
- {{ park.operator.name }} -
- {% endif %} - - {% if park.description %} -

- {{ park.description|truncatewords:30 }} -

- {% endif %} -
- - {# Stats Section #} - {% if park.ride_count or park.coaster_count %} -
- {% if park.ride_count %} -
- - - - {{ park.ride_count }} - rides -
- {% endif %} - {% if park.coaster_count %} -
- - - - {{ park.coaster_count }} - coasters -
- {% endif %} -
- {% endif %} -
-
-
- {% else %} - {# Enhanced Grid View Item #} -
- {# Card Header with Gradient #} -
- -
-
-

- - {{ park.name }} - -

- - {# Status Badge #} - - {{ park.get_status_display }} - -
- - {% if park.operator %} -
- {{ park.operator.name }} -
- {% endif %} - - {% if park.description %} -

- {{ park.description|truncatewords:15 }} -

- {% endif %} - - {# Stats Footer #} - {% if park.ride_count or park.coaster_count %} -
-
- {% if park.ride_count %} -
- - - - {{ park.ride_count }} -
- {% endif %} - {% if park.coaster_count %} -
- - - - {{ park.coaster_count }} -
- {% endif %} -
- - {# View Details Arrow #} -
- - - -
-
- {% endif %} -
-
- {% endif %} + {% empty %}
diff --git a/templates/cotton/ride_card.html b/templates/cotton/ride_card.html index da69497c..0e056337 100644 --- a/templates/cotton/ride_card.html +++ b/templates/cotton/ride_card.html @@ -94,7 +94,7 @@ Features:

- {{ ride.name }} diff --git a/templates/rides/partials/ride_list_results.html b/templates/rides/partials/ride_list_results.html index 273cf3e1..f7265b21 100644 --- a/templates/rides/partials/ride_list_results.html +++ b/templates/rides/partials/ride_list_results.html @@ -1,3 +1,5 @@ +{% load cotton %} + {% if has_filters %}
@@ -83,157 +85,7 @@ {% if rides %}
{% for ride in rides %} -
- -
- {% if ride.image %} - {{ ride.name }} - {% else %} -
- -
- {% endif %} - - -
- {% if ride.operating_status == 'operating' %} - - - Operating - - {% elif ride.operating_status == 'closed_temporarily' %} - - - Temporarily Closed - - {% elif ride.operating_status == 'closed_permanently' %} - - - Permanently Closed - - {% elif ride.operating_status == 'under_construction' %} - - - Under Construction - - {% endif %} -
-
- - -
- -
-

- - {{ ride.name }} - -

-
- - {{ ride.category|default:"Ride" }} - - {% if ride.park %} - - - {{ ride.park.name }} - - {% endif %} -
-
- - -
- {% if ride.height %} -
-
{{ ride.height }}ft
-
Height
-
- {% endif %} - - {% if ride.rollercoaster_stats.max_speed %} -
-
{{ ride.rollercoaster_stats.max_speed }}mph
-
Top Speed
-
- {% elif ride.max_speed %} -
-
{{ ride.max_speed }}mph
-
Max Speed
-
- {% endif %} - - {% if ride.capacity_per_hour %} -
-
{{ ride.capacity_per_hour }}
-
Capacity/Hr
-
- {% endif %} - - {% if ride.duration %} -
-
{{ ride.duration }}s
-
Duration
-
- {% endif %} -
- - - {% if ride.has_inversions or ride.has_launches or ride.rollercoaster_stats %} -
- {% if ride.has_inversions %} - - - {% if ride.rollercoaster_stats.number_of_inversions %} - {{ ride.rollercoaster_stats.number_of_inversions }} Inversion{{ ride.rollercoaster_stats.number_of_inversions|pluralize }} - {% else %} - Inversions - {% endif %} - - {% endif %} - - {% if ride.has_launches %} - - - {% if ride.rollercoaster_stats.number_of_launches %} - {{ ride.rollercoaster_stats.number_of_launches }} Launch{{ ride.rollercoaster_stats.number_of_launches|pluralize }} - {% else %} - Launched - {% endif %} - - {% endif %} - - {% if ride.rollercoaster_stats.track_type %} - - {{ ride.rollercoaster_stats.track_type|title }} - - {% endif %} -
- {% endif %} - - - {% if ride.opened_date %} -
- - Opened {{ ride.opened_date|date:"F j, Y" }} -
- {% endif %} - - - {% if ride.manufacturer %} -
- - {{ ride.manufacturer.name }} - {% if ride.designer and ride.designer != ride.manufacturer %} - • Designed by {{ ride.designer.name }} - {% endif %} -
- {% endif %} -
-
+ {% endfor %}