xtablo-source/backend/templates/tasks_forms.go
Arthur Belleville 889164b437
feat(04-02): KanbanBoard, TaskCard, TaskDeleteConfirmFragment templates
- Add tasks.templ with KanbanBoard, KanbanColumn, TaskCard, TaskCreateFormFragment, TaskDeleteConfirmFragment, AddTaskTrigger, TaskCardOOB
- Add TaskColumns/TaskColumnLabels to tasks_forms.go (moved from web package to break import cycle)
- Update TabloDetailPage signature to accept tasks []sqlc.Task; embed KanbanBoard below tablo header
- Update handlers_tablos.go TabloDetailHandler to fetch tasks via ListTasksByTablo
- Update layout.templ: add sortable.min.js script tag, update footer to Phase 4 · Tasks
2026-05-15 09:32:06 +02:00

48 lines
1.4 KiB
Go

package templates
import "backend/internal/db/sqlc"
// TaskColumns defines the canonical left-to-right column order for the kanban board.
var TaskColumns = []sqlc.TaskStatus{
sqlc.TaskStatusTodo,
sqlc.TaskStatusInProgress,
sqlc.TaskStatusInReview,
sqlc.TaskStatusDone,
}
// TaskColumnLabels maps each TaskStatus to its human-readable column header label.
var TaskColumnLabels = map[sqlc.TaskStatus]string{
sqlc.TaskStatusTodo: "To do",
sqlc.TaskStatusInProgress: "In progress",
sqlc.TaskStatusInReview: "In review",
sqlc.TaskStatusDone: "Done",
}
// TaskCreateForm carries submitted field values back to the template for
// repopulation on validation failure.
type TaskCreateForm struct {
Title string
Status string // holds the column status value, e.g. "todo"
}
// TaskCreateErrors holds per-field and general error messages for the task
// create form. An empty string means "no error for this field".
type TaskCreateErrors struct {
Title string
General string
}
// TaskUpdateForm carries submitted field values back to the template for
// repopulation on validation failure.
type TaskUpdateForm struct {
Title string
Description string
}
// TaskUpdateErrors holds per-field and general error messages for the task
// update/edit form. An empty string means "no error for this field".
type TaskUpdateErrors struct {
Title string
Description string
General string
}