mirror of
https://github.com/ceratic/MediaCollectorLibary.git
synced 2026-05-13 23:56:46 +02:00
first commit
This commit is contained in:
282
resources/views/games/index.twig
Normal file
282
resources/views/games/index.twig
Normal file
@@ -0,0 +1,282 @@
|
||||
{% extends "layouts/app.twig" %}
|
||||
|
||||
{% block content %}
|
||||
<div class="px-4 py-3">
|
||||
<!-- Header with search and view controls -->
|
||||
<div class="d-flex flex-column flex-sm-row justify-content-between align-items-start align-items-sm-center mb-4 gap-3">
|
||||
<div>
|
||||
<h1 class="display-4 fw-bold text-dark">Games</h1>
|
||||
{% if pagination.total_items > 0 %}
|
||||
<div class="text-muted small mt-1">
|
||||
{{ pagination.total_items }} games from {{ games|reduce((carry, game) => carry + game.platform_count, 0) }} platforms
|
||||
{% if search %}
|
||||
matching "{{ search }}"
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="d-flex flex-column flex-sm-row gap-3 w-100 w-sm-auto">
|
||||
<!-- Search form -->
|
||||
<form method="GET" class="d-flex gap-2">
|
||||
<input type="hidden" name="view" value="{{ view_mode }}">
|
||||
<input type="hidden" name="per_page" value="{{ pagination.per_page }}">
|
||||
<div class="position-relative">
|
||||
<input
|
||||
type="text"
|
||||
name="search"
|
||||
value="{{ search }}"
|
||||
placeholder="Search games..."
|
||||
class="form-control ps-5"
|
||||
>
|
||||
<svg class="position-absolute top-50 start-0 translate-middle-y ms-3 text-muted" width="20" height="20" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"/>
|
||||
</svg>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">
|
||||
Search
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<!-- View mode switcher -->
|
||||
<div class="btn-group" role="group">
|
||||
{% for mode in view_modes %}
|
||||
<a
|
||||
href="?view={{ mode }}{% if search %}&search={{ search }}{% endif %}{% if pagination.per_page != 24 %}&per_page={{ pagination.per_page }}{% endif %}"
|
||||
class="btn btn-outline-secondary {{ view_mode == mode ? 'active' : '' }}"
|
||||
>
|
||||
{% if mode == 'grid' %}
|
||||
<svg class="me-1" width="16" height="16" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2V6zM14 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2V6zM4 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2v-2zM14 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2v-2z"/>
|
||||
</svg>
|
||||
{% endif %}
|
||||
{% if mode == 'list' %}
|
||||
<svg class="me-1" width="16" height="16" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 10h16M4 14h16M4 18h16"/>
|
||||
</svg>
|
||||
{% endif %}
|
||||
{{ mode|title }}
|
||||
</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if games is empty %}
|
||||
<div class="text-center py-5">
|
||||
<svg class="mx-auto text-muted mb-3" width="48" height="48" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M14.828 14.828a4 4 0 01-5.656 0M9 10h1m4 0h1m-7 8h12a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v8a2 2 0 002 2z"/>
|
||||
</svg>
|
||||
<h3 class="h5 fw-medium text-dark">
|
||||
{% if search %}
|
||||
No games found matching "{{ search }}"
|
||||
{% else %}
|
||||
No games found
|
||||
{% endif %}
|
||||
</h3>
|
||||
<p class="text-muted">
|
||||
{% if search %}
|
||||
Try adjusting your search terms or browse all games.
|
||||
{% else %}
|
||||
Start syncing your gaming libraries to see your games here.
|
||||
{% endif %}
|
||||
</p>
|
||||
{% if search %}
|
||||
<a href="{{ path_for('games.index') }}" class="btn btn-primary mt-3">
|
||||
View all games
|
||||
</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% else %}
|
||||
<!-- Games content based on view mode -->
|
||||
{% if view_mode == 'list' %}
|
||||
<!-- List view -->
|
||||
<div class="card">
|
||||
<ul class="list-group list-group-flush">
|
||||
{% for game in games %}
|
||||
<li class="list-group-item">
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<div class="d-flex align-items-center">
|
||||
{% if game.image_url %}
|
||||
<img class="rounded me-3" style="width: 64px; height: 64px; object-fit: cover;" src="{{ game.image_url }}" alt="{{ game.title }}">
|
||||
{% else %}
|
||||
<div class="bg-light rounded me-3 d-flex align-items-center justify-content-center" style="width: 64px; height: 64px;">
|
||||
<svg class="text-muted" width="32" height="32" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M14.828 14.828a4 4 0 01-5.656 0M9 10h1m4 0h1m-7 8h12a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v8a2 2 0 002 2z"/>
|
||||
</svg>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="flex-grow-1">
|
||||
<h3 class="h6 mb-1">
|
||||
<a href="{{ path_for('games.show', {'game_key': game.game_key}) }}" class="text-decoration-none">
|
||||
{{ game.title }}
|
||||
</a>
|
||||
</h3>
|
||||
<div class="d-flex align-items-center gap-3 small text-muted">
|
||||
<span>{{ game.platform_count }} platform{{ game.platform_count > 1 ? 's' : '' }}</span>
|
||||
{% if game.platforms %}
|
||||
<span class="badge bg-light text-dark">
|
||||
{{ game.platforms|join(', ') }}
|
||||
</span>
|
||||
{% endif %}
|
||||
<span>{{ game.total_playtime|format_duration }} played</span>
|
||||
{% if game.max_completion > 0 %}
|
||||
<span>{{ game.max_completion }}% complete</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% if game.genres %}
|
||||
<div class="d-flex flex-wrap gap-1">
|
||||
{% for genre in game.genres|slice(0, 3) %}
|
||||
<span class="badge bg-primary">
|
||||
{{ genre }}
|
||||
</span>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
{% elseif view_mode == 'covers' %}
|
||||
<!-- Cover grid view -->
|
||||
<div class="row g-3">
|
||||
{% for game in games %}
|
||||
<div class="col-6 col-sm-4 col-md-3 col-lg-2">
|
||||
<div class="card h-100">
|
||||
{% if game.image_url %}
|
||||
<div class="position-relative" style="aspect-ratio: 3/4; overflow: hidden;">
|
||||
<img src="{{ game.image_url }}" alt="{{ game.title }}" class="card-img-top" style="width: 100%; height: 100%; object-fit: cover;">
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="d-flex align-items-center justify-content-center bg-light" style="aspect-ratio: 3/4; min-height: 200px;">
|
||||
<svg class="text-muted" width="48" height="48" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M14.828 14.828a4 4 0 01-5.656 0M9 10h1m4 0h1m-7 8h12a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v8a2 2 0 002 2z"/>
|
||||
</svg>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="card-body">
|
||||
<h6 class="card-title text-truncate" title="{{ game.title }}">
|
||||
{{ game.title }}
|
||||
</h6>
|
||||
<p class="card-text small text-muted">{{ game.platform_count }} platform{{ game.platform_count > 1 ? 's' : '' }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
{% else %}
|
||||
<!-- Default grid view -->
|
||||
<div class="row g-3">
|
||||
{% for game in games %}
|
||||
<div class="col-12 col-md-6 col-lg-4">
|
||||
<div class="card h-100">
|
||||
<div class="card-body">
|
||||
<div class="d-flex align-items-center">
|
||||
<div class="flex-shrink-0">
|
||||
{% if game.image_url %}
|
||||
<img class="rounded" style="width: 64px; height: 64px; object-fit: cover;" src="{{ game.image_url }}" alt="{{ game.title }}">
|
||||
{% else %}
|
||||
<div class="bg-light rounded d-flex align-items-center justify-content-center" style="width: 64px; height: 64px;">
|
||||
<svg class="text-muted" width="32" height="32" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M14.828 14.828a4 4 0 01-5.656 0M9 10h1m4 0h1m-7 8h12a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v8a2 2 0 002 2z"/>
|
||||
</svg>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="ms-3 flex-grow-1">
|
||||
<h5 class="card-title mb-1">
|
||||
<a href="{{ path_for('games.show', {'game_key': game.game_key}) }}" class="text-decoration-none">
|
||||
{{ game.title }}
|
||||
</a>
|
||||
</h5>
|
||||
<p class="card-text small text-muted mb-2">
|
||||
{{ game.platform_count }} platform{{ game.platform_count > 1 ? 's' : '' }}
|
||||
{% if game.platforms %}
|
||||
<span class="badge bg-light text-dark ms-2">
|
||||
{{ game.platforms|join(', ') }}
|
||||
</span>
|
||||
{% endif %}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-3">
|
||||
<div class="d-flex justify-content-between align-items-center small text-muted">
|
||||
<span>{{ game.total_playtime|format_duration }} played</span>
|
||||
{% if game.max_completion > 0 %}
|
||||
<span>{{ game.max_completion }}% complete</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% if game.genres %}
|
||||
<div class="mt-2 d-flex flex-wrap gap-1">
|
||||
{% for genre in game.genres|slice(0, 3) %}
|
||||
<span class="badge bg-primary">
|
||||
{{ genre }}
|
||||
</span>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<!-- Pagination -->
|
||||
{% if pagination.total_pages > 1 %}
|
||||
<div class="d-flex align-items-center justify-content-between mt-4">
|
||||
<div class="d-flex align-items-center gap-2">
|
||||
<label for="per_page" class="form-label mb-0">Show:</label>
|
||||
<select id="per_page" class="form-select form-select-sm w-auto">
|
||||
<option value="12" {{ pagination.per_page == 12 ? 'selected' : '' }}>12</option>
|
||||
<option value="24" {{ pagination.per_page == 24 ? 'selected' : '' }}>24</option>
|
||||
<option value="48" {{ pagination.per_page == 48 ? 'selected' : '' }}>48</option>
|
||||
<option value="100" {{ pagination.per_page == 100 ? 'selected' : '' }}>100</option>
|
||||
</select>
|
||||
<span class="text-muted small">per page</span>
|
||||
</div>
|
||||
|
||||
<div class="d-flex align-items-center gap-2">
|
||||
{% if pagination.has_prev %}
|
||||
<a href="?page={{ pagination.prev_page }}{% if search %}&search={{ search }}{% endif %}{% if pagination.per_page != 24 %}&per_page={{ pagination.per_page }}{% endif %}&view={{ view_mode }}"
|
||||
class="btn btn-outline-secondary btn-sm">
|
||||
Previous
|
||||
</a>
|
||||
{% endif %}
|
||||
|
||||
<div class="btn-group" role="group">
|
||||
{% for page_num in range(max(1, pagination.current_page - 2), min(pagination.total_pages, pagination.current_page + 2)) %}
|
||||
<a href="?page={{ page_num }}{% if search %}&search={{ search }}{% endif %}{% if pagination.per_page != 24 %}&per_page={{ pagination.per_page }}{% endif %}&view={{ view_mode }}"
|
||||
class="btn btn-sm {{ page_num == pagination.current_page ? 'btn-primary' : 'btn-outline-secondary' }}">
|
||||
{{ page_num }}
|
||||
</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
{% if pagination.has_next %}
|
||||
<a href="?page={{ pagination.next_page }}{% if search %}&search={{ search }}{% endif %}{% if pagination.per_page != 24 %}&per_page={{ pagination.per_page }}{% endif %}&view={{ view_mode }}"
|
||||
class="btn btn-outline-secondary btn-sm">
|
||||
Next
|
||||
</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<script>
|
||||
document.getElementById('per_page')?.addEventListener('change', function() {
|
||||
const url = new URL(window.location);
|
||||
url.searchParams.set('per_page', this.value);
|
||||
url.searchParams.set('page', '1'); // Reset to first page
|
||||
window.location = url.toString();
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
212
resources/views/games/show.twig
Normal file
212
resources/views/games/show.twig
Normal file
@@ -0,0 +1,212 @@
|
||||
{% extends "layouts/app.twig" %}
|
||||
|
||||
{% block content %}
|
||||
<div class="px-4 py-6 sm:px-0">
|
||||
<!-- Game Header -->
|
||||
<div class="bg-white shadow rounded-lg mb-6">
|
||||
<div class="px-6 py-4 border-b border-gray-200">
|
||||
<div class="flex items-center justify-between">
|
||||
<div class="flex items-center">
|
||||
{% if main_game.image_url %}
|
||||
<img class="h-16 w-16 rounded-lg object-cover mr-4" src="{{ main_game.image_url }}" alt="{{ main_game.title }}">
|
||||
{% else %}
|
||||
<div class="h-16 w-16 rounded-lg bg-gray-200 flex items-center justify-center mr-4">
|
||||
<svg class="h-8 w-8 text-gray-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M14.828 14.828a4 4 0 01-5.656 0M9 10h1m4 0h1m-7 8h12a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v8a2 2 0 002 2z"/>
|
||||
</svg>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div>
|
||||
<h1 class="text-2xl font-bold text-gray-900">{{ main_game.title }}</h1>
|
||||
<div class="flex items-center space-x-4 mt-1">
|
||||
<span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-blue-100 text-blue-800">
|
||||
{{ platform_versions|length }} platform{{ platform_versions|length > 1 ? 's' : '' }}
|
||||
</span>
|
||||
{% if main_game.genre %}
|
||||
<span class="text-sm text-gray-500">{{ main_game.genre }}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<a href="{{ path_for('games.index') }}" class="text-indigo-600 hover:text-indigo-900 text-sm font-medium">
|
||||
← Back to Games
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Platform Tabs -->
|
||||
<div class="bg-white shadow rounded-lg">
|
||||
<div class="border-b border-gray-200">
|
||||
<nav class="-mb-px flex space-x-8 px-6" aria-label="Tabs">
|
||||
{% for version in platform_versions %}
|
||||
<button
|
||||
class="platform-tab whitespace-nowrap py-4 px-1 border-b-2 font-medium text-sm {{ loop.first ? 'border-indigo-500 text-indigo-600' : 'border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300' }}"
|
||||
data-platform="{{ version.platform }}"
|
||||
data-source="{{ version.source_id }}"
|
||||
>
|
||||
{{ version.platform }}
|
||||
{% if version.source_name %}
|
||||
<span class="ml-1 text-xs text-gray-400">({{ version.source_name }})</span>
|
||||
{% endif %}
|
||||
</button>
|
||||
{% endfor %}
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<!-- Platform Content -->
|
||||
{% for version in platform_versions %}
|
||||
<div class="platform-content {{ loop.first ? '' : 'hidden' }}" data-platform="{{ version.platform }}" data-source="{{ version.source_id }}">
|
||||
<div class="px-6 py-6">
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
|
||||
<!-- Game Info -->
|
||||
<div>
|
||||
<h3 class="text-lg font-medium text-gray-900 mb-4">Game Information</h3>
|
||||
<dl class="grid grid-cols-1 gap-x-4 gap-y-4 sm:grid-cols-2">
|
||||
{% if version.developer %}
|
||||
<div>
|
||||
<dt class="text-sm font-medium text-gray-500">Developer</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900">{{ version.developer }}</dd>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if version.publisher %}
|
||||
<div>
|
||||
<dt class="text-sm font-medium text-gray-500">Publisher</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900">{{ version.publisher }}</dd>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if version.release_date %}
|
||||
<div>
|
||||
<dt class="text-sm font-medium text-gray-500">Release Date</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900">{{ version.release_date|date('M j, Y') }}</dd>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div>
|
||||
<dt class="text-sm font-medium text-gray-500">Playtime</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900">{{ version.playtime_minutes|format_duration }}</dd>
|
||||
</div>
|
||||
{% if version.rating %}
|
||||
<div>
|
||||
<dt class="text-sm font-medium text-gray-500">Rating</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900">{{ version.rating }}/10</dd>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if version.completion_percentage > 0 %}
|
||||
<div>
|
||||
<dt class="text-sm font-medium text-gray-500">Completion</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900">{{ version.completion_percentage }}%</dd>
|
||||
</div>
|
||||
{% endif %}
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
<!-- Platform Stats -->
|
||||
<div>
|
||||
<h3 class="text-lg font-medium text-gray-900 mb-4">Platform Statistics</h3>
|
||||
<dl class="grid grid-cols-1 gap-x-4 gap-y-4">
|
||||
<div>
|
||||
<dt class="text-sm font-medium text-gray-500">Source</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900">{{ version.source_name }}</dd>
|
||||
</div>
|
||||
{% if version.last_played_at %}
|
||||
<div>
|
||||
<dt class="text-sm font-medium text-gray-500">Last Played</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900">{{ version.last_played_at|date('M j, Y') }}</dd>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if version.is_installed %}
|
||||
<div>
|
||||
<dt class="text-sm font-medium text-gray-500">Status</dt>
|
||||
<dd class="mt-1">
|
||||
<span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-green-100 text-green-800">
|
||||
Installed
|
||||
</span>
|
||||
</dd>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if version.is_favorite %}
|
||||
<div>
|
||||
<dt class="text-sm font-medium text-gray-500">Favorite</dt>
|
||||
<dd class="mt-1">
|
||||
<span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-red-100 text-red-800">
|
||||
Yes
|
||||
</span>
|
||||
</dd>
|
||||
</div>
|
||||
{% endif %}
|
||||
</dl>
|
||||
|
||||
<!-- Platform-specific metadata -->
|
||||
{% set metadata = version.metadata|json_decode %}
|
||||
{% if metadata %}
|
||||
<div class="mt-6">
|
||||
<h4 class="text-sm font-medium text-gray-900 mb-2">Platform Details</h4>
|
||||
<div class="bg-gray-50 rounded-md p-3">
|
||||
<dl class="grid grid-cols-1 gap-x-4 gap-y-2 text-sm">
|
||||
{% if metadata.appid %}
|
||||
<div>
|
||||
<dt class="font-medium text-gray-500">App ID</dt>
|
||||
<dd class="text-gray-900">{{ metadata.appid }}</dd>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if metadata.playtime_windows or metadata.playtime_mac or metadata.playtime_linux %}
|
||||
<div>
|
||||
<dt class="font-medium text-gray-500">Platform Playtime</dt>
|
||||
<dd class="text-gray-900">
|
||||
{% if metadata.playtime_windows %}<span>Windows: {{ metadata.playtime_windows|format_duration }}</span>{% endif %}
|
||||
{% if metadata.playtime_mac %}<span class="ml-2">Mac: {{ metadata.playtime_mac|format_duration }}</span>{% endif %}
|
||||
{% if metadata.playtime_linux %}<span class="ml-2">Linux: {{ metadata.playtime_linux|format_duration }}</span>{% endif %}
|
||||
</dd>
|
||||
</div>
|
||||
{% endif %}
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if version.description %}
|
||||
<div class="mt-6">
|
||||
<h3 class="text-lg font-medium text-gray-900 mb-2">Description</h3>
|
||||
<p class="text-sm text-gray-600">{{ version.description }}</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
// Platform tab switching functionality
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const tabs = document.querySelectorAll('.platform-tab');
|
||||
const contents = document.querySelectorAll('.platform-content');
|
||||
|
||||
tabs.forEach(tab => {
|
||||
tab.addEventListener('click', function() {
|
||||
const platform = this.dataset.platform;
|
||||
const source = this.dataset.source;
|
||||
|
||||
// Update tab styles
|
||||
tabs.forEach(t => {
|
||||
t.classList.remove('border-indigo-500', 'text-indigo-600');
|
||||
t.classList.add('border-transparent', 'text-gray-500');
|
||||
});
|
||||
this.classList.remove('border-transparent', 'text-gray-500');
|
||||
this.classList.add('border-indigo-500', 'text-indigo-600');
|
||||
|
||||
// Update content visibility
|
||||
contents.forEach(content => {
|
||||
if (content.dataset.platform === platform && content.dataset.source === source) {
|
||||
content.classList.remove('hidden');
|
||||
} else {
|
||||
content.classList.add('hidden');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user