draft seasons get special treatment :)

This commit is contained in:
2026-02-18 20:36:15 +11:00
parent b018628d4c
commit 6193fe2ab6
16 changed files with 416 additions and 78 deletions

View File

@@ -125,3 +125,26 @@ templ leagueNavItem(section string, label string, activeSection string, season *
</a>
</li>
}
templ draftNavItem(section string, label string, activeSection string, season *db.Season, league *db.League) {
{{
isActive := section == activeSection
baseClasses := "inline-block px-6 py-3 transition-colors cursor-pointer border-b-2"
activeClasses := "border-blue text-blue font-semibold"
inactiveClasses := "border-transparent text-subtext0 hover:text-text hover:border-surface2"
displayURL := fmt.Sprintf("/seasons/%s/%s", season.ShortName, section)
postURL := fmt.Sprintf("/seasons/%s/leagues/%s/%s", season.ShortName, league.ShortName, section)
}}
<li class="inline-block">
<a
href={ templ.SafeURL(displayURL) }
hx-post={ postURL }
hx-target="#season-league-content"
hx-swap="innerHTML"
hx-push-url={ displayURL }
class={ baseClasses, templ.KV(activeClasses, isActive), templ.KV(inactiveClasses, !isActive) }
>
{ label }
</a>
</li>
}