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:
parent
eff62b0fd9
commit
59f143aecb
6 changed files with 51 additions and 10 deletions
|
|
@ -46,6 +46,9 @@ func AccountProvidersHandler(deps AuthDeps) http.HandlerFunc {
|
||||||
}
|
}
|
||||||
|
|
||||||
w.Header().Set("Content-Type", "text/html; charset=utf-8")
|
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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -75,7 +75,12 @@ func TabloDiscussionTabHandler(deps DiscussionDeps) http.HandlerFunc {
|
||||||
if discussionSidebarTablos == nil {
|
if discussionSidebarTablos == nil {
|
||||||
discussionSidebarTablos = []sqlc.Tablo{}
|
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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -174,7 +174,12 @@ func TabloEventsTabHandler(deps EventsDeps) http.HandlerFunc {
|
||||||
if eventsSidebarTablos == nil {
|
if eventsSidebarTablos == nil {
|
||||||
eventsSidebarTablos = []sqlc.Tablo{}
|
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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -103,7 +103,12 @@ func TabloFilesTabHandler(deps FilesDeps) http.HandlerFunc {
|
||||||
if filesSidebarTablos == nil {
|
if filesSidebarTablos == nil {
|
||||||
filesSidebarTablos = []sqlc.Tablo{}
|
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 {
|
if tasksSidebarTablos == nil {
|
||||||
tasksSidebarTablos = []sqlc.Tablo{}
|
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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -65,6 +65,9 @@ func PlanningPageHandler(deps PlanningDeps) http.HandlerFunc {
|
||||||
}
|
}
|
||||||
|
|
||||||
w.Header().Set("Content-Type", "text/html; charset=utf-8")
|
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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,10 @@ func TablosListHandler(deps TablosDeps) http.HandlerFunc {
|
||||||
}
|
}
|
||||||
|
|
||||||
w.Header().Set("Content-Type", "text/html; charset=utf-8")
|
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)
|
_ = templates.TabloOverviewTabFragment(tablo, csrf.Token(r)).Render(r.Context(), w)
|
||||||
return
|
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 {
|
if updateSidebarTablos == nil {
|
||||||
updateSidebarTablos = []sqlc.Tablo{}
|
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
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -462,5 +475,8 @@ func renderTabloCreateError(w http.ResponseWriter, r *http.Request, form templat
|
||||||
for _, cv := range errorCardViews {
|
for _, cv := range errorCardViews {
|
||||||
errorSidebarTablos = append(errorSidebarTablos, cv.Tablo)
|
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)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue