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

@@ -83,7 +83,7 @@ templ SeasonsList(seasons *db.List[db.Season]) {
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
for _, s := range seasons.Items {
<a
class="bg-mantle border border-surface1 rounded-lg p-6 hover:bg-surface0 transition-colors"
class="bg-mantle border border-surface1 rounded-lg p-6 hover:bg-surface0 transition-colors flex flex-col"
href={ fmt.Sprintf("/seasons/%s", s.ShortName) }
>
<!-- Header: Name + Status Badge -->
@@ -91,14 +91,45 @@ templ SeasonsList(seasons *db.List[db.Season]) {
<h3 class="text-xl font-bold text-text">{ s.Name }</h3>
@StatusBadge(s, true, true)
</div>
<!-- Info Row: Short Name + Start Date -->
<div class="flex items-center gap-3 text-sm">
<!-- Info Row: Short Name + Slap Version -->
<div class="flex items-center gap-2 text-sm mb-3 flex-wrap">
<span class="px-2 py-1 bg-surface1 rounded text-subtext0 font-mono">
{ s.ShortName }
</span>
<span class="text-subtext0">
@SlapVersionBadge(s.SlapVersion)
</div>
<!-- Leagues -->
if len(s.Leagues) > 0 {
<div class="flex flex-wrap gap-1 mb-2">
for _, league := range s.Leagues {
<span class="px-2 py-0.5 bg-surface0 border border-surface1 rounded text-xs text-subtext0">
{ league.ShortName }
</span>
}
</div>
}
<!-- Date Info -->
{{
now := time.Now()
}}
<div class="text-xs text-subtext1 mt-auto">
if now.Before(s.StartDate) {
Starts: { formatDate(s.StartDate) }
} else if !s.FinalsStartDate.IsZero() {
// Finals are scheduled
if !s.FinalsEndDate.IsZero() && now.After(s.FinalsEndDate.Time) {
Completed: { formatDate(s.FinalsEndDate.Time) }
} else if now.After(s.FinalsStartDate.Time) {
Finals Started: { formatDate(s.FinalsStartDate.Time) }
} else {
Finals Start: { formatDate(s.FinalsStartDate.Time) }
}
} else if !s.EndDate.IsZero() && now.After(s.EndDate.Time) {
// No finals scheduled and regular season ended
Completed: { formatDate(s.EndDate.Time) }
} else {
Started: { formatDate(s.StartDate) }
</span>
}
</div>
</a>
}