series overview added
This commit is contained in:
@@ -44,6 +44,15 @@ templ PlayoffBracketView(season *db.Season, league *db.League, bracket *db.Playo
|
||||
</div>
|
||||
</div>
|
||||
<script src="/static/js/bracket-lines.js"></script>
|
||||
<script>
|
||||
document.querySelectorAll('[data-series-url]').forEach(function(card) {
|
||||
card.addEventListener('click', function(e) {
|
||||
if (!e.target.closest('a')) {
|
||||
window.location.href = card.getAttribute('data-series-url');
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
}
|
||||
|
||||
// ──────────────────────────────────────────────
|
||||
@@ -189,11 +198,19 @@ templ bracket10to15(season *db.Season, league *db.League, bracket *db.PlayoffBra
|
||||
// ──────────────────────────────────────────────
|
||||
|
||||
templ seriesCard(season *db.Season, league *db.League, series *db.PlayoffSeries) {
|
||||
{{
|
||||
hasTeams := series.Team1 != nil || series.Team2 != nil
|
||||
seriesURL := fmt.Sprintf("/series/%d", series.ID)
|
||||
}}
|
||||
<div
|
||||
data-series={ fmt.Sprint(series.SeriesNumber) }
|
||||
if hasTeams {
|
||||
data-series-url={ seriesURL }
|
||||
}
|
||||
class={ "bg-surface0 border rounded-lg overflow-hidden",
|
||||
templ.KV("border-blue/50", series.Status == db.SeriesStatusInProgress),
|
||||
templ.KV("border-surface1", series.Status != db.SeriesStatusInProgress) }
|
||||
templ.KV("border-surface1", series.Status != db.SeriesStatusInProgress),
|
||||
templ.KV("hover:bg-surface1 hover:cursor-pointer transition", hasTeams) }
|
||||
>
|
||||
<!-- Series Header -->
|
||||
<div class="bg-mantle px-3 py-1.5 flex items-center justify-between border-b border-surface1">
|
||||
|
||||
Reference in New Issue
Block a user