Add operators and property owners functionality

- Implemented OperatorListView and OperatorDetailView for managing operators.
- Created corresponding templates for operator listing and detail views.
- Added PropertyOwnerListView and PropertyOwnerDetailView for managing property owners.
- Developed templates for property owner listing and detail views.
- Established relationships between parks and operators, and parks and property owners in the models.
- Created migrations to reflect the new relationships and fields in the database.
- Added admin interfaces for PropertyOwner management.
- Implemented tests for operators and property owners.
This commit is contained in:
pacnpal
2025-07-04 14:49:36 -04:00
parent 8360f3fd43
commit 751cd86a31
80 changed files with 2943 additions and 2358 deletions

View File

@@ -1,143 +0,0 @@
{% extends 'base/base.html' %}
{% load static %}
{% block title %}{{ company.name }} - ThrillWiki{% endblock %}
{% block content %}
<div class="container px-4 mx-auto">
<!-- Action Buttons - Above header -->
<div class="flex justify-end gap-2 mb-2">
{% if company.website %}
<a href="{{ company.website }}" target="_blank" rel="noopener noreferrer"
class="transition-transform btn-secondary hover:scale-105">
<i class="mr-1 fas fa-external-link-alt"></i>Visit Website
</a>
{% endif %}
{% if user.is_authenticated %}
<a href="{% url 'companies:company_edit' slug=company.slug %}"
class="transition-transform btn-secondary hover:scale-105">
<i class="mr-1 fas fa-edit"></i>Edit
</a>
{% endif %}
</div>
<!-- Header Grid -->
<div class="grid gap-2 mb-12 sm:mb-16 md:mb-8 grid-cols-1 sm:grid-cols-12 h-auto md:h-[140px]">
<!-- Company Info Card -->
<div class="flex flex-col items-center justify-center h-full col-span-1 p-2 text-center bg-white rounded-lg shadow-lg sm:col-span-3 dark:bg-gray-800">
<h1 class="text-2xl font-bold leading-tight text-gray-900 sm:text-3xl dark:text-white">{{ company.name }}</h1>
{% if company.headquarters %}
<div class="flex items-center justify-center mt-0.5 text-sm text-gray-600 dark:text-gray-400">
<i class="mr-1 fas fa-map-marker-alt"></i>
<p>{{ company.headquarters }}</p>
</div>
{% endif %}
</div>
<!-- Stats and Quick Facts -->
<div class="grid h-full grid-cols-12 col-span-1 gap-2 sm:col-span-9">
<!-- Stats Column -->
<div class="grid grid-cols-2 col-span-12 gap-2 sm:col-span-4">
<div class="flex flex-col items-center justify-center p-2 text-center bg-white rounded-lg shadow-lg dark:bg-gray-800">
<dt class="text-sm font-semibold text-gray-900 sm:text-base dark:text-white">Total Parks</dt>
<dd class="mt-0.5 text-xl font-bold text-sky-900 sm:text-2xl dark:text-sky-400">{{ parks.count }}</dd>
</div>
<div class="flex flex-col items-center justify-center p-2 text-center bg-white rounded-lg shadow-lg dark:bg-gray-800">
<dt class="text-sm font-semibold text-gray-900 sm:text-base dark:text-white">Active Parks</dt>
<dd class="mt-0.5 text-xl font-bold text-sky-900 sm:text-2xl dark:text-sky-400">{{ parks|length }}</dd>
</div>
</div>
<!-- Quick Facts Grid -->
<div class="grid h-full grid-cols-3 col-span-12 gap-1 p-1.5 bg-white rounded-lg shadow-lg sm:col-span-8 dark:bg-gray-800">
<div class="flex flex-col items-center justify-center text-center p-0.5">
<i class="text-sm text-blue-600 sm:text-base fas fa-ticket-alt dark:text-blue-400"></i>
<dt class="font-medium text-gray-500 text-2xs dark:text-gray-400">Total Attractions</dt>
<dd class="text-gray-900 text-2xs sm:text-xs dark:text-white">{{ total_rides }}</dd>
</div>
{% if company.founded_date %}
<div class="flex flex-col items-center justify-center text-center p-0.5">
<i class="text-sm text-blue-600 sm:text-base fas fa-calendar-alt dark:text-blue-400"></i>
<dt class="font-medium text-gray-500 text-2xs dark:text-gray-400">Founded</dt>
<dd class="text-gray-900 text-2xs sm:text-xs dark:text-white">{{ company.founded_date }}</dd>
</div>
{% endif %}
{% if company.website %}
<div class="flex flex-col items-center justify-center text-center p-0.5">
<i class="text-sm text-blue-600 sm:text-base fas fa-globe dark:text-blue-400"></i>
<dt class="font-medium text-gray-500 text-2xs dark:text-gray-400">Website</dt>
<dd>
<a href="{{ company.website }}"
class="text-blue-600 text-2xs sm:text-xs hover:text-blue-700 dark:text-blue-400 dark:hover:text-blue-300"
target="_blank" rel="noopener noreferrer">
Visit
<i class="ml-0.5 text-2xs fas fa-external-link-alt"></i>
</a>
</dd>
</div>
{% endif %}
</div>
</div>
</div>
{% if company.description %}
<div class="p-6 mb-8 bg-white rounded-lg shadow dark:bg-gray-800">
<h2 class="mb-4 text-xl font-semibold text-gray-900 dark:text-white">About</h2>
<div class="prose dark:prose-invert max-w-none">
{{ company.description|linebreaks }}
</div>
</div>
{% endif %}
<!-- Parks List -->
<div class="p-6 bg-white rounded-lg shadow dark:bg-gray-800">
<h2 class="mb-6 text-xl font-semibold text-gray-900 dark:text-white">Theme Parks</h2>
<div class="grid grid-cols-1 gap-6 md:grid-cols-2 lg:grid-cols-3">
{% for park in parks %}
<div class="overflow-hidden transition-transform rounded-lg hover:scale-[1.02] bg-gray-50 dark:bg-gray-700">
{% if park.photos.exists %}
<img src="{{ park.photos.first.image.url }}"
alt="{{ park.name }}"
class="object-cover w-full h-48">
{% else %}
<div class="flex items-center justify-center w-full h-48 bg-gray-200 dark:bg-gray-600">
<span class="text-gray-400">No image available</span>
</div>
{% endif %}
<div class="p-4">
<h3 class="mb-2 text-lg font-semibold">
<a href="{% url 'parks:park_detail' park.slug %}"
class="text-blue-600 dark:text-blue-400 hover:text-blue-700 dark:hover:text-blue-300">
{{ park.name }}
</a>
</h3>
<p class="mb-2 text-gray-600 dark:text-gray-400">{{ park.location }}</p>
<div class="flex items-center justify-between">
<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="mr-1 text-yellow-400"></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="py-8 text-center col-span-full">
<p class="text-gray-500 dark:text-gray-400">No parks found for this company.</p>
</div>
{% endfor %}
</div>
</div>
</div>
{% endblock %}

View File

@@ -1,128 +0,0 @@
{% extends 'base/base.html' %}
{% load static %}
{% block title %}{% if is_edit %}Edit{% else %}Add{% endif %} Company - ThrillWiki{% endblock %}
{% block content %}
<div class="container px-4 mx-auto">
<div class="max-w-3xl mx-auto">
<div class="p-6 bg-white rounded-lg shadow dark:bg-gray-800">
<h1 class="mb-6 text-3xl font-bold text-gray-900 dark:text-white">{% if is_edit %}Edit{% else %}Add{% endif %} Company</h1>
<form method="post" class="space-y-6">
{% csrf_token %}
<!-- Name field -->
<div>
<label for="{{ form.name.id_for_label }}" class="block mb-1 text-sm font-medium text-gray-700 dark:text-gray-300">
Name
</label>
<div>
{{ form.name }}
</div>
{% if form.name.errors %}
<div class="mt-1 text-sm text-red-600 dark:text-red-400">
{{ form.name.errors }}
</div>
{% endif %}
</div>
<!-- Headquarters field -->
<div x-data="locationAutocomplete('country', false)" class="relative">
<label for="{{ form.headquarters.id_for_label }}" class="block mb-1 text-sm font-medium text-gray-700 dark:text-gray-300">
Headquarters
</label>
<input type="text"
id="{{ form.headquarters.id_for_label }}"
name="headquarters"
x-model="query"
@input.debounce.300ms="fetchSuggestions()"
@focus="fetchSuggestions()"
@click.away="suggestions = []"
class="w-full border-gray-300 rounded-lg form-input dark:border-gray-600 dark:bg-gray-700 dark:text-white"
placeholder="e.g., Orlando, Florida, United States"
value="{{ form.headquarters.value|default:'' }}"
autocomplete="off">
<!-- Suggestions Dropdown -->
<ul x-show="suggestions.length > 0"
x-cloak
class="absolute z-50 w-full py-1 mt-1 overflow-auto bg-white rounded-md shadow-lg dark:bg-gray-700 max-h-60">
<template x-for="suggestion in suggestions" :key="suggestion">
<li @click="selectSuggestion(suggestion)"
x-text="suggestion"
class="px-4 py-2 text-gray-700 cursor-pointer dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-600">
</li>
</template>
</ul>
</div>
<!-- Website field -->
<div>
<label for="{{ form.website.id_for_label }}" class="block mb-1 text-sm font-medium text-gray-700 dark:text-gray-300">
Website
</label>
<div>
{{ form.website }}
</div>
{% if form.website.errors %}
<div class="mt-1 text-sm text-red-600 dark:text-red-400">
{{ form.website.errors }}
</div>
{% endif %}
</div>
<!-- Description field -->
<div>
<label for="{{ form.description.id_for_label }}" class="block mb-1 text-sm font-medium text-gray-700 dark:text-gray-300">
Description
</label>
<div>
{{ form.description }}
</div>
{% if form.description.errors %}
<div class="mt-1 text-sm text-red-600 dark:text-red-400">
{{ form.description.errors }}
</div>
{% endif %}
</div>
{% if not user.role == 'MODERATOR' and not user.role == 'ADMIN' and not user.role == 'SUPERUSER' %}
<div class="space-y-4">
<div>
<label for="reason" class="block mb-1 text-sm font-medium text-gray-700 dark:text-gray-300">
Reason for {% if is_edit %}Edit{% else %}Addition{% endif %}
</label>
<textarea name="reason"
id="reason"
class="w-full border-gray-300 rounded-lg form-textarea dark:border-gray-600 dark:bg-gray-700 dark:text-white"
rows="3"
required
placeholder="Please explain why you're {% if is_edit %}editing{% else %}adding{% endif %} this company and provide any relevant details."></textarea>
</div>
<div>
<label for="source" class="block mb-1 text-sm font-medium text-gray-700 dark:text-gray-300">
Source (Optional)
</label>
<input type="text"
name="source"
id="source"
class="w-full border-gray-300 rounded-lg form-input dark:border-gray-600 dark:bg-gray-700 dark:text-white"
placeholder="Link to official website, news article, or other source">
</div>
</div>
{% endif %}
<div class="flex justify-end space-x-4">
<a href="{% if is_edit %}{% url 'companies:company_detail' slug=object.slug %}{% else %}{% url 'companies:company_list' %}{% endif %}"
class="px-4 py-2 text-gray-700 bg-gray-200 rounded-lg hover:bg-gray-300 dark:bg-gray-600 dark:text-gray-200 dark:hover:bg-gray-500">
Cancel
</a>
<button type="submit" class="px-4 py-2 text-white bg-blue-600 rounded-lg hover:bg-blue-700 dark:bg-blue-500 dark:hover:bg-blue-600">
{% if is_edit %}Save Changes{% else %}Submit{% endif %}
</button>
</div>
</form>
</div>
</div>
</div>
{% endblock %}

View File

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

View File

@@ -1,183 +0,0 @@
{% extends 'base/base.html' %}
{% load static %}
{% block title %}{{ manufacturer.name }} - ThrillWiki{% endblock %}
{% block content %}
<div class="container px-4 mx-auto">
<!-- Action Buttons - Above header -->
<div class="flex justify-end gap-2 mb-2">
{% if manufacturer.website %}
<a href="{{ manufacturer.website }}" target="_blank" rel="noopener noreferrer"
class="transition-transform btn-secondary hover:scale-105">
<i class="mr-1 fas fa-external-link-alt"></i>Visit Website
</a>
{% endif %}
{% if user.is_authenticated %}
<a href="{% url 'companies:manufacturer_edit' slug=manufacturer.slug %}"
class="transition-transform btn-secondary hover:scale-105">
<i class="mr-1 fas fa-edit"></i>Edit
</a>
{% endif %}
</div>
<!-- Company Header -->
<div class="p-compact mb-6 bg-white rounded-lg shadow-lg dark:bg-gray-800">
<div class="text-center">
<h1 class="text-3xl font-bold text-gray-900 dark:text-white lg:text-4xl">{{ manufacturer.name }}</h1>
{% if manufacturer.headquarters %}
<div class="flex items-center justify-center mt-2 text-sm text-gray-600 dark:text-gray-400">
<i class="mr-1 fas fa-map-marker-alt"></i>
<p>{{ manufacturer.headquarters }}</p>
</div>
{% endif %}
</div>
</div>
<!-- Horizontal Stats Bar -->
<div class="grid grid-cols-2 gap-4 mb-6 md:grid-cols-3 lg:grid-cols-5">
<!-- Company Info Card -->
<div class="bg-white rounded-lg shadow-lg dark:bg-gray-800 p-compact card-stats">
<div class="text-center">
<dt class="text-sm font-semibold text-gray-900 dark:text-white">Company</dt>
<dd class="mt-1 space-y-1">
{% if manufacturer.headquarters %}
<div class="text-xs text-sky-900 dark:text-sky-400">{{ manufacturer.headquarters }}</div>
{% endif %}
{% if manufacturer.website %}
<div class="text-xs">
<a href="{{ manufacturer.website }}" target="_blank" rel="noopener noreferrer"
class="text-blue-600 hover:text-blue-700 dark:text-blue-400 dark:hover:text-blue-300">
Website
</a>
</div>
{% endif %}
</dd>
</div>
</div>
<!-- Total Rides Card -->
<div class="bg-white rounded-lg shadow-lg dark:bg-gray-800 p-compact card-stats">
<div class="text-center">
<dt class="text-sm font-semibold text-gray-900 dark:text-white">Total Rides</dt>
<dd class="mt-1 text-2xl font-bold text-sky-900 dark:text-sky-400">{{ rides.count }}</dd>
</div>
</div>
<!-- Coasters Card -->
<div class="bg-white rounded-lg shadow-lg dark:bg-gray-800 p-compact card-stats">
<div class="text-center">
<dt class="text-sm font-semibold text-gray-900 dark:text-white">Coasters</dt>
<dd class="mt-1 text-2xl font-bold text-sky-900 dark:text-sky-400">{{ coaster_count }}</dd>
</div>
</div>
<!-- Founded Card -->
<div class="bg-white rounded-lg shadow-lg dark:bg-gray-800 p-compact card-stats">
<div class="text-center">
<dt class="text-sm font-semibold text-gray-900 dark:text-white">Founded</dt>
<dd class="mt-1 space-y-1">
{% if manufacturer.founded_date %}
<div class="text-sm font-bold text-sky-900 dark:text-sky-400">{{ manufacturer.founded_date }}</div>
{% else %}
<div class="text-xs text-sky-900 dark:text-sky-400">Unknown</div>
{% endif %}
<div class="text-xs text-sky-900 dark:text-sky-400">Est.</div>
</dd>
</div>
</div>
<!-- Specialties Card -->
<div class="bg-white rounded-lg shadow-lg dark:bg-gray-800 p-compact card-stats">
<div class="text-center">
<dt class="text-sm font-semibold text-gray-900 dark:text-white">Specialties</dt>
<dd class="mt-1 space-y-1">
<div class="text-xs text-sky-900 dark:text-sky-400">Ride Manufacturer</div>
{% if coaster_count > 0 %}
<div class="text-xs text-sky-900 dark:text-sky-400">Roller Coasters</div>
{% endif %}
{% if rides.count > coaster_count %}
<div class="text-xs text-sky-900 dark:text-sky-400">Other Rides</div>
{% endif %}
</dd>
</div>
</div>
</div>
{% if manufacturer.description %}
<div class="p-optimized mb-8 bg-white rounded-lg shadow dark:bg-gray-800">
<h2 class="mb-4 text-xl font-semibold text-gray-900 dark:text-white">About</h2>
<div class="prose dark:prose-invert max-w-none">
{{ manufacturer.description|linebreaks }}
</div>
</div>
{% endif %}
<!-- Rides List -->
<div class="p-optimized bg-white rounded-lg shadow dark:bg-gray-800">
<h2 class="mb-6 text-xl font-semibold text-gray-900 dark:text-white">Rides</h2>
<div class="grid grid-cols-1 gap-6 md:grid-cols-2 lg:grid-cols-3">
{% for ride in rides %}
<div class="overflow-hidden transition-transform rounded-lg hover:scale-[1.02] bg-gray-50 dark:bg-gray-700">
{% if ride.photos.exists %}
<img src="{{ ride.photos.first.image.url }}"
alt="{{ ride.name }}"
class="object-cover w-full h-48">
{% else %}
<div class="flex items-center justify-center w-full h-48 bg-gray-200 dark:bg-gray-600">
<span class="text-gray-400">No image available</span>
</div>
{% endif %}
<div class="p-4">
<h3 class="mb-2 text-lg font-semibold">
<a href="{% url 'parks:rides:ride_detail' ride.park.slug ride.slug %}"
class="text-blue-600 dark:text-blue-400 hover:text-blue-700 dark:hover:text-blue-300">
{{ ride.name }}
</a>
</h3>
<p class="mb-2 text-gray-600 dark:text-gray-400">
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="flex items-center mt-2">
<span class="mr-1 text-yellow-400"></span>
<span class="text-gray-600 dark:text-gray-400">
{{ ride.average_rating|floatformat:1 }}/10
</span>
</div>
{% endif %}
</div>
</div>
{% empty %}
<div class="py-8 text-center col-span-full">
<p class="text-gray-500 dark:text-gray-400">No rides found for this manufacturer.</p>
</div>
{% endfor %}
</div>
</div>
</div>
{% endblock %}

View File

@@ -1,128 +0,0 @@
{% extends 'base/base.html' %}
{% load static %}
{% block title %}{% if is_edit %}Edit{% else %}Add{% endif %} Manufacturer - ThrillWiki{% endblock %}
{% block content %}
<div class="container px-4 mx-auto">
<div class="max-w-3xl mx-auto">
<div class="p-6 bg-white rounded-lg shadow dark:bg-gray-800">
<h1 class="mb-6 text-3xl font-bold text-gray-900 dark:text-white">{% if is_edit %}Edit{% else %}Add{% endif %} Manufacturer</h1>
<form method="post" class="space-y-6">
{% csrf_token %}
<!-- Name field -->
<div>
<label for="{{ form.name.id_for_label }}" class="block mb-1 text-sm font-medium text-gray-700 dark:text-gray-300">
Name
</label>
<div>
{{ form.name }}
</div>
{% if form.name.errors %}
<div class="mt-1 text-sm text-red-600 dark:text-red-400">
{{ form.name.errors }}
</div>
{% endif %}
</div>
<!-- Headquarters field -->
<div x-data="locationAutocomplete('country', false)" class="relative">
<label for="{{ form.headquarters.id_for_label }}" class="block mb-1 text-sm font-medium text-gray-700 dark:text-gray-300">
Headquarters
</label>
<input type="text"
id="{{ form.headquarters.id_for_label }}"
name="headquarters"
x-model="query"
@input.debounce.300ms="fetchSuggestions()"
@focus="fetchSuggestions()"
@click.away="suggestions = []"
class="w-full border-gray-300 rounded-lg form-input dark:border-gray-600 dark:bg-gray-700 dark:text-white"
placeholder="e.g., Altoona, Pennsylvania, United States"
value="{{ form.headquarters.value|default:'' }}"
autocomplete="off">
<!-- Suggestions Dropdown -->
<ul x-show="suggestions.length > 0"
x-cloak
class="absolute z-50 w-full py-1 mt-1 overflow-auto bg-white rounded-md shadow-lg dark:bg-gray-700 max-h-60">
<template x-for="suggestion in suggestions" :key="suggestion">
<li @click="selectSuggestion(suggestion)"
x-text="suggestion"
class="px-4 py-2 text-gray-700 cursor-pointer dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-600">
</li>
</template>
</ul>
</div>
<!-- Website field -->
<div>
<label for="{{ form.website.id_for_label }}" class="block mb-1 text-sm font-medium text-gray-700 dark:text-gray-300">
Website
</label>
<div>
{{ form.website }}
</div>
{% if form.website.errors %}
<div class="mt-1 text-sm text-red-600 dark:text-red-400">
{{ form.website.errors }}
</div>
{% endif %}
</div>
<!-- Description field -->
<div>
<label for="{{ form.description.id_for_label }}" class="block mb-1 text-sm font-medium text-gray-700 dark:text-gray-300">
Description
</label>
<div>
{{ form.description }}
</div>
{% if form.description.errors %}
<div class="mt-1 text-sm text-red-600 dark:text-red-400">
{{ form.description.errors }}
</div>
{% endif %}
</div>
{% if not user.role == 'MODERATOR' and not user.role == 'ADMIN' and not user.role == 'SUPERUSER' %}
<div class="space-y-4">
<div>
<label for="reason" class="block mb-1 text-sm font-medium text-gray-700 dark:text-gray-300">
Reason for {% if is_edit %}Edit{% else %}Addition{% endif %}
</label>
<textarea name="reason"
id="reason"
class="w-full border-gray-300 rounded-lg form-textarea dark:border-gray-600 dark:bg-gray-700 dark:text-white"
rows="3"
required
placeholder="Please explain why you're {% if is_edit %}editing{% else %}adding{% endif %} this manufacturer and provide any relevant details."></textarea>
</div>
<div>
<label for="source" class="block mb-1 text-sm font-medium text-gray-700 dark:text-gray-300">
Source (Optional)
</label>
<input type="text"
name="source"
id="source"
class="w-full border-gray-300 rounded-lg form-input dark:border-gray-600 dark:bg-gray-700 dark:text-white"
placeholder="Link to official website, news article, or other source">
</div>
</div>
{% endif %}
<div class="flex justify-end space-x-4">
<a href="{% if is_edit %}{% url 'companies:manufacturer_detail' slug=object.slug %}{% else %}{% url 'companies:manufacturer_list' %}{% endif %}"
class="px-4 py-2 text-gray-700 bg-gray-200 rounded-lg hover:bg-gray-300 dark:bg-gray-600 dark:text-gray-200 dark:hover:bg-gray-500">
Cancel
</a>
<button type="submit" class="px-4 py-2 text-white bg-blue-600 rounded-lg hover:bg-blue-700 dark:bg-blue-500 dark:hover:bg-blue-600">
{% if is_edit %}Save Changes{% else %}Submit{% endif %}
</button>
</div>
</form>
</div>
</div>
</div>
{% endblock %}

View File

@@ -1,141 +0,0 @@
{% extends "base/base.html" %}
{% load static %}
{% block title %}Manufacturers - ThrillWiki{% endblock %}
{% block content %}
<div class="container px-4 mx-auto sm:px-6 lg:px-8">
<!-- Header -->
<div class="flex flex-col items-start justify-between gap-4 mb-6 sm:flex-row sm:items-center">
<h1 class="text-2xl font-bold text-gray-900 lg:text-3xl dark:text-white">Manufacturers</h1>
{% if user.is_authenticated %}
<a href="{% url 'companies:manufacturer_create' %}"
class="transition-transform btn-primary hover:scale-105">
<i class="mr-1 fas fa-plus"></i>Add Manufacturer
</a>
{% endif %}
</div>
<!-- Stats -->
<div class="grid grid-cols-1 gap-4 mb-6 sm:grid-cols-3">
<div class="p-4 bg-white rounded-lg shadow dark:bg-gray-800">
<dt class="text-sm font-medium text-gray-500 dark:text-gray-400">Total Manufacturers</dt>
<dd class="mt-1 text-3xl font-semibold text-gray-900 dark:text-white">{{ total_manufacturers }}</dd>
</div>
<div class="p-4 bg-white rounded-lg shadow dark:bg-gray-800">
<dt class="text-sm font-medium text-gray-500 dark:text-gray-400">Total Rides</dt>
<dd class="mt-1 text-3xl font-semibold text-gray-900 dark:text-white">{{ total_rides }}</dd>
</div>
<div class="p-4 bg-white rounded-lg shadow dark:bg-gray-800">
<dt class="text-sm font-medium text-gray-500 dark:text-gray-400">Total Roller Coasters</dt>
<dd class="mt-1 text-3xl font-semibold text-gray-900 dark:text-white">{{ total_roller_coasters }}</dd>
</div>
</div>
<!-- Search and Filter -->
<div class="p-4 mb-6 bg-white rounded-lg shadow dark:bg-gray-800">
<form method="get" class="flex flex-col gap-4 sm:flex-row sm:items-end">
<div class="flex-1">
<label for="search" class="block mb-1 text-sm font-medium text-gray-700 dark:text-gray-300">Search</label>
<input type="text"
name="search"
id="search"
value="{{ request.GET.search }}"
placeholder="Search manufacturers..."
class="w-full px-3 py-2 border rounded-lg dark:bg-gray-700 dark:border-gray-600 dark:text-white">
</div>
<div class="flex-1">
<label for="country" class="block mb-1 text-sm font-medium text-gray-700 dark:text-gray-300">Country</label>
<input type="text"
name="country"
id="country"
value="{{ request.GET.country }}"
placeholder="Filter by country..."
class="w-full px-3 py-2 border rounded-lg dark:bg-gray-700 dark:border-gray-600 dark:text-white">
</div>
<button type="submit" class="btn-primary">
<i class="mr-1 fas fa-search"></i>Search
</button>
{% if request.GET.search or request.GET.country %}
<a href="{% url 'companies:manufacturer_list' %}" class="btn-secondary">
<i class="mr-1 fas fa-times"></i>Clear
</a>
{% endif %}
</form>
</div>
<!-- Manufacturers Grid -->
{% if manufacturers %}
<div class="grid gap-6 sm:grid-cols-2 lg:grid-cols-3">
{% for manufacturer in manufacturers %}
<div class="p-6 transition-transform bg-white rounded-lg shadow hover:scale-[1.02] dark:bg-gray-800">
<h2 class="mb-2 text-xl font-semibold">
<a href="{% url 'companies:manufacturer_detail' manufacturer.slug %}"
class="text-gray-900 hover:text-blue-600 dark:text-white dark:hover:text-blue-400">
{{ manufacturer.name }}
</a>
</h2>
{% if manufacturer.headquarters %}
<div class="flex items-center mb-2 text-gray-600 dark:text-gray-400">
<i class="mr-2 fas fa-building"></i>
{{ manufacturer.headquarters }}
</div>
{% endif %}
{% if manufacturer.website %}
<div class="flex items-center mb-4 text-gray-600 dark:text-gray-400">
<i class="mr-2 fas fa-globe"></i>
<a href="{{ manufacturer.website }}"
class="text-blue-600 hover:text-blue-700 dark:text-blue-400 dark:hover:text-blue-300"
target="_blank" rel="noopener noreferrer">
Website
<i class="ml-1 text-xs fas fa-external-link-alt"></i>
</a>
</div>
{% endif %}
<div class="flex flex-wrap gap-2">
{% if manufacturer.total_rides %}
<span class="px-2 py-1 text-sm font-medium text-blue-800 bg-blue-100 rounded-full dark:bg-blue-700 dark:text-blue-50">
{{ manufacturer.total_rides }} Rides
</span>
{% endif %}
{% if manufacturer.total_roller_coasters %}
<span class="px-2 py-1 text-sm font-medium text-green-800 bg-green-100 rounded-full dark:bg-green-700 dark:text-green-50">
{{ manufacturer.total_roller_coasters }} Coasters
</span>
{% endif %}
</div>
</div>
{% endfor %}
</div>
{% else %}
<div class="p-6 text-center bg-white rounded-lg shadow dark:bg-gray-800">
<p class="text-gray-500 dark:text-gray-400">No manufacturers found.</p>
</div>
{% endif %}
<!-- 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="px-3 py-2 text-sm font-medium text-gray-500 bg-white border border-gray-300 rounded-l-md hover:bg-gray-50 dark:bg-gray-800 dark:border-gray-600 dark:text-gray-400 dark:hover:bg-gray-700">
Previous
</a>
{% endif %}
<span class="px-3 py-2 text-sm font-medium text-gray-700 bg-white border-t border-b border-gray-300 dark:bg-gray-800 dark:border-gray-600 dark:text-gray-300">
Page {{ page_obj.number }} of {{ page_obj.paginator.num_pages }}
</span>
{% if page_obj.has_next %}
<a href="?page={{ page_obj.next_page_number }}"
class="px-3 py-2 text-sm font-medium text-gray-500 bg-white border border-gray-300 rounded-r-md hover:bg-gray-50 dark:bg-gray-800 dark:border-gray-600 dark:text-gray-400 dark:hover:bg-gray-700">
Next
</a>
{% endif %}
</nav>
</div>
{% endif %}
</div>
{% endblock %}

View File

@@ -0,0 +1,106 @@
{% extends "base/base.html" %}
{% load static %}
{% block title %}{{ manufacturer.name }} - ThrillWiki{% endblock %}
{% block content %}
<div class="container px-4 mx-auto sm:px-6 lg:px-8">
<!-- Manufacturer Header -->
<div class="mb-8">
<h1 class="text-4xl font-bold text-gray-900 dark:text-white mb-4">{{ manufacturer.name }}</h1>
{% if manufacturer.description %}
<div class="prose dark:prose-invert max-w-none mb-6">
<p class="text-lg text-gray-600 dark:text-gray-400">{{ manufacturer.description }}</p>
</div>
{% endif %}
<!-- Manufacturer Details -->
<div class="grid grid-cols-1 md:grid-cols-3 gap-4 mb-6">
{% if manufacturer.founded_year %}
<div class="bg-white dark:bg-gray-800 rounded-lg p-4 shadow-sm">
<h3 class="text-sm font-medium text-gray-500 dark:text-gray-400">Founded</h3>
<p class="text-lg font-semibold text-gray-900 dark:text-white">{{ manufacturer.founded_year }}</p>
</div>
{% endif %}
{% if manufacturer.headquarters %}
<div class="bg-white dark:bg-gray-800 rounded-lg p-4 shadow-sm">
<h3 class="text-sm font-medium text-gray-500 dark:text-gray-400">Headquarters</h3>
<p class="text-lg font-semibold text-gray-900 dark:text-white">{{ manufacturer.headquarters }}</p>
</div>
{% endif %}
<div class="bg-white dark:bg-gray-800 rounded-lg p-4 shadow-sm">
<h3 class="text-sm font-medium text-gray-500 dark:text-gray-400">Rides Manufactured</h3>
<p class="text-lg font-semibold text-gray-900 dark:text-white">{{ rides.count }}</p>
</div>
</div>
</div>
<!-- Rides Section -->
{% if rides %}
<div class="mb-8">
<h2 class="text-2xl font-bold text-gray-900 dark:text-white mb-6">Rides Manufactured</h2>
<div class="grid gap-6 md:grid-cols-2 lg:grid-cols-3">
{% for ride in rides %}
<div class="bg-white dark:bg-gray-800 rounded-lg shadow-md overflow-hidden">
{% if ride.main_image %}
<img src="{{ ride.main_image.url }}" alt="{{ ride.name }}" class="w-full h-48 object-cover">
{% endif %}
<div class="p-6">
<h3 class="text-xl font-semibold text-gray-900 dark:text-white mb-2">
<a href="{% url 'rides:ride_detail' ride.slug %}" class="hover:text-blue-600 dark:hover:text-blue-400">
{{ ride.name }}
</a>
</h3>
{% if ride.park %}
<p class="text-gray-600 dark:text-gray-400 mb-2">
<a href="{% url 'parks:park_detail' ride.park.slug %}" class="hover:text-blue-600 dark:hover:text-blue-400">
{{ ride.park.name }}
</a>
</p>
{% endif %}
<div class="text-sm text-gray-500 dark:text-gray-500">
{% if ride.ride_type %}
<p class="mb-1">{{ ride.ride_type }}</p>
{% endif %}
{% if ride.opened_date %}
<p>Opened {{ ride.opened_date|date:"Y" }}</p>
{% endif %}
</div>
</div>
</div>
{% endfor %}
</div>
</div>
{% else %}
<div class="mb-8">
<h2 class="text-2xl font-bold text-gray-900 dark:text-white mb-6">Rides Manufactured</h2>
<div class="bg-gray-50 dark:bg-gray-800 rounded-lg p-8 text-center">
<p class="text-gray-500 dark:text-gray-400">No rides currently manufactured by this company.</p>
</div>
</div>
{% endif %}
<!-- Additional Information -->
{% if manufacturer.website %}
<div class="mb-8">
<h2 class="text-2xl font-bold text-gray-900 dark:text-white mb-4">Links</h2>
<div class="bg-white dark:bg-gray-800 rounded-lg p-6 shadow-sm">
<a href="{{ manufacturer.website }}" target="_blank" rel="noopener noreferrer"
class="inline-flex items-center text-blue-600 dark:text-blue-400 hover:text-blue-800 dark:hover:text-blue-300">
Official Website
<svg class="w-4 h-4 ml-1" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"></path>
</svg>
</a>
</div>
</div>
{% endif %}
</div>
{% endblock %}

View File

@@ -0,0 +1,63 @@
{% extends "base/base.html" %}
{% load static %}
{% block title %}Manufacturers - ThrillWiki{% endblock %}
{% block content %}
<div class="container px-4 mx-auto sm:px-6 lg:px-8">
<!-- Header -->
<div class="mb-8">
<h1 class="text-3xl font-bold text-gray-900 dark:text-white">Ride Manufacturers</h1>
<p class="mt-2 text-gray-600 dark:text-gray-400">Companies that manufacture theme park rides and attractions</p>
</div>
<!-- Manufacturers List -->
<div class="grid gap-6 md:grid-cols-2 lg:grid-cols-3">
{% for manufacturer in manufacturers %}
<div class="bg-white dark:bg-gray-800 rounded-lg shadow-md p-6">
<h3 class="text-xl font-semibold text-gray-900 dark:text-white mb-2">
<a href="{% url 'manufacturers:manufacturer_detail' manufacturer.slug %}" class="hover:text-blue-600 dark:hover:text-blue-400">
{{ manufacturer.name }}
</a>
</h3>
{% if manufacturer.description %}
<p class="text-gray-600 dark:text-gray-400 mb-4">{{ manufacturer.description|truncatewords:20 }}</p>
{% endif %}
<div class="text-sm text-gray-500 dark:text-gray-500">
{% if manufacturer.rides_count %}
<span class="inline-block mr-4">{{ manufacturer.rides_count }} ride{{ manufacturer.rides_count|pluralize }}</span>
{% endif %}
{% if manufacturer.founded_year %}
<span class="inline-block">Founded {{ manufacturer.founded_year }}</span>
{% endif %}
</div>
</div>
{% empty %}
<div class="col-span-full text-center py-12">
<p class="text-gray-500 dark:text-gray-400">No manufacturers found.</p>
</div>
{% endfor %}
</div>
<!-- Pagination -->
{% if is_paginated %}
<div class="mt-8 flex justify-center">
<nav class="flex space-x-2">
{% if page_obj.has_previous %}
<a href="?page={{ page_obj.previous_page_number }}" class="px-3 py-2 bg-blue-600 text-white rounded hover:bg-blue-700">Previous</a>
{% endif %}
<span class="px-3 py-2 bg-gray-200 dark:bg-gray-700 text-gray-700 dark:text-gray-300 rounded">
Page {{ page_obj.number }} of {{ page_obj.paginator.num_pages }}
</span>
{% if page_obj.has_next %}
<a href="?page={{ page_obj.next_page_number }}" class="px-3 py-2 bg-blue-600 text-white rounded hover:bg-blue-700">Next</a>
{% endif %}
</nav>
</div>
{% endif %}
</div>
{% endblock %}

View File

@@ -0,0 +1,96 @@
{% extends "base/base.html" %}
{% load static %}
{% block title %}{{ operator.name }} - ThrillWiki{% endblock %}
{% block content %}
<div class="container px-4 mx-auto sm:px-6 lg:px-8">
<!-- Operator Header -->
<div class="mb-8">
<h1 class="text-4xl font-bold text-gray-900 dark:text-white mb-4">{{ operator.name }}</h1>
{% if operator.description %}
<div class="prose dark:prose-invert max-w-none mb-6">
<p class="text-lg text-gray-600 dark:text-gray-400">{{ operator.description }}</p>
</div>
{% endif %}
<!-- Operator Details -->
<div class="grid grid-cols-1 md:grid-cols-3 gap-4 mb-6">
{% if operator.founded_year %}
<div class="bg-white dark:bg-gray-800 rounded-lg p-4 shadow-sm">
<h3 class="text-sm font-medium text-gray-500 dark:text-gray-400">Founded</h3>
<p class="text-lg font-semibold text-gray-900 dark:text-white">{{ operator.founded_year }}</p>
</div>
{% endif %}
{% if operator.headquarters %}
<div class="bg-white dark:bg-gray-800 rounded-lg p-4 shadow-sm">
<h3 class="text-sm font-medium text-gray-500 dark:text-gray-400">Headquarters</h3>
<p class="text-lg font-semibold text-gray-900 dark:text-white">{{ operator.headquarters }}</p>
</div>
{% endif %}
<div class="bg-white dark:bg-gray-800 rounded-lg p-4 shadow-sm">
<h3 class="text-sm font-medium text-gray-500 dark:text-gray-400">Parks Operated</h3>
<p class="text-lg font-semibold text-gray-900 dark:text-white">{{ parks.count }}</p>
</div>
</div>
</div>
<!-- Parks Section -->
{% if parks %}
<div class="mb-8">
<h2 class="text-2xl font-bold text-gray-900 dark:text-white mb-6">Parks Operated</h2>
<div class="grid gap-6 md:grid-cols-2 lg:grid-cols-3">
{% for park in parks %}
<div class="bg-white dark:bg-gray-800 rounded-lg shadow-md overflow-hidden">
{% if park.main_image %}
<img src="{{ park.main_image.url }}" alt="{{ park.name }}" class="w-full h-48 object-cover">
{% endif %}
<div class="p-6">
<h3 class="text-xl font-semibold text-gray-900 dark:text-white mb-2">
<a href="{% url 'parks:park_detail' park.slug %}" class="hover:text-blue-600 dark:hover:text-blue-400">
{{ park.name }}
</a>
</h3>
{% if park.location_display %}
<p class="text-gray-600 dark:text-gray-400 mb-2">{{ park.location_display }}</p>
{% endif %}
{% if park.opened_date %}
<p class="text-sm text-gray-500 dark:text-gray-500">Opened {{ park.opened_date|date:"Y" }}</p>
{% endif %}
</div>
</div>
{% endfor %}
</div>
</div>
{% else %}
<div class="mb-8">
<h2 class="text-2xl font-bold text-gray-900 dark:text-white mb-6">Parks Operated</h2>
<div class="bg-gray-50 dark:bg-gray-800 rounded-lg p-8 text-center">
<p class="text-gray-500 dark:text-gray-400">No parks currently operated by this company.</p>
</div>
</div>
{% endif %}
<!-- Additional Information -->
{% if operator.website %}
<div class="mb-8">
<h2 class="text-2xl font-bold text-gray-900 dark:text-white mb-4">Links</h2>
<div class="bg-white dark:bg-gray-800 rounded-lg p-6 shadow-sm">
<a href="{{ operator.website }}" target="_blank" rel="noopener noreferrer"
class="inline-flex items-center text-blue-600 dark:text-blue-400 hover:text-blue-800 dark:hover:text-blue-300">
Official Website
<svg class="w-4 h-4 ml-1" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"></path>
</svg>
</a>
</div>
</div>
{% endif %}
</div>
{% endblock %}

View File

@@ -0,0 +1,63 @@
{% extends "base/base.html" %}
{% load static %}
{% block title %}Operators - ThrillWiki{% endblock %}
{% block content %}
<div class="container px-4 mx-auto sm:px-6 lg:px-8">
<!-- Header -->
<div class="mb-8">
<h1 class="text-3xl font-bold text-gray-900 dark:text-white">Park Operators</h1>
<p class="mt-2 text-gray-600 dark:text-gray-400">Companies that operate theme parks around the world</p>
</div>
<!-- Operators List -->
<div class="grid gap-6 md:grid-cols-2 lg:grid-cols-3">
{% for operator in operators %}
<div class="bg-white dark:bg-gray-800 rounded-lg shadow-md p-6">
<h3 class="text-xl font-semibold text-gray-900 dark:text-white mb-2">
<a href="{% url 'operators:operator_detail' operator.slug %}" class="hover:text-blue-600 dark:hover:text-blue-400">
{{ operator.name }}
</a>
</h3>
{% if operator.description %}
<p class="text-gray-600 dark:text-gray-400 mb-4">{{ operator.description|truncatewords:20 }}</p>
{% endif %}
<div class="text-sm text-gray-500 dark:text-gray-500">
{% if operator.parks_count %}
<span class="inline-block mr-4">{{ operator.parks_count }} park{{ operator.parks_count|pluralize }}</span>
{% endif %}
{% if operator.founded_year %}
<span class="inline-block">Founded {{ operator.founded_year }}</span>
{% endif %}
</div>
</div>
{% empty %}
<div class="col-span-full text-center py-12">
<p class="text-gray-500 dark:text-gray-400">No operators found.</p>
</div>
{% endfor %}
</div>
<!-- Pagination -->
{% if is_paginated %}
<div class="mt-8 flex justify-center">
<nav class="flex space-x-2">
{% if page_obj.has_previous %}
<a href="?page={{ page_obj.previous_page_number }}" class="px-3 py-2 bg-blue-600 text-white rounded hover:bg-blue-700">Previous</a>
{% endif %}
<span class="px-3 py-2 bg-gray-200 dark:bg-gray-700 text-gray-700 dark:text-gray-300 rounded">
Page {{ page_obj.number }} of {{ page_obj.paginator.num_pages }}
</span>
{% if page_obj.has_next %}
<a href="?page={{ page_obj.next_page_number }}" class="px-3 py-2 bg-blue-600 text-white rounded hover:bg-blue-700">Next</a>
{% endif %}
</nav>
</div>
{% endif %}
</div>
{% endblock %}

View File

@@ -57,15 +57,30 @@
<!-- Horizontal Stats Bar -->
<div class="grid-stats mb-6">
<!-- Owner - Priority Card (First Position) -->
{% if park.owner %}
<!-- Operator - Priority Card (First Position) -->
{% if park.operator %}
<div class="bg-white rounded-lg shadow-lg dark:bg-gray-800 p-compact card-stats card-stats-priority">
<div class="text-center">
<dt class="text-sm font-semibold text-gray-900 dark:text-white">Owner</dt>
<dt class="text-sm font-semibold text-gray-900 dark:text-white">Operator</dt>
<dd class="mt-1">
<a href="{% url 'companies:company_detail' park.owner.slug %}"
<a href="{% url 'operators:operator_detail' park.operator.slug %}"
class="text-sm font-bold text-sky-900 dark:text-sky-400 hover:text-sky-800 dark:hover:text-sky-300">
{{ park.owner.name }}
{{ park.operator.name }}
</a>
</dd>
</div>
</div>
{% endif %}
<!-- Property Owner (if different from operator) -->
{% if park.property_owner and park.property_owner != park.operator %}
<div class="bg-white rounded-lg shadow-lg dark:bg-gray-800 p-compact card-stats">
<div class="text-center">
<dt class="text-sm font-semibold text-gray-900 dark:text-white">Property Owner</dt>
<dd class="mt-1">
<a href="{% url 'property_owners:property_owner_detail' park.property_owner.slug %}"
class="text-sm font-bold text-sky-900 dark:text-sky-400 hover:text-sky-800 dark:hover:text-sky-300">
{{ park.property_owner.name }}
</a>
</dd>
</div>

View File

@@ -0,0 +1,107 @@
{% extends "base/base.html" %}
{% load static %}
{% block title %}{{ property_owner.name }} - ThrillWiki{% endblock %}
{% block content %}
<div class="container px-4 mx-auto sm:px-6 lg:px-8">
<!-- Property Owner Header -->
<div class="mb-8">
<h1 class="text-4xl font-bold text-gray-900 dark:text-white mb-4">{{ property_owner.name }}</h1>
{% if property_owner.description %}
<div class="prose dark:prose-invert max-w-none mb-6">
<p class="text-lg text-gray-600 dark:text-gray-400">{{ property_owner.description }}</p>
</div>
{% endif %}
<!-- Property Owner Details -->
<div class="grid grid-cols-1 md:grid-cols-3 gap-4 mb-6">
{% if property_owner.founded_year %}
<div class="bg-white dark:bg-gray-800 rounded-lg p-4 shadow-sm">
<h3 class="text-sm font-medium text-gray-500 dark:text-gray-400">Founded</h3>
<p class="text-lg font-semibold text-gray-900 dark:text-white">{{ property_owner.founded_year }}</p>
</div>
{% endif %}
{% if property_owner.headquarters %}
<div class="bg-white dark:bg-gray-800 rounded-lg p-4 shadow-sm">
<h3 class="text-sm font-medium text-gray-500 dark:text-gray-400">Headquarters</h3>
<p class="text-lg font-semibold text-gray-900 dark:text-white">{{ property_owner.headquarters }}</p>
</div>
{% endif %}
<div class="bg-white dark:bg-gray-800 rounded-lg p-4 shadow-sm">
<h3 class="text-sm font-medium text-gray-500 dark:text-gray-400">Properties Owned</h3>
<p class="text-lg font-semibold text-gray-900 dark:text-white">{{ owned_parks.count }}</p>
</div>
</div>
</div>
<!-- Owned Properties Section -->
{% if owned_parks %}
<div class="mb-8">
<h2 class="text-2xl font-bold text-gray-900 dark:text-white mb-6">Properties Owned</h2>
<div class="grid gap-6 md:grid-cols-2 lg:grid-cols-3">
{% for park in owned_parks %}
<div class="bg-white dark:bg-gray-800 rounded-lg shadow-md overflow-hidden">
{% if park.main_image %}
<img src="{{ park.main_image.url }}" alt="{{ park.name }}" class="w-full h-48 object-cover">
{% endif %}
<div class="p-6">
<h3 class="text-xl font-semibold text-gray-900 dark:text-white mb-2">
<a href="{% url 'parks:park_detail' park.slug %}" class="hover:text-blue-600 dark:hover:text-blue-400">
{{ park.name }}
</a>
</h3>
{% if park.location_display %}
<p class="text-gray-600 dark:text-gray-400 mb-2">{{ park.location_display }}</p>
{% endif %}
<div class="text-sm text-gray-500 dark:text-gray-500">
{% if park.operator %}
<p class="mb-1">
Operated by:
<a href="{% url 'operators:operator_detail' park.operator.slug %}" class="text-blue-600 dark:text-blue-400 hover:underline">
{{ park.operator.name }}
</a>
</p>
{% endif %}
{% if park.opened_date %}
<p>Opened {{ park.opened_date|date:"Y" }}</p>
{% endif %}
</div>
</div>
</div>
{% endfor %}
</div>
</div>
{% else %}
<div class="mb-8">
<h2 class="text-2xl font-bold text-gray-900 dark:text-white mb-6">Properties Owned</h2>
<div class="bg-gray-50 dark:bg-gray-800 rounded-lg p-8 text-center">
<p class="text-gray-500 dark:text-gray-400">No properties currently owned by this company.</p>
</div>
</div>
{% endif %}
<!-- Additional Information -->
{% if property_owner.website %}
<div class="mb-8">
<h2 class="text-2xl font-bold text-gray-900 dark:text-white mb-4">Links</h2>
<div class="bg-white dark:bg-gray-800 rounded-lg p-6 shadow-sm">
<a href="{{ property_owner.website }}" target="_blank" rel="noopener noreferrer"
class="inline-flex items-center text-blue-600 dark:text-blue-400 hover:text-blue-800 dark:hover:text-blue-300">
Official Website
<svg class="w-4 h-4 ml-1" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"></path>
</svg>
</a>
</div>
</div>
{% endif %}
</div>
{% endblock %}

View File

@@ -0,0 +1,63 @@
{% extends "base/base.html" %}
{% load static %}
{% block title %}Property Owners - ThrillWiki{% endblock %}
{% block content %}
<div class="container px-4 mx-auto sm:px-6 lg:px-8">
<!-- Header -->
<div class="mb-8">
<h1 class="text-3xl font-bold text-gray-900 dark:text-white">Property Owners</h1>
<p class="mt-2 text-gray-600 dark:text-gray-400">Companies that own theme park properties around the world</p>
</div>
<!-- Property Owners List -->
<div class="grid gap-6 md:grid-cols-2 lg:grid-cols-3">
{% for property_owner in property_owners %}
<div class="bg-white dark:bg-gray-800 rounded-lg shadow-md p-6">
<h3 class="text-xl font-semibold text-gray-900 dark:text-white mb-2">
<a href="{% url 'property_owners:property_owner_detail' property_owner.slug %}" class="hover:text-blue-600 dark:hover:text-blue-400">
{{ property_owner.name }}
</a>
</h3>
{% if property_owner.description %}
<p class="text-gray-600 dark:text-gray-400 mb-4">{{ property_owner.description|truncatewords:20 }}</p>
{% endif %}
<div class="text-sm text-gray-500 dark:text-gray-500">
{% if property_owner.owned_parks_count %}
<span class="inline-block mr-4">{{ property_owner.owned_parks_count }} propert{{ property_owner.owned_parks_count|pluralize:"y,ies" }}</span>
{% endif %}
{% if property_owner.founded_year %}
<span class="inline-block">Founded {{ property_owner.founded_year }}</span>
{% endif %}
</div>
</div>
{% empty %}
<div class="col-span-full text-center py-12">
<p class="text-gray-500 dark:text-gray-400">No property owners found.</p>
</div>
{% endfor %}
</div>
<!-- Pagination -->
{% if is_paginated %}
<div class="mt-8 flex justify-center">
<nav class="flex space-x-2">
{% if page_obj.has_previous %}
<a href="?page={{ page_obj.previous_page_number }}" class="px-3 py-2 bg-blue-600 text-white rounded hover:bg-blue-700">Previous</a>
{% endif %}
<span class="px-3 py-2 bg-gray-200 dark:bg-gray-700 text-gray-700 dark:text-gray-300 rounded">
Page {{ page_obj.number }} of {{ page_obj.paginator.num_pages }}
</span>
{% if page_obj.has_next %}
<a href="?page={{ page_obj.next_page_number }}" class="px-3 py-2 bg-blue-600 text-white rounded hover:bg-blue-700">Next</a>
{% endif %}
</nav>
</div>
{% endif %}
</div>
{% endblock %}

View File

@@ -96,7 +96,7 @@
<dt class="text-sm font-semibold text-gray-900 dark:text-white">Manufacturer</dt>
<dd class="mt-1">
{% if ride.manufacturer %}
<a href="{% url 'companies:manufacturer_detail' ride.manufacturer.slug %}"
<a href="{% url 'manufacturers:manufacturer_detail' ride.manufacturer.slug %}"
class="text-xs text-blue-600 hover:text-blue-700 dark:text-blue-400 dark:hover:text-blue-300">
{{ ride.manufacturer.name }}
</a>

View File

@@ -112,28 +112,55 @@
</div>
</div>
<!-- Companies Results -->
<!-- Operators Results -->
<div class="p-6 bg-white rounded-lg shadow dark:bg-gray-800">
<h2 class="mb-4 text-xl font-semibold">Companies</h2>
<h2 class="mb-4 text-xl font-semibold">Park Operators</h2>
<div class="grid grid-cols-1 gap-6 md:grid-cols-2 lg:grid-cols-3">
{% for company in companies %}
{% for operator in operators %}
<div class="p-4 rounded-lg bg-gray-50 dark:bg-gray-700">
<h3 class="mb-2 text-lg font-semibold">
<a href="{% url 'companies:company_detail' company.slug %}"
<a href="{% url 'operators:operator_detail' operator.slug %}"
class="text-blue-600 hover:underline dark:text-blue-400">
{{ company.name }}
{{ operator.name }}
</a>
</h3>
{% if company.headquarters %}
<p class="mb-2 text-gray-600 dark:text-gray-400">{{ company.headquarters }}</p>
{% if operator.headquarters %}
<p class="mb-2 text-gray-600 dark:text-gray-400">{{ operator.headquarters }}</p>
{% endif %}
<div class="text-sm text-gray-500 dark:text-gray-400">
{{ company.parks.count }} parks owned
{{ operator.operated_parks.count }} parks operated
</div>
</div>
{% empty %}
<div class="py-4 text-center col-span-full">
<p class="text-gray-500 dark:text-gray-400">No companies found matching your search.</p>
<p class="text-gray-500 dark:text-gray-400">No operators found matching your search.</p>
</div>
{% endfor %}
</div>
</div>
<!-- Property Owners Results -->
<div class="p-6 bg-white rounded-lg shadow dark:bg-gray-800">
<h2 class="mb-4 text-xl font-semibold">Property Owners</h2>
<div class="grid grid-cols-1 gap-6 md:grid-cols-2 lg:grid-cols-3">
{% for property_owner in property_owners %}
<div class="p-4 rounded-lg bg-gray-50 dark:bg-gray-700">
<h3 class="mb-2 text-lg font-semibold">
<a href="{% url 'property_owners:property_owner_detail' property_owner.slug %}"
class="text-blue-600 hover:underline dark:text-blue-400">
{{ property_owner.name }}
</a>
</h3>
{% if property_owner.headquarters %}
<p class="mb-2 text-gray-600 dark:text-gray-400">{{ property_owner.headquarters }}</p>
{% endif %}
<div class="text-sm text-gray-500 dark:text-gray-400">
{{ property_owner.owned_parks.count }} properties owned
</div>
</div>
{% empty %}
<div class="py-4 text-center col-span-full">
<p class="text-gray-500 dark:text-gray-400">No property owners found matching your search.</p>
</div>
{% endfor %}
</div>