Add full SkinsPins application

- FastAPI + SQLite + Alpine.js + HTMX PWA for Bingo Bango Bongo golf scoring
- Passwordless magic link auth with email (aiosmtplib) and admin invite system
- Real-time score entry via WebSocket with drag-and-drop player ordering
- Course management with per-hole par and stroke index
- Scorecard with golf score markers (birdie, eagle, bogey, etc.)
- Two-step new game form with tee selection per player
- Dashboard with stats, live games social stream, and recent game history
- Game summary view (read-only scorecard with leaderboard)
- User profile pages with win stats
- PWA install support with generated PNG icons
- Admin panel for users, courses, games, and invitations

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Rolf
2026-03-20 10:16:46 +01:00
parent 4b31b98f89
commit 3a1da1482c
51 changed files with 4964 additions and 1 deletions
+77
View File
@@ -0,0 +1,77 @@
{% extends "base.html" %}
{% block title %}New Course Skins &amp; Pins{% endblock %}
{% block content %}
<div class="page">
<div class="page-header">
<a href="/admin/courses" style="color:var(--text-muted); font-size:0.9rem;">← Courses</a>
<h1 style="margin-top:0.25rem;">New course</h1>
</div>
<form method="post" action="/admin/courses/new"
x-data="{
holes: {{ (form.holes if form else 18)|int }},
initPars: {{ form.pars | tojson if (form and form.pars) else '{}' }},
initSIs: {{ form.stroke_indices | tojson if (form and form.stroke_indices) else '{}' }}
}">
<div class="card">
<div class="form-group">
<label for="name">Course name</label>
{% if errors and errors.name %}<div class="alert alert-error">{{ errors.name }}</div>{% endif %}
<input type="text" id="name" name="name"
value="{{ form.name if form else '' }}" placeholder="e.g. Augusta National" required>
</div>
<div class="form-group">
<label for="location">Location <span style="color:var(--text-muted); font-size:0.8rem;">(optional)</span></label>
<input type="text" id="location" name="location"
value="{{ form.location if form else '' }}" placeholder="e.g. Augusta, Georgia">
</div>
<div class="form-group">
<label>Holes</label>
{% if errors and errors.holes %}<div class="alert alert-error">{{ errors.holes }}</div>{% endif %}
<div style="display:flex; gap:0.75rem;">
<label class="radio-card">
<input type="radio" name="holes" value="9" x-model.number="holes">
<span>9 holes</span>
</label>
<label class="radio-card">
<input type="radio" name="holes" value="18" x-model.number="holes">
<span>18 holes</span>
</label>
</div>
</div>
</div>
<div class="card">
<h2 style="font-size:0.95rem; color:var(--text-muted); margin-bottom:0.75rem;">
Hole details
<span style="font-weight:400; font-size:0.85rem;">
— Course par: <strong x-text="Array.from({length: holes}, (_, i) => parseInt(document.querySelector('[name=par_' + (i+1) + ']')?.value || 4)).reduce((a,b)=>a+b,0)"></strong>
</span>
</h2>
<div class="hole-pars-grid">
<template x-for="n in Array.from({length: holes}, (_, i) => i + 1)" :key="n">
<div class="hole-par-cell">
<div class="hole-par-label" x-text="n"></div>
<select :name="'par_' + n" class="hole-par-select">
<option value="3" :selected="(initPars[String(n)] || 4) == 3">3</option>
<option value="4" :selected="(initPars[String(n)] || 4) == 4">4</option>
<option value="5" :selected="(initPars[String(n)] || 4) == 5">5</option>
</select>
<select :name="'si_' + n" class="hole-par-select">
<option value=""></option>
<template x-for="s in Array.from({length: holes}, (_, i) => i + 1)" :key="s">
<option :value="s" :selected="(initSIs[String(n)] || null) == s" x-text="s"></option>
</template>
</select>
</div>
</template>
</div>
</div>
<button type="submit" class="btn btn-primary">Create course</button>
</form>
</div>
{% endblock %}