From 13529dd810003f4ed0aa90a6ebc17a1219487e00 Mon Sep 17 00:00:00 2001 From: lin onetwo Date: Sun, 9 Jun 2024 03:08:45 +0800 Subject: [PATCH] feat: move entertainment to another tab closes #68 --- .../EntertainmentDynamicTable.tid | 33 +++++++++++++++++++ .../PriorityTaskDynamicTable.tid | 4 +-- .../filters/leaf-task.tid | 4 ++- .../language/en-GB/Translations.multids | 2 ++ .../language/zh-Hans/Translations.multids | 2 ++ 5 files changed, 42 insertions(+), 3 deletions(-) create mode 100644 src/intention-tower-knowledge-graph/ViewTemplate/ProjectsOverview/EntertainmentDynamicTable.tid diff --git a/src/intention-tower-knowledge-graph/ViewTemplate/ProjectsOverview/EntertainmentDynamicTable.tid b/src/intention-tower-knowledge-graph/ViewTemplate/ProjectsOverview/EntertainmentDynamicTable.tid new file mode 100644 index 0000000..0005f5d --- /dev/null +++ b/src/intention-tower-knowledge-graph/ViewTemplate/ProjectsOverview/EntertainmentDynamicTable.tid @@ -0,0 +1,33 @@ +title: $:/plugins/linonetwo/intention-tower-knowledge-graph/ViewTemplate/EntertainmentDynamicTable +caption: {{$:/plugins/linonetwo/intention-tower-knowledge-graph/Images/Table}} <> +tags: $:/tags/ITKG/ProjectsOverview + +\import [[$:/plugins/linonetwo/intention-tower-knowledge-graph/filters/leaf-task]] +\procedure lingo-base() $:/plugins/linonetwo/intention-tower-knowledge-graph/language/ + +<> + +<$basic-table + height="800px" + filter=<> + columns=""" + [ + { + field: 'title', + width: 'auto', + }, + { + field: 'tags', + width: 200, + fieldFormat: (record) => record.tags.filter(tag => !([$tw.wiki.getTiddlerText('$:/plugins/linonetwo/intention-tower-knowledge-graph/Config/task-tag', '')].includes(tag))).join(', '), + }, + ...$tw.wiki.getTiddlerText('$:/plugins/linonetwo/intention-tower-knowledge-graph/Config/defaultFields-PriorityTaskDynamicTable', '') + .split(' ').filter(field => !(['title', 'tags'].includes(field))) + .map(field => ({ + field, + title: field, + width: 'auto', + })), + ] + """ +/> diff --git a/src/intention-tower-knowledge-graph/ViewTemplate/ProjectsOverview/PriorityTaskDynamicTable.tid b/src/intention-tower-knowledge-graph/ViewTemplate/ProjectsOverview/PriorityTaskDynamicTable.tid index 881a21f..528250d 100644 --- a/src/intention-tower-knowledge-graph/ViewTemplate/ProjectsOverview/PriorityTaskDynamicTable.tid +++ b/src/intention-tower-knowledge-graph/ViewTemplate/ProjectsOverview/PriorityTaskDynamicTable.tid @@ -5,11 +5,11 @@ tags: $:/tags/ITKG/ProjectsOverview \import [[$:/plugins/linonetwo/intention-tower-knowledge-graph/filters/leaf-task]] \procedure lingo-base() $:/plugins/linonetwo/intention-tower-knowledge-graph/language/ -!! <> <$count filter=<> /> +!! <> <$count filter=<> /> <$basic-table height="800px" - filter=<> + filter=<> columns=""" [ { diff --git a/src/intention-tower-knowledge-graph/filters/leaf-task.tid b/src/intention-tower-knowledge-graph/filters/leaf-task.tid index 82d6630..eead6c9 100644 --- a/src/intention-tower-knowledge-graph/filters/leaf-task.tid +++ b/src/intention-tower-knowledge-graph/filters/leaf-task.tid @@ -11,6 +11,8 @@ title: $:/plugins/linonetwo/intention-tower-knowledge-graph/filters/leaf-task \define compareByPriority() [get[tmo_priority]match[High]then[3]] :else[get[tmo_priority]match[Medium]then[2]] :else[get[tmo_priority]match[Low]then[1]] :else[[2]] +\define filter-is-entertainment() [get[tmo_importance]compare:number:gteq[7]] + \define get-non-completed-leaf-projects() [in-tagtree-oftag{$:/plugins/linonetwo/intention-tower-knowledge-graph/Config/project-tag}filter] @@ -22,4 +24,4 @@ get all project first, and for each project, run same logic as get-non-completed If some project is sub project of others, this may introduce duplication, so deduplicate by `unique[]` at last. Then `!sortsub:integer` to sort by priority from 3 to 1 --> -\define get-all-non-completed-leaf-tasks() [all[tiddlers]tag{$:/plugins/linonetwo/intention-tower-knowledge-graph/Config/project-tag}filter] :map:flat[all[tiddlers]in-tagtree-of!filterfilter] :and[filterunique[]!sortsub:integer] \ No newline at end of file +\define get-all-non-completed-leaf-tasks(entertainment:"") [all[tiddlers]tag{$:/plugins/linonetwo/intention-tower-knowledge-graph/Config/project-tag}filter] :map:flat[all[tiddlers]in-tagtree-of!filterfilter$entertainment$filter] :and[filterunique[]!sortsub:integer] diff --git a/src/intention-tower-knowledge-graph/language/en-GB/Translations.multids b/src/intention-tower-knowledge-graph/language/en-GB/Translations.multids index ddb8d9a..b4a133c 100644 --- a/src/intention-tower-knowledge-graph/language/en-GB/Translations.multids +++ b/src/intention-tower-knowledge-graph/language/en-GB/Translations.multids @@ -12,6 +12,8 @@ BackToDefaultLayout: Back To Default Layout Configs/Description: These settings let you customise the behaviour of "Intention Tower Knowledge Graph" plugin. Tabs/TaskArchive: Task Archive Tabs/PriorityTaskList: Priority Task List +Tabs/EntertainmentTaskList: Entertainment List +Tabs/EntertainmentTaskList/Description: "Tasks" with an importance of P7 and later, are considered entertainment, i.e., playable things that are not finished and will be continued later. Tabs/MeaningOfLife: Meaning Of Life Tabs/ProjectOverviewMap: Project Overview Map Tabs/AddIntention: Add Intention diff --git a/src/intention-tower-knowledge-graph/language/zh-Hans/Translations.multids b/src/intention-tower-knowledge-graph/language/zh-Hans/Translations.multids index 514e78d..8e731bd 100644 --- a/src/intention-tower-knowledge-graph/language/zh-Hans/Translations.multids +++ b/src/intention-tower-knowledge-graph/language/zh-Hans/Translations.multids @@ -12,6 +12,8 @@ BackToDefaultLayout: 返回默认布局 Configs/Description: 通过这些设置,您可以自定义「意义之塔与知识图谱」插件的行为。 Tabs/TaskArchive: 任务归档 Tabs/PriorityTaskList: 优先任务列表 +Tabs/EntertainmentTaskList: 娱乐列表 +Tabs/EntertainmentTaskList/Description: 重要性在 P7 及以后的「任务」,算是娱乐,即没玩完,待之后继续玩的事物。 Tabs/MeaningOfLife: 人生意义 Tabs/AddIntention: 添加意义 Tabs/CalendarRecord: 日历记录