package seasonsview import "git.haelnorr.com/h/oslstats/internal/db" import "git.haelnorr.com/h/oslstats/internal/permissions" import "git.haelnorr.com/h/oslstats/internal/contexts" import "git.haelnorr.com/h/oslstats/internal/view/baseview" import "fmt" import "time" func formatScheduleTime(t *time.Time) string { if t == nil { return "No time set" } return t.Format("Mon 2 Jan 2006 at 3:04 PM") } func formatHistoryTime(unix int64) string { return time.Unix(unix, 0).Format("2 Jan 2006 15:04") } templ FixtureDetailPage( fixture *db.Fixture, currentSchedule *db.FixtureSchedule, history []*db.FixtureSchedule, canSchedule bool, userTeamID int, ) { {{ permCache := contexts.Permissions(ctx) canManage := permCache.HasPermission(permissions.FixturesManage) backURL := fmt.Sprintf("/seasons/%s/leagues/%s/fixtures", fixture.Season.ShortName, fixture.League.ShortName) }} @baseview.Layout(fmt.Sprintf("%s vs %s", fixture.HomeTeam.Name, fixture.AwayTeam.Name)) {
No time scheduled
if canSchedule { Use the form to propose a time for this fixture. } else { A team manager needs to propose a time for this fixture. }
Proposed: { formatScheduleTime(current.ScheduledTime) }
Proposed by { current.ProposedBy.Name } β awaiting response from the other team
if canSchedule && userTeamID != current.ProposedByTeamID {Confirmed: { formatScheduleTime(current.ScheduledTime) }
Both teams have agreed on this time.
Proposal Rejected
The proposed time was rejected. A new time needs to be proposed.
Fixture Forfeited
if current.RescheduleReason != nil {{ *current.RescheduleReason }
}Rescheduled
if current.RescheduleReason != nil {Reason: { *current.RescheduleReason }
}A new time needs to be proposed.
Postponed
if current.RescheduleReason != nil {Reason: { *current.RescheduleReason }
}A new time needs to be proposed.
Proposal Withdrawn
The proposed time was withdrawn. A new time needs to be proposed.
This action is irreversible. Declaring a forfeit will permanently cancel the fixture schedule.
Only team managers can manage fixture scheduling.
No scheduling activity yet.
} else {