loko/streetup/maps/templates/maps/index.html
2026-07-22 14:48:40 +02:00

255 lines
6.2 KiB
HTML

{% extends "maps/base.html" %}
{% load i18n %}
{% load static %}
{% block head %}
<style>
/* ── Maps index page ──────────────────────────────────────────────────── */
.maps-index-hero {
background: linear-gradient(135deg, #1a2a6c 0%, #2d4090 50%, #1e3a8a 100%);
color: #fff;
border-radius: 16px;
padding: 2.5rem 2rem;
margin-bottom: 2rem;
position: relative;
overflow: hidden;
}
.maps-index-hero::before {
content: '';
position: absolute;
top: -40%;
right: -10%;
width: 340px;
height: 340px;
border-radius: 50%;
background: rgba(255, 255, 255, 0.05);
pointer-events: none;
}
.maps-index-hero::after {
content: '';
position: absolute;
bottom: -50%;
right: 8%;
width: 220px;
height: 220px;
border-radius: 50%;
background: rgba(255, 255, 255, 0.04);
pointer-events: none;
}
.maps-index-hero .hero-icon {
font-size: 3rem;
opacity: .9;
margin-bottom: .75rem;
display: block;
}
.maps-index-hero h1 {
font-size: 1.9rem;
font-weight: 700;
margin-bottom: .35rem;
}
.maps-index-hero p {
font-size: 1rem;
opacity: .8;
margin: 0;
}
/* ── Map card ─────────────────────────────────────────────────────────── */
.map-card {
border: none;
border-radius: 14px;
box-shadow: 0 2px 12px rgba(30, 58, 138, .08);
transition: transform .22s ease, box-shadow .22s ease;
overflow: hidden;
cursor: pointer;
height: 100%;
text-decoration: none;
color: inherit;
display: flex;
flex-direction: column;
background: #fff;
}
.map-card:hover {
transform: translateY(-4px);
box-shadow: 0 8px 28px rgba(30, 58, 138, .16);
color: inherit;
}
.map-card-header {
background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
padding: 1.6rem 1.5rem 1.2rem;
display: flex;
align-items: center;
gap: 1rem;
}
.map-card-icon {
width: 52px;
height: 52px;
border-radius: 12px;
background: rgba(255, 255, 255, .15);
display: flex;
align-items: center;
justify-content: center;
font-size: 1.6rem;
color: #fff;
flex-shrink: 0;
}
.map-card-title {
color: #fff;
font-size: 1.1rem;
font-weight: 600;
margin: 0;
line-height: 1.3;
}
.map-card-body {
padding: 1.25rem 1.5rem;
flex-grow: 1;
display: flex;
flex-direction: column;
gap: .75rem;
}
.map-card-access-badge {
display: inline-flex;
align-items: center;
gap: .35rem;
font-size: .75rem;
padding: .25rem .65rem;
border-radius: 20px;
font-weight: 500;
}
.badge-public {
background: #ecfdf5;
color: #065f46;
}
.badge-authenticated {
background: #eff6ff;
color: #1e40af;
}
.badge-restricted {
background: #fff7ed;
color: #92400e;
}
.map-card-action {
margin-top: auto;
display: flex;
align-items: center;
gap: .4rem;
color: #2563eb;
font-size: .875rem;
font-weight: 500;
}
.map-card-action i {
transition: transform .2s ease;
}
.map-card:hover .map-card-action i {
transform: translateX(4px);
}
/* Empty state */
.maps-empty {
text-align: center;
padding: 4rem 1rem;
color: #6b7280;
}
.maps-empty i {
font-size: 3.5rem;
display: block;
margin-bottom: 1rem;
opacity: .4;
}
</style>
{% endblock head %}
{% block content %}
<div class="container-fluid mt-4 px-4">
<!-- Hero banner -->
<div class="maps-index-hero">
<i class="bi bi-map hero-icon"></i>
<h1>{% translate "Cartes" %}</h1>
<p>{% translate "Consultez et gérez les cartes auxquelles vous avez accès." %}</p>
</div>
<!-- Cards grid -->
{% if accessible_maps %}
<div class="row g-4">
{% for entry in accessible_maps %}
<div class="col-sm-6 col-lg-4 col-xl-3">
{% if entry.url_name %}
<a href="{% url entry.url_name %}" class="map-card" id="map-card-{{ entry.config.code }}">
{% else %}
<div class="map-card" id="map-card-{{ entry.config.code }}">
{% endif %}
<!-- Card header -->
<div class="map-card-header">
<div class="map-card-icon">
<i class="bi {{ entry.icon }}"></i>
</div>
<h2 class="map-card-title">{{ entry.config.name }}</h2>
</div>
<!-- Card body -->
<div class="map-card-body">
<!-- Access level badge -->
{% if entry.config.access_level == 'public' %}
<span class="map-card-access-badge badge-public">
<i class="bi bi-globe2"></i>
{% translate "Tout public" %}
</span>
{% elif entry.config.access_level == 'authenticated' %}
<span class="map-card-access-badge badge-authenticated">
<i class="bi bi-person-check"></i>
{% translate "Accès connecté" %}
</span>
{% else %}
<span class="map-card-access-badge badge-restricted">
<i class="bi bi-shield-lock"></i>
{% translate "Accès restreint" %}
</span>
{% endif %}
<!-- CTA -->
{% if entry.url_name %}
<div class="map-card-action">
{% translate "Ouvrir la carte" %}
<i class="bi bi-arrow-right"></i>
</div>
{% endif %}
</div>
{% if entry.url_name %}
</a>
{% else %}
</div>
{% endif %}
</div>
{% endfor %}
</div>
{% else %}
<!-- Empty state -->
<div class="maps-empty">
<i class="bi bi-map"></i>
<p class="mb-0">{% translate "Aucune carte accessible pour votre compte." %}</p>
</div>
{% endif %}
</div>
{% endblock content %}