Files
ShooterHub/templates/sessions/list.html
2026-03-19 16:42:37 +01:00

59 lines
2.5 KiB
HTML

{% extends "base.html" %}
{% block title %}{{ _('Sessions') }} — The Shooter's Network{% endblock %}
{% block content %}
<div style="display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:1rem;margin-bottom:1.5rem;">
<h1 style="margin:0;">{{ _('My Sessions') }}</h1>
<a href="{{ url_for('sessions.new') }}"
style="background:#1a1a2e;color:#fff;padding:0.5rem 1.2rem;border-radius:4px;font-size:0.92rem;text-decoration:none;">
{{ _('+ New session') }}
</a>
</div>
{% if sessions %}
<table>
<thead>
<tr>
<th>{{ _('Session') }}</th>
<th>{{ _('Type') }}</th>
<th>{{ _('Location') }}</th>
<th>{{ _('Visibility') }}</th>
<th></th>
</tr>
</thead>
<tbody>
{% for s in sessions %}
<tr>
<td><a href="{{ url_for('sessions.detail', session_id=s.id) }}">{{ s.session_date.strftime('%d %b %Y') }}</a></td>
<td style="font-size:0.82rem;">
{% if s.session_type == 'long_range' %}
<span style="background:#f0f4ff;color:#1a1a2e;padding:.15rem .5rem;border-radius:3px;">{{ _('Long Range') }}</span>
{% elif s.session_type == 'prs' %}
<span style="background:#fff3e0;color:#e65100;padding:.15rem .5rem;border-radius:3px;">PRS</span>
{% elif s.session_type == 'pistol_25m' %}
<span style="background:#f3e5f5;color:#6a1b9a;padding:.15rem .5rem;border-radius:3px;">{{ _('25m Pistol') }}</span>
{% else %}—{% endif %}
</td>
<td style="color:#666;font-size:0.88rem;">{{ s.location_name or '—' }}</td>
<td style="font-size:0.85rem;color:{% if s.is_public %}#27ae60{% else %}#aaa{% endif %};">
{{ _('Public') if s.is_public else _('Private') }}
</td>
<td style="white-space:nowrap;">
<a href="{{ url_for('sessions.edit', session_id=s.id) }}" style="font-size:0.85rem;margin-right:.75rem;">{{ _('Edit') }}</a>
<form method="post" action="{{ url_for('sessions.delete', session_id=s.id) }}" style="display:inline;"
onsubmit="return confirm('{{ _('Delete this session?') | e }}');">
<button type="submit" class="btn-link" style="font-size:0.85rem;color:#e74c3c;">{{ _('Delete') }}</button>
</form>
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<div style="text-align:center;padding:3rem 0;color:#888;">
<div style="font-size:3rem;margin-bottom:1rem;">🎯</div>
<p style="margin-bottom:1rem;">{{ _('No sessions recorded yet.') }}</p>
<a href="{{ url_for('sessions.new') }}">{{ _('Log your first session') }}</a>
</div>
{% endif %}
{% endblock %}