Add standardized HTMX conventions, interaction patterns, and migration guide for ThrillWiki UX

This commit is contained in:
pacnpal
2025-12-22 16:56:27 -05:00
parent 2e35f8c5d9
commit ae31e889d7
144 changed files with 25792 additions and 4440 deletions

View File

@@ -1,130 +0,0 @@
{% load static %}
<!DOCTYPE html>
<html lang="en" class="h-full">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="{% block meta_description %}ThrillWiki - Your comprehensive guide to theme parks and roller coasters{% endblock %}">
<meta name="keywords" content="{% block meta_keywords %}theme parks, roller coasters, rides, amusement parks{% endblock %}">
<!-- Open Graph / Facebook -->
<meta property="og:type" content="{% block og_type %}website{% endblock %}">
<meta property="og:url" content="{% block og_url %}{{ request.build_absolute_uri }}{% endblock %}">
<meta property="og:title" content="{% block og_title %}{% block title %}ThrillWiki{% endblock %}{% endblock %}">
<meta property="og:description" content="{% block og_description %}{% block meta_description %}ThrillWiki - Your comprehensive guide to theme parks and roller coasters{% endblock %}{% endblock %}">
<meta property="og:image" content="{% block og_image %}{% static 'images/og-default.jpg' %}{% endblock %}">
<!-- Twitter -->
<meta property="twitter:card" content="summary_large_image">
<meta property="twitter:url" content="{% block twitter_url %}{{ request.build_absolute_uri }}{% endblock %}">
<meta property="twitter:title" content="{% block twitter_title %}{% block title %}ThrillWiki{% endblock %}{% endblock %}">
<meta property="twitter:description" content="{% block twitter_description %}{% block meta_description %}ThrillWiki - Your comprehensive guide to theme parks and roller coasters{% endblock %}{% endblock %}">
<meta property="twitter:image" content="{% block twitter_image %}{% static 'images/twitter-default.jpg' %}{% endblock %}">
<title>{% block title %}ThrillWiki{% endblock %}</title>
<!-- Favicon -->
<link rel="icon" type="image/x-icon" href="{% static 'favicon.ico' %}">
<!-- Fonts -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&family=Playfair+Display:wght@400;500;600;700&display=swap" rel="stylesheet">
<!-- CSS -->
<link href="{% static 'css/design-tokens.css' %}" rel="stylesheet">
<link href="{% static 'css/tailwind.css' %}" rel="stylesheet">
{% block extra_css %}{% endblock %}
<!-- HTMX -->
<script src="https://unpkg.com/htmx.org@1.9.10"></script>
<!-- Alpine.js -->
<script defer src="https://unpkg.com/@alpinejs/intersect@3.x.x/dist/cdn.min.js"></script>
<script defer src="https://unpkg.com/@alpinejs/persist@3.x.x/dist/cdn.min.js"></script>
<script defer src="https://unpkg.com/alpinejs@3.x.x/dist/cdn.min.js"></script>
<!-- App Scripts -->
<script src="{% static 'js/stores/index.js' %}"></script>
</head>
<body class="h-full font-sans antialiased bg-background text-foreground"
x-data
:class="{ 'dark': $store.theme.isDark }">
<!-- Skip to content link for accessibility -->
<a href="#main-content" class="z-50 px-4 py-2 rounded-md sr-only focus:not-sr-only focus:absolute focus:top-4 focus:left-4 bg-primary text-primary-foreground">
Skip to main content
</a>
<!-- HTMX Configuration -->
<div hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}' style="display: none;"></div>
<div class="flex flex-col min-h-full">
<!-- Navigation -->
{% block navigation %}
{% include "components/navigation/navbar.html" %}
{% endblock navigation %}
<!-- Main Content -->
<main id="main-content" class="flex-1" role="main">
{% block content %}{% endblock %}
</main>
<!-- Footer -->
{% block footer %}
{% include "components/navigation/footer.html" %}
{% endblock footer %}
</div>
<!-- Global Components -->
{% include "components/ui/toast-container.html" %}
<!-- HTMX Configuration -->
<script>
document.addEventListener('DOMContentLoaded', function() {
// Configure HTMX
htmx.config.globalViewTransitions = true;
htmx.config.useTemplateFragments = true;
// Add loading states
document.body.addEventListener('htmx:beforeRequest', function(evt) {
evt.target.classList.add('htmx-request');
});
document.body.addEventListener('htmx:afterRequest', function(evt) {
evt.target.classList.remove('htmx-request');
});
// Handle HTMX errors
document.body.addEventListener('htmx:responseError', function(evt) {
const xhr = evt.detail.xhr;
if (xhr.status >= 500) {
Alpine.store('toast').error('Server error. Please try again later.');
} else if (xhr.status === 403) {
Alpine.store('toast').error('You do not have permission to perform this action.');
} else if (xhr.status === 404) {
Alpine.store('toast').error('Resource not found.');
}
});
});
</script>
<!-- Auth Context -->
<script>
window.__AUTH_USER__ = {% if user.is_authenticated %}{
id: {{ user.id }},
username: "{{ user.username }}",
email: "{{ user.email }}",
avatar: "{{ user.profile.avatar.url|default:'' }}"
}{% else %}null{% endif %};
window.__AUTH_PERMISSIONS__ = [
{% for perm in user.get_all_permissions %}
"{{ perm }}",
{% endfor %}
];
</script>
{% block extra_js %}{% endblock %}
</body>
</html>

View File

@@ -1,9 +0,0 @@
{% extends "base/base.html" %}
{% block content %}
<div id="main-content-area" hx-history-elt>
{% block main %}
<!-- Content will be swapped here by HTMX -->
{% endblock main %}
</div>
{% endblock content %}

View File

@@ -1,88 +0,0 @@
<div class="overflow-hidden border rounded-md shadow-sm bg-card text-card-foreground">
<div class="relative w-full overflow-auto">
<table class="w-full text-sm caption-bottom">
{% if caption %}
<caption class="mt-4 text-sm text-muted-foreground">{{ caption }}</caption>
{% endif %}
<thead class="[&_tr]:border-b">
<tr class="border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted">
{% for column in columns %}
<th class="h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0">
{% if column.sortable %}
<button hx-get="{{ hx_url }}?sort={{ column.field }}"
hx-target="{{ hx_target }}"
class="flex items-center gap-1 hover:text-foreground">
{{ column.label }}
<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="M7 16V4m0 0L3 8m4-4l4 4m6 0v12m0 0l4-4m-4 4l-4-4" />
</svg>
</button>
{% else %}
{{ column.label }}
{% endif %}
</th>
{% endfor %}
{% if actions %}
<th class="h-12 px-4 font-medium text-right align-middle text-muted-foreground">Actions</th>
{% endif %}
</tr>
</thead>
<tbody class="[&_tr:last-child]:border-0">
{% for row in data %}
<tr class="border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted">
{% for column in columns %}
<td class="p-4 align-middle [&:has([role=checkbox])]:pr-0">
{% with value=row|get_item:column.field %}
{% if column.template %}
{% include column.template with value=value row=row %}
{% else %}
{{ value|default:"-" }}
{% endif %}
{% endwith %}
</td>
{% endfor %}
{% if actions %}
<td class="p-4 text-right align-middle">
{% include actions with row=row %}
</td>
{% endif %}
</tr>
{% empty %}
<tr>
<td colspan="{{ columns|length|add:1 }}" class="h-24 p-4 text-center text-muted-foreground">
No results found.
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% if page_obj.has_other_pages %}
<div class="flex items-center justify-between px-4 py-4 border-t">
<div class="flex items-center gap-2 text-sm text-muted-foreground">
Page {{ page_obj.number }} of {{ page_obj.paginator.num_pages }}
</div>
<div class="flex items-center gap-2">
{% if page_obj.has_previous %}
<button hx-get="{{ hx_url }}?page={{ page_obj.previous_page_number }}"
hx-target="{{ hx_target }}"
class="inline-flex items-center justify-center px-4 py-2 text-sm font-medium transition-colors border rounded-md focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:opacity-50 disabled:pointer-events-none ring-offset-background border-input hover:bg-accent hover:text-accent-foreground h-9">
Previous
</button>
{% endif %}
{% if page_obj.has_next %}
<button hx-get="{{ hx_url }}?page={{ page_obj.next_page_number }}"
hx-target="{{ hx_target }}"
class="inline-flex items-center justify-center px-4 py-2 text-sm font-medium transition-colors border rounded-md focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:opacity-50 disabled:pointer-events-none ring-offset-background border-input hover:bg-accent hover:text-accent-foreground h-9">
Next
</button>
{% endif %}
</div>
</div>
{% endif %}
</div>

View File

@@ -1,58 +0,0 @@
{% load static %}
<footer class="mt-auto border-t bg-background border-border">
<div class="px-4 py-12 mx-auto max-w-7xl sm:px-6 lg:px-8">
<div class="grid grid-cols-1 gap-8 md:grid-cols-4">
<!-- Brand -->
<div class="col-span-1 md:col-span-2">
<div class="flex items-center gap-2 mb-4">
<!-- Replace with logo -->
<span class="text-xl font-bold tracking-tight text-foreground">ThrillWiki</span>
</div>
<p class="max-w-sm mb-6 text-sm text-muted-foreground">
Your comprehensive guide to theme parks and roller coasters.
Discover, track, and rate your favorite thrills.
</p>
<div class="flex space-x-4">
<!-- Social Links -->
<a href="#" class="transition-colors text-muted-foreground hover:text-foreground">
<span class="sr-only">Twitter</span>
<svg class="w-5 h-5" fill="currentColor" viewBox="0 0 24 24" aria-hidden="true">
<path d="M8.29 20.251c7.547 0 11.675-6.253 11.675-11.675 0-.178 0-.355-.012-.53A8.348 8.348 0 0022 5.92a8.19 8.19 0 01-2.357.646 4.118 4.118 0 001.804-2.27 8.224 8.224 0 01-2.605.996 4.107 4.107 0 00-6.993 3.743 11.65 11.65 0 01-8.457-4.287 4.106 4.106 0 001.27 5.477A4.072 4.072 0 012.8 9.713v.052a4.105 4.105 0 003.292 4.022 4.095 4.095 0 01-1.853.07 4.108 4.108 0 003.834 2.85A8.233 8.233 0 012 18.407a11.616 11.616 0 006.29 1.84" />
</svg>
</a>
<a href="#" class="transition-colors text-muted-foreground hover:text-foreground">
<span class="sr-only">GitHub</span>
<svg class="w-5 h-5" fill="currentColor" viewBox="0 0 24 24" aria-hidden="true">
<path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd" />
</svg>
</a>
</div>
</div>
<!-- Links -->
<div class="col-span-1">
<h3 class="mb-4 text-sm font-semibold tracking-wider uppercase text-foreground">Discover</h3>
<ul class="space-y-3">
<li><a href="{% url 'parks:park_list' %}" class="text-sm transition-colors text-muted-foreground hover:text-foreground">Parks</a></li>
<li><a href="{% url 'rides:ride_list' %}" class="text-sm transition-colors text-muted-foreground hover:text-foreground">Rides</a></li>
<li><a href="#" class="text-sm transition-colors text-muted-foreground hover:text-foreground">Manufacturers</a></li>
<li><a href="#" class="text-sm transition-colors text-muted-foreground hover:text-foreground">Top Rated</a></li>
</ul>
</div>
<!-- Legal -->
<div class="col-span-1">
<h3 class="mb-4 text-sm font-semibold tracking-wider uppercase text-foreground">Legal</h3>
<ul class="space-y-3">
<li><a href="{% url 'pages:privacy' %}" class="text-sm transition-colors text-muted-foreground hover:text-foreground">Privacy Policy</a></li>
<li><a href="{% url 'pages:terms' %}" class="text-sm transition-colors text-muted-foreground hover:text-foreground">Terms of Service</a></li>
<li><a href="#" class="text-sm transition-colors text-muted-foreground hover:text-foreground">Cookie Policy</a></li>
</ul>
</div>
</div>
<div class="pt-8 mt-8 text-center border-t border-border">
<p class="text-sm text-muted-foreground">&copy; {% now "Y" %} ThrillWiki. All rights reserved.</p>
</div>
</div>
</footer>

View File

@@ -1,182 +0,0 @@
{% load static %}
<nav class="bg-background border-b border-border sticky top-0 z-40 backdrop-blur supports-[backdrop-filter]:bg-background/60" x-data="{ mobileMenuOpen: false }">
<div class="px-4 mx-auto max-w-7xl sm:px-6 lg:px-8">
<div class="flex items-center justify-between h-16">
<!-- Left Side: Logo & Desktop Menu -->
<div class="flex">
<!-- Logo -->
<div class="flex items-center flex-shrink-0">
<a href="{% url 'home' %}" class="flex items-center gap-2">
<!-- Replace with actual logo SVG/Image -->
<span class="text-xl font-bold tracking-tight text-foreground">ThrillWiki</span>
</a>
</div>
<!-- Desktop Menu -->
<div class="hidden sm:ml-6 sm:flex sm:space-x-8">
<!-- Current: "border-primary text-foreground", Default: "border-transparent text-muted-foreground hover:border-border hover:text-foreground" -->
<a href="{% url 'parks:park_list' %}"
class="inline-flex items-center px-1 pt-1 border-b-2 text-sm font-medium transition-colors duration-200
{% if '/parks/' in request.path %}border-primary text-foreground{% else %}border-transparent text-muted-foreground hover:border-border hover:text-foreground{% endif %}">
Parks
</a>
<a href="{% url 'rides:ride_list' %}"
class="inline-flex items-center px-1 pt-1 border-b-2 text-sm font-medium transition-colors duration-200
{% if '/rides/' in request.path %}border-primary text-foreground{% else %}border-transparent text-muted-foreground hover:border-border hover:text-foreground{% endif %}">
Rides
</a>
<!-- Add more links as needed -->
</div>
</div>
<!-- Right Side: Search, Theme, User Menu, Mobile Toggle -->
<div class="flex items-center gap-4">
<!-- Search Trigger -->
<button type="button"
class="p-2 transition-colors duration-200 text-muted-foreground hover:text-foreground"
@click="$store.search.toggle()"
aria-label="Search">
<svg class="w-5 h-5" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" d="M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z" />
</svg>
</button>
<!-- Theme Toggle -->
<button type="button"
class="p-2 transition-colors duration-200 text-muted-foreground hover:text-foreground"
@click="$store.theme.toggle()"
aria-label="Toggle theme">
<!-- Sun Icon -->
<svg x-show="!$store.theme.isDark" class="w-5 h-5" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" d="M12 3v2.25m6.364.386l-1.591 1.591M21 12h-2.25m-.386 6.364l-1.591-1.591M12 18.75V21m-4.773-4.227l-1.591 1.591M5.25 12H3m4.227-4.773L5.636 5.636M15.75 12a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0z" />
</svg>
<!-- Moon Icon -->
<svg x-show="$store.theme.isDark" class="w-5 h-5" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" style="display: none;">
<path stroke-linecap="round" stroke-linejoin="round" d="M21.752 15.002A9.718 9.718 0 0118 15.75c-5.385 0-9.75-4.365-9.75-9.75 0-1.33.266-2.597.748-3.752A9.753 9.753 0 003 11.25C3 16.635 7.365 21 12.75 21a9.753 9.753 0 009.002-5.998z" />
</svg>
</button>
<!-- User Menu (Authenticated) -->
{% if user.is_authenticated %}
<div class="relative ml-3" x-data="{ open: false }">
<div>
<button type="button"
class="flex text-sm rounded-full bg-background focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2"
@click="open = !open"
@click.away="open = false"
aria-expanded="false"
aria-haspopup="true">
<span class="sr-only">Open user menu</span>
{% if user.profile.avatar %}
<img class="object-cover w-8 h-8 rounded-full" src="{{ user.profile.avatar.url }}" alt="{{ user.username }}">
{% else %}
<div class="flex items-center justify-center w-8 h-8 text-xs font-medium rounded-full bg-primary/10 text-primary">
{{ user.username|make_list|first|upper }}
</div>
{% endif %}
</button>
</div>
<!-- Dropdown menu -->
<div x-show="open"
x-transition:enter="transition ease-out duration-200"
x-transition:enter-start="transform opacity-0 scale-95"
x-transition:enter-end="transform opacity-100 scale-100"
x-transition:leave="transition ease-in duration-75"
x-transition:leave-start="transform opacity-100 scale-100"
x-transition:leave-end="transform opacity-0 scale-95"
class="absolute right-0 z-10 w-48 py-1 mt-2 origin-top-right rounded-md shadow-lg bg-popover ring-1 ring-black ring-opacity-5 focus:outline-none"
role="menu"
aria-orientation="vertical"
aria-labelledby="user-menu-button"
tabindex="-1"
style="display: none;">
<a href="{% url 'accounts:profile' %}" class="block px-4 py-2 text-sm text-foreground hover:bg-muted" role="menuitem">Your Profile</a>
<a href="{% url 'accounts:settings' %}" class="block px-4 py-2 text-sm text-foreground hover:bg-muted" role="menuitem">Settings</a>
<div class="my-1 border-t border-border"></div>
<form method="post" action="{% url 'account_logout' %}">
{% csrf_token %}
<button type="submit" class="block w-full px-4 py-2 text-sm text-left text-destructive hover:bg-destructive/10" role="menuitem">Sign out</button>
</form>
</div>
</div>
{% else %}
<!-- Auth Buttons (Guest) -->
<div class="items-center hidden gap-3 sm:flex">
<a href="{% url 'account_login' %}" class="text-sm font-medium transition-colors text-muted-foreground hover:text-foreground">Log in</a>
<a href="{% url 'account_signup' %}" class="inline-flex items-center justify-center px-4 py-2 text-sm font-medium transition-colors rounded-md ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 bg-primary text-primary-foreground hover:bg-primary/90 h-9">Sign up</a>
</div>
{% endif %}
<!-- Mobile menu button -->
<div class="flex items-center sm:hidden">
<button type="button"
class="inline-flex items-center justify-center p-2 rounded-md text-muted-foreground hover:bg-muted hover:text-foreground focus:outline-none focus:ring-2 focus:ring-inset focus:ring-primary"
@click="mobileMenuOpen = !mobileMenuOpen"
aria-controls="mobile-menu"
aria-expanded="false">
<span class="sr-only">Open main menu</span>
<!-- Icon when menu is closed -->
<svg x-show="!mobileMenuOpen" class="block w-6 h-6" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" aria-hidden="true">
<path stroke-linecap="round" stroke-linejoin="round" d="M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5" />
</svg>
<!-- Icon when menu is open -->
<svg x-show="mobileMenuOpen" class="block w-6 h-6" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" aria-hidden="true" style="display: none;">
<path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12" />
</svg>
</button>
</div>
</div>
</div>
</div>
<!-- Mobile menu -->
<div class="sm:hidden" id="mobile-menu" x-show="mobileMenuOpen" style="display: none;">
<div class="pt-2 pb-3 space-y-1">
<!-- Current: "bg-primary/10 border-primary text-primary", Default: "border-transparent text-muted-foreground hover:bg-muted hover:border-border hover:text-foreground" -->
<a href="{% url 'parks:park_list' %}"
class="block border-l-4 py-2 pl-3 pr-4 text-base font-medium {% if '/parks/' in request.path %}bg-primary/10 border-primary text-primary{% else %}border-transparent text-muted-foreground hover:bg-muted hover:border-border hover:text-foreground{% endif %}">
Parks
</a>
<a href="{% url 'rides:ride_list' %}"
class="block border-l-4 py-2 pl-3 pr-4 text-base font-medium {% if '/rides/' in request.path %}bg-primary/10 border-primary text-primary{% else %}border-transparent text-muted-foreground hover:bg-muted hover:border-border hover:text-foreground{% endif %}">
Rides
</a>
</div>
{% if not user.is_authenticated %}
<div class="pt-4 pb-3 border-t border-border">
<div class="space-y-1">
<a href="{% url 'account_login' %}" class="block py-2 pl-3 pr-4 text-base font-medium border-l-4 border-transparent text-muted-foreground hover:border-border hover:bg-muted hover:text-foreground">Log in</a>
<a href="{% url 'account_signup' %}" class="block py-2 pl-3 pr-4 text-base font-medium border-l-4 border-transparent text-muted-foreground hover:border-border hover:bg-muted hover:text-foreground">Sign up</a>
</div>
</div>
{% else %}
<div class="pt-4 pb-3 border-t border-border">
<div class="flex items-center px-4">
<div class="flex-shrink-0">
{% if user.profile.avatar %}
<img class="object-cover w-10 h-10 rounded-full" src="{{ user.profile.avatar.url }}" alt="{{ user.username }}">
{% else %}
<div class="flex items-center justify-center w-10 h-10 text-sm font-medium rounded-full bg-primary/10 text-primary">
{{ user.username|make_list|first|upper }}
</div>
{% endif %}
</div>
<div class="ml-3">
<div class="text-base font-medium text-foreground">{{ user.username }}</div>
<div class="text-sm font-medium text-muted-foreground">{{ user.email }}</div>
</div>
</div>
<div class="mt-3 space-y-1">
<a href="{% url 'accounts:profile' %}" class="block px-4 py-2 text-base font-medium text-muted-foreground hover:bg-muted hover:text-foreground">Your Profile</a>
<a href="{% url 'accounts:settings' %}" class="block px-4 py-2 text-base font-medium text-muted-foreground hover:bg-muted hover:text-foreground">Settings</a>
<form method="post" action="{% url 'account_logout' %}">
{% csrf_token %}
<button type="submit" class="block w-full px-4 py-2 text-base font-medium text-left text-destructive hover:bg-muted hover:text-destructive">Sign out</button>
</form>
</div>
</div>
{% endif %}
</div>
</nav>

View File

@@ -1,42 +0,0 @@
<div class="relative w-full" x-data="{ open: false, selected: [], query: '' }">
<label class="block mb-2 text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70">
{{ label }}
</label>
<div class="relative">
<button type="button"
@click="open = !open"
class="flex items-center justify-between w-full h-10 px-3 py-2 text-sm border rounded-md border-input bg-background ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50">
<span x-text="selected.length ? `${selected.length} selected` : '{{ placeholder|default:'Select options...' }}'"></span>
<svg class="w-4 h-4 opacity-50" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7" />
</svg>
</button>
<div x-show="open"
@click.away="open = false"
class="absolute z-50 w-full mt-2 border rounded-md shadow-md outline-none top-full bg-popover text-popover-foreground animate-in fade-in-0 zoom-in-95">
<div class="p-2 border-b">
<input type="text"
x-model="query"
class="flex w-full px-3 py-1 text-sm transition-colors bg-transparent rounded-md shadow-sm h-9 placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50"
placeholder="Search...">
</div>
<div class="max-h-[200px] overflow-y-auto p-1">
{% for option in options %}
<label class="flex items-center p-2 space-x-2 rounded-sm cursor-pointer hover:bg-accent hover:text-accent-foreground"
x-show="query === '' || '{{ option.label }}'.toLowerCase().includes(query.toLowerCase())">
<input type="checkbox"
name="{{ name }}"
value="{{ option.value }}"
x-model="selected"
class="w-4 h-4 rounded border-primary text-primary focus:ring-primary">
<span class="text-sm">{{ option.label }}</span>
</label>
{% endfor %}
</div>
</div>
</div>
</div>

View File

@@ -1,9 +0,0 @@
<span class="relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full {{ class }}">
{% if src %}
<img class="object-cover w-full h-full aspect-square" src="{{ src }}" alt="{{ alt|default:'' }}">
{% else %}
<span class="flex items-center justify-center w-full h-full rounded-full bg-muted text-muted-foreground">
{{ fallback|default:alt|make_list|first|upper }}
</span>
{% endif %}
</span>

View File

@@ -1,62 +0,0 @@
{% load widget_tweaks safe_html %}
{# Security: Icon SVGs are sanitized to prevent XSS. Only trusted SVG elements are allowed. #}
{% if type == 'button' or type == 'submit' or type == 'reset' %}
<button
type="{{ type|default:'button' }}"
{% if id %}id="{{ id }}"{% endif %}
class="inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50
{% if variant == 'destructive' %}bg-destructive text-destructive-foreground hover:bg-destructive/90
{% elif variant == 'outline' %}border border-input bg-background hover:bg-accent hover:text-accent-foreground
{% elif variant == 'secondary' %}bg-secondary text-secondary-foreground hover:bg-secondary/80
{% elif variant == 'ghost' %}hover:bg-accent hover:text-accent-foreground
{% elif variant == 'link' %}text-primary underline-offset-4 hover:underline
{% else %}bg-primary text-primary-foreground hover:bg-primary/90{% endif %}
{% if size == 'sm' %}h-9 rounded-md px-3
{% elif size == 'lg' %}h-11 rounded-md px-8
{% elif size == 'icon' %}h-10 w-10
{% else %}h-10 px-4 py-2{% endif %}
{{ class }}"
{% if disabled %}disabled{% endif %}
{% if onclick %}onclick="{{ onclick }}"{% endif %}
{% if hx_get %}hx-get="{{ hx_get }}"{% endif %}
{% if hx_post %}hx-post="{{ hx_post }}"{% endif %}
{% if hx_target %}hx-target="{{ hx_target }}"{% endif %}
{% if hx_swap %}hx-swap="{{ hx_swap }}"{% endif %}
{% if hx_indicator %}hx-indicator="{{ hx_indicator }}"{% endif %}
{% if x_data %}x-data="{{ x_data }}"{% endif %}
{% if x_on_click %}@click="{{ x_on_click }}"{% endif %}>
{% if icon %}
{{ icon|sanitize_svg }}
{% if label %}<span class="ml-2">{{ label }}</span>{% endif %}
{% else %}
{{ label|default:content }}
{% endif %}
{% block button_content %}{% endblock %}
</button>
{% else %}
<a
href="{{ href }}"
class="inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50
{% if variant == 'destructive' %}bg-destructive text-destructive-foreground hover:bg-destructive/90
{% elif variant == 'outline' %}border border-input bg-background hover:bg-accent hover:text-accent-foreground
{% elif variant == 'secondary' %}bg-secondary text-secondary-foreground hover:bg-secondary/80
{% elif variant == 'ghost' %}hover:bg-accent hover:text-accent-foreground
{% elif variant == 'link' %}text-primary underline-offset-4 hover:underline
{% else %}bg-primary text-primary-foreground hover:bg-primary/90{% endif %}
{% if size == 'sm' %}h-9 rounded-md px-3
{% elif size == 'lg' %}h-11 rounded-md px-8
{% elif size == 'icon' %}h-10 w-10
{% else %}h-10 px-4 py-2{% endif %}
{{ class }}"
{% if x_data %}x-data="{{ x_data }}"{% endif %}
{% if x_on_click %}@click="{{ x_on_click }}"{% endif %}>
{% if icon %}
{{ icon|sanitize_svg }}
{% if label %}<span class="ml-2">{{ label }}</span>{% endif %}
{% else %}
{{ label|default:content }}
{% endif %}
{% block link_content %}{% endblock %}
</a>
{% endif %}

View File

@@ -1,29 +0,0 @@
{% load safe_html %}
{# Security: Header, content, and footer are sanitized to prevent XSS. #}
<div class="border rounded-lg shadow-sm bg-card text-card-foreground">
{% if header or title %}
<div class="flex flex-col space-y-1.5 p-6">
{% if title %}
<h3 class="text-2xl font-semibold leading-none tracking-tight">{{ title }}</h3>
{% endif %}
{% if description %}
<p class="text-sm text-muted-foreground">{{ description }}</p>
{% endif %}
{% if header %}
{{ header|sanitize }}
{% endif %}
</div>
{% endif %}
<div class="p-6 pt-0">
{{ content|sanitize }}
{% block card_content %}{% endblock %}
</div>
{% if footer %}
<div class="flex items-center p-6 pt-0">
{{ footer|sanitize }}
</div>
{% endif %}
</div>

View File

@@ -1,60 +0,0 @@
{% load safe_html %}
{# Security: Dialog content and footer are sanitized to prevent XSS. #}
<div class="fixed inset-0 z-50 flex items-start justify-center sm:items-center"
role="dialog"
aria-modal="true"
x-data="{ open: true }"
x-show="open"
x-transition:enter="transition ease-out duration-200"
x-transition:enter-start="opacity-0"
x-transition:enter-end="opacity-100"
x-transition:leave="transition ease-in duration-100"
x-transition:leave-start="opacity-100"
x-transition:leave-end="opacity-0">
<!-- Backdrop -->
<div class="fixed inset-0 transition-all bg-background/80 backdrop-blur-sm"
@click="open = false; setTimeout(() => $el.closest('[hx-history-elt]').innerHTML = '', 200)"></div>
<!-- Dialog Panel -->
<div class="fixed z-50 grid w-full gap-4 p-6 duration-200 border shadow-lg bg-background sm:max-w-lg sm:rounded-lg"
x-show="open"
x-transition:enter="animate-in fade-in-0 zoom-in-95 slide-in-from-left-1/2 slide-in-from-top-[48%]"
x-transition:leave="animate-out fade-out-0 zoom-out-95 slide-out-to-left-1/2 slide-out-to-top-[48%]">
<div class="flex flex-col space-y-1.5 text-center sm:text-left">
{% if title %}
<h2 class="text-lg font-semibold leading-none tracking-tight">
{{ title }}
</h2>
{% endif %}
{% if description %}
<p class="text-sm text-muted-foreground">
{{ description }}
</p>
{% endif %}
</div>
<div class="py-4">
{{ content|sanitize }}
{% block dialog_content %}{% endblock %}
</div>
{% if footer %}
<div class="flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2">
{{ footer|sanitize }}
</div>
{% endif %}
<!-- Close Button -->
<button class="absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground"
@click="open = false">
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path>
</svg>
<span class="sr-only">Close</span>
</button>
</div>
</div>

View File

@@ -1,39 +0,0 @@
{% load safe_html %}
{# Security: Trigger and content are sanitized to allow only safe HTML elements. #}
<div class="relative inline-block text-left" x-data="{ open: false }" @click.away="open = false">
<div @click="open = !open">
{% if trigger %}
{{ trigger|sanitize }}
{% else %}
<button type="button"
class="inline-flex w-full justify-center gap-x-1.5 rounded-md bg-white px-3 py-2 text-sm font-semibold text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 hover:bg-gray-50"
id="menu-button"
aria-expanded="true"
aria-haspopup="true">
{{ label|default:"Options" }}
<svg class="w-5 h-5 -mr-1 text-gray-400" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
<path fill-rule="evenodd" d="M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z" clip-rule="evenodd" />
</svg>
</button>
{% endif %}
</div>
<div class="absolute right-0 z-10 w-56 mt-2 transition-all duration-100 ease-in-out origin-top-right transform scale-95 bg-white rounded-md shadow-lg opacity-0 ring-1 ring-black ring-opacity-5 focus:outline-none"
x-show="open"
x-transition:enter="transition ease-out duration-100"
x-transition:enter-start="transform opacity-0 scale-95"
x-transition:enter-end="transform opacity-100 scale-100"
x-transition:leave="transition ease-in duration-75"
x-transition:leave-start="transform opacity-100 scale-100"
x-transition:leave-end="transform opacity-0 scale-95"
role="menu"
aria-orientation="vertical"
aria-labelledby="menu-button"
tabindex="-1">
<div class="py-1" role="none">
{{ content|sanitize }}
{% block dropdown_content %}{% endblock %}
</div>
</div>
</div>

View File

@@ -1,12 +0,0 @@
{% load widget_tweaks %}
<div class="flex items-center space-x-2">
{% render_field field class+="aspect-square h-4 w-4 rounded border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50" %}
<label for="{{ field.id_for_label }}" class="text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70">
{{ label }}
</label>
</div>
{% if field.errors %}
<p class="mt-1 text-sm font-medium text-destructive">{{ field.errors.0 }}</p>
{% endif %}

View File

@@ -1,19 +0,0 @@
{% load widget_tweaks %}
<div class="space-y-2">
{% if label %}
<label for="{{ field.id_for_label }}" class="text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70">
{{ label }}
</label>
{% endif %}
{% render_field field class+="flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50" placeholder=placeholder %}
{% if field.help_text %}
<p class="text-sm text-muted-foreground">{{ field.help_text }}</p>
{% endif %}
{% if field.errors %}
<p class="text-sm font-medium text-destructive">{{ field.errors.0 }}</p>
{% endif %}
</div>

View File

@@ -1,19 +0,0 @@
{% load widget_tweaks %}
<div class="space-y-2">
{% if label %}
<label for="{{ field.id_for_label }}" class="text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70">
{{ label }}
</label>
{% endif %}
{% render_field field class+="flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1" %}
{% if field.help_text %}
<p class="text-sm text-muted-foreground">{{ field.help_text }}</p>
{% endif %}
{% if field.errors %}
<p class="text-sm font-medium text-destructive">{{ field.errors.0 }}</p>
{% endif %}
</div>

View File

@@ -1,19 +0,0 @@
{% load widget_tweaks %}
<div class="space-y-2">
{% if label %}
<label for="{{ field.id_for_label }}" class="text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70">
{{ label }}
</label>
{% endif %}
{% render_field field class+="flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50" placeholder=placeholder %}
{% if field.help_text %}
<p class="text-sm text-muted-foreground">{{ field.help_text }}</p>
{% endif %}
{% if field.errors %}
<p class="text-sm font-medium text-destructive">{{ field.errors.0 }}</p>
{% endif %}
</div>

View File

@@ -1 +0,0 @@
<div class="animate-pulse rounded-md bg-muted {{ class }}"></div>

View File

@@ -1,58 +0,0 @@
<div x-data
class="fixed z-50 flex flex-col max-w-sm gap-2 pointer-events-none bottom-4 right-4">
<template x-for="toast in $store.toast.toasts" :key="toast.id">
<div x-show="true"
x-transition:enter="transition ease-out duration-300"
x-transition:enter-start="opacity-0 translate-y-2"
x-transition:enter-end="opacity-100 translate-y-0"
x-transition:leave="transition ease-in duration-200"
x-transition:leave-start="opacity-100"
x-transition:leave-end="opacity-0 translate-x-full"
:class="{
'bg-success-50 border-success-200 text-success-800 dark:bg-success-900/20 dark:border-success-800 dark:text-success-200': toast.type === 'success',
'bg-error-50 border-error-200 text-error-800 dark:bg-error-900/20 dark:border-error-800 dark:text-error-200': toast.type === 'error',
'bg-warning-50 border-warning-200 text-warning-800 dark:bg-warning-900/20 dark:border-warning-800 dark:text-warning-200': toast.type === 'warning',
'bg-info-50 border-info-200 text-info-800 dark:bg-info-900/20 dark:border-info-800 dark:text-info-200': toast.type === 'info'
}"
class="flex items-start w-full gap-3 p-4 border rounded-lg shadow-lg pointer-events-auto">
<!-- Icon -->
<div class="flex-shrink-0 mt-0.5">
<template x-if="toast.type === 'success'">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"></path>
</svg>
</template>
<template x-if="toast.type === 'error'">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"></path>
</svg>
</template>
<template x-if="toast.type === 'warning'">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"></path>
</svg>
</template>
<template x-if="toast.type === 'info'">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path>
</svg>
</template>
</div>
<!-- Content -->
<div class="flex-1">
<p x-text="toast.message" class="text-sm font-medium"></p>
</div>
<!-- Dismiss -->
<button @click="$store.toast.dismiss(toast.id)"
class="flex-shrink-0 p-1 transition-colors rounded hover:bg-black/10 dark:hover:bg-white/10">
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path>
</svg>
</button>
</div>
</template>
</div>

View File

@@ -1,78 +0,0 @@
{% extends "components/ui/dialog.html" %}
{% block dialog_content %}
<div class="space-y-6">
<div class="flex flex-col space-y-2 text-center">
<h1 class="text-2xl font-semibold tracking-tight">Welcome back</h1>
<p class="text-sm text-muted-foreground">
Enter your credentials to sign in to your account
</p>
</div>
<form class="space-y-4"
hx-post="{% url 'account_login' %}"
hx-swap="outerHTML"
hx-target="#login-form-container">
{% csrf_token %}
<div id="login-form-container" class="space-y-4">
{% if form.non_field_errors %}
<div class="p-3 text-sm rounded-md text-destructive bg-destructive/10">
{{ form.non_field_errors.0 }}
</div>
{% endif %}
<div class="space-y-2">
<label for="{{ form.login.id_for_label }}" class="text-sm font-medium">
Email or Username
</label>
{% include "components/ui/form/input.html" with field=form.login placeholder="name@example.com" %}
</div>
<div class="space-y-2">
<div class="flex items-center justify-between">
<label for="{{ form.password.id_for_label }}" class="text-sm font-medium">
Password
</label>
<a href="{% url 'account_reset_password' %}" class="text-sm font-medium text-primary hover:underline">
Forgot password?
</a>
</div>
{% include "components/ui/form/input.html" with field=form.password type="password" %}
</div>
{% if form.remember %}
<div class="flex items-center space-x-2">
{% include "components/ui/form/checkbox.html" with field=form.remember label="Remember me" %}
</div>
{% endif %}
</div>
{% include "components/ui/button.html" with type="submit" label="Sign In" class="w-full" %}
</form>
<div class="relative">
<div class="absolute inset-0 flex items-center">
<span class="w-full border-t"></span>
</div>
<div class="relative flex justify-center text-xs uppercase">
<span class="px-2 bg-background text-muted-foreground">
Or continue with
</span>
</div>
</div>
<div class="grid grid-cols-2 gap-4">
{% include "components/ui/button.html" with variant="outline" icon='<svg class="w-4 h-4 mr-2" aria-hidden="true" focusable="false" data-prefix="fab" data-icon="github" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512"><path fill="currentColor" d="M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"></path></svg>' label="Github" %}
{% include "components/ui/button.html" with variant="outline" icon='<svg class="w-4 h-4 mr-2" aria-hidden="true" focusable="false" data-prefix="fab" data-icon="google" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 488 512"><path fill="currentColor" d="M488 261.8C488 403.3 391.1 504 248 504 110.8 504 0 393.2 0 256S110.8 8 248 8c66.8 0 123 24.5 166.3 64.9l-67.5 64.9C258.5 52.6 94.3 116.6 94.3 256c0 86.5 69.1 156.6 153.7 156.6 98.2 0 135-70.4 140.8-106.9H248v-85.3h236.1c2.3 12.7 3.9 24.9 3.9 41.4z"></path></svg>' label="Google" %}
</div>
<div class="text-sm text-center text-muted-foreground">
Don't have an account?
<a href="{% url 'account_signup' %}" class="underline underline-offset-4 hover:text-primary">
Sign up
</a>
</div>
</div>
{% endblock %}

View File

@@ -1,81 +0,0 @@
{% extends "components/ui/dialog.html" %}
{% block dialog_content %}
<div class="space-y-6">
<div class="flex flex-col space-y-2 text-center">
<h1 class="text-2xl font-semibold tracking-tight">Create an account</h1>
<p class="text-sm text-muted-foreground">
Enter your email below to create your account
</p>
</div>
<form class="space-y-4"
hx-post="{% url 'account_signup' %}"
hx-swap="outerHTML"
hx-target="#signup-form-container">
{% csrf_token %}
<div id="signup-form-container" class="space-y-4">
{% if form.non_field_errors %}
<div class="p-3 text-sm rounded-md text-destructive bg-destructive/10">
{{ form.non_field_errors.0 }}
</div>
{% endif %}
<div class="space-y-2">
<label for="{{ form.email.id_for_label }}" class="text-sm font-medium">
Email
</label>
{% include "components/ui/form/input.html" with field=form.email placeholder="name@example.com" %}
</div>
<div class="space-y-2">
<label for="{{ form.username.id_for_label }}" class="text-sm font-medium">
Username
</label>
{% include "components/ui/form/input.html" with field=form.username placeholder="username" %}
</div>
<div class="space-y-2">
<label for="{{ form.password.id_for_label }}" class="text-sm font-medium">
Password
</label>
{% include "components/ui/form/input.html" with field=form.password type="password" %}
</div>
<div class="space-y-2">
<label for="{{ form.password_confirm.id_for_label }}" class="text-sm font-medium">
Confirm Password
</label>
{% include "components/ui/form/input.html" with field=form.password_confirm type="password" %}
</div>
</div>
{% include "components/ui/button.html" with type="submit" label="Sign Up" class="w-full" %}
</form>
<div class="relative">
<div class="absolute inset-0 flex items-center">
<span class="w-full border-t"></span>
</div>
<div class="relative flex justify-center text-xs uppercase">
<span class="px-2 bg-background text-muted-foreground">
Or continue with
</span>
</div>
</div>
<div class="grid grid-cols-2 gap-4">
{% include "components/ui/button.html" with variant="outline" icon='<svg class="w-4 h-4 mr-2" aria-hidden="true" focusable="false" data-prefix="fab" data-icon="github" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512"><path fill="currentColor" d="M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"></path></svg>' label="Github" %}
{% include "components/ui/button.html" with variant="outline" icon='<svg class="w-4 h-4 mr-2" aria-hidden="true" focusable="false" data-prefix="fab" data-icon="google" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 488 512"><path fill="currentColor" d="M488 261.8C488 403.3 391.1 504 248 504 110.8 504 0 393.2 0 256S110.8 8 248 8c66.8 0 123 24.5 166.3 64.9l-67.5 64.9C258.5 52.6 94.3 116.6 94.3 256c0 86.5 69.1 156.6 153.7 156.6 98.2 0 135-70.4 140.8-106.9H248v-85.3h236.1c2.3 12.7 3.9 24.9 3.9 41.4z"></path></svg>' label="Google" %}
</div>
<div class="text-sm text-center text-muted-foreground">
Already have an account?
<a href="{% url 'account_login' %}" class="underline underline-offset-4 hover:text-primary">
Sign in
</a>
</div>
</div>
{% endblock %}

View File

@@ -1,175 +0,0 @@
{% extends "base/htmx-base.html" %}
{% load static %}
{% block title %}ThrillWiki - Your Ultimate Theme Park & Ride Database{% endblock %}
{% block extra_css %}
<style>
.hero-pattern {
background-color: var(--color-background);
background-image: radial-gradient(var(--color-primary-100) 1px, transparent 1px);
background-size: 40px 40px;
}
.dark .hero-pattern {
background-image: radial-gradient(var(--color-primary-900) 1px, transparent 1px);
}
</style>
{% endblock %}
{% block main %}
<div class="flex flex-col min-h-screen">
<!-- Hero Section -->
<section class="relative py-20 overflow-hidden hero-pattern lg:py-32">
<div class="container relative z-10 mx-auto text-center">
<h1 class="mb-6 text-4xl font-extrabold tracking-tight text-foreground sm:text-5xl lg:text-6xl">
Discover Your Next <br class="hidden sm:inline">
<span class="text-transparent bg-clip-text bg-gradient-to-r from-primary-600 to-secondary-600">Adrenaline Rush</span>
</h1>
<p class="max-w-2xl mx-auto mb-10 text-lg text-muted-foreground sm:text-xl">
The most comprehensive database of theme parks and roller coasters.
Track your credits, rate rides, and join the community.
</p>
<!-- Search Bar -->
<div class="max-w-2xl mx-auto mb-12" x-data="{ query: '', results: [] }">
<div class="relative group">
<div class="absolute inset-0 transition duration-200 rounded-lg opacity-25 bg-gradient-to-r from-primary-500 to-secondary-500 blur group-hover:opacity-50"></div>
<div class="relative rounded-lg shadow-xl bg-background">
<div class="flex items-center px-4 py-3">
<svg class="w-6 h-6 text-muted-foreground" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" />
</svg>
<input type="text"
x-model="query"
@focus="$store.search.open()"
placeholder="Search parks, rides, or locations..."
class="w-full px-4 py-2 text-lg bg-transparent border-none focus:ring-0 placeholder:text-muted-foreground text-foreground">
<div class="hidden sm:flex text-xs text-muted-foreground border border-border rounded px-1.5 py-0.5">
<span class="text-xs"></span>K
</div>
</div>
</div>
</div>
<div class="flex justify-center gap-4 mt-4 text-sm text-muted-foreground">
<span>Popular:</span>
<button class="transition-colors hover:text-primary">Cedar Point</button>
<button class="transition-colors hover:text-primary">Six Flags</button>
<button class="transition-colors hover:text-primary">Disney World</button>
</div>
</div>
<div class="flex flex-col justify-center gap-4 sm:flex-row">
{% include "components/ui/button.html" with label="Explore Parks" href="/parks/" size="lg" %}
{% include "components/ui/button.html" with label="Browse Rides" href="/rides/" variant="outline" size="lg" %}
</div>
</div>
</section>
<!-- Stats Section -->
<section class="py-12 border-y border-border bg-muted/50">
<div class="container mx-auto">
<div class="grid grid-cols-2 gap-8 text-center md:grid-cols-4">
<div class="space-y-2">
<dt class="text-3xl font-bold text-foreground">2,500+</dt>
<dd class="text-sm font-medium tracking-wide uppercase text-muted-foreground">Parks</dd>
</div>
<div class="space-y-2">
<dt class="text-3xl font-bold text-foreground">12,000+</dt>
<dd class="text-sm font-medium tracking-wide uppercase text-muted-foreground">Rides</dd>
</div>
<div class="space-y-2">
<dt class="text-3xl font-bold text-foreground">50k+</dt>
<dd class="text-sm font-medium tracking-wide uppercase text-muted-foreground">Reviews</dd>
</div>
<div class="space-y-2">
<dt class="text-3xl font-bold text-foreground">150k+</dt>
<dd class="text-sm font-medium tracking-wide uppercase text-muted-foreground">Photos</dd>
</div>
</div>
</div>
</section>
<!-- Featured Parks -->
<section class="py-20">
<div class="container mx-auto">
<div class="flex items-center justify-between mb-10">
<div>
<h2 class="text-3xl font-bold tracking-tight text-foreground">Featured Parks</h2>
<p class="mt-2 text-muted-foreground">Top rated destinations from around the world.</p>
</div>
<a href="{% url 'parks:park_list' %}" class="items-center hidden font-medium sm:flex text-primary hover:text-primary/80">
View all parks <span class="ml-1"></span>
</a>
</div>
<div class="grid gap-6 md:grid-cols-2 lg:grid-cols-3"
hx-get="{% url 'api:parks-featured' %}"
hx-trigger="load"
hx-swap="innerHTML">
<!-- Loading Skeleton -->
{% for i in "123"|make_list %}
<div class="rounded-lg border bg-card text-card-foreground shadow-sm h-[400px]">
<div class="p-6 space-y-4">
<div class="w-full h-48 rounded bg-muted animate-pulse"></div>
<div class="space-y-2">
<div class="w-2/3 h-4 rounded bg-muted animate-pulse"></div>
<div class="w-1/2 h-4 rounded bg-muted animate-pulse"></div>
</div>
</div>
</div>
{% endfor %}
</div>
<div class="mt-8 text-center sm:hidden">
{% include "components/ui/button.html" with label="View all parks" href="/parks/" variant="outline" class="w-full" %}
</div>
</div>
</section>
<!-- Latest Reviews -->
<section class="py-20 bg-muted/30">
<div class="container mx-auto">
<div class="flex items-center justify-between mb-10">
<div>
<h2 class="text-3xl font-bold tracking-tight text-foreground">Community Pulse</h2>
<p class="mt-2 text-muted-foreground">Recent activity and reviews from our community.</p>
</div>
</div>
<div class="grid gap-6 md:grid-cols-2 lg:grid-cols-3"
hx-get="{% url 'api:reviews-recent' %}"
hx-trigger="load"
hx-swap="innerHTML">
<!-- Loading Skeleton -->
{% for i in "123"|make_list %}
<div class="p-6 border rounded-lg shadow-sm bg-card text-card-foreground">
<div class="flex items-center gap-4 mb-4">
<div class="w-10 h-10 rounded-full bg-muted animate-pulse"></div>
<div class="flex-1 space-y-2">
<div class="w-1/3 h-4 rounded bg-muted animate-pulse"></div>
<div class="w-1/4 h-3 rounded bg-muted animate-pulse"></div>
</div>
</div>
<div class="space-y-2">
<div class="w-full h-4 rounded bg-muted animate-pulse"></div>
<div class="w-5/6 h-4 rounded bg-muted animate-pulse"></div>
</div>
</div>
{% endfor %}
</div>
</div>
</section>
<!-- CTA Section -->
<section class="relative py-24 overflow-hidden bg-primary text-primary-foreground">
<div class="absolute inset-0 bg-[url('/static/images/pattern.svg')] opacity-10"></div>
<div class="container relative z-10 mx-auto text-center">
<h2 class="mb-6 text-3xl font-bold sm:text-4xl">Ready to track your rides?</h2>
<p class="max-w-2xl mx-auto mb-10 text-lg text-primary-foreground/80">
Create a free account to log your coasters, rate parks, upload photos, and join the discussion.
</p>
{% include "components/ui/button.html" with label="Get Started for Free" href="/accounts/signup/" variant="secondary" size="lg" %}
</div>
</section>
</div>
{% endblock main %}

View File

@@ -1,415 +0,0 @@
{% extends "base/base.html" %}
{% load static %}
{% block title %}ThrillWiki - Your Ultimate Theme Park & Ride Database{% endblock %}
{% block meta_description %}Discover the world's best theme parks and thrilling rides. Search, explore, and share your experiences with the ultimate theme park database.{% endblock %}
{% block extra_head %}
<!-- Homepage specific meta tags -->
<meta property="og:title" content="ThrillWiki - Your Ultimate Theme Park & Ride Database">
<meta property="og:description" content="Discover the world's best theme parks and thrilling rides. Search, explore, and share your experiences.">
<meta property="og:type" content="website">
<meta property="og:url" content="{{ request.build_absolute_uri }}">
<!-- Preload critical homepage resources -->
<link rel="preload" href="{% static 'images/hero-bg.jpg' %}" as="image">
{% endblock %}
{% block body_class %}homepage{% endblock %}
{% block content %}
<!-- Skip to main content for accessibility -->
<a href="#main-content" class="sr-only focus:not-sr-only focus:absolute focus:top-4 focus:left-4 bg-primary text-primary-foreground px-4 py-2 rounded-md z-50">
Skip to main content
</a>
<main id="main-content" class="min-h-screen">
<!-- Hero Section -->
<section class="hero-section relative overflow-hidden bg-gradient-to-br from-primary/10 via-background to-secondary/10 dark:from-primary/5 dark:via-background dark:to-secondary/5">
<!-- Background Pattern -->
<div class="absolute inset-0 bg-grid-pattern opacity-5 dark:opacity-10"></div>
<!-- Hero Content -->
<div class="relative container mx-auto px-4 py-16 lg:py-24">
<div class="max-w-4xl mx-auto text-center">
<!-- Main Heading -->
<h1 class="text-4xl md:text-6xl lg:text-7xl font-bold tracking-tight mb-6">
<span class="bg-gradient-to-r from-primary to-secondary bg-clip-text text-transparent">
Discover
</span>
<br>
<span class="text-foreground">Amazing Theme Parks</span>
</h1>
<!-- Subtitle -->
<p class="text-xl md:text-2xl text-muted-foreground mb-8 max-w-2xl mx-auto leading-relaxed">
Explore the world's most thrilling rides, discover new parks, and share your adventures with fellow enthusiasts.
</p>
<!-- Search Bar -->
<div class="max-w-2xl mx-auto mb-8"
x-data="{
searchQuery: '',
isSearching: false,
searchResults: [],
showResults: false
}">
<div class="relative">
<div class="relative">
<input
type="text"
x-model="searchQuery"
@input.debounce.300ms="searchGlobal()"
@focus="showResults = true"
@keydown.escape="showResults = false"
placeholder="Search parks, rides, or locations..."
class="w-full px-6 py-4 pl-14 pr-16 text-lg rounded-2xl border-2 border-border/50 bg-background/80 backdrop-blur-sm focus:border-primary focus:ring-4 focus:ring-primary/20 transition-all duration-200 shadow-lg"
aria-label="Search parks and rides"
autocomplete="off"
>
<!-- Search Icon -->
<div class="absolute left-5 top-1/2 transform -translate-y-1/2">
<svg class="w-6 h-6 text-muted-foreground" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"></path>
</svg>
</div>
<!-- Loading Spinner -->
<div x-show="isSearching" class="absolute right-5 top-1/2 transform -translate-y-1/2">
<div class="animate-spin rounded-full h-6 w-6 border-2 border-primary border-t-transparent"></div>
</div>
<!-- Clear Button -->
<button
x-show="searchQuery.length > 0 && !isSearching"
@click="searchQuery = ''; showResults = false"
class="absolute right-5 top-1/2 transform -translate-y-1/2 p-1 rounded-full hover:bg-muted transition-colors"
aria-label="Clear search"
>
<svg class="w-5 h-5 text-muted-foreground" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path>
</svg>
</button>
</div>
<!-- Search Results Dropdown -->
<div x-show="showResults && searchResults.length > 0"
x-transition:enter="transition ease-out duration-200"
x-transition:enter-start="opacity-0 scale-95"
x-transition:enter-end="opacity-100 scale-100"
x-transition:leave="transition ease-in duration-150"
x-transition:leave-start="opacity-100 scale-100"
x-transition:leave-end="opacity-0 scale-95"
@click.away="showResults = false"
class="absolute top-full left-0 right-0 mt-2 bg-background border border-border rounded-xl shadow-xl z-50 max-h-96 overflow-y-auto">
<div id="search-results-container">
<!-- Search results will be loaded here via HTMX -->
</div>
</div>
</div>
<!-- Search Suggestions -->
<div class="flex flex-wrap gap-2 mt-4 justify-center">
<span class="text-sm text-muted-foreground">Popular searches:</span>
<button class="text-sm text-primary hover:text-primary/80 transition-colors" @click="searchQuery = 'roller coaster'">
Roller Coasters
</button>
<span class="text-muted-foreground"></span>
<button class="text-sm text-primary hover:text-primary/80 transition-colors" @click="searchQuery = 'Disney'">
Disney Parks
</button>
<span class="text-muted-foreground"></span>
<button class="text-sm text-primary hover:text-primary/80 transition-colors" @click="searchQuery = 'Cedar Point'">
Cedar Point
</button>
</div>
</div>
<!-- CTA Buttons -->
<div class="flex flex-col sm:flex-row gap-4 justify-center items-center">
<a href="/parks/"
class="inline-flex items-center px-8 py-4 bg-primary text-primary-foreground rounded-xl font-semibold text-lg hover:bg-primary/90 transition-all duration-200 shadow-lg hover:shadow-xl transform hover:-translate-y-0.5">
<svg class="w-6 h-6 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4"></path>
</svg>
Explore Parks
</a>
<a href="/rides/"
class="inline-flex items-center px-8 py-4 bg-secondary text-secondary-foreground rounded-xl font-semibold text-lg hover:bg-secondary/90 transition-all duration-200 shadow-lg hover:shadow-xl transform hover:-translate-y-0.5">
<svg class="w-6 h-6 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z"></path>
</svg>
Browse Rides
</a>
</div>
</div>
</div>
<!-- Scroll Indicator -->
<div class="absolute bottom-8 left-1/2 transform -translate-x-1/2 animate-bounce">
<svg class="w-6 h-6 text-muted-foreground" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 14l-7 7m0 0l-7-7m7 7V3"></path>
</svg>
</div>
</section>
<!-- Statistics Dashboard -->
<section class="py-16 bg-muted/30 dark:bg-muted/10">
<div class="container mx-auto px-4">
<div class="grid grid-cols-2 md:grid-cols-4 gap-6 max-w-4xl mx-auto">
<!-- Stats will be loaded via HTMX -->
<div hx-get="/api/v1/stats/homepage/"
hx-trigger="load"
hx-target="this"
class="text-center p-6 bg-background rounded-xl shadow-sm border border-border/50">
<div class="animate-pulse">
<div class="h-8 bg-muted rounded mb-2"></div>
<div class="h-4 bg-muted rounded"></div>
</div>
</div>
<div class="text-center p-6 bg-background rounded-xl shadow-sm border border-border/50">
<div class="animate-pulse">
<div class="h-8 bg-muted rounded mb-2"></div>
<div class="h-4 bg-muted rounded"></div>
</div>
</div>
<div class="text-center p-6 bg-background rounded-xl shadow-sm border border-border/50">
<div class="animate-pulse">
<div class="h-8 bg-muted rounded mb-2"></div>
<div class="h-4 bg-muted rounded"></div>
</div>
</div>
<div class="text-center p-6 bg-background rounded-xl shadow-sm border border-border/50">
<div class="animate-pulse">
<div class="h-8 bg-muted rounded mb-2"></div>
<div class="h-4 bg-muted rounded"></div>
</div>
</div>
</div>
</div>
</section>
<!-- Featured Parks Section -->
<section class="py-16">
<div class="container mx-auto px-4">
<div class="text-center mb-12">
<h2 class="text-3xl md:text-4xl font-bold mb-4">Featured Theme Parks</h2>
<p class="text-xl text-muted-foreground max-w-2xl mx-auto">
Discover the world's most amazing theme parks, from classic favorites to hidden gems.
</p>
</div>
<!-- Featured Parks Grid -->
<div hx-get="/api/v1/parks/featured/"
hx-trigger="load"
hx-target="this"
class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8">
<!-- Loading Placeholders -->
<div class="animate-pulse">
<div class="aspect-video bg-muted rounded-xl mb-4"></div>
<div class="h-6 bg-muted rounded mb-2"></div>
<div class="h-4 bg-muted rounded w-3/4"></div>
</div>
<div class="animate-pulse">
<div class="aspect-video bg-muted rounded-xl mb-4"></div>
<div class="h-6 bg-muted rounded mb-2"></div>
<div class="h-4 bg-muted rounded w-3/4"></div>
</div>
<div class="animate-pulse">
<div class="aspect-video bg-muted rounded-xl mb-4"></div>
<div class="h-6 bg-muted rounded mb-2"></div>
<div class="h-4 bg-muted rounded w-3/4"></div>
</div>
</div>
<!-- View All Parks Button -->
<div class="text-center mt-12">
<a href="/parks/"
class="inline-flex items-center px-6 py-3 bg-primary text-primary-foreground rounded-lg font-semibold hover:bg-primary/90 transition-colors">
View All Parks
<svg class="w-5 h-5 ml-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 8l4 4m0 0l-4 4m4-4H3"></path>
</svg>
</a>
</div>
</div>
</section>
<!-- Featured Rides Section -->
<section class="py-16 bg-muted/30 dark:bg-muted/10">
<div class="container mx-auto px-4">
<div class="text-center mb-12">
<h2 class="text-3xl md:text-4xl font-bold mb-4">Top-Rated Rides</h2>
<p class="text-xl text-muted-foreground max-w-2xl mx-auto">
Experience the most thrilling and beloved rides from around the world.
</p>
</div>
<!-- Featured Rides Grid -->
<div hx-get="/api/v1/rides/featured/"
hx-trigger="load"
hx-target="this"
class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6">
<!-- Loading Placeholders -->
<div class="animate-pulse">
<div class="aspect-square bg-muted rounded-xl mb-4"></div>
<div class="h-5 bg-muted rounded mb-2"></div>
<div class="h-4 bg-muted rounded w-2/3"></div>
</div>
<div class="animate-pulse">
<div class="aspect-square bg-muted rounded-xl mb-4"></div>
<div class="h-5 bg-muted rounded mb-2"></div>
<div class="h-4 bg-muted rounded w-2/3"></div>
</div>
<div class="animate-pulse">
<div class="aspect-square bg-muted rounded-xl mb-4"></div>
<div class="h-5 bg-muted rounded mb-2"></div>
<div class="h-4 bg-muted rounded w-2/3"></div>
</div>
<div class="animate-pulse">
<div class="aspect-square bg-muted rounded-xl mb-4"></div>
<div class="h-5 bg-muted rounded mb-2"></div>
<div class="h-4 bg-muted rounded w-2/3"></div>
</div>
</div>
<!-- View All Rides Button -->
<div class="text-center mt-12">
<a href="/rides/"
class="inline-flex items-center px-6 py-3 bg-secondary text-secondary-foreground rounded-lg font-semibold hover:bg-secondary/90 transition-colors">
View All Rides
<svg class="w-5 h-5 ml-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 8l4 4m0 0l-4 4m4-4H3"></path>
</svg>
</a>
</div>
</div>
</section>
<!-- Recent Activity Section -->
<section class="py-16">
<div class="container mx-auto px-4">
<div class="text-center mb-12">
<h2 class="text-3xl md:text-4xl font-bold mb-4">Recent Activity</h2>
<p class="text-xl text-muted-foreground max-w-2xl mx-auto">
See what's new in the ThrillWiki community - latest reviews, photos, and updates.
</p>
</div>
<!-- Recent Activity Feed -->
<div class="max-w-4xl mx-auto">
<div hx-get="/api/v1/activity/recent/"
hx-trigger="load"
hx-target="this"
class="space-y-6">
<!-- Loading Placeholders -->
<div class="animate-pulse flex items-start space-x-4 p-6 bg-background rounded-xl border border-border/50">
<div class="w-12 h-12 bg-muted rounded-full"></div>
<div class="flex-1">
<div class="h-4 bg-muted rounded w-1/4 mb-2"></div>
<div class="h-4 bg-muted rounded w-3/4 mb-2"></div>
<div class="h-3 bg-muted rounded w-1/2"></div>
</div>
</div>
<div class="animate-pulse flex items-start space-x-4 p-6 bg-background rounded-xl border border-border/50">
<div class="w-12 h-12 bg-muted rounded-full"></div>
<div class="flex-1">
<div class="h-4 bg-muted rounded w-1/4 mb-2"></div>
<div class="h-4 bg-muted rounded w-3/4 mb-2"></div>
<div class="h-3 bg-muted rounded w-1/2"></div>
</div>
</div>
<div class="animate-pulse flex items-start space-x-4 p-6 bg-background rounded-xl border border-border/50">
<div class="w-12 h-12 bg-muted rounded-full"></div>
<div class="flex-1">
<div class="h-4 bg-muted rounded w-1/4 mb-2"></div>
<div class="h-4 bg-muted rounded w-3/4 mb-2"></div>
<div class="h-3 bg-muted rounded w-1/2"></div>
</div>
</div>
</div>
</div>
</div>
</section>
</main>
<!-- Alpine.js Search Functionality -->
<script>
function searchGlobal() {
if (this.searchQuery.length < 2) {
this.searchResults = [];
this.showResults = false;
return;
}
this.isSearching = true;
// Use HTMX to fetch search results
htmx.ajax('GET', `/api/v1/search/global/?q=${encodeURIComponent(this.searchQuery)}`, {
target: '#search-results-container',
swap: 'innerHTML'
}).then(() => {
this.isSearching = false;
this.showResults = true;
}).catch(() => {
this.isSearching = false;
});
}
</script>
{% endblock %}
{% block extra_js %}
<!-- Homepage specific JavaScript -->
<script>
document.addEventListener('DOMContentLoaded', function() {
// Smooth scroll for anchor links
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
anchor.addEventListener('click', function (e) {
e.preventDefault();
const target = document.querySelector(this.getAttribute('href'));
if (target) {
target.scrollIntoView({
behavior: 'smooth',
block: 'start'
});
}
});
});
// Intersection Observer for animations
const observerOptions = {
threshold: 0.1,
rootMargin: '0px 0px -50px 0px'
};
const observer = new IntersectionObserver((entries) => {
entries.forEach(entry => {
if (entry.isIntersecting) {
entry.target.classList.add('animate-fade-in-up');
}
});
}, observerOptions);
// Observe sections for animation
document.querySelectorAll('section').forEach(section => {
observer.observe(section);
});
});
</script>
{% endblock %}

View File

@@ -1,159 +0,0 @@
{% extends "base/htmx-base.html" %}
{% load static %}
{% block title %}{{ park.name }} - ThrillWiki{% endblock %}
{% block main %}
<div class="container py-8">
<!-- Breadcrumbs -->
<nav class="flex mb-6 text-sm text-muted-foreground">
<a href="{% url 'home' %}" class="hover:text-foreground">Home</a>
<span class="mx-2">/</span>
<a href="{% url 'parks:park_list' %}" class="hover:text-foreground">Parks</a>
<span class="mx-2">/</span>
<span class="text-foreground">{{ park.name }}</span>
</nav>
<div class="grid grid-cols-1 gap-8 lg:grid-cols-3">
<!-- Main Content -->
<div class="space-y-8 lg:col-span-2">
<!-- Park Header -->
<div class="relative overflow-hidden border rounded-lg shadow-sm bg-card text-card-foreground">
<div class="relative aspect-video">
{% if park.image %}
<img src="{{ park.image.url }}" alt="{{ park.name }}" class="object-cover w-full h-full">
{% else %}
<div class="flex items-center justify-center w-full h-full bg-muted">
<span class="text-muted-foreground">No image available</span>
</div>
{% endif %}
<div class="absolute inset-0 bg-gradient-to-t from-black/60 to-transparent"></div>
<div class="absolute text-white bottom-6 left-6">
<h1 class="mb-2 text-4xl font-bold">{{ park.name }}</h1>
<div class="flex items-center gap-4 text-sm">
<span class="flex items-center gap-1">
<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="M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z" />
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 11a3 3 0 11-6 0 3 3 0 016 0z" />
</svg>
{{ park.location.city }}, {{ park.location.country }}
</span>
<span class="px-2 py-0.5 rounded-full bg-white/20 backdrop-blur-sm border border-white/20">
{{ park.get_status_display }}
</span>
</div>
</div>
</div>
<div class="p-6">
<div class="flex items-center justify-between mb-6">
<div class="flex items-center gap-4">
<div class="flex flex-col items-center p-3 rounded-lg bg-muted/50">
<span class="text-2xl font-bold">{{ park.average_rating|default:"-" }}</span>
<span class="text-xs text-muted-foreground">Rating</span>
</div>
<div class="flex flex-col items-center p-3 rounded-lg bg-muted/50">
<span class="text-2xl font-bold">{{ park.rides.count }}</span>
<span class="text-xs text-muted-foreground">Rides</span>
</div>
</div>
<div class="flex gap-2">
{% include "components/ui/button.html" with label="Rate Park" variant="outline" icon='<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="M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z" /></svg>' %}
{% include "components/ui/button.html" with label="I've Been Here" variant="default" icon='<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="M5 13l4 4L19 7" /></svg>' %}
</div>
</div>
<div class="prose dark:prose-invert max-w-none">
<h3 class="mb-2 text-lg font-semibold">About</h3>
<p class="text-muted-foreground">{{ park.description }}</p>
</div>
</div>
</div>
<!-- Rides List -->
<div class="space-y-6">
<div class="flex items-center justify-between">
<h2 class="text-2xl font-bold tracking-tight">Rides & Attractions</h2>
<!-- Ride Filters -->
<div class="flex items-center gap-2" x-data="{ sort: 'rating' }">
<select class="w-32 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"
hx-get="{% url 'api:park-rides' park.id %}"
hx-target="#rides-grid"
name="sort">
<option value="rating">Top Rated</option>
<option value="name">Name (A-Z)</option>
<option value="thrill">Thrill Level</option>
</select>
</div>
</div>
<div id="rides-grid"
class="grid gap-4 sm:grid-cols-2"
hx-get="{% url 'api:park-rides' park.id %}"
hx-trigger="load"
hx-swap="innerHTML">
<!-- Loading State -->
{% for i in "1234"|make_list %}
<div class="flex items-start gap-4 p-4 border rounded-lg shadow-sm bg-card text-card-foreground">
<div class="w-20 h-20 rounded-md bg-muted animate-pulse shrink-0"></div>
<div class="flex-1 space-y-2">
<div class="w-3/4 h-5 rounded bg-muted animate-pulse"></div>
<div class="w-1/2 h-4 rounded bg-muted animate-pulse"></div>
<div class="w-1/3 h-4 rounded bg-muted animate-pulse"></div>
</div>
</div>
{% endfor %}
</div>
</div>
</div>
<!-- Sidebar -->
<div class="space-y-6">
<!-- Map -->
<div class="overflow-hidden border rounded-lg shadow-sm bg-card text-card-foreground">
<div class="p-4 border-b">
<h3 class="font-semibold">Location</h3>
</div>
<div class="relative aspect-square bg-muted">
<!-- Map Placeholder -->
<div class="absolute inset-0 flex items-center justify-center text-muted-foreground">
Map Component
</div>
</div>
<div class="p-4 text-sm text-muted-foreground">
<p>{{ park.location.address }}</p>
<a href="#" class="inline-block mt-2 text-primary hover:underline">Get Directions</a>
</div>
</div>
<!-- Operating Hours -->
<div class="border rounded-lg shadow-sm bg-card text-card-foreground">
<div class="p-4 border-b">
<h3 class="font-semibold">Operating Hours</h3>
</div>
<div class="p-4 space-y-3 text-sm">
<div class="flex justify-between">
<span class="text-muted-foreground">Today</span>
<span class="font-medium text-green-600">Open • 10:00 AM - 8:00 PM</span>
</div>
<!-- More days would go here -->
</div>
</div>
<!-- Weather -->
<div class="border rounded-lg shadow-sm bg-card text-card-foreground"
hx-get="{% url 'api:weather' park.id %}"
hx-trigger="load">
<div class="p-4 border-b">
<h3 class="font-semibold">Current Weather</h3>
</div>
<div class="p-4">
<div class="h-16 rounded bg-muted animate-pulse"></div>
</div>
</div>
</div>
</div>
</div>
{% endblock %}

View File

@@ -1,125 +0,0 @@
{% extends "base/htmx-base.html" %}
{% load static %}
{% block title %}Explore Parks - 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="park-filters"
hx-get="{% url 'api:park-list' %}"
hx-target="#park-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 parks..."
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>
<!-- Country Filter -->
<div class="mb-6 space-y-2">
<label class="text-sm font-medium">Country</label>
<select name="country"
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 Countries</option>
{% for country in countries %}
<option value="{{ country.code }}">{{ country.name }}</option>
{% endfor %}
</select>
</div>
<!-- Status Filter -->
<div class="mb-6 space-y-3">
<label class="text-sm font-medium">Status</label>
<div class="space-y-2">
<label class="flex items-center space-x-2">
<input type="checkbox" name="status" value="Operating" class="rounded border-primary text-primary focus:ring-primary">
<span class="text-sm">Operating</span>
</label>
<label class="flex items-center space-x-2">
<input type="checkbox" name="status" value="Closed" class="rounded border-primary text-primary focus:ring-primary">
<span class="text-sm">Closed</span>
</label>
<label class="flex items-center space-x-2">
<input type="checkbox" name="status" value="Construction" class="rounded border-primary text-primary focus:ring-primary">
<span class="text-sm">Under Construction</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">Theme Parks</h1>
<div class="flex items-center gap-2">
<span class="text-sm text-muted-foreground" id="park-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>
<!-- Park Grid -->
<div id="park-grid"
class="grid gap-6 sm:grid-cols-2 lg:grid-cols-3"
hx-get="{% url 'api:park-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 %}

View File

@@ -1,177 +0,0 @@
{% extends "base/htmx-base.html" %}
{% load static %}
{% block title %}{{ ride.name }} - {{ ride.park.name }} - ThrillWiki{% endblock %}
{% block main %}
<div class="container py-8">
<!-- Breadcrumbs -->
<nav class="flex mb-6 text-sm text-muted-foreground">
<a href="{% url 'home' %}" class="hover:text-foreground">Home</a>
<span class="mx-2">/</span>
<a href="{% url 'parks:park_list' %}" class="hover:text-foreground">Parks</a>
<span class="mx-2">/</span>
<a href="{% url 'parks:park_detail' ride.park.id %}" class="hover:text-foreground">{{ ride.park.name }}</a>
<span class="mx-2">/</span>
<span class="text-foreground">{{ ride.name }}</span>
</nav>
<div class="grid grid-cols-1 gap-8 lg:grid-cols-3">
<!-- Main Content -->
<div class="space-y-8 lg:col-span-2">
<!-- Ride Header -->
<div class="relative overflow-hidden border rounded-lg shadow-sm bg-card text-card-foreground">
<div class="relative aspect-video">
{% if ride.image %}
<img src="{{ ride.image.url }}" alt="{{ ride.name }}" class="object-cover w-full h-full">
{% else %}
<div class="flex items-center justify-center w-full h-full bg-muted">
<span class="text-muted-foreground">No image available</span>
</div>
{% endif %}
<div class="absolute inset-0 bg-gradient-to-t from-black/60 to-transparent"></div>
<div class="absolute text-white bottom-6 left-6">
<h1 class="mb-2 text-4xl font-bold">{{ ride.name }}</h1>
<div class="flex items-center gap-4 text-sm">
<span class="flex items-center gap-1">
<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="M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4" />
</svg>
{{ ride.park.name }}
</span>
<span class="px-2 py-0.5 rounded-full bg-white/20 backdrop-blur-sm border border-white/20">
{{ ride.get_status_display }}
</span>
</div>
</div>
</div>
<div class="p-6">
<div class="flex items-center justify-between mb-6">
<div class="flex items-center gap-4">
<div class="flex flex-col items-center p-3 rounded-lg bg-muted/50">
<span class="text-2xl font-bold">{{ ride.average_rating|default:"-" }}</span>
<span class="text-xs text-muted-foreground">Rating</span>
</div>
<div class="flex flex-col items-center p-3 rounded-lg bg-muted/50">
<span class="text-2xl font-bold">{{ ride.top_speed|default:"-" }}</span>
<span class="text-xs text-muted-foreground">mph</span>
</div>
<div class="flex flex-col items-center p-3 rounded-lg bg-muted/50">
<span class="text-2xl font-bold">{{ ride.height|default:"-" }}</span>
<span class="text-xs text-muted-foreground">ft</span>
</div>
</div>
<div class="flex gap-2">
{% include "components/ui/button.html" with label="Rate Ride" variant="outline" icon='<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="M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z" /></svg>' %}
{% include "components/ui/button.html" with label="Add to Credits" variant="default" icon='<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="M12 6v6m0 0v6m0-6h6m-6 0H6" /></svg>' %}
</div>
</div>
<div class="prose dark:prose-invert max-w-none">
<h3 class="mb-2 text-lg font-semibold">Description</h3>
<p class="text-muted-foreground">{{ ride.description }}</p>
</div>
</div>
</div>
<!-- Stats Grid -->
<div class="grid grid-cols-2 gap-4 md:grid-cols-4">
<div class="p-4 border rounded-lg shadow-sm bg-card text-card-foreground">
<dt class="text-sm font-medium text-muted-foreground">Manufacturer</dt>
<dd class="mt-1 text-lg font-semibold">{{ ride.manufacturer.name|default:"Unknown" }}</dd>
</div>
<div class="p-4 border rounded-lg shadow-sm bg-card text-card-foreground">
<dt class="text-sm font-medium text-muted-foreground">Opened</dt>
<dd class="mt-1 text-lg font-semibold">{{ ride.opening_date|date:"Y"|default:"Unknown" }}</dd>
</div>
<div class="p-4 border rounded-lg shadow-sm bg-card text-card-foreground">
<dt class="text-sm font-medium text-muted-foreground">Length</dt>
<dd class="mt-1 text-lg font-semibold">{{ ride.length|default:"-" }} ft</dd>
</div>
<div class="p-4 border rounded-lg shadow-sm bg-card text-card-foreground">
<dt class="text-sm font-medium text-muted-foreground">Inversions</dt>
<dd class="mt-1 text-lg font-semibold">{{ ride.inversions|default:"0" }}</dd>
</div>
</div>
<!-- Reviews Section -->
<div class="space-y-6">
<div class="flex items-center justify-between">
<h2 class="text-2xl font-bold tracking-tight">Reviews</h2>
<div class="flex items-center gap-2">
<span class="text-sm text-muted-foreground">{{ ride.review_count }} reviews</span>
</div>
</div>
<div id="reviews-list"
hx-get="{% url 'api:ride-reviews' ride.id %}"
hx-trigger="load"
hx-swap="innerHTML">
<!-- Loading State -->
{% for i in "123"|make_list %}
<div class="p-6 space-y-4 border rounded-lg shadow-sm bg-card text-card-foreground">
<div class="flex items-center justify-between">
<div class="flex items-center gap-3">
<div class="w-10 h-10 rounded-full bg-muted animate-pulse"></div>
<div class="space-y-2">
<div class="w-24 h-4 rounded bg-muted animate-pulse"></div>
<div class="w-16 h-3 rounded bg-muted animate-pulse"></div>
</div>
</div>
<div class="w-16 h-8 rounded bg-muted animate-pulse"></div>
</div>
<div class="space-y-2">
<div class="w-full h-4 rounded bg-muted animate-pulse"></div>
<div class="w-5/6 h-4 rounded bg-muted animate-pulse"></div>
</div>
</div>
{% endfor %}
</div>
</div>
</div>
<!-- Sidebar -->
<div class="space-y-6">
<!-- Similar Rides -->
<div class="border rounded-lg shadow-sm bg-card text-card-foreground">
<div class="p-4 border-b">
<h3 class="font-semibold">Similar Rides</h3>
</div>
<div class="divide-y"
hx-get="{% url 'api:ride-similar' ride.id %}"
hx-trigger="load"
hx-swap="innerHTML">
{% for i in "123"|make_list %}
<div class="flex gap-4 p-4">
<div class="w-16 h-16 rounded bg-muted animate-pulse shrink-0"></div>
<div class="flex-1 space-y-2">
<div class="w-3/4 h-4 rounded bg-muted animate-pulse"></div>
<div class="w-1/2 h-3 rounded bg-muted animate-pulse"></div>
</div>
</div>
{% endfor %}
</div>
</div>
<!-- POV Video -->
{% if ride.pov_video_url %}
<div class="overflow-hidden border rounded-lg shadow-sm bg-card text-card-foreground">
<div class="p-4 border-b">
<h3 class="font-semibold">On-Ride POV</h3>
</div>
<div class="relative aspect-video bg-muted">
<!-- Video Embed -->
<iframe src="{{ ride.pov_video_url }}"
class="absolute inset-0 w-full h-full"
frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
allowfullscreen></iframe>
</div>
</div>
{% endif %}
</div>
</div>
</div>
{% endblock %}

View File

@@ -1,130 +0,0 @@
{% 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 %}

View File

@@ -1,120 +0,0 @@
{% extends "base/htmx-base.html" %}
{% load static %}
{% block title %}Search Results - ThrillWiki{% endblock %}
{% block main %}
<div class="container py-8">
<div class="max-w-4xl mx-auto">
<!-- Search Header -->
<div class="mb-8 text-center">
<h1 class="mb-4 text-3xl font-bold tracking-tight">Search Results</h1>
<div class="max-w-xl mx-auto">
<form action="{% url 'search:results' %}" method="get" class="relative">
<input type="text"
name="q"
value="{{ query|default:'' }}"
placeholder="Search parks, rides, manufacturers..."
class="w-full h-12 pl-12 pr-4 text-lg transition-all border rounded-lg shadow-sm border-input bg-background focus:ring-2 focus:ring-primary focus:border-primary">
<div class="absolute -translate-y-1/2 left-4 top-1/2 text-muted-foreground">
<svg class="w-5 h-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" />
</svg>
</div>
<button type="submit" class="absolute right-2 top-1/2 -translate-y-1/2 px-4 py-1.5 bg-primary text-primary-foreground rounded-md text-sm font-medium hover:bg-primary/90 transition-colors">
Search
</button>
</form>
</div>
</div>
<!-- Filters Tabs -->
<div class="flex items-center justify-center gap-2 pb-2 mb-8 overflow-x-auto" x-data="{ tab: 'all' }">
<button @click="tab = 'all'"
:class="tab === 'all' ? 'bg-primary text-primary-foreground' : 'bg-muted text-muted-foreground hover:bg-muted/80'"
class="px-4 py-2 text-sm font-medium transition-colors rounded-full whitespace-nowrap">
All Results
</button>
<button @click="tab = 'parks'"
:class="tab === 'parks' ? 'bg-primary text-primary-foreground' : 'bg-muted text-muted-foreground hover:bg-muted/80'"
class="px-4 py-2 text-sm font-medium transition-colors rounded-full whitespace-nowrap">
Parks
</button>
<button @click="tab = 'rides'"
:class="tab === 'rides' ? 'bg-primary text-primary-foreground' : 'bg-muted text-muted-foreground hover:bg-muted/80'"
class="px-4 py-2 text-sm font-medium transition-colors rounded-full whitespace-nowrap">
Rides
</button>
<button @click="tab = 'users'"
:class="tab === 'users' ? 'bg-primary text-primary-foreground' : 'bg-muted text-muted-foreground hover:bg-muted/80'"
class="px-4 py-2 text-sm font-medium transition-colors rounded-full whitespace-nowrap">
Users
</button>
</div>
<!-- Results Grid -->
<div class="space-y-8">
{% if not query %}
<div class="py-12 text-center">
<div class="flex items-center justify-center w-16 h-16 mx-auto mb-4 rounded-full bg-muted">
<svg class="w-8 h-8 text-muted-foreground" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" />
</svg>
</div>
<h3 class="text-lg font-medium text-foreground">Start Searching</h3>
<p class="mt-1 text-muted-foreground">Enter a keyword to find parks, rides, and more.</p>
</div>
{% else %}
<!-- Parks Section -->
<section x-show="tab === 'all' || tab === 'parks'">
<div class="flex items-center justify-between mb-4">
<h2 class="text-xl font-bold">Parks</h2>
<span class="text-sm text-muted-foreground">3 results</span>
</div>
<div class="grid gap-4 sm:grid-cols-2">
{% for i in "123"|make_list %}
<a href="#" class="flex gap-4 p-4 transition-colors border rounded-lg bg-card hover:bg-muted/50">
<div class="w-20 h-20 rounded-md bg-muted shrink-0"></div>
<div>
<h3 class="text-lg font-semibold">Cedar Point</h3>
<p class="text-sm text-muted-foreground">Sandusky, OH, United States</p>
<div class="flex items-center gap-2 mt-2 text-xs text-muted-foreground">
<span class="bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400 px-2 py-0.5 rounded-full">Operating</span>
<span></span>
<span>72 Rides</span>
</div>
</div>
</a>
{% endfor %}
</div>
</section>
<!-- Rides Section -->
<section x-show="tab === 'all' || tab === 'rides'">
<div class="flex items-center justify-between mb-4">
<h2 class="text-xl font-bold">Rides</h2>
<span class="text-sm text-muted-foreground">5 results</span>
</div>
<div class="grid gap-4 sm:grid-cols-2">
{% for i in "12345"|make_list %}
<a href="#" class="flex gap-4 p-4 transition-colors border rounded-lg bg-card hover:bg-muted/50">
<div class="w-20 h-20 rounded-md bg-muted shrink-0"></div>
<div>
<h3 class="text-lg font-semibold">Millennium Force</h3>
<p class="text-sm text-muted-foreground">Cedar Point</p>
<div class="flex items-center gap-2 mt-2 text-xs text-muted-foreground">
<span class="font-medium text-yellow-600 dark:text-yellow-400">★ 4.9</span>
<span></span>
<span>Giga Coaster</span>
</div>
</div>
</a>
{% endfor %}
</div>
</section>
{% endif %}
</div>
</div>
</div>
{% endblock %}

View File

@@ -1,96 +0,0 @@
<!-- Featured Parks Grid -->
{% for park in featured_parks %}
<div class="group relative overflow-hidden rounded-xl bg-background border border-border/50 shadow-sm hover:shadow-lg transition-all duration-300 transform hover:-translate-y-1">
<!-- Park Image -->
<div class="aspect-video relative overflow-hidden">
{% if park.card_image %}
<img src="{{ park.card_image.url }}"
alt="{{ park.name }}"
class="w-full h-full object-cover group-hover:scale-105 transition-transform duration-300"
loading="lazy">
{% else %}
<div class="w-full h-full bg-gradient-to-br from-primary/20 to-secondary/20 flex items-center justify-center">
<svg class="w-16 h-16 text-muted-foreground" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4"></path>
</svg>
</div>
{% endif %}
<!-- Overlay -->
<div class="absolute inset-0 bg-gradient-to-t from-black/60 via-transparent to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-300"></div>
<!-- Quick Stats Overlay -->
<div class="absolute top-4 right-4 flex gap-2">
{% if park.average_rating %}
<div class="bg-background/90 backdrop-blur-sm px-2 py-1 rounded-full text-xs font-medium flex items-center gap-1">
<svg class="w-3 h-3 text-yellow-500" fill="currentColor" viewBox="0 0 20 20">
<path d="M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z"></path>
</svg>
{{ park.average_rating|floatformat:1 }}
</div>
{% endif %}
{% if park.ride_count %}
<div class="bg-background/90 backdrop-blur-sm px-2 py-1 rounded-full text-xs font-medium">
{{ park.ride_count }} rides
</div>
{% endif %}
</div>
</div>
<!-- Park Info -->
<div class="p-6">
<h3 class="text-xl font-bold mb-2 group-hover:text-primary transition-colors">
<a href="/parks/{{ park.slug }}/" class="stretched-link">
{{ park.name }}
</a>
</h3>
<p class="text-muted-foreground text-sm mb-4 line-clamp-2">
{{ park.description|truncatewords:20 }}
</p>
<!-- Park Details -->
<div class="flex items-center justify-between text-sm">
<div class="flex items-center gap-4">
{% if park.location %}
<div class="flex items-center gap-1 text-muted-foreground">
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"></path>
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 11a3 3 0 11-6 0 3 3 0 016 0z"></path>
</svg>
{{ park.location.city }}, {{ park.location.country }}
</div>
{% endif %}
{% if park.opening_year %}
<div class="flex items-center gap-1 text-muted-foreground">
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"></path>
</svg>
{{ park.opening_year }}
</div>
{% endif %}
</div>
<!-- Status Badge -->
{% if park.status %}
<span class="px-2 py-1 rounded-full text-xs font-medium
{% if park.status == 'operating' %}bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400
{% elif park.status == 'closed' %}bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-400
{% elif park.status == 'seasonal' %}bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-400
{% else %}bg-gray-100 text-gray-800 dark:bg-gray-900/30 dark:text-gray-400{% endif %}">
{{ park.get_status_display }}
</span>
{% endif %}
</div>
</div>
</div>
{% empty %}
<div class="col-span-full text-center py-12">
<svg class="w-16 h-16 text-muted-foreground mx-auto mb-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4"></path>
</svg>
<h3 class="text-lg font-semibold mb-2">No Featured Parks</h3>
<p class="text-muted-foreground">Check back soon for featured theme parks!</p>
</div>
{% endfor %}

View File

@@ -1,128 +0,0 @@
<!-- Featured Rides Grid -->
{% for ride in featured_rides %}
<div class="group relative overflow-hidden rounded-xl bg-background border border-border/50 shadow-sm hover:shadow-lg transition-all duration-300 transform hover:-translate-y-1">
<!-- Ride Image -->
<div class="aspect-square relative overflow-hidden">
{% if ride.card_image %}
<img src="{{ ride.card_image.url }}"
alt="{{ ride.name }}"
class="w-full h-full object-cover group-hover:scale-105 transition-transform duration-300"
loading="lazy">
{% else %}
<div class="w-full h-full bg-gradient-to-br from-secondary/20 to-accent/20 flex items-center justify-center">
<svg class="w-12 h-12 text-muted-foreground" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z"></path>
</svg>
</div>
{% endif %}
<!-- Overlay -->
<div class="absolute inset-0 bg-gradient-to-t from-black/60 via-transparent to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-300"></div>
<!-- Quick Stats Overlay -->
<div class="absolute top-3 right-3 flex flex-col gap-1">
{% if ride.average_rating %}
<div class="bg-background/90 backdrop-blur-sm px-2 py-1 rounded-full text-xs font-medium flex items-center gap-1">
<svg class="w-3 h-3 text-yellow-500" fill="currentColor" viewBox="0 0 20 20">
<path d="M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z"></path>
</svg>
{{ ride.average_rating|floatformat:1 }}
</div>
{% endif %}
{% if ride.ride_type %}
<div class="bg-background/90 backdrop-blur-sm px-2 py-1 rounded-full text-xs font-medium">
{{ ride.get_ride_type_display }}
</div>
{% endif %}
</div>
<!-- Thrill Level Indicator -->
{% if ride.thrill_level %}
<div class="absolute bottom-3 left-3">
<div class="flex items-center gap-1 bg-background/90 backdrop-blur-sm px-2 py-1 rounded-full text-xs font-medium">
{% if ride.thrill_level == 'family' %}
<div class="w-2 h-2 rounded-full bg-green-500"></div>
<span class="text-green-700 dark:text-green-400">Family</span>
{% elif ride.thrill_level == 'moderate' %}
<div class="w-2 h-2 rounded-full bg-yellow-500"></div>
<span class="text-yellow-700 dark:text-yellow-400">Moderate</span>
{% elif ride.thrill_level == 'extreme' %}
<div class="w-2 h-2 rounded-full bg-red-500"></div>
<span class="text-red-700 dark:text-red-400">Extreme</span>
{% endif %}
</div>
</div>
{% endif %}
</div>
<!-- Ride Info -->
<div class="p-4">
<h3 class="font-bold mb-1 group-hover:text-primary transition-colors line-clamp-1">
<a href="/rides/{{ ride.slug }}/" class="stretched-link">
{{ ride.name }}
</a>
</h3>
<p class="text-sm text-muted-foreground mb-2 line-clamp-1">
<a href="/parks/{{ ride.park.slug }}/" class="hover:text-primary transition-colors">
{{ ride.park.name }}
</a>
</p>
<!-- Ride Stats -->
<div class="flex items-center justify-between text-xs text-muted-foreground">
{% if ride.height_requirement %}
<div class="flex items-center gap-1">
<svg class="w-3 h-3" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 4V2a1 1 0 011-1h8a1 1 0 011 1v2m-9 0h10m-10 0a2 2 0 00-2 2v14a2 2 0 002 2h10a2 2 0 002-2V6a2 2 0 00-2-2"></path>
</svg>
{{ ride.height_requirement }}"
</div>
{% endif %}
{% if ride.opening_year %}
<div class="flex items-center gap-1">
<svg class="w-3 h-3" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"></path>
</svg>
{{ ride.opening_year }}
</div>
{% endif %}
</div>
<!-- Roller Coaster Stats (if applicable) -->
{% if ride.roller_coaster_stats %}
<div class="mt-2 pt-2 border-t border-border/50">
<div class="grid grid-cols-2 gap-2 text-xs">
{% if ride.roller_coaster_stats.max_height %}
<div class="flex items-center gap-1 text-muted-foreground">
<svg class="w-3 h-3" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 11l5-5m0 0l5 5m-5-5v12"></path>
</svg>
{{ ride.roller_coaster_stats.max_height }}ft
</div>
{% endif %}
{% if ride.roller_coaster_stats.max_speed %}
<div class="flex items-center gap-1 text-muted-foreground">
<svg class="w-3 h-3" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z"></path>
</svg>
{{ ride.roller_coaster_stats.max_speed }}mph
</div>
{% endif %}
</div>
</div>
{% endif %}
</div>
</div>
{% empty %}
<div class="col-span-full text-center py-12">
<svg class="w-16 h-16 text-muted-foreground mx-auto mb-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z"></path>
</svg>
<h3 class="text-lg font-semibold mb-2">No Featured Rides</h3>
<p class="text-muted-foreground">Check back soon for featured thrilling rides!</p>
</div>
{% endfor %}

View File

@@ -1,183 +0,0 @@
<!-- Recent Activity Feed -->
{% for activity in recent_activities %}
<div class="flex items-start space-x-4 p-6 bg-background rounded-xl border border-border/50 hover:shadow-md transition-all duration-200">
<!-- Activity Icon/Avatar -->
<div class="flex-shrink-0">
{% if activity.type == 'review' %}
<div class="w-12 h-12 bg-primary/10 rounded-full flex items-center justify-center">
<svg class="w-6 h-6 text-primary" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z"></path>
</svg>
</div>
{% elif activity.type == 'photo' %}
<div class="w-12 h-12 bg-secondary/10 rounded-full flex items-center justify-center">
<svg class="w-6 h-6 text-secondary" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"></path>
</svg>
</div>
{% elif activity.type == 'park_update' %}
<div class="w-12 h-12 bg-accent/10 rounded-full flex items-center justify-center">
<svg class="w-6 h-6 text-accent" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4"></path>
</svg>
</div>
{% elif activity.type == 'ride_update' %}
<div class="w-12 h-12 bg-primary/10 rounded-full flex items-center justify-center">
<svg class="w-6 h-6 text-primary" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z"></path>
</svg>
</div>
{% else %}
<div class="w-12 h-12 bg-muted rounded-full flex items-center justify-center">
<svg class="w-6 h-6 text-muted-foreground" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path>
</svg>
</div>
{% endif %}
</div>
<!-- Activity Content -->
<div class="flex-1 min-w-0">
<!-- Activity Header -->
<div class="flex items-center justify-between mb-2">
<div class="flex items-center gap-2">
{% if activity.user %}
<span class="font-medium text-foreground">{{ activity.user.username }}</span>
{% else %}
<span class="font-medium text-foreground">ThrillWiki</span>
{% endif %}
<!-- Activity Type Badge -->
<span class="px-2 py-1 rounded-full text-xs font-medium
{% if activity.type == 'review' %}bg-primary/10 text-primary
{% elif activity.type == 'photo' %}bg-secondary/10 text-secondary
{% elif activity.type == 'park_update' %}bg-accent/10 text-accent
{% elif activity.type == 'ride_update' %}bg-primary/10 text-primary
{% else %}bg-muted text-muted-foreground{% endif %}">
{% if activity.type == 'review' %}Review
{% elif activity.type == 'photo' %}Photo
{% elif activity.type == 'park_update' %}Park Update
{% elif activity.type == 'ride_update' %}Ride Update
{% else %}Update{% endif %}
</span>
</div>
<!-- Timestamp -->
<time class="text-sm text-muted-foreground" datetime="{{ activity.created_at|date:'c' }}">
{{ activity.created_at|timesince }} ago
</time>
</div>
<!-- Activity Description -->
<div class="mb-3">
{% if activity.type == 'review' %}
<p class="text-foreground">
{% if activity.rating %}
Rated
<span class="inline-flex items-center gap-1">
<svg class="w-4 h-4 text-yellow-500" fill="currentColor" viewBox="0 0 20 20">
<path d="M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z"></path>
</svg>
{{ activity.rating }}/5
</span>
{% else %}
Reviewed
{% endif %}
{% if activity.content_object %}
<a href="{{ activity.content_object.get_absolute_url }}" class="font-medium text-primary hover:text-primary/80 transition-colors">
{{ activity.content_object.name }}
</a>
{% if activity.content_object.park and activity.content_object.park != activity.content_object %}
at <a href="{{ activity.content_object.park.get_absolute_url }}" class="text-muted-foreground hover:text-primary transition-colors">{{ activity.content_object.park.name }}</a>
{% endif %}
{% endif %}
</p>
{% if activity.comment %}
<blockquote class="mt-2 pl-4 border-l-2 border-border text-muted-foreground italic">
"{{ activity.comment|truncatewords:20 }}"
</blockquote>
{% endif %}
{% elif activity.type == 'photo' %}
<p class="text-foreground">
Added a new photo to
{% if activity.content_object %}
<a href="{{ activity.content_object.get_absolute_url }}" class="font-medium text-primary hover:text-primary/80 transition-colors">
{{ activity.content_object.name }}
</a>
{% endif %}
</p>
{% elif activity.type == 'park_update' %}
<p class="text-foreground">
{% if activity.content_object %}
<a href="{{ activity.content_object.get_absolute_url }}" class="font-medium text-primary hover:text-primary/80 transition-colors">
{{ activity.content_object.name }}
</a>
{% endif %}
{{ activity.description|default:"was updated" }}
</p>
{% elif activity.type == 'ride_update' %}
<p class="text-foreground">
{% if activity.content_object %}
<a href="{{ activity.content_object.get_absolute_url }}" class="font-medium text-primary hover:text-primary/80 transition-colors">
{{ activity.content_object.name }}
</a>
{% if activity.content_object.park %}
at <a href="{{ activity.content_object.park.get_absolute_url }}" class="text-muted-foreground hover:text-primary transition-colors">{{ activity.content_object.park.name }}</a>
{% endif %}
{% endif %}
{{ activity.description|default:"was updated" }}
</p>
{% else %}
<p class="text-foreground">{{ activity.description }}</p>
{% endif %}
</div>
<!-- Activity Image (if applicable) -->
{% if activity.image %}
<div class="mt-3">
<img src="{{ activity.image.url }}"
alt="Activity image"
class="w-full max-w-sm h-32 object-cover rounded-lg border border-border/50"
loading="lazy">
</div>
{% endif %}
<!-- Activity Actions -->
<div class="flex items-center gap-4 mt-3 text-sm text-muted-foreground">
{% if activity.content_object %}
<a href="{{ activity.content_object.get_absolute_url }}"
class="inline-flex items-center gap-1 hover:text-primary transition-colors">
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"></path>
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"></path>
</svg>
View Details
</a>
{% endif %}
{% if activity.type == 'review' and activity.helpful_count %}
<span class="inline-flex items-center gap-1">
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M14 10h4.764a2 2 0 011.789 2.894l-3.5 7A2 2 0 0115.263 21h-4.017c-.163 0-.326-.02-.485-.06L7 20m7-10V5a2 2 0 00-2-2h-.095c-.5 0-.905.405-.905.905 0 .714-.211 1.412-.608 2.006L7 11v9m7-10h-2M7 20H5a2 2 0 01-2-2v-6a2 2 0 012-2h2.5"></path>
</svg>
{{ activity.helpful_count }} helpful
</span>
{% endif %}
</div>
</div>
</div>
{% empty %}
<div class="text-center py-12">
<svg class="w-16 h-16 text-muted-foreground mx-auto mb-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"></path>
</svg>
<h3 class="text-lg font-semibold mb-2">No Recent Activity</h3>
<p class="text-muted-foreground">Be the first to add a review or photo!</p>
</div>
{% endfor %}

View File

@@ -1,194 +0,0 @@
<!-- Global Search Results -->
{% if results %}
<!-- Results Header -->
<div class="px-4 py-3 border-b border-border/50 bg-muted/30">
<div class="flex items-center justify-between">
<span class="text-sm font-medium text-foreground">
{{ results|length }} result{{ results|length|pluralize }} found
</span>
{% if query %}
<span class="text-xs text-muted-foreground">
for "{{ query }}"
</span>
{% endif %}
</div>
</div>
<!-- Results List -->
<div class="max-h-80 overflow-y-auto">
{% for result in results %}
<a href="{{ result.url }}"
class="flex items-start gap-3 px-4 py-3 hover:bg-muted/50 transition-colors border-b border-border/30 last:border-b-0">
<!-- Result Icon -->
<div class="flex-shrink-0 mt-1">
{% if result.type == 'park' %}
<div class="w-8 h-8 bg-primary/10 rounded-lg flex items-center justify-center">
<svg class="w-4 h-4 text-primary" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4"></path>
</svg>
</div>
{% elif result.type == 'ride' %}
<div class="w-8 h-8 bg-secondary/10 rounded-lg flex items-center justify-center">
<svg class="w-4 h-4 text-secondary" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z"></path>
</svg>
</div>
{% elif result.type == 'operator' %}
<div class="w-8 h-8 bg-accent/10 rounded-lg flex items-center justify-center">
<svg class="w-4 h-4 text-accent" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4"></path>
</svg>
</div>
{% elif result.type == 'manufacturer' %}
<div class="w-8 h-8 bg-primary/10 rounded-lg flex items-center justify-center">
<svg class="w-4 h-4 text-primary" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"></path>
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"></path>
</svg>
</div>
{% else %}
<div class="w-8 h-8 bg-muted rounded-lg flex items-center justify-center">
<svg class="w-4 h-4 text-muted-foreground" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"></path>
</svg>
</div>
{% endif %}
</div>
<!-- Result Content -->
<div class="flex-1 min-w-0">
<!-- Result Title -->
<div class="flex items-center gap-2 mb-1">
<h4 class="font-medium text-foreground truncate">
{{ result.title }}
</h4>
<!-- Result Type Badge -->
<span class="px-2 py-0.5 rounded-full text-xs font-medium flex-shrink-0
{% if result.type == 'park' %}bg-primary/10 text-primary
{% elif result.type == 'ride' %}bg-secondary/10 text-secondary
{% elif result.type == 'operator' %}bg-accent/10 text-accent
{% elif result.type == 'manufacturer' %}bg-primary/10 text-primary
{% else %}bg-muted text-muted-foreground{% endif %}">
{{ result.type|title }}
</span>
</div>
<!-- Result Description -->
{% if result.description %}
<p class="text-sm text-muted-foreground line-clamp-2 mb-2">
{{ result.description|truncatewords:15 }}
</p>
{% endif %}
<!-- Result Meta -->
<div class="flex items-center gap-3 text-xs text-muted-foreground">
{% if result.location %}
<div class="flex items-center gap-1">
<svg class="w-3 h-3" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"></path>
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 11a3 3 0 11-6 0 3 3 0 016 0z"></path>
</svg>
{{ result.location }}
</div>
{% endif %}
{% if result.rating %}
<div class="flex items-center gap-1">
<svg class="w-3 h-3 text-yellow-500" fill="currentColor" viewBox="0 0 20 20">
<path d="M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z"></path>
</svg>
{{ result.rating|floatformat:1 }}
</div>
{% endif %}
{% if result.count %}
<div class="flex items-center gap-1">
{% if result.type == 'park' %}
<svg class="w-3 h-3" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z"></path>
</svg>
{{ result.count }} ride{{ result.count|pluralize }}
{% elif result.type == 'operator' %}
<svg class="w-3 h-3" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4"></path>
</svg>
{{ result.count }} park{{ result.count|pluralize }}
{% elif result.type == 'manufacturer' %}
<svg class="w-3 h-3" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z"></path>
</svg>
{{ result.count }} ride{{ result.count|pluralize }}
{% endif %}
</div>
{% endif %}
{% if result.year %}
<div class="flex items-center gap-1">
<svg class="w-3 h-3" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"></path>
</svg>
{{ result.year }}
</div>
{% endif %}
</div>
</div>
<!-- Result Arrow -->
<div class="flex-shrink-0 mt-2">
<svg class="w-4 h-4 text-muted-foreground" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"></path>
</svg>
</div>
</a>
{% endfor %}
</div>
<!-- View All Results Footer -->
{% if results|length >= 5 %}
<div class="px-4 py-3 border-t border-border/50 bg-muted/30">
<a href="/search/?q={{ query|urlencode }}"
class="text-sm text-primary hover:text-primary/80 transition-colors font-medium">
View all search results →
</a>
</div>
{% endif %}
{% else %}
<!-- No Results -->
<div class="px-4 py-8 text-center">
<svg class="w-12 h-12 text-muted-foreground mx-auto mb-3" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"></path>
</svg>
<h3 class="font-medium text-foreground mb-1">No results found</h3>
{% if query %}
<p class="text-sm text-muted-foreground mb-4">
No results for "{{ query }}"
</p>
{% else %}
<p class="text-sm text-muted-foreground mb-4">
Try searching for parks, rides, or locations
</p>
{% endif %}
<!-- Search Suggestions -->
<div class="flex flex-wrap gap-2 justify-center">
<span class="text-xs text-muted-foreground">Try:</span>
<button class="text-xs text-primary hover:text-primary/80 transition-colors"
onclick="document.querySelector('input[type=text]').value='Disney'; document.querySelector('input[type=text]').dispatchEvent(new Event('input'));">
Disney
</button>
<span class="text-xs text-muted-foreground"></span>
<button class="text-xs text-primary hover:text-primary/80 transition-colors"
onclick="document.querySelector('input[type=text]').value='roller coaster'; document.querySelector('input[type=text]').dispatchEvent(new Event('input'));">
Roller Coaster
</button>
<span class="text-xs text-muted-foreground"></span>
<button class="text-xs text-primary hover:text-primary/80 transition-colors"
onclick="document.querySelector('input[type=text]').value='Cedar Point'; document.querySelector('input[type=text]').dispatchEvent(new Event('input'));">
Cedar Point
</button>
</div>
</div>
{% endif %}

View File

@@ -1,20 +0,0 @@
<!-- Homepage Statistics Dashboard -->
<div class="text-center p-6 bg-background rounded-xl shadow-sm border border-border/50">
<div class="text-3xl font-bold text-primary mb-2">{{ total_parks|default:"0" }}</div>
<div class="text-sm text-muted-foreground">Theme Parks</div>
</div>
<div class="text-center p-6 bg-background rounded-xl shadow-sm border border-border/50">
<div class="text-3xl font-bold text-secondary mb-2">{{ total_rides|default:"0" }}</div>
<div class="text-sm text-muted-foreground">Thrilling Rides</div>
</div>
<div class="text-center p-6 bg-background rounded-xl shadow-sm border border-border/50">
<div class="text-3xl font-bold text-accent mb-2">{{ total_reviews|default:"0" }}</div>
<div class="text-sm text-muted-foreground">User Reviews</div>
</div>
<div class="text-center p-6 bg-background rounded-xl shadow-sm border border-border/50">
<div class="text-3xl font-bold text-primary mb-2">{{ total_countries|default:"0" }}</div>
<div class="text-sm text-muted-foreground">Countries</div>
</div>