added leagues

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

View File

@@ -26,9 +26,13 @@ templ SeasonDetails(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">{ 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 flex-wrap">
<span class="inline-block bg-blue px-3 py-1 rounded-full text-sm font-semibold text-mantle">
{ season.ShortName }
</span>
@SlapVersionBadge(season.SlapVersion)
@StatusBadge(season, false, false)
</div>
</div>
<div class="flex gap-2">
if canEditSeason {
@@ -127,13 +131,25 @@ templ SeasonDetails(season *db.Season) {
</div>
</div>
</div>
<!-- Status Section -->
<!-- Leagues Section -->
<div class="px-6 pb-6">
<div class="bg-surface0 border border-surface1 rounded-lg p-6">
<h2 class="text-2xl font-bold text-text mb-4">Status</h2>
<div class="flex items-center gap-3">
@StatusBadge(season, false, false)
</div>
<h2 class="text-2xl font-bold text-text mb-4">Leagues</h2>
if len(season.Leagues) == 0 {
<p class="text-subtext0 text-sm">No leagues assigned to this season.</p>
} else {
<div class="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-3">
for _, league := range season.Leagues {
<a
href={ templ.SafeURL("/seasons/" + season.ShortName + "/leagues/" + league.ShortName) }
class="bg-mantle border border-surface1 rounded-lg p-4 hover:bg-surface1 transition-colors"
>
<h3 class="font-semibold text-text mb-1">{ league.Name }</h3>
<span class="text-xs text-subtext0 font-mono">{ league.ShortName }</span>
</a>
}
</div>
}
</div>
</div>
</div>
@@ -169,3 +185,15 @@ func formatDuration(start, end time.Time) string {
return strconv.Itoa(years) + " years"
}
}
templ SlapVersionBadge(version string) {
if version == "rebound" {
<span class="inline-block bg-green px-3 py-1 rounded-full text-sm font-semibold text-mantle">
Rebound
</span>
} else if version == "slapshot1" {
<span class="inline-block bg-red px-3 py-1 rounded-full text-sm font-semibold text-mantle">
Slapshot 1
</span>
}
}