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

81 lines
3.0 KiB
HTML

{% extends "base.html" %}
{% block title %}{{ profile_user.display_name or profile_user.email.split('@')[0] }} — The Shooter's Network{% endblock %}
{% block content %}
<div style="display:flex;align-items:center;gap:1.5rem;margin-bottom:2rem;flex-wrap:wrap;">
{% set av = profile_user.effective_avatar_url %}
{% if av %}
<img src="{{ av }}" alt="Avatar"
style="width:80px;height:80px;border-radius:50%;object-fit:cover;border:2px solid #e0e0e0;flex-shrink:0;">
{% else %}
<div style="width:80px;height:80px;border-radius:50%;background:#e0e6f0;display:flex;align-items:center;justify-content:center;font-size:2.5rem;color:#888;flex-shrink:0;">
&#128100;
</div>
{% endif %}
<div>
<h1 style="margin:0 0 .25rem;">{{ profile_user.display_name or profile_user.email.split('@')[0] }}</h1>
<div style="font-size:0.85rem;color:#888;">
{{ _('Member since %(date)s', date=profile_user.created_at.strftime('%B %Y')) }}
</div>
{% if profile_user.bio %}
<p style="margin-top:.75rem;color:#444;white-space:pre-wrap;max-width:600px;">{{ profile_user.bio }}</p>
{% endif %}
</div>
</div>
{# ---- Public Sessions ---- #}
<h2>{{ _('Sessions') }}{% if public_sessions %} ({{ public_sessions|length }}){% endif %}</h2>
{% if public_sessions %}
<table style="margin-bottom:1.5rem;">
<thead>
<tr><th>{{ _('Session') }}</th><th>{{ _('Location') }}</th><th>{{ _('Distance') }}</th></tr>
</thead>
<tbody>
{% for s in public_sessions %}
<tr style="cursor:pointer;" onclick="location.href='{{ url_for('sessions.detail', session_id=s.id) }}'">
<td>
<a href="{{ url_for('sessions.detail', session_id=s.id) }}" style="color:inherit;text-decoration:none;">
{{ s.session_date.strftime('%d %b %Y') }}
</a>
</td>
<td style="color:#666;">{{ s.location_name or '—' }}</td>
<td style="color:#666;">{% if s.distance_m %}{{ s.distance_m }} m{% else %}—{% endif %}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p style="color:#888;margin-bottom:1.5rem;">{{ _('No public sessions yet.') }}</p>
{% endif %}
{# ---- Equipment (optional) ---- #}
{% if equipment is not none %}
<h2>{{ _('Equipment') }}</h2>
{% if equipment %}
<table style="margin-bottom:1.5rem;">
<thead>
<tr><th>{{ _('Name') }}</th><th>{{ _('Category') }}</th><th>{{ _('Brand / Model') }}</th><th>{{ _('Caliber') }}</th></tr>
</thead>
<tbody>
{% for item in equipment %}
<tr>
<td>{{ item.name }}</td>
<td style="color:#666;font-size:0.88rem;">{{ item.category.title() }}</td>
<td style="color:#666;font-size:0.88rem;">
{% if item.brand or item.model %}
{{ item.brand or '' }}{% if item.brand and item.model %} {% endif %}{{ item.model or '' }}
{% else %}—{% endif %}
</td>
<td style="color:#666;font-size:0.88rem;">{{ item.caliber or '—' }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p style="color:#888;margin-bottom:1.5rem;">{{ _('No equipment listed.') }}</p>
{% endif %}
{% endif %}
{% endblock %}