added leagues

This commit is contained in:
2026-02-10 23:32:48 +11:00
parent ac5e38d82b
commit 2a3f4e4861
28 changed files with 1544 additions and 89 deletions

View File

@@ -4,7 +4,7 @@ import "git.haelnorr.com/h/oslstats/internal/view/datepicker"
import "git.haelnorr.com/h/oslstats/internal/db"
import "time"
templ EditForm(season *db.Season) {
templ EditForm(season *db.Season, allLeagues []*db.League) {
{{
// Format dates for display (DD/MM/YYYY)
startDateStr := formatDateInput(season.StartDate)
@@ -86,9 +86,20 @@ templ EditForm(season *db.Season) {
<div class="flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4">
<div>
<h1 class="text-4xl font-bold text-text mb-2">Edit { season.Name }</h1>
<span class="inline-block bg-blue px-3 py-1 rounded-full text-sm font-semibold text-mantle">
{ season.ShortName }
</span>
<div class="flex items-center gap-2">
<span class="inline-block bg-blue px-3 py-1 rounded-full text-sm font-semibold text-mantle">
{ season.ShortName }
</span>
<select
id="slap_version"
name="slap_version"
class="py-1 pl-3 pr-2 rounded-full text-sm bg-base border-2 border-overlay0 focus:border-blue outline-none"
required
>
<option value="rebound" selected?={ season.SlapVersion == "rebound" }>Rebound</option>
<option value="slapshot1" selected?={ season.SlapVersion == "slapshot1" }>Slapshot 1</option>
</select>
</div>
</div>
<div class="flex gap-2">
<button
@@ -158,6 +169,8 @@ templ EditForm(season *db.Season) {
</div>
</div>
</div>
<!-- Leagues Section -->
@LeaguesSection(season, allLeagues)
<!-- General Error Message -->
<div
class="px-6 pb-6"