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

68 lines
2.9 KiB
HTML

{% extends "base.html" %}
{% block title %}{{ _('Dashboard') }} — The Shooter's Network{% endblock %}
{% block content %}
<h1>{{ _('Dashboard') }}</h1>
<p style="color:#555;margin-bottom:2rem;">
{{ _('Welcome back, %(name)s.', name=(current_user.display_name or current_user.email)) }}
</p>
<div style="display:flex;gap:1.5rem;margin-bottom:2.5rem;flex-wrap:wrap;">
<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>
<a href="{{ url_for('equipment.new') }}"
style="background:#f0f4ff;color:#1a1a2e;padding:0.5rem 1.2rem;border-radius:4px;font-size:0.92rem;text-decoration:none;border:1px solid #c0d0f0;">
{{ _('+ Add equipment') }}
</a>
<a href="{{ url_for('analyze') }}"
style="background:#f0f4ff;color:#1a1a2e;padding:0.5rem 1.2rem;border-radius:4px;font-size:0.92rem;text-decoration:none;border:1px solid #c0d0f0;">
{{ _('New analysis') }}
</a>
</div>
<h2>{{ _('Recent Analyses') }}</h2>
{% if analyses %}
<table>
<thead>
<tr>
<th>{{ _('Title') }}</th>
<th>{{ _('Date') }}</th>
<th>{{ _('Shots') }}</th>
<th>{{ _('Groups') }}</th>
<th>{{ _('Visibility') }}</th>
</tr>
</thead>
<tbody>
{% for a in analyses %}
<tr style="cursor:pointer;" onclick="location.href='{{ url_for('analyses.detail', analysis_id=a.id) }}'">
<td><a href="{{ url_for('analyses.detail', analysis_id=a.id) }}" style="color:inherit;text-decoration:none;">{{ a.title }}</a></td>
<td style="white-space:nowrap;color:#666;font-size:0.88rem;">{{ a.created_at.strftime('%d %b %Y') }}</td>
<td>{{ a.shot_count }}</td>
<td>{{ a.group_count }}</td>
<td style="color:{% if a.is_public %}#27ae60{% else %}#888{% endif %};font-size:0.88rem;">
{{ _('Public') if a.is_public else _('Private') }}
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p style="color:#888;margin-top:1rem;">
{{ _('No analyses yet.') }} <a href="{{ url_for('analyze') }}">{{ _('Upload a CSV file') }}</a> {{ _('to get started — it will be saved here automatically.') }}
</p>
{% endif %}
<div style="display:flex;gap:2rem;margin-top:2.5rem;flex-wrap:wrap;">
<div style="flex:1;min-width:180px;padding:1.25rem;border:1px solid #e0e0e0;border-radius:6px;">
<div style="font-size:0.8rem;color:#888;text-transform:uppercase;letter-spacing:.05em;margin-bottom:.4rem;">{{ _('Equipment') }}</div>
<a href="{{ url_for('equipment.index') }}">{{ _('Manage your rifles, scopes & gear →') }}</a>
</div>
<div style="flex:1;min-width:180px;padding:1.25rem;border:1px solid #e0e0e0;border-radius:6px;">
<div style="font-size:0.8rem;color:#888;text-transform:uppercase;letter-spacing:.05em;margin-bottom:.4rem;">{{ _('Sessions') }}</div>
<a href="{{ url_for('sessions.index') }}">{{ _('View your shooting sessions →') }}</a>
</div>
</div>
{% endblock %}