xtablo-source/deprecated/internal/web/views/planning_view.go
Arthur Belleville 5d0c201e86
Some checks failed
backend-ci / Backend tests (pull_request) Failing after 53s
backend-ci / Backend tests (push) Failing after 1s
Some work
2026-05-23 17:26:01 +02:00

40 lines
1.6 KiB
Go
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package views
// PlanningEventRow holds data for a single event row in the planning agenda.
type PlanningEventRow struct {
DateLabel string
TimeRange string
Title string
TabloTitle string
Location string
}
// PlanningTabData is the view model for the planning page.
type PlanningTabData struct {
Events []PlanningEventRow
DateRange string
}
// NewPlanningTabData returns a PlanningTabData with static demo events spanning 2 dates.
func NewPlanningTabData() PlanningTabData {
return PlanningTabData{
DateRange: "May 17 May 30, 2026",
Events: []PlanningEventRow{
{DateLabel: "May 17, 2026", TimeRange: "09:00-10:00", Title: "Sprint Planning", TabloTitle: "Product", Location: "Room A"},
{DateLabel: "May 17, 2026", TimeRange: "11:00-12:00", Title: "Design Review", TabloTitle: "Design", Location: ""},
{DateLabel: "May 17, 2026", TimeRange: "14:00-15:00", Title: "Stakeholder Sync", TabloTitle: "Product", Location: "HQ"},
{DateLabel: "May 18, 2026", TimeRange: "10:00-11:00", Title: "Engineering Stand-up", TabloTitle: "Engineering", Location: ""},
{DateLabel: "May 18, 2026", TimeRange: "15:00-16:00", Title: "Retrospective", TabloTitle: "Product", Location: "Room B"},
},
}
}
// PlanningShowDaySeparator returns true when a day separator header should be
// rendered before the event at index. The separator is shown for the first
// event (index 0) or whenever the date label changes from the previous event.
func PlanningShowDaySeparator(events []PlanningEventRow, index int) bool {
if index == 0 {
return true
}
return events[index].DateLabel != events[index-1].DateLabel
}