feat: wire Dashboard, Issues, and Pulls handlers to use html/template files instead of inline HTML #38
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
The
Dashboard,ListIssues, andListPullshandlers ininternal/handlers/handlers.gocurrently build HTML viafmt.Sprintfinline strings. The template filesdashboard.html,issues.html, andpulls.htmlexist ininternal/templates/but are not used by these handlers. This is tracked in leeworks-agents/gitea-mobile#34.This issue breaks down the concrete implementation steps.
What to do
internal/templates/dashboard.html— define a{{define "content"}}block that renders the triage queue cards (currently built inline inDashboardhandler)internal/templates/issues.html— define a{{define "content"}}block for the issues list with filter bar and rowsinternal/templates/pulls.html— define a{{define "content"}}block for the pulls listDashboard,ListIssues, andListPullshandlers to:template.ParseFiles("internal/templates/dashboard.html")(etc.)tmpl.ExecuteTemplate(&buf, "content", data)and pass the result torenderPageAcceptance Criteria
fmt.SprintfHTML generation remains in the three handlersgo test ./...passesHX-Request: true) still work correctlyReferences
Roadmap Phase 2.2 — Views
See also: leeworks-agents/gitea-mobile#34