mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2025-12-21 10:51:09 -05:00
first commit
This commit is contained in:
15
templates/404.html
Normal file
15
templates/404.html
Normal file
@@ -0,0 +1,15 @@
|
||||
{% extends "base/base.html" %}
|
||||
|
||||
{% block title %}Page Not Found{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="container mx-auto px-4 py-16">
|
||||
<div class="text-center">
|
||||
<h1 class="text-4xl font-bold mb-4">404 - Page Not Found</h1>
|
||||
<p class="text-lg mb-8">The page you're looking for doesn't exist or has been moved.</p>
|
||||
<a href="/" class="inline-block bg-blue-600 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded">
|
||||
Return Home
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
15
templates/500.html
Normal file
15
templates/500.html
Normal file
@@ -0,0 +1,15 @@
|
||||
{% extends "base/base.html" %}
|
||||
|
||||
{% block title %}Server Error{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="container mx-auto px-4 py-16">
|
||||
<div class="text-center">
|
||||
<h1 class="text-4xl font-bold mb-4">500 - Server Error</h1>
|
||||
<p class="text-lg mb-8">Something went wrong on our end. Please try again later.</p>
|
||||
<a href="/" class="inline-block bg-blue-600 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded">
|
||||
Return Home
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
133
templates/account/login.html
Normal file
133
templates/account/login.html
Normal file
@@ -0,0 +1,133 @@
|
||||
{% extends "base/base.html" %}
|
||||
{% load i18n %}
|
||||
{% load account socialaccount %}
|
||||
{% load static %}
|
||||
|
||||
{% block title %}Login - ThrillWiki{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="max-w-md mx-auto">
|
||||
<div class="bg-white dark:bg-gray-800 shadow rounded-lg p-6">
|
||||
<h1 class="text-2xl font-bold mb-6 text-gray-900 dark:text-white">{% trans "Sign In" %}</h1>
|
||||
|
||||
{% get_providers as socialaccount_providers %}
|
||||
|
||||
{% if socialaccount_providers %}
|
||||
<div class="space-y-3 mb-6">
|
||||
{% for provider in socialaccount_providers %}
|
||||
<a href="{% provider_login_url provider.id process='login' %}"
|
||||
class="w-full flex items-center justify-center px-4 py-2 border border-gray-300 rounded-md shadow-sm text-sm font-medium text-gray-700 dark:text-gray-200 bg-white dark:bg-gray-700 hover:bg-gray-50 dark:hover:bg-gray-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500"
|
||||
role="button"
|
||||
tabindex="0"
|
||||
onkeydown="if(event.key === 'Enter' || event.key === ' ') { this.click(); event.preventDefault(); }">
|
||||
{% if provider.id == 'google' %}
|
||||
<img src="{% static 'images/google-icon.svg' %}" alt="Google" class="h-5 w-5 mr-2">
|
||||
{% elif provider.id == 'discord' %}
|
||||
<img src="{% static 'images/discord-icon.svg' %}" alt="Discord" class="h-5 w-5 mr-2">
|
||||
{% endif %}
|
||||
Sign in with {{ provider.name }}
|
||||
</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
<div class="relative my-6">
|
||||
<div class="absolute inset-0 flex items-center">
|
||||
<div class="w-full border-t border-gray-300 dark:border-gray-600"></div>
|
||||
</div>
|
||||
<div class="relative flex justify-center text-sm">
|
||||
<span class="px-2 bg-white dark:bg-gray-800 text-gray-500">Or continue with</span>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<form class="space-y-4" method="POST" action="{% url 'account_login' %}"
|
||||
onkeydown="if(event.key === 'Enter' && !event.shiftKey) {
|
||||
const activeElement = document.activeElement;
|
||||
if (activeElement.tagName === 'TEXTAREA') {
|
||||
if (!event.shiftKey) {
|
||||
event.preventDefault();
|
||||
this.submit();
|
||||
}
|
||||
} else {
|
||||
event.preventDefault();
|
||||
this.submit();
|
||||
}
|
||||
}">
|
||||
{% csrf_token %}
|
||||
|
||||
{% if form.non_field_errors %}
|
||||
<div class="bg-red-50 dark:bg-red-900 border-l-4 border-red-400 p-4 mb-4">
|
||||
<div class="text-sm text-red-700 dark:text-red-200">
|
||||
{{ form.non_field_errors }}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div>
|
||||
<label for="id_login" class="block text-sm font-medium text-gray-700 dark:text-gray-300">
|
||||
{% trans "Username or Email" %}
|
||||
</label>
|
||||
<input type="text" name="login" id="id_login" required
|
||||
autocomplete="username email"
|
||||
class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:text-white">
|
||||
{% if form.login.errors %}
|
||||
<p class="mt-1 text-sm text-red-600 dark:text-red-400">{{ form.login.errors }}</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="id_password" class="block text-sm font-medium text-gray-700 dark:text-gray-300">
|
||||
{% trans "Password" %}
|
||||
</label>
|
||||
<input type="password" name="password" id="id_password" required
|
||||
autocomplete="current-password"
|
||||
class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:text-white">
|
||||
{% if form.password.errors %}
|
||||
<p class="mt-1 text-sm text-red-600 dark:text-red-400">{{ form.password.errors }}</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="flex items-center justify-between">
|
||||
<div class="flex items-center">
|
||||
<input type="checkbox" name="remember" id="id_remember"
|
||||
class="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded">
|
||||
<label for="id_remember" class="ml-2 block text-sm text-gray-900 dark:text-gray-300">
|
||||
{% trans "Remember me" %}
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="text-sm">
|
||||
<a href="{% url 'account_reset_password' %}"
|
||||
class="font-medium text-blue-600 hover:text-blue-500 dark:text-blue-400 focus:outline-none focus:underline"
|
||||
onkeydown="if(event.key === 'Enter') { this.click(); }">
|
||||
{% trans "Forgot Password?" %}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if redirect_field_value %}
|
||||
<input type="hidden" name="{{ redirect_field_name }}" value="{{ redirect_field_value }}" />
|
||||
{% endif %}
|
||||
|
||||
<div>
|
||||
<button type="submit"
|
||||
class="w-full inline-flex justify-center items-center px-4 py-3 border border-transparent text-base font-medium rounded-md text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500">
|
||||
<i class="fas fa-sign-in-alt mr-2"></i>
|
||||
{% trans "Sign In" %}
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div class="mt-6 text-center text-sm">
|
||||
<p class="text-gray-600 dark:text-gray-400">
|
||||
{% trans "Don't have an account?" %}
|
||||
<a href="{% url 'account_signup' %}"
|
||||
class="font-medium text-blue-600 hover:text-blue-500 dark:text-blue-400 focus:outline-none focus:underline"
|
||||
onkeydown="if(event.key === 'Enter') { this.click(); }">
|
||||
{% trans "Sign up" %}
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
142
templates/account/signup.html
Normal file
142
templates/account/signup.html
Normal file
@@ -0,0 +1,142 @@
|
||||
{% extends "base/base.html" %}
|
||||
{% load i18n %}
|
||||
{% load account socialaccount %}
|
||||
{% load static %}
|
||||
|
||||
{% block title %}Register - ThrillWiki{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="max-w-md mx-auto">
|
||||
<div class="bg-white dark:bg-gray-800 shadow rounded-lg p-6">
|
||||
<h1 class="text-2xl font-bold mb-6 text-gray-900 dark:text-white">{% trans "Sign Up" %}</h1>
|
||||
|
||||
{% get_providers as socialaccount_providers %}
|
||||
|
||||
{% if socialaccount_providers %}
|
||||
<div class="space-y-3 mb-6">
|
||||
{% for provider in socialaccount_providers %}
|
||||
<a href="{% provider_login_url provider.id process='signup' %}"
|
||||
class="w-full flex items-center justify-center px-4 py-2 border border-gray-300 rounded-md shadow-sm text-sm font-medium text-gray-700 dark:text-gray-200 bg-white dark:bg-gray-700 hover:bg-gray-50 dark:hover:bg-gray-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500"
|
||||
role="button"
|
||||
tabindex="0"
|
||||
onkeydown="if(event.key === 'Enter' || event.key === ' ') { this.click(); event.preventDefault(); }">
|
||||
{% if provider.id == 'google' %}
|
||||
<img src="{% static 'images/google-icon.svg' %}" alt="Google" class="h-5 w-5 mr-2">
|
||||
{% elif provider.id == 'discord' %}
|
||||
<img src="{% static 'images/discord-icon.svg' %}" alt="Discord" class="h-5 w-5 mr-2">
|
||||
{% endif %}
|
||||
Sign up with {{ provider.name }}
|
||||
</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
<div class="relative my-6">
|
||||
<div class="absolute inset-0 flex items-center">
|
||||
<div class="w-full border-t border-gray-300 dark:border-gray-600"></div>
|
||||
</div>
|
||||
<div class="relative flex justify-center text-sm">
|
||||
<span class="px-2 bg-white dark:bg-gray-800 text-gray-500">Or continue with</span>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<form class="space-y-4" method="POST" action="{% url 'account_signup' %}"
|
||||
onkeydown="if(event.key === 'Enter' && !event.shiftKey) {
|
||||
const activeElement = document.activeElement;
|
||||
if (activeElement.tagName === 'TEXTAREA') {
|
||||
if (!event.shiftKey) {
|
||||
event.preventDefault();
|
||||
this.submit();
|
||||
}
|
||||
} else {
|
||||
event.preventDefault();
|
||||
this.submit();
|
||||
}
|
||||
}">
|
||||
{% csrf_token %}
|
||||
|
||||
{% if form.non_field_errors %}
|
||||
<div class="bg-red-50 dark:bg-red-900 border-l-4 border-red-400 p-4 mb-4">
|
||||
<div class="text-sm text-red-700 dark:text-red-200">
|
||||
{{ form.non_field_errors }}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div>
|
||||
<label for="id_username" class="block text-sm font-medium text-gray-700 dark:text-gray-300">
|
||||
{% trans "Username" %}
|
||||
</label>
|
||||
<input type="text" name="username" id="id_username" required
|
||||
autocomplete="username"
|
||||
class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:text-white">
|
||||
{% if form.username.errors %}
|
||||
<p class="mt-1 text-sm text-red-600 dark:text-red-400">{{ form.username.errors }}</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="id_email" class="block text-sm font-medium text-gray-700 dark:text-gray-300">
|
||||
{% trans "Email" %}
|
||||
</label>
|
||||
<input type="email" name="email" id="id_email" required
|
||||
autocomplete="email"
|
||||
class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:text-white">
|
||||
{% if form.email.errors %}
|
||||
<p class="mt-1 text-sm text-red-600 dark:text-red-400">{{ form.email.errors }}</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="id_password1" class="block text-sm font-medium text-gray-700 dark:text-gray-300">
|
||||
{% trans "Password" %}
|
||||
</label>
|
||||
<input type="password" name="password1" id="id_password1" required
|
||||
autocomplete="new-password"
|
||||
class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:text-white">
|
||||
{% if form.password1.errors %}
|
||||
<p class="mt-1 text-sm text-red-600 dark:text-red-400">{{ form.password1.errors }}</p>
|
||||
{% endif %}
|
||||
{% if form.password1.help_text %}
|
||||
<p class="mt-1 text-sm text-gray-500 dark:text-gray-400">{{ form.password1.help_text }}</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="id_password2" class="block text-sm font-medium text-gray-700 dark:text-gray-300">
|
||||
{% trans "Confirm Password" %}
|
||||
</label>
|
||||
<input type="password" name="password2" id="id_password2" required
|
||||
autocomplete="new-password"
|
||||
class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:text-white">
|
||||
{% if form.password2.errors %}
|
||||
<p class="mt-1 text-sm text-red-600 dark:text-red-400">{{ form.password2.errors }}</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% if redirect_field_value %}
|
||||
<input type="hidden" name="{{ redirect_field_name }}" value="{{ redirect_field_value }}" />
|
||||
{% endif %}
|
||||
|
||||
<div class="mt-6">
|
||||
<button type="submit"
|
||||
class="w-full inline-flex justify-center items-center px-4 py-3 border border-transparent text-base font-medium rounded-md text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500">
|
||||
<i class="fas fa-user-plus mr-2"></i>
|
||||
{% trans "Create Account" %}
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div class="mt-6 text-center text-sm">
|
||||
<p class="text-gray-600 dark:text-gray-400">
|
||||
{% trans "Already have an account?" %}
|
||||
<a href="{% url 'account_login' %}"
|
||||
class="font-medium text-blue-600 hover:text-blue-500 dark:text-blue-400 focus:outline-none focus:underline"
|
||||
onkeydown="if(event.key === 'Enter') { this.click(); }">
|
||||
{% trans "Sign in" %}
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
19
templates/accounts/email/password_changed.html
Normal file
19
templates/accounts/email/password_changed.html
Normal file
@@ -0,0 +1,19 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Password Changed - ThrillWiki</title>
|
||||
</head>
|
||||
<body>
|
||||
<div style="max-width: 600px; margin: 0 auto; padding: 20px;">
|
||||
<h1 style="color: #2b3a4a;">Password Changed</h1>
|
||||
|
||||
<p>Hi {{ user.username }},</p>
|
||||
|
||||
<p>Your password has been successfully changed on ThrillWiki.</p>
|
||||
|
||||
<p>If you did not make this change, please contact us immediately.</p>
|
||||
|
||||
<p>Best regards,<br>The ThrillWiki Team</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
47
templates/accounts/email/password_reset.html
Normal file
47
templates/accounts/email/password_reset.html
Normal file
@@ -0,0 +1,47 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Reset Your Password</title>
|
||||
<style>
|
||||
body {
|
||||
font-family: Arial, sans-serif;
|
||||
line-height: 1.6;
|
||||
color: #333;
|
||||
max-width: 600px;
|
||||
margin: 0 auto;
|
||||
padding: 20px;
|
||||
}
|
||||
.button {
|
||||
display: inline-block;
|
||||
padding: 10px 20px;
|
||||
background-color: #007bff;
|
||||
color: white;
|
||||
text-decoration: none;
|
||||
border-radius: 5px;
|
||||
margin: 20px 0;
|
||||
}
|
||||
.footer {
|
||||
margin-top: 30px;
|
||||
padding-top: 20px;
|
||||
border-top: 1px solid #eee;
|
||||
font-size: 0.9em;
|
||||
color: #666;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h2>Reset Your Password</h2>
|
||||
<p>Hello {{ user.get_display_name }},</p>
|
||||
<p>We received a request to reset your password. Click the button below to set a new password:</p>
|
||||
<p>
|
||||
<a href="{{ reset_url }}" class="button">Reset Password</a>
|
||||
</p>
|
||||
<p>This link will expire in 24 hours for security reasons.</p>
|
||||
<p>If you didn't request this password reset, you can safely ignore this email. Your password will remain unchanged.</p>
|
||||
<div class="footer">
|
||||
<p>Best regards,<br>ThrillWiki Team</p>
|
||||
<p>If you're having trouble clicking the button, copy and paste this URL into your browser:<br>
|
||||
{{ reset_url }}</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
41
templates/accounts/email/password_reset_complete.html
Normal file
41
templates/accounts/email/password_reset_complete.html
Normal file
@@ -0,0 +1,41 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Password Reset Complete</title>
|
||||
<style>
|
||||
body {
|
||||
font-family: Arial, sans-serif;
|
||||
line-height: 1.6;
|
||||
color: #333;
|
||||
max-width: 600px;
|
||||
margin: 0 auto;
|
||||
padding: 20px;
|
||||
}
|
||||
.success {
|
||||
color: #28a745;
|
||||
font-weight: bold;
|
||||
}
|
||||
.warning {
|
||||
color: #dc3545;
|
||||
font-weight: bold;
|
||||
}
|
||||
.footer {
|
||||
margin-top: 30px;
|
||||
padding-top: 20px;
|
||||
border-top: 1px solid #eee;
|
||||
font-size: 0.9em;
|
||||
color: #666;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h2>Password Reset Complete</h2>
|
||||
<p>Hello {{ user.get_display_name }},</p>
|
||||
<p class="success">Your password has been successfully reset.</p>
|
||||
<p>You can now log in to your account with your new password.</p>
|
||||
<p class="warning">If you did not make this change, please contact us immediately as your account may have been compromised.</p>
|
||||
<div class="footer">
|
||||
<p>Best regards,<br>ThrillWiki Team</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
51
templates/accounts/email/verify_email_change.html
Normal file
51
templates/accounts/email/verify_email_change.html
Normal file
@@ -0,0 +1,51 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Verify Your New Email Address</title>
|
||||
<style>
|
||||
body {
|
||||
font-family: Arial, sans-serif;
|
||||
line-height: 1.6;
|
||||
color: #333;
|
||||
max-width: 600px;
|
||||
margin: 0 auto;
|
||||
padding: 20px;
|
||||
}
|
||||
.button {
|
||||
display: inline-block;
|
||||
padding: 10px 20px;
|
||||
background-color: #007bff;
|
||||
color: white;
|
||||
text-decoration: none;
|
||||
border-radius: 5px;
|
||||
margin: 20px 0;
|
||||
}
|
||||
.footer {
|
||||
margin-top: 30px;
|
||||
padding-top: 20px;
|
||||
border-top: 1px solid #eee;
|
||||
font-size: 0.9em;
|
||||
color: #666;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h2>Hello {{ user.username }},</h2>
|
||||
|
||||
<p>We received a request to change your email address on ThrillWiki. To complete this change, please click the button below:</p>
|
||||
|
||||
<a href="{{ verification_url }}" class="button">Verify Email Address</a>
|
||||
|
||||
<p>If the button doesn't work, you can copy and paste this link into your browser:</p>
|
||||
<p>{{ verification_url }}</p>
|
||||
|
||||
<p>This link will expire in 24 hours for security reasons.</p>
|
||||
|
||||
<p>If you did not request this change, please ignore this email or contact support if you have concerns.</p>
|
||||
|
||||
<div class="footer">
|
||||
<p>Best regards,<br>The ThrillWiki Team</p>
|
||||
<p>This is an automated message, please do not reply to this email.</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
33
templates/accounts/email_required.html
Normal file
33
templates/accounts/email_required.html
Normal file
@@ -0,0 +1,33 @@
|
||||
{% extends "base/base.html" %}
|
||||
|
||||
{% block title %}Email Required{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="container mx-auto px-4 py-16">
|
||||
<div class="max-w-md mx-auto bg-white rounded-lg shadow-md p-8">
|
||||
<h1 class="text-2xl font-bold mb-6">Email Required</h1>
|
||||
|
||||
{% if error %}
|
||||
<div class="bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded mb-4" role="alert">
|
||||
<p>{{ error }}</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<p class="mb-6">Please provide your email address to complete the registration process.</p>
|
||||
|
||||
<form method="post" class="space-y-4">
|
||||
{% csrf_token %}
|
||||
<div>
|
||||
<label for="email" class="block text-sm font-medium text-gray-700">Email Address</label>
|
||||
<input type="email" name="email" id="email" required
|
||||
class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500">
|
||||
</div>
|
||||
|
||||
<button type="submit"
|
||||
class="w-full bg-blue-600 text-white py-2 px-4 rounded hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2">
|
||||
Submit
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
147
templates/accounts/profile.html
Normal file
147
templates/accounts/profile.html
Normal file
@@ -0,0 +1,147 @@
|
||||
{% extends 'base/base.html' %}
|
||||
{% load static %}
|
||||
|
||||
{% block title %}{{ profile_user.username }}'s Profile - ThrillWiki{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="container mx-auto px-4">
|
||||
<!-- Profile Header -->
|
||||
<div class="bg-white dark:bg-gray-800 shadow rounded-lg overflow-hidden">
|
||||
<div class="p-6">
|
||||
<div class="flex items-center">
|
||||
<img src="{{ profile_user.profile.avatar.url|default:'/static/images/default-avatar.png' }}"
|
||||
alt="{{ profile_user.username }}"
|
||||
class="w-24 h-24 rounded-full object-cover">
|
||||
<div class="ml-6">
|
||||
<h1 class="text-2xl font-bold">
|
||||
{{ profile_user.profile.display_name|default:profile_user.username }}
|
||||
</h1>
|
||||
{% if profile_user.profile.pronouns %}
|
||||
<p class="text-gray-600 dark:text-gray-400">{{ profile_user.profile.pronouns }}</p>
|
||||
{% endif %}
|
||||
<div class="mt-2">
|
||||
{% if profile_user.role != 'USER' %}
|
||||
<span class="role-badge role-{{ profile_user.role|lower }}">
|
||||
{{ profile_user.get_role_display }}
|
||||
</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if profile_user.profile.bio %}
|
||||
<div class="mt-6">
|
||||
<h2 class="text-lg font-semibold mb-2">About Me</h2>
|
||||
<p class="text-gray-600 dark:text-gray-400">{{ profile_user.profile.bio }}</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<!-- Social Links -->
|
||||
{% if profile_user.profile.twitter or profile_user.profile.instagram or profile_user.profile.youtube or profile_user.profile.discord %}
|
||||
<div class="mt-4 flex space-x-4">
|
||||
{% if profile_user.profile.twitter %}
|
||||
<a href="{{ profile_user.profile.twitter }}" target="_blank" rel="noopener noreferrer"
|
||||
class="text-gray-600 dark:text-gray-400 hover:text-blue-500">
|
||||
<i class="material-icons">link</i> Twitter
|
||||
</a>
|
||||
{% endif %}
|
||||
{% if profile_user.profile.instagram %}
|
||||
<a href="{{ profile_user.profile.instagram }}" target="_blank" rel="noopener noreferrer"
|
||||
class="text-gray-600 dark:text-gray-400 hover:text-blue-500">
|
||||
<i class="material-icons">link</i> Instagram
|
||||
</a>
|
||||
{% endif %}
|
||||
{% if profile_user.profile.youtube %}
|
||||
<a href="{{ profile_user.profile.youtube }}" target="_blank" rel="noopener noreferrer"
|
||||
class="text-gray-600 dark:text-gray-400 hover:text-blue-500">
|
||||
<i class="material-icons">link</i> YouTube
|
||||
</a>
|
||||
{% endif %}
|
||||
{% if profile_user.profile.discord %}
|
||||
<span class="text-gray-600 dark:text-gray-400">
|
||||
<i class="material-icons">discord</i> {{ profile_user.profile.discord }}
|
||||
</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Statistics -->
|
||||
<div class="grid grid-cols-1 md:grid-cols-4 gap-4 mt-6">
|
||||
<div class="card">
|
||||
<div class="card-body text-center">
|
||||
<div class="stat-value">{{ profile_user.profile.coaster_credits }}</div>
|
||||
<div class="stat-label">Coaster Credits</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-body text-center">
|
||||
<div class="stat-value">{{ profile_user.profile.dark_ride_credits }}</div>
|
||||
<div class="stat-label">Dark Ride Credits</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-body text-center">
|
||||
<div class="stat-value">{{ profile_user.profile.flat_ride_credits }}</div>
|
||||
<div class="stat-label">Flat Ride Credits</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-body text-center">
|
||||
<div class="stat-value">{{ profile_user.profile.water_ride_credits }}</div>
|
||||
<div class="stat-label">Water Ride Credits</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Recent Activity -->
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-6 mt-6">
|
||||
<!-- Recent Reviews -->
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h2 class="text-xl font-semibold">Recent Reviews</h2>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{% for review in recent_reviews %}
|
||||
<div class="mb-4 last:mb-0">
|
||||
<div class="flex justify-between items-start">
|
||||
<div>
|
||||
<h3 class="font-medium">{{ review.title }}</h3>
|
||||
<p class="text-sm text-gray-600 dark:text-gray-400">
|
||||
{{ review.content_object.name }}
|
||||
</p>
|
||||
</div>
|
||||
<div class="flex items-center">
|
||||
<span class="text-yellow-400 mr-1">★</span>
|
||||
<span>{{ review.rating }}/10</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% empty %}
|
||||
<p class="text-gray-500 dark:text-gray-400">No reviews yet.</p>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Top Lists -->
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h2 class="text-xl font-semibold">Top Lists</h2>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{% for list in top_lists %}
|
||||
<div class="mb-4 last:mb-0">
|
||||
<h3 class="font-medium">{{ list.title }}</h3>
|
||||
<p class="text-sm text-gray-600 dark:text-gray-400">
|
||||
{{ list.get_category_display }}
|
||||
</p>
|
||||
</div>
|
||||
{% empty %}
|
||||
<p class="text-gray-500 dark:text-gray-400">No top lists created yet.</p>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
179
templates/base/base.html
Normal file
179
templates/base/base.html
Normal file
@@ -0,0 +1,179 @@
|
||||
{% load static %}
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" x-data="{ darkMode: localStorage.getItem('darkMode') === 'true' }" :class="{ 'dark': darkMode }">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>{% block title %}ThrillWiki{% endblock %}</title>
|
||||
|
||||
<!-- Tailwind CSS -->
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
<script>
|
||||
tailwind.config = {
|
||||
darkMode: 'class',
|
||||
theme: {
|
||||
extend: {
|
||||
colors: {
|
||||
primary: '#2563eb',
|
||||
secondary: '#4b5563'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<!-- AlpineJS -->
|
||||
<script defer src="https://unpkg.com/alpinejs@3.x.x/dist/cdn.min.js"></script>
|
||||
|
||||
<!-- Custom CSS -->
|
||||
<link rel="stylesheet" href="{% static 'css/styles.css' %}">
|
||||
|
||||
<!-- Font Awesome -->
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
|
||||
|
||||
{% block extra_head %}{% endblock %}
|
||||
</head>
|
||||
<body class="bg-gray-100 dark:bg-gray-900 min-h-screen flex flex-col" x-data="{ mobileMenuOpen: false, userMenuOpen: false }">
|
||||
<!-- Header -->
|
||||
<header class="bg-white dark:bg-gray-800 shadow-sm">
|
||||
<nav class="container mx-auto px-4 py-4">
|
||||
<div class="flex justify-between items-center">
|
||||
<!-- Logo -->
|
||||
<div class="flex items-center">
|
||||
<a href="{% url 'home' %}" class="text-xl font-bold text-blue-600 dark:text-blue-400">ThrillWiki</a>
|
||||
</div>
|
||||
|
||||
<!-- Desktop Navigation -->
|
||||
<div class="hidden md:flex items-center space-x-4">
|
||||
<a href="{% url 'parks:park_list' %}" class="nav-link">Parks</a>
|
||||
<a href="{% url 'rides:ride_list' %}" class="nav-link">Rides</a>
|
||||
</div>
|
||||
|
||||
<!-- Search Bar -->
|
||||
<div class="hidden md:flex flex-1 max-w-md mx-4">
|
||||
<form action="{% url 'search' %}" method="get" class="w-full">
|
||||
<div class="relative">
|
||||
<input type="text" name="q" placeholder="Search parks and rides..."
|
||||
class="w-full px-4 py-2 rounded-lg border border-gray-300 dark:border-gray-600
|
||||
bg-white dark:bg-gray-700 text-gray-900 dark:text-white">
|
||||
<button type="submit" class="absolute right-3 top-2.5">
|
||||
<i class="fas fa-search text-gray-400"></i>
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<!-- Right Side Menu -->
|
||||
<div class="flex items-center space-x-4">
|
||||
<!-- Theme Toggle -->
|
||||
<button @click="darkMode = !darkMode; localStorage.setItem('darkMode', darkMode)"
|
||||
class="p-2 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-700">
|
||||
<i class="fas" :class="darkMode ? 'fa-sun' : 'fa-moon'"></i>
|
||||
</button>
|
||||
|
||||
<!-- User Menu -->
|
||||
{% if user.is_authenticated %}
|
||||
<div class="relative" x-data="{ open: false }">
|
||||
<button @click="open = !open" class="flex items-center space-x-2">
|
||||
{% if user.profile.avatar %}
|
||||
<img src="{{ user.profile.avatar.url }}" alt="{{ user.username }}"
|
||||
class="h-8 w-8 rounded-full">
|
||||
{% else %}
|
||||
<div class="h-8 w-8 rounded-full bg-blue-500 flex items-center justify-center text-white">
|
||||
{{ user.username.0|upper }}
|
||||
</div>
|
||||
{% endif %}
|
||||
</button>
|
||||
|
||||
<!-- Dropdown Menu -->
|
||||
<div x-show="open" @click.away="open = false"
|
||||
class="absolute right-0 mt-2 w-48 rounded-md shadow-lg bg-white dark:bg-gray-800 ring-1 ring-black ring-opacity-5">
|
||||
<div class="py-1">
|
||||
<a href="{% url 'user_profile' user.username %}"
|
||||
class="menu-item">Profile</a>
|
||||
<a href="{% url 'settings' %}"
|
||||
class="menu-item">Settings</a>
|
||||
{% if user.is_staff or user.is_superuser %}
|
||||
<a href="{% url 'admin:index' %}"
|
||||
class="menu-item">Admin</a>
|
||||
{% endif %}
|
||||
<form method="post" action="{% url 'account_logout' %}">
|
||||
{% csrf_token %}
|
||||
<button type="submit" class="menu-item w-full text-left">
|
||||
Logout
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="flex space-x-2">
|
||||
<a href="{% url 'account_login' %}" class="btn-secondary">
|
||||
<i class="fas fa-sign-in-alt mr-2"></i>
|
||||
Login
|
||||
</a>
|
||||
<a href="{% url 'account_signup' %}" class="btn-primary">
|
||||
<i class="fas fa-user-plus mr-2"></i>
|
||||
Register
|
||||
</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<!-- Mobile Menu Button -->
|
||||
<button @click="mobileMenuOpen = !mobileMenuOpen"
|
||||
class="md:hidden p-2 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-700">
|
||||
<i class="fas fa-bars"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Mobile Menu -->
|
||||
<div x-show="mobileMenuOpen" @click.away="mobileMenuOpen = false"
|
||||
class="md:hidden mt-4 py-2 bg-white dark:bg-gray-800">
|
||||
<a href="{% url 'parks:park_list' %}" class="mobile-nav-link">Parks</a>
|
||||
<a href="{% url 'rides:ride_list' %}" class="mobile-nav-link">Rides</a>
|
||||
<form action="{% url 'search' %}" method="get" class="px-4 py-2">
|
||||
<input type="text" name="q" placeholder="Search parks and rides..."
|
||||
class="w-full px-4 py-2 rounded-lg border border-gray-300 dark:border-gray-600
|
||||
bg-white dark:bg-gray-700 text-gray-900 dark:text-white">
|
||||
</form>
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
<!-- Flash Messages -->
|
||||
{% if messages %}
|
||||
<div class="container mx-auto px-4 mt-4">
|
||||
{% for message in messages %}
|
||||
<div class="alert {% if message.tags %}alert-{{ message.tags }}{% endif %}">
|
||||
{{ message }}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<!-- Main Content -->
|
||||
<main class="flex-grow container mx-auto px-4 py-8">
|
||||
{% block content %}{% endblock %}
|
||||
</main>
|
||||
|
||||
<!-- Footer -->
|
||||
<footer class="bg-white dark:bg-gray-800 mt-auto">
|
||||
<div class="container mx-auto px-4 py-6">
|
||||
<div class="flex justify-between items-center">
|
||||
<div class="text-gray-600 dark:text-gray-400">
|
||||
<p>© {% now "Y" %} ThrillWiki. All rights reserved.</p>
|
||||
</div>
|
||||
<div class="space-x-4">
|
||||
<a href="{% url 'terms' %}" class="text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white">Terms</a>
|
||||
<a href="{% url 'privacy' %}" class="text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white">Privacy</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<!-- Custom JavaScript -->
|
||||
<script src="{% static 'js/main.js' %}"></script>
|
||||
{% block extra_scripts %}{% endblock %}
|
||||
</body>
|
||||
</html>
|
||||
111
templates/companies/company_detail.html
Normal file
111
templates/companies/company_detail.html
Normal file
@@ -0,0 +1,111 @@
|
||||
{% extends 'base/base.html' %}
|
||||
{% load static %}
|
||||
|
||||
{% block title %}{{ company.name }} - ThrillWiki{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="container mx-auto px-4">
|
||||
<!-- Company Header -->
|
||||
<div class="bg-white dark:bg-gray-800 shadow rounded-lg p-6 mb-6">
|
||||
<div class="flex flex-col md:flex-row justify-between items-start md:items-center">
|
||||
<div>
|
||||
<h1 class="text-3xl font-bold text-gray-900 dark:text-white mb-2">{{ company.name }}</h1>
|
||||
{% if company.headquarters %}
|
||||
<p class="text-gray-600 dark:text-gray-400">
|
||||
<i class="fas fa-map-marker-alt mr-2"></i>{{ company.headquarters }}
|
||||
</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% if company.website %}
|
||||
<a href="{{ company.website }}" target="_blank" rel="noopener noreferrer"
|
||||
class="btn-secondary mt-4 md:mt-0">
|
||||
<i class="fas fa-external-link-alt mr-2"></i>Visit Website
|
||||
</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% if company.description %}
|
||||
<div class="mt-6 prose dark:prose-invert max-w-none">
|
||||
{{ company.description|linebreaks }}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<!-- Company Stats -->
|
||||
<div class="grid grid-cols-1 md:grid-cols-3 gap-6 mb-6">
|
||||
<div class="bg-white dark:bg-gray-800 shadow rounded-lg p-6 text-center">
|
||||
<div class="text-3xl font-bold text-blue-600 dark:text-blue-400">
|
||||
{{ parks.count }}
|
||||
</div>
|
||||
<div class="text-gray-600 dark:text-gray-400 mt-1">Theme Parks</div>
|
||||
</div>
|
||||
|
||||
<div class="bg-white dark:bg-gray-800 shadow rounded-lg p-6 text-center">
|
||||
<div class="text-3xl font-bold text-blue-600 dark:text-blue-400">
|
||||
{{ parks|length }}
|
||||
</div>
|
||||
<div class="text-gray-600 dark:text-gray-400 mt-1">Active Parks</div>
|
||||
</div>
|
||||
|
||||
<div class="bg-white dark:bg-gray-800 shadow rounded-lg p-6 text-center">
|
||||
<div class="text-3xl font-bold text-blue-600 dark:text-blue-400">
|
||||
{% with total_rides=0 %}
|
||||
{% for park in parks %}
|
||||
{% with total_rides=total_rides|add:park.rides.count %}{% endwith %}
|
||||
{% endfor %}
|
||||
{{ total_rides }}
|
||||
{% endwith %}
|
||||
</div>
|
||||
<div class="text-gray-600 dark:text-gray-400 mt-1">Total Attractions</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Parks List -->
|
||||
<div class="bg-white dark:bg-gray-800 shadow rounded-lg p-6">
|
||||
<h2 class="text-2xl font-bold text-gray-900 dark:text-white mb-6">Theme Parks</h2>
|
||||
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
|
||||
{% for park in parks %}
|
||||
<div class="bg-gray-50 dark:bg-gray-700 rounded-lg overflow-hidden">
|
||||
{% if park.photos.exists %}
|
||||
<img src="{{ park.photos.first.image.url }}"
|
||||
alt="{{ park.name }}"
|
||||
class="w-full h-48 object-cover">
|
||||
{% else %}
|
||||
<div class="w-full h-48 bg-gray-200 dark:bg-gray-600 flex items-center justify-center">
|
||||
<span class="text-gray-400">No image available</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="p-4">
|
||||
<h3 class="text-lg font-semibold mb-2">
|
||||
<a href="{% url 'parks:park_detail' park.slug %}"
|
||||
class="text-blue-600 dark:text-blue-400 hover:underline">
|
||||
{{ park.name }}
|
||||
</a>
|
||||
</h3>
|
||||
<p class="text-gray-600 dark:text-gray-400 mb-2">{{ park.location }}</p>
|
||||
<div class="flex justify-between items-center">
|
||||
<span class="text-sm text-gray-500 dark:text-gray-400">
|
||||
{{ park.rides.count }} attractions
|
||||
</span>
|
||||
{% if park.average_rating %}
|
||||
<div class="flex items-center">
|
||||
<span class="text-yellow-400 mr-1">★</span>
|
||||
<span class="text-gray-600 dark:text-gray-400">
|
||||
{{ park.average_rating|floatformat:1 }}/10
|
||||
</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% empty %}
|
||||
<div class="col-span-full text-center py-8">
|
||||
<p class="text-gray-500 dark:text-gray-400">No parks found for this company.</p>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
83
templates/companies/company_list.html
Normal file
83
templates/companies/company_list.html
Normal file
@@ -0,0 +1,83 @@
|
||||
{% extends 'base/base.html' %}
|
||||
{% load static %}
|
||||
|
||||
{% block title %}Companies - ThrillWiki{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="container mx-auto px-4">
|
||||
<div class="flex justify-between items-center mb-6">
|
||||
<h1 class="text-3xl font-bold text-gray-900 dark:text-white">Theme Park Companies</h1>
|
||||
</div>
|
||||
|
||||
<!-- Filters -->
|
||||
<div class="bg-white dark:bg-gray-800 shadow rounded-lg p-4 mb-6">
|
||||
<form method="get" class="grid grid-cols-1 md:grid-cols-3 gap-4">
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1">Search</label>
|
||||
<input type="text" name="search" value="{{ request.GET.search }}"
|
||||
class="form-input w-full" placeholder="Search companies...">
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1">Country</label>
|
||||
<input type="text" name="country" value="{{ request.GET.country }}"
|
||||
class="form-input w-full" placeholder="Filter by country...">
|
||||
</div>
|
||||
<div class="flex items-end">
|
||||
<button type="submit" class="btn-primary w-full">Apply Filters</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<!-- Companies Grid -->
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
|
||||
{% for company in companies %}
|
||||
<div class="bg-white dark:bg-gray-800 shadow rounded-lg overflow-hidden">
|
||||
<div class="p-4">
|
||||
<h3 class="text-xl font-semibold mb-2">
|
||||
<a href="{% url 'companies:company_detail' company.slug %}"
|
||||
class="text-blue-600 dark:text-blue-400 hover:underline">
|
||||
{{ company.name }}
|
||||
</a>
|
||||
</h3>
|
||||
{% if company.headquarters %}
|
||||
<p class="text-gray-600 dark:text-gray-400 mb-2">{{ company.headquarters }}</p>
|
||||
{% endif %}
|
||||
<div class="text-sm text-gray-500 dark:text-gray-400">
|
||||
{{ company.parks.count }} parks owned
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% empty %}
|
||||
<div class="col-span-full text-center py-8">
|
||||
<p class="text-gray-500 dark:text-gray-400">No companies found matching your criteria.</p>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
<!-- Pagination -->
|
||||
{% if is_paginated %}
|
||||
<div class="flex justify-center mt-6">
|
||||
<nav class="inline-flex rounded-md shadow">
|
||||
{% if page_obj.has_previous %}
|
||||
<a href="?page={{ page_obj.previous_page_number }}{% if request.GET.search %}&search={{ request.GET.search }}{% endif %}{% if request.GET.country %}&country={{ request.GET.country }}{% endif %}"
|
||||
class="pagination-link">Previous</a>
|
||||
{% endif %}
|
||||
|
||||
{% for num in page_obj.paginator.page_range %}
|
||||
{% if page_obj.number == num %}
|
||||
<span class="pagination-current">{{ num }}</span>
|
||||
{% elif num > page_obj.number|add:'-3' and num < page_obj.number|add:'3' %}
|
||||
<a href="?page={{ num }}{% if request.GET.search %}&search={{ request.GET.search }}{% endif %}{% if request.GET.country %}&country={{ request.GET.country }}{% endif %}"
|
||||
class="pagination-link">{{ num }}</a>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
{% if page_obj.has_next %}
|
||||
<a href="?page={{ page_obj.next_page_number }}{% if request.GET.search %}&search={{ request.GET.search }}{% endif %}{% if request.GET.country %}&country={{ request.GET.country }}{% endif %}"
|
||||
class="pagination-link">Next</a>
|
||||
{% endif %}
|
||||
</nav>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
125
templates/companies/manufacturer_detail.html
Normal file
125
templates/companies/manufacturer_detail.html
Normal file
@@ -0,0 +1,125 @@
|
||||
{% extends 'base/base.html' %}
|
||||
{% load static %}
|
||||
|
||||
{% block title %}{{ manufacturer.name }} - ThrillWiki{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="container mx-auto px-4">
|
||||
<!-- Manufacturer Header -->
|
||||
<div class="bg-white dark:bg-gray-800 shadow rounded-lg p-6 mb-6">
|
||||
<div class="flex flex-col md:flex-row justify-between items-start md:items-center">
|
||||
<div>
|
||||
<h1 class="text-3xl font-bold text-gray-900 dark:text-white mb-2">{{ manufacturer.name }}</h1>
|
||||
{% if manufacturer.headquarters %}
|
||||
<p class="text-gray-600 dark:text-gray-400">
|
||||
<i class="fas fa-map-marker-alt mr-2"></i>{{ manufacturer.headquarters }}
|
||||
</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% if manufacturer.website %}
|
||||
<a href="{{ manufacturer.website }}" target="_blank" rel="noopener noreferrer"
|
||||
class="btn-secondary mt-4 md:mt-0">
|
||||
<i class="fas fa-external-link-alt mr-2"></i>Visit Website
|
||||
</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% if manufacturer.description %}
|
||||
<div class="mt-6 prose dark:prose-invert max-w-none">
|
||||
{{ manufacturer.description|linebreaks }}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<!-- Manufacturer Stats -->
|
||||
<div class="grid grid-cols-1 md:grid-cols-3 gap-6 mb-6">
|
||||
<div class="bg-white dark:bg-gray-800 shadow rounded-lg p-6 text-center">
|
||||
<div class="text-3xl font-bold text-blue-600 dark:text-blue-400">
|
||||
{{ rides.count }}
|
||||
</div>
|
||||
<div class="text-gray-600 dark:text-gray-400 mt-1">Total Rides</div>
|
||||
</div>
|
||||
|
||||
<div class="bg-white dark:bg-gray-800 shadow rounded-lg p-6 text-center">
|
||||
<div class="text-3xl font-bold text-blue-600 dark:text-blue-400">
|
||||
{{ rides|filter:"type='ROLLER_COASTER'"|length }}
|
||||
</div>
|
||||
<div class="text-gray-600 dark:text-gray-400 mt-1">Roller Coasters</div>
|
||||
</div>
|
||||
|
||||
<div class="bg-white dark:bg-gray-800 shadow rounded-lg p-6 text-center">
|
||||
<div class="text-3xl font-bold text-blue-600 dark:text-blue-400">
|
||||
{{ rides|regroup:"park"|length }}
|
||||
</div>
|
||||
<div class="text-gray-600 dark:text-gray-400 mt-1">Parks with Rides</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Rides List -->
|
||||
<div class="bg-white dark:bg-gray-800 shadow rounded-lg p-6">
|
||||
<h2 class="text-2xl font-bold text-gray-900 dark:text-white mb-6">Rides</h2>
|
||||
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
|
||||
{% for ride in rides %}
|
||||
<div class="bg-gray-50 dark:bg-gray-700 rounded-lg overflow-hidden">
|
||||
{% if ride.photos.exists %}
|
||||
<img src="{{ ride.photos.first.image.url }}"
|
||||
alt="{{ ride.name }}"
|
||||
class="w-full h-48 object-cover">
|
||||
{% else %}
|
||||
<div class="w-full h-48 bg-gray-200 dark:bg-gray-600 flex items-center justify-center">
|
||||
<span class="text-gray-400">No image available</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="p-4">
|
||||
<h3 class="text-lg font-semibold mb-2">
|
||||
<a href="{% url 'rides:ride_detail' ride.park.slug ride.slug %}"
|
||||
class="text-blue-600 dark:text-blue-400 hover:underline">
|
||||
{{ ride.name }}
|
||||
</a>
|
||||
</h3>
|
||||
<p class="text-gray-600 dark:text-gray-400 mb-2">
|
||||
at <a href="{% url 'parks:park_detail' ride.park.slug %}"
|
||||
class="hover:underline">{{ ride.park.name }}</a>
|
||||
</p>
|
||||
|
||||
{% if ride.coaster_stats %}
|
||||
<div class="mt-2 space-y-1">
|
||||
{% if ride.coaster_stats.height %}
|
||||
<div class="text-sm text-gray-500 dark:text-gray-400">
|
||||
Height: {{ ride.coaster_stats.height }}ft
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if ride.coaster_stats.speed %}
|
||||
<div class="text-sm text-gray-500 dark:text-gray-400">
|
||||
Speed: {{ ride.coaster_stats.speed }}mph
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if ride.coaster_stats.length %}
|
||||
<div class="text-sm text-gray-500 dark:text-gray-400">
|
||||
Length: {{ ride.coaster_stats.length }}ft
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if ride.average_rating %}
|
||||
<div class="mt-2 flex items-center">
|
||||
<span class="text-yellow-400 mr-1">★</span>
|
||||
<span class="text-gray-600 dark:text-gray-400">
|
||||
{{ ride.average_rating|floatformat:1 }}/10
|
||||
</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% empty %}
|
||||
<div class="col-span-full text-center py-8">
|
||||
<p class="text-gray-500 dark:text-gray-400">No rides found for this manufacturer.</p>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
107
templates/companies/manufacturer_list.html
Normal file
107
templates/companies/manufacturer_list.html
Normal file
@@ -0,0 +1,107 @@
|
||||
{% extends 'base/base.html' %}
|
||||
{% load static %}
|
||||
|
||||
{% block title %}Ride Manufacturers - ThrillWiki{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="container mx-auto px-4">
|
||||
<div class="flex justify-between items-center mb-6">
|
||||
<h1 class="text-3xl font-bold text-gray-900 dark:text-white">Ride Manufacturers</h1>
|
||||
</div>
|
||||
|
||||
<!-- Stats -->
|
||||
<div class="grid grid-cols-1 md:grid-cols-3 gap-6 mb-6">
|
||||
<div class="bg-white dark:bg-gray-800 shadow rounded-lg p-6 text-center">
|
||||
<div class="text-3xl font-bold text-blue-600 dark:text-blue-400">
|
||||
{{ total_manufacturers }}
|
||||
</div>
|
||||
<div class="text-gray-600 dark:text-gray-400 mt-1">Manufacturers</div>
|
||||
</div>
|
||||
|
||||
<div class="bg-white dark:bg-gray-800 shadow rounded-lg p-6 text-center">
|
||||
<div class="text-3xl font-bold text-blue-600 dark:text-blue-400">
|
||||
{{ total_rides }}
|
||||
</div>
|
||||
<div class="text-gray-600 dark:text-gray-400 mt-1">Total Rides</div>
|
||||
</div>
|
||||
|
||||
<div class="bg-white dark:bg-gray-800 shadow rounded-lg p-6 text-center">
|
||||
<div class="text-3xl font-bold text-blue-600 dark:text-blue-400">
|
||||
{{ total_roller_coasters }}
|
||||
</div>
|
||||
<div class="text-gray-600 dark:text-gray-400 mt-1">Roller Coasters</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Filters -->
|
||||
<div class="bg-white dark:bg-gray-800 shadow rounded-lg p-4 mb-6">
|
||||
<form method="get" class="grid grid-cols-1 md:grid-cols-3 gap-4">
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1">Search</label>
|
||||
<input type="text" name="search" value="{{ request.GET.search }}"
|
||||
class="form-input w-full" placeholder="Search manufacturers...">
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1">Country</label>
|
||||
<input type="text" name="country" value="{{ request.GET.country }}"
|
||||
class="form-input w-full" placeholder="Filter by country...">
|
||||
</div>
|
||||
<div class="flex items-end">
|
||||
<button type="submit" class="btn-primary w-full">Apply Filters</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<!-- Manufacturers Grid -->
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
|
||||
{% for manufacturer in manufacturers %}
|
||||
<div class="bg-white dark:bg-gray-800 shadow rounded-lg overflow-hidden">
|
||||
<div class="p-4">
|
||||
<h3 class="text-xl font-semibold mb-2">
|
||||
<a href="{% url 'companies:manufacturer_detail' manufacturer.slug %}"
|
||||
class="text-blue-600 dark:text-blue-400 hover:underline">
|
||||
{{ manufacturer.name }}
|
||||
</a>
|
||||
</h3>
|
||||
{% if manufacturer.headquarters %}
|
||||
<p class="text-gray-600 dark:text-gray-400 mb-2">{{ manufacturer.headquarters }}</p>
|
||||
{% endif %}
|
||||
<div class="text-sm text-gray-500 dark:text-gray-400">
|
||||
{{ manufacturer.rides.count }} rides manufactured
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% empty %}
|
||||
<div class="col-span-full text-center py-8">
|
||||
<p class="text-gray-500 dark:text-gray-400">No manufacturers found matching your criteria.</p>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
<!-- Pagination -->
|
||||
{% if is_paginated %}
|
||||
<div class="flex justify-center mt-6">
|
||||
<nav class="inline-flex rounded-md shadow">
|
||||
{% if page_obj.has_previous %}
|
||||
<a href="?page={{ page_obj.previous_page_number }}{% if request.GET.search %}&search={{ request.GET.search }}{% endif %}{% if request.GET.country %}&country={{ request.GET.country }}{% endif %}"
|
||||
class="pagination-link">Previous</a>
|
||||
{% endif %}
|
||||
|
||||
{% for num in page_obj.paginator.page_range %}
|
||||
{% if page_obj.number == num %}
|
||||
<span class="pagination-current">{{ num }}</span>
|
||||
{% elif num > page_obj.number|add:'-3' and num < page_obj.number|add:'3' %}
|
||||
<a href="?page={{ num }}{% if request.GET.search %}&search={{ request.GET.search }}{% endif %}{% if request.GET.country %}&country={{ request.GET.country }}{% endif %}"
|
||||
class="pagination-link">{{ num }}</a>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
{% if page_obj.has_next %}
|
||||
<a href="?page={{ page_obj.next_page_number }}{% if request.GET.search %}&search={{ request.GET.search }}{% endif %}{% if request.GET.country %}&country={{ request.GET.country }}{% endif %}"
|
||||
class="pagination-link">Next</a>
|
||||
{% endif %}
|
||||
</nav>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
116
templates/home.html
Normal file
116
templates/home.html
Normal file
@@ -0,0 +1,116 @@
|
||||
{% extends 'base/base.html' %}
|
||||
{% load static %}
|
||||
|
||||
{% block title %}ThrillWiki - Theme Parks & Attractions Guide{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<!-- Hero Section -->
|
||||
<div class="bg-white dark:bg-gray-800 rounded-lg shadow-lg border border-gray-200 dark:border-gray-700 mb-12">
|
||||
<div class="py-12 px-4 text-center">
|
||||
<h1 class="text-4xl md:text-5xl lg:text-6xl font-bold mb-6 text-gray-900 dark:text-white">
|
||||
Welcome to ThrillWiki
|
||||
</h1>
|
||||
<p class="text-xl md:text-2xl text-gray-600 dark:text-gray-300 mb-8 max-w-3xl mx-auto">
|
||||
Your ultimate guide to theme parks and attractions worldwide
|
||||
</p>
|
||||
<div class="flex flex-wrap justify-center gap-4">
|
||||
<a href="{% url 'parks:park_list' %}"
|
||||
class="btn-primary text-lg px-8 py-3">
|
||||
Explore Parks
|
||||
</a>
|
||||
<a href="{% url 'rides:ride_list' %}"
|
||||
class="btn-secondary text-lg px-8 py-3">
|
||||
View Rides
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Stats Section -->
|
||||
<div class="grid grid-cols-1 md:grid-cols-3 gap-6 mb-12">
|
||||
<!-- Total Parks -->
|
||||
<div class="bg-white dark:bg-gray-800 rounded-lg shadow-lg p-6 text-center transform transition-transform hover:-translate-y-1">
|
||||
<div class="text-4xl font-bold text-blue-600 dark:text-blue-400 mb-2">
|
||||
{{ stats.total_parks }}
|
||||
</div>
|
||||
<div class="text-xl text-gray-600 dark:text-gray-300">
|
||||
Theme Parks
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Total Attractions -->
|
||||
<div class="bg-white dark:bg-gray-800 rounded-lg shadow-lg p-6 text-center transform transition-transform hover:-translate-y-1">
|
||||
<div class="text-4xl font-bold text-blue-600 dark:text-blue-400 mb-2">
|
||||
{{ stats.total_rides }}
|
||||
</div>
|
||||
<div class="text-xl text-gray-600 dark:text-gray-300">
|
||||
Attractions
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Total Roller Coasters -->
|
||||
<div class="bg-white dark:bg-gray-800 rounded-lg shadow-lg p-6 text-center transform transition-transform hover:-translate-y-1">
|
||||
<div class="text-4xl font-bold text-blue-600 dark:text-blue-400 mb-2">
|
||||
{{ stats.total_roller_coasters }}
|
||||
</div>
|
||||
<div class="text-xl text-gray-600 dark:text-gray-300">
|
||||
Roller Coasters
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Featured Content -->
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
|
||||
<!-- Popular Parks -->
|
||||
<div class="bg-white dark:bg-gray-800 rounded-lg shadow-lg p-6">
|
||||
<h2 class="text-2xl font-bold mb-6 text-gray-900 dark:text-white">
|
||||
Popular Parks
|
||||
</h2>
|
||||
{% for park in popular_parks %}
|
||||
<a href="{% url 'parks:park_detail' park.slug %}"
|
||||
class="block mb-4 p-4 rounded-lg transition-all hover:bg-gray-50 dark:hover:bg-gray-700 hover:translate-x-2">
|
||||
<div class="text-lg font-semibold text-blue-600 dark:text-blue-400">
|
||||
{{ park.name }}
|
||||
</div>
|
||||
<div class="text-gray-600 dark:text-gray-300">
|
||||
{{ park.location }}
|
||||
</div>
|
||||
{% if park.average_rating %}
|
||||
<div class="mt-1 flex items-center text-yellow-500">
|
||||
<span class="mr-1">★</span>
|
||||
<span>{{ park.average_rating|floatformat:1 }}/10</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
</a>
|
||||
{% empty %}
|
||||
<p class="text-gray-600 dark:text-gray-400">No popular parks found.</p>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
<!-- Popular Rides -->
|
||||
<div class="bg-white dark:bg-gray-800 rounded-lg shadow-lg p-6">
|
||||
<h2 class="text-2xl font-bold mb-6 text-gray-900 dark:text-white">
|
||||
Popular Rides
|
||||
</h2>
|
||||
{% for ride in popular_rides %}
|
||||
<a href="{% url 'rides:ride_detail' ride.park.slug ride.slug %}"
|
||||
class="block mb-4 p-4 rounded-lg transition-all hover:bg-gray-50 dark:hover:bg-gray-700 hover:translate-x-2">
|
||||
<div class="text-lg font-semibold text-blue-600 dark:text-blue-400">
|
||||
{{ ride.name }}
|
||||
</div>
|
||||
<div class="text-gray-600 dark:text-gray-300">
|
||||
at {{ ride.park.name }}
|
||||
</div>
|
||||
{% if ride.average_rating %}
|
||||
<div class="mt-1 flex items-center text-yellow-500">
|
||||
<span class="mr-1">★</span>
|
||||
<span>{{ ride.average_rating|floatformat:1 }}/10</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
</a>
|
||||
{% empty %}
|
||||
<p class="text-gray-600 dark:text-gray-400">No popular rides found.</p>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
70
templates/pages/privacy.html
Normal file
70
templates/pages/privacy.html
Normal file
@@ -0,0 +1,70 @@
|
||||
{% extends 'base/base.html' %}
|
||||
{% load static %}
|
||||
|
||||
{% block title %}Privacy Policy - ThrillWiki{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="container mx-auto px-4 py-8">
|
||||
<div class="bg-white dark:bg-gray-800 shadow rounded-lg p-6">
|
||||
<h1 class="text-3xl font-bold mb-6">Privacy Policy</h1>
|
||||
|
||||
<div class="prose dark:prose-invert max-w-none">
|
||||
<h2>1. Information We Collect</h2>
|
||||
<p>We collect information that you provide directly to us, including:</p>
|
||||
<ul>
|
||||
<li>Account information (username, email, password)</li>
|
||||
<li>Profile information (name, avatar, location)</li>
|
||||
<li>Content you post (reviews, photos, comments)</li>
|
||||
<li>Communications with us</li>
|
||||
</ul>
|
||||
|
||||
<h2>2. How We Use Your Information</h2>
|
||||
<p>We use the information we collect to:</p>
|
||||
<ul>
|
||||
<li>Provide and maintain our services</li>
|
||||
<li>Process your transactions</li>
|
||||
<li>Send you technical notices and updates</li>
|
||||
<li>Respond to your comments and questions</li>
|
||||
<li>Understand how users interact with our service</li>
|
||||
</ul>
|
||||
|
||||
<h2>3. Information Sharing</h2>
|
||||
<p>We do not sell your personal information. We may share your information:</p>
|
||||
<ul>
|
||||
<li>With your consent</li>
|
||||
<li>To comply with legal obligations</li>
|
||||
<li>To protect our rights and safety</li>
|
||||
<li>With service providers who assist in our operations</li>
|
||||
</ul>
|
||||
|
||||
<h2>4. Data Security</h2>
|
||||
<p>We implement appropriate security measures to protect your personal information from unauthorized access, alteration, or destruction.</p>
|
||||
|
||||
<h2>5. Your Rights</h2>
|
||||
<p>You have the right to:</p>
|
||||
<ul>
|
||||
<li>Access your personal information</li>
|
||||
<li>Correct inaccurate information</li>
|
||||
<li>Request deletion of your information</li>
|
||||
<li>Object to processing of your information</li>
|
||||
<li>Export your data</li>
|
||||
</ul>
|
||||
|
||||
<h2>6. Cookies</h2>
|
||||
<p>We use cookies and similar technologies to:</p>
|
||||
<ul>
|
||||
<li>Keep you logged in</li>
|
||||
<li>Remember your preferences</li>
|
||||
<li>Understand how you use our service</li>
|
||||
<li>Improve our service</li>
|
||||
</ul>
|
||||
|
||||
<h2>7. Changes to Privacy Policy</h2>
|
||||
<p>We may update this privacy policy from time to time. We will notify you of any changes by posting the new policy on this page.</p>
|
||||
|
||||
<h2>8. Contact Us</h2>
|
||||
<p>If you have any questions about this privacy policy, please contact us at privacy@thrillwiki.com</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
41
templates/pages/terms.html
Normal file
41
templates/pages/terms.html
Normal file
@@ -0,0 +1,41 @@
|
||||
{% extends 'base/base.html' %}
|
||||
{% load static %}
|
||||
|
||||
{% block title %}Terms of Service - ThrillWiki{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="container mx-auto px-4 py-8">
|
||||
<div class="bg-white dark:bg-gray-800 shadow rounded-lg p-6">
|
||||
<h1 class="text-3xl font-bold mb-6">Terms of Service</h1>
|
||||
|
||||
<div class="prose dark:prose-invert max-w-none">
|
||||
<h2>1. Acceptance of Terms</h2>
|
||||
<p>By accessing and using ThrillWiki, you accept and agree to be bound by the terms and provision of this agreement.</p>
|
||||
|
||||
<h2>2. User Content</h2>
|
||||
<p>Users are responsible for the content they submit to ThrillWiki. Content must be accurate, legal, and not infringe on any third party's rights.</p>
|
||||
|
||||
<h2>3. Account Responsibilities</h2>
|
||||
<p>You are responsible for maintaining the confidentiality of your account and password. You agree to accept responsibility for all activities that occur under your account.</p>
|
||||
|
||||
<h2>4. Prohibited Activities</h2>
|
||||
<p>Users must not engage in any activity that:</p>
|
||||
<ul>
|
||||
<li>Violates any laws or regulations</li>
|
||||
<li>Infringes on intellectual property rights</li>
|
||||
<li>Harasses or discriminates against others</li>
|
||||
<li>Spreads false or misleading information</li>
|
||||
</ul>
|
||||
|
||||
<h2>5. Content Ownership</h2>
|
||||
<p>Users retain ownership of their content but grant ThrillWiki a license to use, modify, and display the content on the platform.</p>
|
||||
|
||||
<h2>6. Modifications to Service</h2>
|
||||
<p>ThrillWiki reserves the right to modify or discontinue the service at any time without notice.</p>
|
||||
|
||||
<h2>7. Limitation of Liability</h2>
|
||||
<p>ThrillWiki is not liable for any indirect, incidental, special, consequential, or punitive damages.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
211
templates/parks/park_detail.html
Normal file
211
templates/parks/park_detail.html
Normal file
@@ -0,0 +1,211 @@
|
||||
{% extends 'base/base.html' %}
|
||||
{% load static %}
|
||||
|
||||
{% block title %}{{ park.name }} - ThrillWiki{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="container mx-auto px-4">
|
||||
<!-- Park Header -->
|
||||
<div class="bg-white dark:bg-gray-800 shadow rounded-lg p-6 mb-6">
|
||||
<div class="flex flex-col md:flex-row justify-between items-start md:items-center">
|
||||
<div>
|
||||
<h1 class="text-3xl font-bold text-gray-900 dark:text-white mb-2">{{ park.name }}</h1>
|
||||
<p class="text-gray-600 dark:text-gray-400">
|
||||
<i class="fas fa-map-marker-alt mr-2"></i>{{ park.location }}
|
||||
</p>
|
||||
</div>
|
||||
<div class="mt-4 md:mt-0 flex gap-2">
|
||||
{% if park.website %}
|
||||
<a href="{{ park.website }}" target="_blank" rel="noopener noreferrer"
|
||||
class="btn-secondary">
|
||||
<i class="fas fa-external-link-alt mr-2"></i>Visit Website
|
||||
</a>
|
||||
{% endif %}
|
||||
{% if user.is_authenticated %}
|
||||
<button class="btn-secondary">
|
||||
<i class="fas fa-edit mr-2"></i>Edit
|
||||
</button>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-wrap gap-2 mt-4">
|
||||
<span class="status-badge {% if park.status == 'OPERATING' %}status-operating
|
||||
{% elif park.status == 'CLOSED_TEMP' or park.status == 'CLOSED_PERM' %}status-closed
|
||||
{% elif park.status == 'UNDER_CONSTRUCTION' %}status-construction{% endif %}">
|
||||
{{ park.get_status_display }}
|
||||
</span>
|
||||
{% if park.average_rating %}
|
||||
<span class="status-badge bg-yellow-100 text-yellow-800">
|
||||
<i class="fas fa-star text-yellow-500 mr-1"></i>
|
||||
{{ park.average_rating|floatformat:1 }}/10
|
||||
</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Park Stats -->
|
||||
<div class="grid grid-cols-1 md:grid-cols-3 gap-6 mb-6">
|
||||
<div class="bg-white dark:bg-gray-800 shadow rounded-lg p-6 text-center">
|
||||
<div class="text-3xl font-bold text-blue-600 dark:text-blue-400">
|
||||
{{ rides.count }}
|
||||
</div>
|
||||
<div class="text-gray-600 dark:text-gray-400 mt-1">Total Attractions</div>
|
||||
</div>
|
||||
|
||||
<div class="bg-white dark:bg-gray-800 shadow rounded-lg p-6 text-center">
|
||||
<div class="text-3xl font-bold text-blue-600 dark:text-blue-400">
|
||||
{% with roller_coasters=rides|dictsortreversed:"category"|slice:":RC" %}
|
||||
{{ roller_coasters|length }}
|
||||
{% endwith %}
|
||||
</div>
|
||||
<div class="text-gray-600 dark:text-gray-400 mt-1">Roller Coasters</div>
|
||||
</div>
|
||||
|
||||
<div class="bg-white dark:bg-gray-800 shadow rounded-lg p-6 text-center">
|
||||
<div class="text-3xl font-bold text-blue-600 dark:text-blue-400">
|
||||
{{ areas.count }}
|
||||
</div>
|
||||
<div class="text-gray-600 dark:text-gray-400 mt-1">Areas</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Main Content Grid -->
|
||||
<div class="grid grid-cols-1 lg:grid-cols-3 gap-6">
|
||||
<!-- Left Column - Description and Areas -->
|
||||
<div class="lg:col-span-2">
|
||||
{% if park.description %}
|
||||
<div class="bg-white dark:bg-gray-800 shadow rounded-lg p-6 mb-6">
|
||||
<h2 class="text-xl font-semibold mb-4 text-gray-900 dark:text-white">About</h2>
|
||||
<div class="prose dark:prose-invert max-w-none">
|
||||
{{ park.description|linebreaks }}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<!-- Park Areas -->
|
||||
{% if areas %}
|
||||
<div class="bg-white dark:bg-gray-800 shadow rounded-lg p-6 mb-6">
|
||||
<h2 class="text-xl font-semibold mb-4 text-gray-900 dark:text-white">Areas</h2>
|
||||
<div class="space-y-4">
|
||||
{% for area in areas %}
|
||||
<div class="border-b border-gray-200 dark:border-gray-700 last:border-0 pb-4 last:pb-0">
|
||||
<h3 class="text-lg font-semibold text-gray-900 dark:text-white mb-2">{{ area.name }}</h3>
|
||||
{% if area.description %}
|
||||
<p class="text-gray-600 dark:text-gray-400 mb-2">
|
||||
{{ area.description }}
|
||||
</p>
|
||||
{% endif %}
|
||||
<div class="text-sm text-gray-500 dark:text-gray-400">
|
||||
{{ area.rides.count }} attractions
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<!-- Rides List -->
|
||||
<div class="bg-white dark:bg-gray-800 shadow rounded-lg p-6">
|
||||
<h2 class="text-xl font-semibold mb-4 text-gray-900 dark:text-white">Attractions</h2>
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||
{% for ride in rides %}
|
||||
<div class="border border-gray-200 dark:border-gray-700 rounded-lg p-4">
|
||||
<h3 class="text-lg font-semibold mb-2">
|
||||
<a href="{% url 'rides:ride_detail' park.slug ride.slug %}"
|
||||
class="text-blue-600 dark:text-blue-400 hover:underline">
|
||||
{{ ride.name }}
|
||||
</a>
|
||||
</h3>
|
||||
<div class="flex flex-wrap gap-2 mb-2">
|
||||
<span class="px-2 py-1 text-xs rounded-full bg-blue-100 text-blue-800">
|
||||
{{ ride.get_category_display }}
|
||||
</span>
|
||||
<span class="px-2 py-1 text-xs rounded-full
|
||||
{% if ride.status == 'OPERATING' %}bg-green-100 text-green-800
|
||||
{% elif ride.status == 'CLOSED_TEMP' or ride.status == 'CLOSED_PERM' %}bg-red-100 text-red-800
|
||||
{% else %}bg-gray-100 text-gray-800{% endif %}">
|
||||
{{ ride.get_status_display }}
|
||||
</span>
|
||||
</div>
|
||||
{% if ride.coaster_stats %}
|
||||
<div class="text-sm text-gray-600 dark:text-gray-400">
|
||||
{% if ride.coaster_stats.height_ft %}
|
||||
<div>Height: {{ ride.coaster_stats.height_ft }}ft</div>
|
||||
{% endif %}
|
||||
{% if ride.coaster_stats.speed_mph %}
|
||||
<div>Speed: {{ ride.coaster_stats.speed_mph }}mph</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% empty %}
|
||||
<div class="col-span-2 text-center py-8">
|
||||
<p class="text-gray-500 dark:text-gray-400">No attractions found.</p>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Right Column - Quick Facts -->
|
||||
<div>
|
||||
<div class="bg-white dark:bg-gray-800 shadow rounded-lg p-6 mb-6">
|
||||
<h2 class="text-xl font-semibold mb-4 text-gray-900 dark:text-white">Quick Facts</h2>
|
||||
<dl class="space-y-4">
|
||||
{% if park.owner %}
|
||||
<div>
|
||||
<dt class="text-gray-500 dark:text-gray-400">Owner/Operator</dt>
|
||||
<dd>
|
||||
<a href="{% url 'companies:company_detail' park.owner.slug %}"
|
||||
class="text-blue-600 dark:text-blue-400 hover:underline">
|
||||
{{ park.owner.name }}
|
||||
</a>
|
||||
</dd>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if park.opening_date %}
|
||||
<div>
|
||||
<dt class="text-gray-500 dark:text-gray-400">Opening Date</dt>
|
||||
<dd class="text-gray-900 dark:text-white">{{ park.opening_date }}</dd>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if park.closing_date %}
|
||||
<div>
|
||||
<dt class="text-gray-500 dark:text-gray-400">Closing Date</dt>
|
||||
<dd class="text-gray-900 dark:text-white">{{ park.closing_date }}</dd>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if park.operating_season %}
|
||||
<div>
|
||||
<dt class="text-gray-500 dark:text-gray-400">Operating Season</dt>
|
||||
<dd class="text-gray-900 dark:text-white">{{ park.operating_season }}</dd>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if park.size_acres %}
|
||||
<div>
|
||||
<dt class="text-gray-500 dark:text-gray-400">Size</dt>
|
||||
<dd class="text-gray-900 dark:text-white">{{ park.size_acres }} acres</dd>
|
||||
</div>
|
||||
{% endif %}
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
{% if park.photos.exists %}
|
||||
<div class="bg-white dark:bg-gray-800 shadow rounded-lg p-6">
|
||||
<h2 class="text-xl font-semibold mb-4 text-gray-900 dark:text-white">Photos</h2>
|
||||
<div class="grid grid-cols-2 gap-2">
|
||||
{% for photo in park.photos.all %}
|
||||
<div class="aspect-w-16 aspect-h-9">
|
||||
<img src="{{ photo.image.url }}"
|
||||
alt="{{ photo.caption|default:park.name }}"
|
||||
class="object-cover rounded-lg">
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
125
templates/parks/park_list.html
Normal file
125
templates/parks/park_list.html
Normal file
@@ -0,0 +1,125 @@
|
||||
{% extends 'base/base.html' %}
|
||||
{% load static %}
|
||||
|
||||
{% block title %}Parks - ThrillWiki{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="container mx-auto px-4">
|
||||
<div class="flex justify-between items-center mb-6">
|
||||
<h1 class="text-3xl font-bold text-gray-900 dark:text-white">Theme Parks & Amusement Parks</h1>
|
||||
</div>
|
||||
|
||||
<!-- Filters -->
|
||||
<div class="bg-white dark:bg-gray-800 shadow rounded-lg p-4 mb-6">
|
||||
<h2 class="text-xl font-semibold mb-4 text-gray-900 dark:text-white">Filters</h2>
|
||||
<form method="get" class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1">Location</label>
|
||||
<select name="location" class="form-select w-full">
|
||||
<option value="">All Locations</option>
|
||||
{% for location in locations %}
|
||||
<option value="{{ location }}" {% if location == selected_location %}selected{% endif %}>
|
||||
{{ location }}
|
||||
</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1">Status</label>
|
||||
<select name="status" class="form-select w-full">
|
||||
<option value="">All Statuses</option>
|
||||
<option value="OPERATING">Operating</option>
|
||||
<option value="CLOSED_TEMP">Temporarily Closed</option>
|
||||
<option value="CLOSED_PERM">Permanently Closed</option>
|
||||
<option value="UNDER_CONSTRUCTION">Under Construction</option>
|
||||
<option value="DEMOLISHED">Demolished</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="md:col-span-2">
|
||||
<button type="submit" class="btn-primary w-full">Apply Filters</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<!-- Parks Grid -->
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
|
||||
{% for park in parks %}
|
||||
<div class="bg-white dark:bg-gray-800 shadow rounded-lg overflow-hidden">
|
||||
{% if park.photos.exists %}
|
||||
<img src="{{ park.photos.first.image.url }}"
|
||||
alt="{{ park.name }}"
|
||||
class="w-full h-48 object-cover">
|
||||
{% else %}
|
||||
<div class="w-full h-48 bg-gray-200 dark:bg-gray-700 flex items-center justify-center">
|
||||
<span class="text-gray-400">No image available</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="p-4">
|
||||
<h3 class="text-xl font-semibold mb-2">
|
||||
<a href="{% url 'parks:park_detail' park.slug %}"
|
||||
class="text-blue-600 dark:text-blue-400 hover:underline">
|
||||
{{ park.name }}
|
||||
</a>
|
||||
</h3>
|
||||
<p class="text-gray-600 dark:text-gray-400 mb-2">{{ park.location }}</p>
|
||||
<div class="flex justify-between items-center">
|
||||
<span class="text-sm text-gray-500 dark:text-gray-400">
|
||||
{{ park.rides.count }} attractions
|
||||
</span>
|
||||
{% if park.average_rating %}
|
||||
<div class="flex items-center">
|
||||
<span class="text-yellow-400 mr-1">★</span>
|
||||
<span class="text-gray-600 dark:text-gray-400">
|
||||
{{ park.average_rating|floatformat:1 }}/10
|
||||
</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% if park.status != 'OPERATING' %}
|
||||
<div class="mt-2">
|
||||
<span class="px-2 py-1 text-xs rounded-full
|
||||
{% if park.status == 'CLOSED_TEMP' %}bg-yellow-100 text-yellow-800
|
||||
{% elif park.status == 'CLOSED_PERM' %}bg-red-100 text-red-800
|
||||
{% elif park.status == 'UNDER_CONSTRUCTION' %}bg-blue-100 text-blue-800
|
||||
{% else %}bg-gray-100 text-gray-800{% endif %}">
|
||||
{{ park.get_status_display }}
|
||||
</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% empty %}
|
||||
<div class="col-span-full text-center py-8">
|
||||
<p class="text-gray-500 dark:text-gray-400">No parks found matching your criteria.</p>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
<!-- Pagination -->
|
||||
{% if is_paginated %}
|
||||
<div class="flex justify-center mt-6">
|
||||
<nav class="inline-flex rounded-md shadow">
|
||||
{% if page_obj.has_previous %}
|
||||
<a href="?page={{ page_obj.previous_page_number }}{% if request.GET.location %}&location={{ request.GET.location }}{% endif %}{% if request.GET.status %}&status={{ request.GET.status }}{% endif %}"
|
||||
class="pagination-link">Previous</a>
|
||||
{% endif %}
|
||||
|
||||
{% for num in page_obj.paginator.page_range %}
|
||||
{% if page_obj.number == num %}
|
||||
<span class="pagination-current">{{ num }}</span>
|
||||
{% elif num > page_obj.number|add:'-3' and num < page_obj.number|add:'3' %}
|
||||
<a href="?page={{ num }}{% if request.GET.location %}&location={{ request.GET.location }}{% endif %}{% if request.GET.status %}&status={{ request.GET.status }}{% endif %}"
|
||||
class="pagination-link">{{ num }}</a>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
{% if page_obj.has_next %}
|
||||
<a href="?page={{ page_obj.next_page_number }}{% if request.GET.location %}&location={{ request.GET.location }}{% endif %}{% if request.GET.status %}&status={{ request.GET.status }}{% endif %}"
|
||||
class="pagination-link">Next</a>
|
||||
{% endif %}
|
||||
</nav>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
233
templates/rides/ride_detail.html
Normal file
233
templates/rides/ride_detail.html
Normal file
@@ -0,0 +1,233 @@
|
||||
{% extends 'base/base.html' %}
|
||||
{% load static %}
|
||||
|
||||
{% block title %}{{ ride.name }} at {{ ride.park.name }} - ThrillWiki{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="container mx-auto px-4">
|
||||
<!-- Header -->
|
||||
<div class="bg-white dark:bg-gray-800 shadow rounded-lg p-6 mb-6">
|
||||
<div class="flex justify-between items-start">
|
||||
<div>
|
||||
<h1 class="text-3xl font-bold mb-2">{{ ride.name }}</h1>
|
||||
<p class="text-gray-600 dark:text-gray-400 mb-2">
|
||||
at <a href="{{ ride.park.get_absolute_url }}" class="text-blue-500 hover:text-blue-600">
|
||||
{{ ride.park.name }}
|
||||
</a>
|
||||
{% if ride.area %}
|
||||
- {{ ride.area.name }}
|
||||
{% endif %}
|
||||
</p>
|
||||
<div class="flex flex-wrap gap-2 mt-3">
|
||||
<span class="px-3 py-1 rounded-full text-sm
|
||||
{% if ride.status == 'OPERATING' %}bg-green-100 text-green-800
|
||||
{% elif ride.status == 'CLOSED' %}bg-red-100 text-red-800
|
||||
{% else %}bg-gray-100 text-gray-800{% endif %}">
|
||||
{{ ride.get_status_display }}
|
||||
</span>
|
||||
<span class="px-3 py-1 rounded-full bg-blue-100 text-blue-800 text-sm">
|
||||
{{ ride.get_category_display }}
|
||||
</span>
|
||||
{% if ride.average_rating %}
|
||||
<span class="px-3 py-1 rounded-full bg-yellow-100 text-yellow-800 text-sm flex items-center">
|
||||
<span class="text-yellow-500 mr-1">★</span>
|
||||
{{ ride.average_rating|floatformat:1 }}/10
|
||||
</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% if user.is_authenticated %}
|
||||
<div class="flex gap-2">
|
||||
<button class="btn-secondary">
|
||||
<i class="fas fa-edit mr-2"></i>
|
||||
Edit
|
||||
</button>
|
||||
<button class="btn-secondary">
|
||||
<i class="fas fa-history mr-2"></i>
|
||||
History
|
||||
</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Photos Grid -->
|
||||
{% if ride.photos.exists %}
|
||||
<div class="bg-white dark:bg-gray-800 shadow rounded-lg p-6 mb-6">
|
||||
<h2 class="text-xl font-semibold mb-4">Photos</h2>
|
||||
<div class="grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4">
|
||||
{% for photo in ride.photos.all %}
|
||||
<div class="aspect-w-16 aspect-h-9">
|
||||
<img src="{{ photo.image.url }}"
|
||||
alt="{{ photo.caption|default:ride.name }}"
|
||||
class="object-cover rounded-lg">
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<!-- Main Content Grid -->
|
||||
<div class="grid grid-cols-1 lg:grid-cols-3 gap-6">
|
||||
<!-- Left Column - Description and Details -->
|
||||
<div class="lg:col-span-2">
|
||||
<div class="bg-white dark:bg-gray-800 shadow rounded-lg p-6 mb-6">
|
||||
<h2 class="text-xl font-semibold mb-4">About</h2>
|
||||
<div class="prose dark:prose-invert max-w-none">
|
||||
{{ ride.description|linebreaks }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if ride.previous_names %}
|
||||
<div class="bg-white dark:bg-gray-800 shadow rounded-lg p-6 mb-6">
|
||||
<h2 class="text-xl font-semibold mb-4">Previous Names</h2>
|
||||
<div class="space-y-2">
|
||||
{% for name_history in ride.previous_names %}
|
||||
<div class="flex justify-between">
|
||||
<span>{{ name_history.name }}</span>
|
||||
<span class="text-gray-500">{{ name_history.period }}</span>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if coaster_stats %}
|
||||
<div class="bg-white dark:bg-gray-800 shadow rounded-lg p-6 mb-6">
|
||||
<h2 class="text-xl font-semibold mb-4">Roller Coaster Statistics</h2>
|
||||
<div class="grid grid-cols-2 md:grid-cols-3 gap-4">
|
||||
{% if coaster_stats.height_ft %}
|
||||
<div>
|
||||
<span class="text-gray-500 block">Height</span>
|
||||
<span class="text-2xl font-bold">{{ coaster_stats.height_ft }} ft</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if coaster_stats.length_ft %}
|
||||
<div>
|
||||
<span class="text-gray-500 block">Length</span>
|
||||
<span class="text-2xl font-bold">{{ coaster_stats.length_ft }} ft</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if coaster_stats.speed_mph %}
|
||||
<div>
|
||||
<span class="text-gray-500 block">Speed</span>
|
||||
<span class="text-2xl font-bold">{{ coaster_stats.speed_mph }} mph</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div>
|
||||
<span class="text-gray-500 block">Inversions</span>
|
||||
<span class="text-2xl font-bold">{{ coaster_stats.inversions }}</span>
|
||||
</div>
|
||||
{% if coaster_stats.ride_time_seconds %}
|
||||
<div>
|
||||
<span class="text-gray-500 block">Ride Duration</span>
|
||||
<span class="text-2xl font-bold">{{ coaster_stats.ride_time_seconds }} sec</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<!-- Right Column - Quick Facts -->
|
||||
<div class="lg:col-span-1">
|
||||
<div class="bg-white dark:bg-gray-800 shadow rounded-lg p-6 mb-6">
|
||||
<h2 class="text-xl font-semibold mb-4">Quick Facts</h2>
|
||||
<dl class="space-y-4">
|
||||
<div>
|
||||
<dt class="text-gray-500">Manufacturer</dt>
|
||||
<dd>{{ ride.manufacturer }}</dd>
|
||||
</div>
|
||||
{% if ride.model_name %}
|
||||
<div>
|
||||
<dt class="text-gray-500">Model</dt>
|
||||
<dd>{{ ride.model_name }}</dd>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if ride.opening_date %}
|
||||
<div>
|
||||
<dt class="text-gray-500">Opening Date</dt>
|
||||
<dd>{{ ride.opening_date }}</dd>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if ride.status_since %}
|
||||
<div>
|
||||
<dt class="text-gray-500">Status Since</dt>
|
||||
<dd>{{ ride.status_since }}</dd>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if ride.closing_date %}
|
||||
<div>
|
||||
<dt class="text-gray-500">Closing Date</dt>
|
||||
<dd>{{ ride.closing_date }}</dd>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if ride.capacity_per_hour %}
|
||||
<div>
|
||||
<dt class="text-gray-500">Capacity</dt>
|
||||
<dd>{{ ride.capacity_per_hour }} riders/hour</dd>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if ride.minimum_height %}
|
||||
<div>
|
||||
<dt class="text-gray-500">Minimum Height</dt>
|
||||
<dd>{{ ride.minimum_height }} inches</dd>
|
||||
</div>
|
||||
{% endif %}
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
{% if ride.other_details %}
|
||||
<div class="bg-white dark:bg-gray-800 shadow rounded-lg p-6 mb-6">
|
||||
<h2 class="text-xl font-semibold mb-4">Additional Details</h2>
|
||||
<dl class="space-y-4">
|
||||
{% for key, value in ride.other_details.items %}
|
||||
<div>
|
||||
<dt class="text-gray-500">{{ key }}</dt>
|
||||
<dd>{{ value }}</dd>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</dl>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Reviews Section -->
|
||||
<div class="bg-white dark:bg-gray-800 shadow rounded-lg p-6 mt-6">
|
||||
<div class="flex justify-between items-center mb-4">
|
||||
<h2 class="text-xl font-semibold">Reviews</h2>
|
||||
{% if user.is_authenticated %}
|
||||
<button class="btn-primary">
|
||||
<i class="fas fa-star mr-2"></i>
|
||||
Write a Review
|
||||
</button>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% if ride.reviews.exists %}
|
||||
<div class="space-y-4">
|
||||
{% for review in ride.reviews.all %}
|
||||
<div class="border-b border-gray-200 dark:border-gray-700 pb-4">
|
||||
<div class="flex justify-between items-start">
|
||||
<div>
|
||||
<h3 class="font-semibold">{{ review.title }}</h3>
|
||||
<p class="text-sm text-gray-500">
|
||||
by {{ review.user.username }} on {{ review.created_at|date }}
|
||||
</p>
|
||||
</div>
|
||||
<div class="flex items-center">
|
||||
<span class="text-yellow-400 mr-1">★</span>
|
||||
<span>{{ review.rating }}/10</span>
|
||||
</div>
|
||||
</div>
|
||||
<p class="mt-2">{{ review.content }}</p>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% else %}
|
||||
<p class="text-gray-500">No reviews yet. Be the first to review this ride!</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
127
templates/rides/ride_list.html
Normal file
127
templates/rides/ride_list.html
Normal file
@@ -0,0 +1,127 @@
|
||||
{% extends 'base/base.html' %}
|
||||
{% load static %}
|
||||
|
||||
{% block title %}Rides - ThrillWiki{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="container mx-auto px-4">
|
||||
<div class="flex justify-between items-center mb-6">
|
||||
<h1 class="text-3xl font-bold">Rides & Attractions</h1>
|
||||
</div>
|
||||
|
||||
<!-- Filters -->
|
||||
<div class="bg-white dark:bg-gray-800 shadow rounded-lg p-4 mb-6">
|
||||
<h2 class="text-xl font-semibold mb-4">Filters</h2>
|
||||
<form method="get" class="grid grid-cols-1 md:grid-cols-3 gap-4">
|
||||
<div>
|
||||
<label class="block text-sm font-medium mb-1">Category</label>
|
||||
<select name="category" class="form-select w-full">
|
||||
<option value="">All Categories</option>
|
||||
<option value="RC">Roller Coaster</option>
|
||||
<option value="DR">Dark Ride</option>
|
||||
<option value="FR">Flat Ride</option>
|
||||
<option value="WR">Water Ride</option>
|
||||
<option value="TR">Transport</option>
|
||||
<option value="OT">Other</option>
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-sm font-medium mb-1">Status</label>
|
||||
<select name="status" class="form-select w-full">
|
||||
<option value="">All Statuses</option>
|
||||
<option value="OPERATING">Operating</option>
|
||||
<option value="CLOSED_TEMP">Temporarily Closed</option>
|
||||
<option value="CLOSED_PERM">Permanently Closed</option>
|
||||
<option value="UNDER_CONSTRUCTION">Under Construction</option>
|
||||
<option value="DEMOLISHED">Demolished</option>
|
||||
<option value="RELOCATED">Relocated</option>
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-sm font-medium mb-1">Manufacturer</label>
|
||||
<select name="manufacturer" class="form-select w-full">
|
||||
<option value="">All Manufacturers</option>
|
||||
{% for manufacturer in manufacturers %}
|
||||
<option value="{{ manufacturer }}">{{ manufacturer }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<!-- Rides Grid -->
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
|
||||
{% for ride in rides %}
|
||||
<div class="bg-white dark:bg-gray-800 shadow rounded-lg overflow-hidden">
|
||||
{% if ride.photos.exists %}
|
||||
<img src="{{ ride.photos.first.image.url }}"
|
||||
alt="{{ ride.name }}"
|
||||
class="w-full h-48 object-cover">
|
||||
{% else %}
|
||||
<div class="w-full h-48 bg-gray-200 dark:bg-gray-700 flex items-center justify-center">
|
||||
<span class="text-gray-400">No image available</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="p-4">
|
||||
<h3 class="text-xl font-semibold mb-2">
|
||||
<a href="{{ ride.get_absolute_url }}" class="hover:text-blue-500">
|
||||
{{ ride.name }}
|
||||
</a>
|
||||
</h3>
|
||||
<p class="text-gray-600 dark:text-gray-400 mb-2">
|
||||
at <a href="{{ ride.park.get_absolute_url }}" class="hover:text-blue-500">
|
||||
{{ ride.park.name }}
|
||||
</a>
|
||||
</p>
|
||||
<div class="flex justify-between items-center">
|
||||
<span class="text-sm text-gray-500 dark:text-gray-400">
|
||||
{{ ride.get_category_display }}
|
||||
</span>
|
||||
{% if ride.average_rating %}
|
||||
<div class="flex items-center">
|
||||
<span class="text-yellow-400 mr-1">★</span>
|
||||
<span>{{ ride.average_rating|floatformat:1 }}/10</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% if ride.category == 'RC' and ride.coaster_stats %}
|
||||
<div class="mt-2 text-sm text-gray-600 dark:text-gray-400">
|
||||
<div>Height: {{ ride.coaster_stats.height_ft }}ft</div>
|
||||
<div>Speed: {{ ride.coaster_stats.speed_mph }}mph</div>
|
||||
<div>Inversions: {{ ride.coaster_stats.inversions }}</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% empty %}
|
||||
<div class="col-span-full text-center py-8">
|
||||
<p class="text-gray-500 dark:text-gray-400">No rides found matching your criteria.</p>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
<!-- Pagination -->
|
||||
{% if is_paginated %}
|
||||
<div class="flex justify-center mt-6">
|
||||
<nav class="inline-flex rounded-md shadow">
|
||||
{% if page_obj.has_previous %}
|
||||
<a href="?page={{ page_obj.previous_page_number }}" class="pagination-link">Previous</a>
|
||||
{% endif %}
|
||||
|
||||
{% for num in page_obj.paginator.page_range %}
|
||||
{% if page_obj.number == num %}
|
||||
<span class="pagination-current">{{ num }}</span>
|
||||
{% elif num > page_obj.number|add:'-3' and num < page_obj.number|add:'3' %}
|
||||
<a href="?page={{ num }}" class="pagination-link">{{ num }}</a>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
{% if page_obj.has_next %}
|
||||
<a href="?page={{ page_obj.next_page_number }}" class="pagination-link">Next</a>
|
||||
{% endif %}
|
||||
</nav>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
142
templates/search_results.html
Normal file
142
templates/search_results.html
Normal file
@@ -0,0 +1,142 @@
|
||||
{% extends 'base/base.html' %}
|
||||
{% load static %}
|
||||
|
||||
{% block title %}Search Results - ThrillWiki{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="container mx-auto px-4 py-8">
|
||||
<!-- Search Header -->
|
||||
<div class="mb-8">
|
||||
<h1 class="text-3xl font-bold mb-2">Search Results</h1>
|
||||
<p class="text-gray-600 dark:text-gray-400">
|
||||
{% if request.GET.q %}
|
||||
Results for "{{ request.GET.q }}"
|
||||
{% else %}
|
||||
Enter a search term above to find parks, rides, and more
|
||||
{% endif %}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
{% if request.GET.q %}
|
||||
<!-- Parks Results -->
|
||||
<div class="bg-white dark:bg-gray-800 shadow rounded-lg p-6 mb-6">
|
||||
<h2 class="text-xl font-semibold mb-4">Theme Parks</h2>
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
|
||||
{% for park in parks %}
|
||||
<div class="bg-gray-50 dark:bg-gray-700 rounded-lg overflow-hidden">
|
||||
{% if park.photos.exists %}
|
||||
<img src="{{ park.photos.first.image.url }}"
|
||||
alt="{{ park.name }}"
|
||||
class="w-full h-48 object-cover">
|
||||
{% else %}
|
||||
<div class="w-full h-48 bg-gray-200 dark:bg-gray-600 flex items-center justify-center">
|
||||
<span class="text-gray-400">No image available</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="p-4">
|
||||
<h3 class="text-lg font-semibold mb-2">
|
||||
<a href="{% url 'parks:park_detail' park.slug %}"
|
||||
class="text-blue-600 dark:text-blue-400 hover:underline">
|
||||
{{ park.name }}
|
||||
</a>
|
||||
</h3>
|
||||
<p class="text-gray-600 dark:text-gray-400 mb-2">{{ park.location }}</p>
|
||||
<div class="flex justify-between items-center">
|
||||
<span class="text-sm text-gray-500 dark:text-gray-400">
|
||||
{{ park.rides.count }} attractions
|
||||
</span>
|
||||
{% if park.average_rating %}
|
||||
<div class="flex items-center">
|
||||
<span class="text-yellow-400 mr-1">★</span>
|
||||
<span>{{ park.average_rating|floatformat:1 }}/10</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% empty %}
|
||||
<div class="col-span-full text-center py-4">
|
||||
<p class="text-gray-500 dark:text-gray-400">No parks found matching your search.</p>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Rides Results -->
|
||||
<div class="bg-white dark:bg-gray-800 shadow rounded-lg p-6 mb-6">
|
||||
<h2 class="text-xl font-semibold mb-4">Rides & Attractions</h2>
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
|
||||
{% for ride in rides %}
|
||||
<div class="bg-gray-50 dark:bg-gray-700 rounded-lg overflow-hidden">
|
||||
{% if ride.photos.exists %}
|
||||
<img src="{{ ride.photos.first.image.url }}"
|
||||
alt="{{ ride.name }}"
|
||||
class="w-full h-48 object-cover">
|
||||
{% else %}
|
||||
<div class="w-full h-48 bg-gray-200 dark:bg-gray-600 flex items-center justify-center">
|
||||
<span class="text-gray-400">No image available</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="p-4">
|
||||
<h3 class="text-lg font-semibold mb-2">
|
||||
<a href="{% url 'rides:ride_detail' ride.park.slug ride.slug %}"
|
||||
class="text-blue-600 dark:text-blue-400 hover:underline">
|
||||
{{ ride.name }}
|
||||
</a>
|
||||
</h3>
|
||||
<p class="text-gray-600 dark:text-gray-400 mb-2">
|
||||
at <a href="{% url 'parks:park_detail' ride.park.slug %}"
|
||||
class="hover:underline">{{ ride.park.name }}</a>
|
||||
</p>
|
||||
<div class="flex flex-wrap gap-2 mb-2">
|
||||
<span class="px-2 py-1 text-xs rounded-full bg-blue-100 text-blue-800">
|
||||
{{ ride.get_category_display }}
|
||||
</span>
|
||||
{% if ride.average_rating %}
|
||||
<div class="flex items-center">
|
||||
<span class="text-yellow-400 mr-1">★</span>
|
||||
<span>{{ ride.average_rating|floatformat:1 }}/10</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% empty %}
|
||||
<div class="col-span-full text-center py-4">
|
||||
<p class="text-gray-500 dark:text-gray-400">No rides found matching your search.</p>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Companies Results -->
|
||||
<div class="bg-white dark:bg-gray-800 shadow rounded-lg p-6">
|
||||
<h2 class="text-xl font-semibold mb-4">Companies</h2>
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
|
||||
{% for company in companies %}
|
||||
<div class="bg-gray-50 dark:bg-gray-700 rounded-lg p-4">
|
||||
<h3 class="text-lg font-semibold mb-2">
|
||||
<a href="{% url 'companies:company_detail' company.slug %}"
|
||||
class="text-blue-600 dark:text-blue-400 hover:underline">
|
||||
{{ company.name }}
|
||||
</a>
|
||||
</h3>
|
||||
{% if company.headquarters %}
|
||||
<p class="text-gray-600 dark:text-gray-400 mb-2">{{ company.headquarters }}</p>
|
||||
{% endif %}
|
||||
<div class="text-sm text-gray-500 dark:text-gray-400">
|
||||
{{ company.parks.count }} parks owned
|
||||
</div>
|
||||
</div>
|
||||
{% empty %}
|
||||
<div class="col-span-full text-center py-4">
|
||||
<p class="text-gray-500 dark:text-gray-400">No companies found matching your search.</p>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user