mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2025-12-21 11:11:08 -05:00
Add homepage templates for featured parks, rides, recent activity, search results, and statistics
- Implemented featured parks and rides sections with responsive design and hover effects. - Created a recent activity feed to display user interactions with parks and rides. - Developed a search results template to show relevant results with icons and descriptions. - Added a statistics dashboard to showcase total parks, rides, reviews, and countries.
This commit is contained in:
96
templates/partials/homepage/featured_parks.html
Normal file
96
templates/partials/homepage/featured_parks.html
Normal file
@@ -0,0 +1,96 @@
|
||||
<!-- Featured Parks Grid -->
|
||||
{% for park in featured_parks %}
|
||||
<div class="group relative overflow-hidden rounded-xl bg-background border border-border/50 shadow-sm hover:shadow-lg transition-all duration-300 transform hover:-translate-y-1">
|
||||
<!-- Park Image -->
|
||||
<div class="aspect-video relative overflow-hidden">
|
||||
{% if park.card_image %}
|
||||
<img src="{{ park.card_image.url }}"
|
||||
alt="{{ park.name }}"
|
||||
class="w-full h-full object-cover group-hover:scale-105 transition-transform duration-300"
|
||||
loading="lazy">
|
||||
{% else %}
|
||||
<div class="w-full h-full bg-gradient-to-br from-primary/20 to-secondary/20 flex items-center justify-center">
|
||||
<svg class="w-16 h-16 text-muted-foreground" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4"></path>
|
||||
</svg>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<!-- Overlay -->
|
||||
<div class="absolute inset-0 bg-gradient-to-t from-black/60 via-transparent to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-300"></div>
|
||||
|
||||
<!-- Quick Stats Overlay -->
|
||||
<div class="absolute top-4 right-4 flex gap-2">
|
||||
{% if park.average_rating %}
|
||||
<div class="bg-background/90 backdrop-blur-sm px-2 py-1 rounded-full text-xs font-medium flex items-center gap-1">
|
||||
<svg class="w-3 h-3 text-yellow-500" fill="currentColor" viewBox="0 0 20 20">
|
||||
<path d="M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z"></path>
|
||||
</svg>
|
||||
{{ park.average_rating|floatformat:1 }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if park.ride_count %}
|
||||
<div class="bg-background/90 backdrop-blur-sm px-2 py-1 rounded-full text-xs font-medium">
|
||||
{{ park.ride_count }} rides
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Park Info -->
|
||||
<div class="p-6">
|
||||
<h3 class="text-xl font-bold mb-2 group-hover:text-primary transition-colors">
|
||||
<a href="/parks/{{ park.slug }}/" class="stretched-link">
|
||||
{{ park.name }}
|
||||
</a>
|
||||
</h3>
|
||||
|
||||
<p class="text-muted-foreground text-sm mb-4 line-clamp-2">
|
||||
{{ park.description|truncatewords:20 }}
|
||||
</p>
|
||||
|
||||
<!-- Park Details -->
|
||||
<div class="flex items-center justify-between text-sm">
|
||||
<div class="flex items-center gap-4">
|
||||
{% if park.location %}
|
||||
<div class="flex items-center gap-1 text-muted-foreground">
|
||||
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"></path>
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 11a3 3 0 11-6 0 3 3 0 016 0z"></path>
|
||||
</svg>
|
||||
{{ park.location.city }}, {{ park.location.country }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if park.opening_year %}
|
||||
<div class="flex items-center gap-1 text-muted-foreground">
|
||||
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"></path>
|
||||
</svg>
|
||||
{{ park.opening_year }}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<!-- Status Badge -->
|
||||
{% if park.status %}
|
||||
<span class="px-2 py-1 rounded-full text-xs font-medium
|
||||
{% if park.status == 'operating' %}bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400
|
||||
{% elif park.status == 'closed' %}bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-400
|
||||
{% elif park.status == 'seasonal' %}bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-400
|
||||
{% else %}bg-gray-100 text-gray-800 dark:bg-gray-900/30 dark:text-gray-400{% endif %}">
|
||||
{{ park.get_status_display }}
|
||||
</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% empty %}
|
||||
<div class="col-span-full text-center py-12">
|
||||
<svg class="w-16 h-16 text-muted-foreground mx-auto mb-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4"></path>
|
||||
</svg>
|
||||
<h3 class="text-lg font-semibold mb-2">No Featured Parks</h3>
|
||||
<p class="text-muted-foreground">Check back soon for featured theme parks!</p>
|
||||
</div>
|
||||
{% endfor %}
|
||||
128
templates/partials/homepage/featured_rides.html
Normal file
128
templates/partials/homepage/featured_rides.html
Normal file
@@ -0,0 +1,128 @@
|
||||
<!-- Featured Rides Grid -->
|
||||
{% for ride in featured_rides %}
|
||||
<div class="group relative overflow-hidden rounded-xl bg-background border border-border/50 shadow-sm hover:shadow-lg transition-all duration-300 transform hover:-translate-y-1">
|
||||
<!-- Ride Image -->
|
||||
<div class="aspect-square relative overflow-hidden">
|
||||
{% if ride.card_image %}
|
||||
<img src="{{ ride.card_image.url }}"
|
||||
alt="{{ ride.name }}"
|
||||
class="w-full h-full object-cover group-hover:scale-105 transition-transform duration-300"
|
||||
loading="lazy">
|
||||
{% else %}
|
||||
<div class="w-full h-full bg-gradient-to-br from-secondary/20 to-accent/20 flex items-center justify-center">
|
||||
<svg class="w-12 h-12 text-muted-foreground" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z"></path>
|
||||
</svg>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<!-- Overlay -->
|
||||
<div class="absolute inset-0 bg-gradient-to-t from-black/60 via-transparent to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-300"></div>
|
||||
|
||||
<!-- Quick Stats Overlay -->
|
||||
<div class="absolute top-3 right-3 flex flex-col gap-1">
|
||||
{% if ride.average_rating %}
|
||||
<div class="bg-background/90 backdrop-blur-sm px-2 py-1 rounded-full text-xs font-medium flex items-center gap-1">
|
||||
<svg class="w-3 h-3 text-yellow-500" fill="currentColor" viewBox="0 0 20 20">
|
||||
<path d="M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z"></path>
|
||||
</svg>
|
||||
{{ ride.average_rating|floatformat:1 }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if ride.ride_type %}
|
||||
<div class="bg-background/90 backdrop-blur-sm px-2 py-1 rounded-full text-xs font-medium">
|
||||
{{ ride.get_ride_type_display }}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<!-- Thrill Level Indicator -->
|
||||
{% if ride.thrill_level %}
|
||||
<div class="absolute bottom-3 left-3">
|
||||
<div class="flex items-center gap-1 bg-background/90 backdrop-blur-sm px-2 py-1 rounded-full text-xs font-medium">
|
||||
{% if ride.thrill_level == 'family' %}
|
||||
<div class="w-2 h-2 rounded-full bg-green-500"></div>
|
||||
<span class="text-green-700 dark:text-green-400">Family</span>
|
||||
{% elif ride.thrill_level == 'moderate' %}
|
||||
<div class="w-2 h-2 rounded-full bg-yellow-500"></div>
|
||||
<span class="text-yellow-700 dark:text-yellow-400">Moderate</span>
|
||||
{% elif ride.thrill_level == 'extreme' %}
|
||||
<div class="w-2 h-2 rounded-full bg-red-500"></div>
|
||||
<span class="text-red-700 dark:text-red-400">Extreme</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<!-- Ride Info -->
|
||||
<div class="p-4">
|
||||
<h3 class="font-bold mb-1 group-hover:text-primary transition-colors line-clamp-1">
|
||||
<a href="/rides/{{ ride.slug }}/" class="stretched-link">
|
||||
{{ ride.name }}
|
||||
</a>
|
||||
</h3>
|
||||
|
||||
<p class="text-sm text-muted-foreground mb-2 line-clamp-1">
|
||||
<a href="/parks/{{ ride.park.slug }}/" class="hover:text-primary transition-colors">
|
||||
{{ ride.park.name }}
|
||||
</a>
|
||||
</p>
|
||||
|
||||
<!-- Ride Stats -->
|
||||
<div class="flex items-center justify-between text-xs text-muted-foreground">
|
||||
{% if ride.height_requirement %}
|
||||
<div class="flex items-center gap-1">
|
||||
<svg class="w-3 h-3" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 4V2a1 1 0 011-1h8a1 1 0 011 1v2m-9 0h10m-10 0a2 2 0 00-2 2v14a2 2 0 002 2h10a2 2 0 002-2V6a2 2 0 00-2-2"></path>
|
||||
</svg>
|
||||
{{ ride.height_requirement }}"
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if ride.opening_year %}
|
||||
<div class="flex items-center gap-1">
|
||||
<svg class="w-3 h-3" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"></path>
|
||||
</svg>
|
||||
{{ ride.opening_year }}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<!-- Roller Coaster Stats (if applicable) -->
|
||||
{% if ride.roller_coaster_stats %}
|
||||
<div class="mt-2 pt-2 border-t border-border/50">
|
||||
<div class="grid grid-cols-2 gap-2 text-xs">
|
||||
{% if ride.roller_coaster_stats.max_height %}
|
||||
<div class="flex items-center gap-1 text-muted-foreground">
|
||||
<svg class="w-3 h-3" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 11l5-5m0 0l5 5m-5-5v12"></path>
|
||||
</svg>
|
||||
{{ ride.roller_coaster_stats.max_height }}ft
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if ride.roller_coaster_stats.max_speed %}
|
||||
<div class="flex items-center gap-1 text-muted-foreground">
|
||||
<svg class="w-3 h-3" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z"></path>
|
||||
</svg>
|
||||
{{ ride.roller_coaster_stats.max_speed }}mph
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% empty %}
|
||||
<div class="col-span-full text-center py-12">
|
||||
<svg class="w-16 h-16 text-muted-foreground mx-auto mb-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z"></path>
|
||||
</svg>
|
||||
<h3 class="text-lg font-semibold mb-2">No Featured Rides</h3>
|
||||
<p class="text-muted-foreground">Check back soon for featured thrilling rides!</p>
|
||||
</div>
|
||||
{% endfor %}
|
||||
183
templates/partials/homepage/recent_activity.html
Normal file
183
templates/partials/homepage/recent_activity.html
Normal file
@@ -0,0 +1,183 @@
|
||||
<!-- Recent Activity Feed -->
|
||||
{% for activity in recent_activities %}
|
||||
<div class="flex items-start space-x-4 p-6 bg-background rounded-xl border border-border/50 hover:shadow-md transition-all duration-200">
|
||||
<!-- Activity Icon/Avatar -->
|
||||
<div class="flex-shrink-0">
|
||||
{% if activity.type == 'review' %}
|
||||
<div class="w-12 h-12 bg-primary/10 rounded-full flex items-center justify-center">
|
||||
<svg class="w-6 h-6 text-primary" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z"></path>
|
||||
</svg>
|
||||
</div>
|
||||
{% elif activity.type == 'photo' %}
|
||||
<div class="w-12 h-12 bg-secondary/10 rounded-full flex items-center justify-center">
|
||||
<svg class="w-6 h-6 text-secondary" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"></path>
|
||||
</svg>
|
||||
</div>
|
||||
{% elif activity.type == 'park_update' %}
|
||||
<div class="w-12 h-12 bg-accent/10 rounded-full flex items-center justify-center">
|
||||
<svg class="w-6 h-6 text-accent" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4"></path>
|
||||
</svg>
|
||||
</div>
|
||||
{% elif activity.type == 'ride_update' %}
|
||||
<div class="w-12 h-12 bg-primary/10 rounded-full flex items-center justify-center">
|
||||
<svg class="w-6 h-6 text-primary" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z"></path>
|
||||
</svg>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="w-12 h-12 bg-muted rounded-full flex items-center justify-center">
|
||||
<svg class="w-6 h-6 text-muted-foreground" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path>
|
||||
</svg>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<!-- Activity Content -->
|
||||
<div class="flex-1 min-w-0">
|
||||
<!-- Activity Header -->
|
||||
<div class="flex items-center justify-between mb-2">
|
||||
<div class="flex items-center gap-2">
|
||||
{% if activity.user %}
|
||||
<span class="font-medium text-foreground">{{ activity.user.username }}</span>
|
||||
{% else %}
|
||||
<span class="font-medium text-foreground">ThrillWiki</span>
|
||||
{% endif %}
|
||||
|
||||
<!-- Activity Type Badge -->
|
||||
<span class="px-2 py-1 rounded-full text-xs font-medium
|
||||
{% if activity.type == 'review' %}bg-primary/10 text-primary
|
||||
{% elif activity.type == 'photo' %}bg-secondary/10 text-secondary
|
||||
{% elif activity.type == 'park_update' %}bg-accent/10 text-accent
|
||||
{% elif activity.type == 'ride_update' %}bg-primary/10 text-primary
|
||||
{% else %}bg-muted text-muted-foreground{% endif %}">
|
||||
{% if activity.type == 'review' %}Review
|
||||
{% elif activity.type == 'photo' %}Photo
|
||||
{% elif activity.type == 'park_update' %}Park Update
|
||||
{% elif activity.type == 'ride_update' %}Ride Update
|
||||
{% else %}Update{% endif %}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<!-- Timestamp -->
|
||||
<time class="text-sm text-muted-foreground" datetime="{{ activity.created_at|date:'c' }}">
|
||||
{{ activity.created_at|timesince }} ago
|
||||
</time>
|
||||
</div>
|
||||
|
||||
<!-- Activity Description -->
|
||||
<div class="mb-3">
|
||||
{% if activity.type == 'review' %}
|
||||
<p class="text-foreground">
|
||||
{% if activity.rating %}
|
||||
Rated
|
||||
<span class="inline-flex items-center gap-1">
|
||||
<svg class="w-4 h-4 text-yellow-500" fill="currentColor" viewBox="0 0 20 20">
|
||||
<path d="M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z"></path>
|
||||
</svg>
|
||||
{{ activity.rating }}/5
|
||||
</span>
|
||||
{% else %}
|
||||
Reviewed
|
||||
{% endif %}
|
||||
|
||||
{% if activity.content_object %}
|
||||
<a href="{{ activity.content_object.get_absolute_url }}" class="font-medium text-primary hover:text-primary/80 transition-colors">
|
||||
{{ activity.content_object.name }}
|
||||
</a>
|
||||
{% if activity.content_object.park and activity.content_object.park != activity.content_object %}
|
||||
at <a href="{{ activity.content_object.park.get_absolute_url }}" class="text-muted-foreground hover:text-primary transition-colors">{{ activity.content_object.park.name }}</a>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</p>
|
||||
|
||||
{% if activity.comment %}
|
||||
<blockquote class="mt-2 pl-4 border-l-2 border-border text-muted-foreground italic">
|
||||
"{{ activity.comment|truncatewords:20 }}"
|
||||
</blockquote>
|
||||
{% endif %}
|
||||
|
||||
{% elif activity.type == 'photo' %}
|
||||
<p class="text-foreground">
|
||||
Added a new photo to
|
||||
{% if activity.content_object %}
|
||||
<a href="{{ activity.content_object.get_absolute_url }}" class="font-medium text-primary hover:text-primary/80 transition-colors">
|
||||
{{ activity.content_object.name }}
|
||||
</a>
|
||||
{% endif %}
|
||||
</p>
|
||||
|
||||
{% elif activity.type == 'park_update' %}
|
||||
<p class="text-foreground">
|
||||
{% if activity.content_object %}
|
||||
<a href="{{ activity.content_object.get_absolute_url }}" class="font-medium text-primary hover:text-primary/80 transition-colors">
|
||||
{{ activity.content_object.name }}
|
||||
</a>
|
||||
{% endif %}
|
||||
{{ activity.description|default:"was updated" }}
|
||||
</p>
|
||||
|
||||
{% elif activity.type == 'ride_update' %}
|
||||
<p class="text-foreground">
|
||||
{% if activity.content_object %}
|
||||
<a href="{{ activity.content_object.get_absolute_url }}" class="font-medium text-primary hover:text-primary/80 transition-colors">
|
||||
{{ activity.content_object.name }}
|
||||
</a>
|
||||
{% if activity.content_object.park %}
|
||||
at <a href="{{ activity.content_object.park.get_absolute_url }}" class="text-muted-foreground hover:text-primary transition-colors">{{ activity.content_object.park.name }}</a>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{{ activity.description|default:"was updated" }}
|
||||
</p>
|
||||
|
||||
{% else %}
|
||||
<p class="text-foreground">{{ activity.description }}</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<!-- Activity Image (if applicable) -->
|
||||
{% if activity.image %}
|
||||
<div class="mt-3">
|
||||
<img src="{{ activity.image.url }}"
|
||||
alt="Activity image"
|
||||
class="w-full max-w-sm h-32 object-cover rounded-lg border border-border/50"
|
||||
loading="lazy">
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<!-- Activity Actions -->
|
||||
<div class="flex items-center gap-4 mt-3 text-sm text-muted-foreground">
|
||||
{% if activity.content_object %}
|
||||
<a href="{{ activity.content_object.get_absolute_url }}"
|
||||
class="inline-flex items-center gap-1 hover:text-primary transition-colors">
|
||||
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"></path>
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"></path>
|
||||
</svg>
|
||||
View Details
|
||||
</a>
|
||||
{% endif %}
|
||||
|
||||
{% if activity.type == 'review' and activity.helpful_count %}
|
||||
<span class="inline-flex items-center gap-1">
|
||||
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M14 10h4.764a2 2 0 011.789 2.894l-3.5 7A2 2 0 0115.263 21h-4.017c-.163 0-.326-.02-.485-.06L7 20m7-10V5a2 2 0 00-2-2h-.095c-.5 0-.905.405-.905.905 0 .714-.211 1.412-.608 2.006L7 11v9m7-10h-2M7 20H5a2 2 0 01-2-2v-6a2 2 0 012-2h2.5"></path>
|
||||
</svg>
|
||||
{{ activity.helpful_count }} helpful
|
||||
</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% empty %}
|
||||
<div class="text-center py-12">
|
||||
<svg class="w-16 h-16 text-muted-foreground mx-auto mb-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"></path>
|
||||
</svg>
|
||||
<h3 class="text-lg font-semibold mb-2">No Recent Activity</h3>
|
||||
<p class="text-muted-foreground">Be the first to add a review or photo!</p>
|
||||
</div>
|
||||
{% endfor %}
|
||||
194
templates/partials/homepage/search_results.html
Normal file
194
templates/partials/homepage/search_results.html
Normal file
@@ -0,0 +1,194 @@
|
||||
<!-- Global Search Results -->
|
||||
{% if results %}
|
||||
<!-- Results Header -->
|
||||
<div class="px-4 py-3 border-b border-border/50 bg-muted/30">
|
||||
<div class="flex items-center justify-between">
|
||||
<span class="text-sm font-medium text-foreground">
|
||||
{{ results|length }} result{{ results|length|pluralize }} found
|
||||
</span>
|
||||
{% if query %}
|
||||
<span class="text-xs text-muted-foreground">
|
||||
for "{{ query }}"
|
||||
</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Results List -->
|
||||
<div class="max-h-80 overflow-y-auto">
|
||||
{% for result in results %}
|
||||
<a href="{{ result.url }}"
|
||||
class="flex items-start gap-3 px-4 py-3 hover:bg-muted/50 transition-colors border-b border-border/30 last:border-b-0">
|
||||
|
||||
<!-- Result Icon -->
|
||||
<div class="flex-shrink-0 mt-1">
|
||||
{% if result.type == 'park' %}
|
||||
<div class="w-8 h-8 bg-primary/10 rounded-lg flex items-center justify-center">
|
||||
<svg class="w-4 h-4 text-primary" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4"></path>
|
||||
</svg>
|
||||
</div>
|
||||
{% elif result.type == 'ride' %}
|
||||
<div class="w-8 h-8 bg-secondary/10 rounded-lg flex items-center justify-center">
|
||||
<svg class="w-4 h-4 text-secondary" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z"></path>
|
||||
</svg>
|
||||
</div>
|
||||
{% elif result.type == 'operator' %}
|
||||
<div class="w-8 h-8 bg-accent/10 rounded-lg flex items-center justify-center">
|
||||
<svg class="w-4 h-4 text-accent" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4"></path>
|
||||
</svg>
|
||||
</div>
|
||||
{% elif result.type == 'manufacturer' %}
|
||||
<div class="w-8 h-8 bg-primary/10 rounded-lg flex items-center justify-center">
|
||||
<svg class="w-4 h-4 text-primary" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"></path>
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"></path>
|
||||
</svg>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="w-8 h-8 bg-muted rounded-lg flex items-center justify-center">
|
||||
<svg class="w-4 h-4 text-muted-foreground" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"></path>
|
||||
</svg>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<!-- Result Content -->
|
||||
<div class="flex-1 min-w-0">
|
||||
<!-- Result Title -->
|
||||
<div class="flex items-center gap-2 mb-1">
|
||||
<h4 class="font-medium text-foreground truncate">
|
||||
{{ result.title }}
|
||||
</h4>
|
||||
|
||||
<!-- Result Type Badge -->
|
||||
<span class="px-2 py-0.5 rounded-full text-xs font-medium flex-shrink-0
|
||||
{% if result.type == 'park' %}bg-primary/10 text-primary
|
||||
{% elif result.type == 'ride' %}bg-secondary/10 text-secondary
|
||||
{% elif result.type == 'operator' %}bg-accent/10 text-accent
|
||||
{% elif result.type == 'manufacturer' %}bg-primary/10 text-primary
|
||||
{% else %}bg-muted text-muted-foreground{% endif %}">
|
||||
{{ result.type|title }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<!-- Result Description -->
|
||||
{% if result.description %}
|
||||
<p class="text-sm text-muted-foreground line-clamp-2 mb-2">
|
||||
{{ result.description|truncatewords:15 }}
|
||||
</p>
|
||||
{% endif %}
|
||||
|
||||
<!-- Result Meta -->
|
||||
<div class="flex items-center gap-3 text-xs text-muted-foreground">
|
||||
{% if result.location %}
|
||||
<div class="flex items-center gap-1">
|
||||
<svg class="w-3 h-3" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"></path>
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 11a3 3 0 11-6 0 3 3 0 016 0z"></path>
|
||||
</svg>
|
||||
{{ result.location }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if result.rating %}
|
||||
<div class="flex items-center gap-1">
|
||||
<svg class="w-3 h-3 text-yellow-500" fill="currentColor" viewBox="0 0 20 20">
|
||||
<path d="M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z"></path>
|
||||
</svg>
|
||||
{{ result.rating|floatformat:1 }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if result.count %}
|
||||
<div class="flex items-center gap-1">
|
||||
{% if result.type == 'park' %}
|
||||
<svg class="w-3 h-3" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z"></path>
|
||||
</svg>
|
||||
{{ result.count }} ride{{ result.count|pluralize }}
|
||||
{% elif result.type == 'operator' %}
|
||||
<svg class="w-3 h-3" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4"></path>
|
||||
</svg>
|
||||
{{ result.count }} park{{ result.count|pluralize }}
|
||||
{% elif result.type == 'manufacturer' %}
|
||||
<svg class="w-3 h-3" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z"></path>
|
||||
</svg>
|
||||
{{ result.count }} ride{{ result.count|pluralize }}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if result.year %}
|
||||
<div class="flex items-center gap-1">
|
||||
<svg class="w-3 h-3" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"></path>
|
||||
</svg>
|
||||
{{ result.year }}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Result Arrow -->
|
||||
<div class="flex-shrink-0 mt-2">
|
||||
<svg class="w-4 h-4 text-muted-foreground" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"></path>
|
||||
</svg>
|
||||
</div>
|
||||
</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
<!-- View All Results Footer -->
|
||||
{% if results|length >= 5 %}
|
||||
<div class="px-4 py-3 border-t border-border/50 bg-muted/30">
|
||||
<a href="/search/?q={{ query|urlencode }}"
|
||||
class="text-sm text-primary hover:text-primary/80 transition-colors font-medium">
|
||||
View all search results →
|
||||
</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% else %}
|
||||
<!-- No Results -->
|
||||
<div class="px-4 py-8 text-center">
|
||||
<svg class="w-12 h-12 text-muted-foreground mx-auto mb-3" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"></path>
|
||||
</svg>
|
||||
<h3 class="font-medium text-foreground mb-1">No results found</h3>
|
||||
{% if query %}
|
||||
<p class="text-sm text-muted-foreground mb-4">
|
||||
No results for "{{ query }}"
|
||||
</p>
|
||||
{% else %}
|
||||
<p class="text-sm text-muted-foreground mb-4">
|
||||
Try searching for parks, rides, or locations
|
||||
</p>
|
||||
{% endif %}
|
||||
|
||||
<!-- Search Suggestions -->
|
||||
<div class="flex flex-wrap gap-2 justify-center">
|
||||
<span class="text-xs text-muted-foreground">Try:</span>
|
||||
<button class="text-xs text-primary hover:text-primary/80 transition-colors"
|
||||
onclick="document.querySelector('input[type=text]').value='Disney'; document.querySelector('input[type=text]').dispatchEvent(new Event('input'));">
|
||||
Disney
|
||||
</button>
|
||||
<span class="text-xs text-muted-foreground">•</span>
|
||||
<button class="text-xs text-primary hover:text-primary/80 transition-colors"
|
||||
onclick="document.querySelector('input[type=text]').value='roller coaster'; document.querySelector('input[type=text]').dispatchEvent(new Event('input'));">
|
||||
Roller Coaster
|
||||
</button>
|
||||
<span class="text-xs text-muted-foreground">•</span>
|
||||
<button class="text-xs text-primary hover:text-primary/80 transition-colors"
|
||||
onclick="document.querySelector('input[type=text]').value='Cedar Point'; document.querySelector('input[type=text]').dispatchEvent(new Event('input'));">
|
||||
Cedar Point
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
20
templates/partials/homepage/stats.html
Normal file
20
templates/partials/homepage/stats.html
Normal file
@@ -0,0 +1,20 @@
|
||||
<!-- Homepage Statistics Dashboard -->
|
||||
<div class="text-center p-6 bg-background rounded-xl shadow-sm border border-border/50">
|
||||
<div class="text-3xl font-bold text-primary mb-2">{{ total_parks|default:"0" }}</div>
|
||||
<div class="text-sm text-muted-foreground">Theme Parks</div>
|
||||
</div>
|
||||
|
||||
<div class="text-center p-6 bg-background rounded-xl shadow-sm border border-border/50">
|
||||
<div class="text-3xl font-bold text-secondary mb-2">{{ total_rides|default:"0" }}</div>
|
||||
<div class="text-sm text-muted-foreground">Thrilling Rides</div>
|
||||
</div>
|
||||
|
||||
<div class="text-center p-6 bg-background rounded-xl shadow-sm border border-border/50">
|
||||
<div class="text-3xl font-bold text-accent mb-2">{{ total_reviews|default:"0" }}</div>
|
||||
<div class="text-sm text-muted-foreground">User Reviews</div>
|
||||
</div>
|
||||
|
||||
<div class="text-center p-6 bg-background rounded-xl shadow-sm border border-border/50">
|
||||
<div class="text-3xl font-bold text-primary mb-2">{{ total_countries|default:"0" }}</div>
|
||||
<div class="text-sm text-muted-foreground">Countries</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user