mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2025-12-23 04:11:10 -05:00
- Implemented park detail page with dynamic content loading for rides and weather. - Created park list page with filters and search functionality. - Developed ride detail page showcasing ride stats, reviews, and similar rides. - Added ride list page with filtering options and dynamic loading. - Introduced search results page with tabs for parks, rides, and users. - Added HTMX tests for global search functionality.
131 lines
7.1 KiB
HTML
131 lines
7.1 KiB
HTML
{% extends "base/htmx-base.html" %}
|
|
{% load static %}
|
|
|
|
{% block title %}Explore Rides - ThrillWiki{% endblock %}
|
|
|
|
{% block main %}
|
|
<div class="container py-8">
|
|
<div class="flex flex-col gap-8 md:flex-row">
|
|
<!-- Sidebar Filters -->
|
|
<aside class="w-full md:w-64 shrink-0"
|
|
x-data="{ showFilters: false }">
|
|
<div class="flex items-center justify-between mb-4 md:hidden">
|
|
<h2 class="text-lg font-semibold">Filters</h2>
|
|
<button @click="showFilters = !showFilters"
|
|
class="text-sm text-primary hover:underline">
|
|
<span x-text="showFilters ? 'Hide' : 'Show'"></span>
|
|
</button>
|
|
</div>
|
|
|
|
<div class="space-y-6"
|
|
:class="{'hidden': !showFilters, 'block': showFilters}"
|
|
class="md:block">
|
|
|
|
<form id="ride-filters"
|
|
hx-get="{% url 'api:ride-list' %}"
|
|
hx-target="#ride-grid"
|
|
hx-trigger="change delay:300ms, submit">
|
|
|
|
<!-- Search -->
|
|
<div class="mb-6 space-y-2">
|
|
<label class="text-sm font-medium">Search</label>
|
|
<input type="text"
|
|
name="q"
|
|
placeholder="Search rides..."
|
|
class="w-full px-3 py-1 text-sm transition-colors border rounded-md shadow-sm h-9 border-input bg-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring">
|
|
</div>
|
|
|
|
<!-- Type Filter -->
|
|
<div class="mb-6 space-y-2">
|
|
<label class="text-sm font-medium">Ride Type</label>
|
|
<select name="type"
|
|
class="w-full px-3 py-1 text-sm transition-colors border rounded-md shadow-sm h-9 border-input bg-background focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring">
|
|
<option value="">All Types</option>
|
|
<option value="Roller Coaster">Roller Coaster</option>
|
|
<option value="Water Ride">Water Ride</option>
|
|
<option value="Dark Ride">Dark Ride</option>
|
|
<option value="Flat Ride">Flat Ride</option>
|
|
</select>
|
|
</div>
|
|
|
|
<!-- Intensity Filter -->
|
|
<div class="mb-6 space-y-3">
|
|
<label class="text-sm font-medium">Thrill Level</label>
|
|
<div class="space-y-2">
|
|
<label class="flex items-center space-x-2">
|
|
<input type="checkbox" name="intensity" value="Extreme" class="rounded border-primary text-primary focus:ring-primary">
|
|
<span class="text-sm">Extreme</span>
|
|
</label>
|
|
<label class="flex items-center space-x-2">
|
|
<input type="checkbox" name="intensity" value="High" class="rounded border-primary text-primary focus:ring-primary">
|
|
<span class="text-sm">High</span>
|
|
</label>
|
|
<label class="flex items-center space-x-2">
|
|
<input type="checkbox" name="intensity" value="Moderate" class="rounded border-primary text-primary focus:ring-primary">
|
|
<span class="text-sm">Moderate</span>
|
|
</label>
|
|
<label class="flex items-center space-x-2">
|
|
<input type="checkbox" name="intensity" value="Low" class="rounded border-primary text-primary focus:ring-primary">
|
|
<span class="text-sm">Low</span>
|
|
</label>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</aside>
|
|
|
|
<!-- Main Content -->
|
|
<div class="flex-1">
|
|
<div class="flex items-center justify-between mb-6">
|
|
<h1 class="text-3xl font-bold tracking-tight">Rides</h1>
|
|
<div class="flex items-center gap-2">
|
|
<span class="text-sm text-muted-foreground" id="ride-count">
|
|
Showing all results
|
|
</span>
|
|
<!-- View Toggle -->
|
|
<div class="flex items-center border rounded-md" x-data="{ view: 'grid' }">
|
|
<button @click="view = 'grid'"
|
|
:class="{'bg-muted': view === 'grid'}"
|
|
class="p-2 transition-colors hover:bg-muted/50">
|
|
<svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2V6zM14 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2V6zM4 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2v-2zM14 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2v-2z" />
|
|
</svg>
|
|
</button>
|
|
<button @click="view = 'list'"
|
|
:class="{'bg-muted': view === 'list'}"
|
|
class="p-2 transition-colors hover:bg-muted/50">
|
|
<svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16" />
|
|
</svg>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Ride Grid -->
|
|
<div id="ride-grid"
|
|
class="grid gap-6 sm:grid-cols-2 lg:grid-cols-3"
|
|
hx-get="{% url 'api:ride-list' %}"
|
|
hx-trigger="load"
|
|
hx-swap="innerHTML">
|
|
<!-- Loading State -->
|
|
{% for i in "123456"|make_list %}
|
|
<div class="rounded-lg border bg-card text-card-foreground shadow-sm h-[380px]">
|
|
<div class="p-0">
|
|
<div class="w-full h-48 rounded-t-lg bg-muted animate-pulse"></div>
|
|
<div class="p-6 space-y-4">
|
|
<div class="w-3/4 h-6 rounded bg-muted animate-pulse"></div>
|
|
<div class="space-y-2">
|
|
<div class="w-full h-4 rounded bg-muted animate-pulse"></div>
|
|
<div class="w-2/3 h-4 rounded bg-muted animate-pulse"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|