2026-05-15 07:24:05 +00:00
|
|
|
package templates
|
|
|
|
|
|
2026-05-15 07:32:06 +00:00
|
|
|
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",
|
|
|
|
|
}
|
|
|
|
|
|
2026-05-15 07:24:05 +00:00
|
|
|
// TaskCreateForm carries submitted field values back to the template for
|
|
|
|
|
// repopulation on validation failure.
|
|
|
|
|
type TaskCreateForm struct {
|
2026-05-15 20:40:25 +00:00
|
|
|
Title string
|
|
|
|
|
Status string // holds the column status value, e.g. "todo"
|
|
|
|
|
EtapeID string
|
2026-05-15 07:24:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 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
|
|
|
|
|
}
|