mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2025-12-20 04:51:07 -05:00
212 lines
13 KiB
HTML
212 lines
13 KiB
HTML
<!-- 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 -->
|
|
<script>
|
|
document.addEventListener('alpine:init', () => {
|
|
Alpine.data('searchSuggestions', () => ({
|
|
fillSearchInput(value) {
|
|
// Find the search input using AlpineJS approach
|
|
const searchInput = document.querySelector('input[type=text]');
|
|
if (searchInput) {
|
|
searchInput.value = value;
|
|
// Dispatch input event to trigger search
|
|
searchInput.dispatchEvent(new Event('input', { bubbles: true }));
|
|
searchInput.focus();
|
|
}
|
|
}
|
|
}));
|
|
});
|
|
</script>
|
|
|
|
<div x-data="searchSuggestions()" 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"
|
|
@click="fillSearchInput('Disney')">
|
|
Disney
|
|
</button>
|
|
<span class="text-xs text-muted-foreground">•</span>
|
|
<button class="text-xs text-primary hover:text-primary/80 transition-colors"
|
|
@click="fillSearchInput('roller coaster')">
|
|
Roller Coaster
|
|
</button>
|
|
<span class="text-xs text-muted-foreground">•</span>
|
|
<button class="text-xs text-primary hover:text-primary/80 transition-colors"
|
|
@click="fillSearchInput('Cedar Point')">
|
|
Cedar Point
|
|
</button>
|
|
</div>
|
|
</div>
|
|
{% endif %}
|