1use askama::Template;
2
3use crate::cmd::webui::project::views::TaskRow;
4
5/// View-model for the task detail page.
6pub(in crate::cmd::webui) struct TaskView {
7 pub(in crate::cmd::webui) full_id: String,
8 pub(in crate::cmd::webui) short_id: String,
9 pub(in crate::cmd::webui) title: String,
10 pub(in crate::cmd::webui) description: String,
11 /// Raw markdown source for the edit form textarea.
12 pub(in crate::cmd::webui) description_raw: String,
13 pub(in crate::cmd::webui) task_type: String,
14 pub(in crate::cmd::webui) status: String,
15 pub(in crate::cmd::webui) priority: String,
16 pub(in crate::cmd::webui) effort: String,
17 pub(in crate::cmd::webui) created_at: String,
18 pub(in crate::cmd::webui) created_at_display: String,
19 pub(in crate::cmd::webui) updated_at: String,
20 pub(in crate::cmd::webui) updated_at_display: String,
21 /// Parent task ID (short form) for display, empty string if none.
22 pub(in crate::cmd::webui) parent_id: String,
23 pub(in crate::cmd::webui) labels: Vec<String>,
24 pub(in crate::cmd::webui) logs: Vec<LogView>,
25}
26
27pub(in crate::cmd::webui) struct LogView {
28 pub(in crate::cmd::webui) timestamp: String,
29 pub(in crate::cmd::webui) timestamp_display: String,
30 pub(in crate::cmd::webui) message: String,
31}
32
33/// A blocker reference for the task detail page.
34pub(in crate::cmd::webui) struct BlockerRef {
35 pub(in crate::cmd::webui) full_id: String,
36 pub(in crate::cmd::webui) short_id: String,
37}
38
39#[derive(Template)]
40#[template(path = "task.html")]
41pub(super) struct TaskTemplate {
42 pub(super) all_projects: Vec<String>,
43 pub(super) active_project: Option<String>,
44 pub(super) project_name: String,
45 pub(super) task: TaskView,
46 pub(super) blockers_open: Vec<BlockerRef>,
47 pub(super) blockers_resolved: Vec<BlockerRef>,
48 pub(super) subtasks: Vec<TaskRow>,
49 /// Pre-built heading for the edit dialog, e.g. "Edit td-XXXXXXX".
50 pub(super) edit_heading: String,
51 /// Pre-built form action URL for the edit dialog.
52 pub(super) edit_form_action: String,
53}