added finals log uploads

This commit is contained in:
2026-03-15 12:59:34 +11:00
parent af42c16faf
commit ad93c44fae
7 changed files with 1468 additions and 2 deletions

View File

@@ -216,9 +216,8 @@ templ SeriesDetailOverviewContent(
{{
permCache := contexts.Permissions(ctx)
canManage := permCache.HasPermission(permissions.PlayoffsManage)
_ = canManage
}}
@seriesOverviewTab(series, currentSchedule, rosters, canSchedule, userTeamID)
@seriesOverviewTab(series, currentSchedule, rosters, canSchedule, canManage, userTeamID)
}
templ SeriesDetailPreviewContent(
@@ -257,8 +256,15 @@ templ seriesOverviewTab(
currentSchedule *db.PlayoffSeriesSchedule,
rosters map[string][]*db.PlayerWithPlayStatus,
canSchedule bool,
canManage bool,
userTeamID int,
) {
{{
isCompleted := series.Status == db.SeriesStatusCompleted
isBye := series.Status == db.SeriesStatusBye
bothTeamsAssigned := series.Team1ID != nil && series.Team2ID != nil
showUploadPrompt := canManage && !isCompleted && !isBye && bothTeamsAssigned
}}
<div class="space-y-6">
<!-- Series Score + Schedule Row -->
<div class="grid grid-cols-1 lg:grid-cols-3 gap-6">
@@ -270,6 +276,11 @@ templ seriesOverviewTab(
</div>
</div>
<!-- Upload Prompt (for admins when series is in progress) -->
if showUploadPrompt {
@seriesUploadPrompt(series)
}
<!-- Match List -->
if len(series.Matches) > 0 {
@seriesMatchList(series)
@@ -290,6 +301,44 @@ templ seriesOverviewTab(
</div>
}
templ seriesUploadPrompt(series *db.PlayoffSeries) {
{{
// Check if there are pending results waiting for review
hasPendingMatches := false
for _, match := range series.Matches {
if match.FixtureID != nil && match.Status == "pending" {
hasPendingMatches = true
break
}
}
}}
<div class="bg-mantle border border-surface1 rounded-lg p-6 text-center">
if hasPendingMatches {
<div class="text-4xl mb-3">📋</div>
<p class="text-lg text-text font-medium mb-2">Results Pending Review</p>
<p class="text-sm text-subtext1 mb-4">Uploaded results are waiting to be reviewed and finalized.</p>
<a
href={ templ.SafeURL(fmt.Sprintf("/series/%d/results/review", series.ID)) }
class="inline-block px-4 py-2 bg-green hover:bg-green/75 text-mantle rounded-lg
font-medium transition hover:cursor-pointer"
>
Review Results
</a>
} else {
<div class="text-4xl mb-3">📋</div>
<p class="text-lg text-text font-medium mb-2">No Results Uploaded</p>
<p class="text-sm text-subtext1 mb-4">Upload match log files to record the series results.</p>
<a
href={ templ.SafeURL(fmt.Sprintf("/series/%d/results/upload", series.ID)) }
class="inline-block px-4 py-2 bg-blue hover:bg-blue/80 text-mantle rounded-lg
font-medium transition hover:cursor-pointer"
>
Upload Match Logs
</a>
}
</div>
}
templ seriesScoreDisplay(series *db.PlayoffSeries) {
{{
isCompleted := series.Status == db.SeriesStatusCompleted