feat(18-01): update all handler call sites with per-page breadcrumbs

- handlers_tablos.go: TablosListHandler, renderTabloCreateError, TabloDetailHandler, TabloUpdateHandler
- handlers_planning.go: PlanningPageHandler
- handlers_account.go: AccountProvidersHandler
- handlers_discussion.go: TabloDiscussionTabHandler
- handlers_files.go: TabloFilesTabHandler, TabloTasksTabHandler
- handlers_events.go: TabloEventsTabHandler
- go build ./... succeeds, go test ./... passes
This commit is contained in:
Arthur Belleville 2026-05-17 15:27:38 +02:00
parent eff62b0fd9
commit 59f143aecb
No known key found for this signature in database
6 changed files with 51 additions and 10 deletions

View file

@ -46,6 +46,9 @@ func AccountProvidersHandler(deps AuthDeps) http.HandlerFunc {
}
w.Header().Set("Content-Type", "text/html; charset=utf-8")
_ = templates.AccountProvidersPage(user, statuses, csrf.Token(r), "/", sidebarTablos).Render(r.Context(), w)
_ = templates.AccountProvidersPage(user, statuses, csrf.Token(r), "/", sidebarTablos,
"Linked Providers",
[]templates.BreadcrumbItem{{Label: "Linked Providers", Href: ""}},
).Render(r.Context(), w)
}
}

View file

@ -75,7 +75,12 @@ func TabloDiscussionTabHandler(deps DiscussionDeps) http.HandlerFunc {
if discussionSidebarTablos == nil {
discussionSidebarTablos = []sqlc.Tablo{}
}
_ = templates.TabloDetailPage(user, csrf.Token(r), "", discussionSidebarTablos, tablo, nil, nil, templates.EtapeTaskCounts{}, templates.EtapeFilter{}, nil, templates.EventsCalendar{}, data, "discussion").Render(r.Context(), w)
_ = templates.TabloDetailPage(user, csrf.Token(r), "", discussionSidebarTablos, tablo, nil, nil,
templates.EtapeTaskCounts{}, templates.EtapeFilter{}, nil, templates.EventsCalendar{},
data, "discussion",
tablo.Title,
[]templates.BreadcrumbItem{{Label: "Dashboard", Href: "/"}, {Label: tablo.Title, Href: ""}},
).Render(r.Context(), w)
}
}

View file

@ -174,7 +174,12 @@ func TabloEventsTabHandler(deps EventsDeps) http.HandlerFunc {
if eventsSidebarTablos == nil {
eventsSidebarTablos = []sqlc.Tablo{}
}
_ = templates.TabloDetailPage(user, csrf.Token(r), "", eventsSidebarTablos, tablo, nil, nil, templates.EtapeTaskCounts{}, templates.EtapeFilter{}, nil, calendar, templates.DiscussionTabData{}, "events").Render(r.Context(), w)
_ = templates.TabloDetailPage(user, csrf.Token(r), "", eventsSidebarTablos, tablo, nil, nil,
templates.EtapeTaskCounts{}, templates.EtapeFilter{}, nil, calendar,
templates.DiscussionTabData{}, "events",
tablo.Title,
[]templates.BreadcrumbItem{{Label: "Dashboard", Href: "/"}, {Label: tablo.Title, Href: ""}},
).Render(r.Context(), w)
}
}

View file

@ -103,7 +103,12 @@ func TabloFilesTabHandler(deps FilesDeps) http.HandlerFunc {
if filesSidebarTablos == nil {
filesSidebarTablos = []sqlc.Tablo{}
}
_ = templates.TabloDetailPage(user, csrf.Token(r), "", filesSidebarTablos, tablo, nil, nil, templates.EtapeTaskCounts{}, templates.EtapeFilter{}, fileList, templates.EventsCalendar{}, templates.DiscussionTabData{}, "files").Render(r.Context(), w)
_ = templates.TabloDetailPage(user, csrf.Token(r), "", filesSidebarTablos, tablo, nil, nil,
templates.EtapeTaskCounts{}, templates.EtapeFilter{}, fileList, templates.EventsCalendar{},
templates.DiscussionTabData{}, "files",
tablo.Title,
[]templates.BreadcrumbItem{{Label: "Dashboard", Href: "/"}, {Label: tablo.Title, Href: ""}},
).Render(r.Context(), w)
}
}
@ -135,7 +140,11 @@ func TabloTasksTabHandler(deps FilesDeps) http.HandlerFunc {
if tasksSidebarTablos == nil {
tasksSidebarTablos = []sqlc.Tablo{}
}
_ = templates.TabloDetailPage(user, csrf.Token(r), "", tasksSidebarTablos, tablo, tasks, etapes, counts, filter, nil, templates.EventsCalendar{}, templates.DiscussionTabData{}, "tasks").Render(r.Context(), w)
_ = templates.TabloDetailPage(user, csrf.Token(r), "", tasksSidebarTablos, tablo, tasks, etapes,
counts, filter, nil, templates.EventsCalendar{}, templates.DiscussionTabData{}, "tasks",
tablo.Title,
[]templates.BreadcrumbItem{{Label: "Dashboard", Href: "/"}, {Label: tablo.Title, Href: ""}},
).Render(r.Context(), w)
}
}

View file

@ -65,6 +65,9 @@ func PlanningPageHandler(deps PlanningDeps) http.HandlerFunc {
}
w.Header().Set("Content-Type", "text/html; charset=utf-8")
_ = templates.PlanningPage(user, csrf.Token(r), "/planning", sidebarTablos, agenda).Render(r.Context(), w)
_ = templates.PlanningPage(user, csrf.Token(r), "/planning", sidebarTablos, agenda,
"Planning",
[]templates.BreadcrumbItem{{Label: "Planning", Href: ""}},
).Render(r.Context(), w)
}
}

View file

@ -57,7 +57,10 @@ func TablosListHandler(deps TablosDeps) http.HandlerFunc {
}
w.Header().Set("Content-Type", "text/html; charset=utf-8")
_ = templates.TablosDashboard(user, csrf.Token(r), "/", sidebarTablos, cardViews).Render(r.Context(), w)
_ = templates.TablosDashboard(user, csrf.Token(r), "/", sidebarTablos, cardViews,
"Dashboard",
[]templates.BreadcrumbItem{{Label: "Dashboard", Href: ""}},
).Render(r.Context(), w)
}
}
@ -222,7 +225,12 @@ func TabloDetailHandler(deps TablosDeps) http.HandlerFunc {
_ = templates.TabloOverviewTabFragment(tablo, csrf.Token(r)).Render(r.Context(), w)
return
}
_ = templates.TabloDetailPage(user, csrf.Token(r), "", sidebarTablos, tablo, tasks, nil, templates.EtapeTaskCounts{}, templates.EtapeFilter{}, nil, templates.EventsCalendar{}, templates.DiscussionTabData{}, "overview").Render(r.Context(), w)
_ = templates.TabloDetailPage(user, csrf.Token(r), "", sidebarTablos, tablo, tasks, nil,
templates.EtapeTaskCounts{}, templates.EtapeFilter{}, nil, templates.EventsCalendar{},
templates.DiscussionTabData{}, "overview",
tablo.Title,
[]templates.BreadcrumbItem{{Label: "Dashboard", Href: "/"}, {Label: tablo.Title, Href: ""}},
).Render(r.Context(), w)
}
}
@ -335,7 +343,12 @@ func TabloUpdateHandler(deps TablosDeps) http.HandlerFunc {
if updateSidebarTablos == nil {
updateSidebarTablos = []sqlc.Tablo{}
}
_ = templates.TabloDetailPage(user, csrf.Token(r), "", updateSidebarTablos, tablo, tasks, nil, templates.EtapeTaskCounts{}, templates.EtapeFilter{}, nil, templates.EventsCalendar{}, templates.DiscussionTabData{}, "overview").Render(ctx, w)
_ = templates.TabloDetailPage(user, csrf.Token(r), "", updateSidebarTablos, tablo, tasks, nil,
templates.EtapeTaskCounts{}, templates.EtapeFilter{}, nil, templates.EventsCalendar{},
templates.DiscussionTabData{}, "overview",
tablo.Title,
[]templates.BreadcrumbItem{{Label: "Dashboard", Href: "/"}, {Label: tablo.Title, Href: ""}},
).Render(ctx, w)
return
}
@ -462,5 +475,8 @@ func renderTabloCreateError(w http.ResponseWriter, r *http.Request, form templat
for _, cv := range errorCardViews {
errorSidebarTablos = append(errorSidebarTablos, cv.Tablo)
}
_ = templates.TablosDashboard(user, csrf.Token(r), "/", errorSidebarTablos, errorCardViews).Render(r.Context(), w)
_ = templates.TablosDashboard(user, csrf.Token(r), "/", errorSidebarTablos, errorCardViews,
"Dashboard",
[]templates.BreadcrumbItem{{Label: "Dashboard", Href: ""}},
).Render(r.Context(), w)
}