Skip to content

Commit

Permalink
feat: move entertainment to another tab
Browse files Browse the repository at this point in the history
closes #68
  • Loading branch information
linonetwo committed Jun 8, 2024
1 parent e857737 commit 13529dd
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
title: $:/plugins/linonetwo/intention-tower-knowledge-graph/ViewTemplate/EntertainmentDynamicTable
caption: {{$:/plugins/linonetwo/intention-tower-knowledge-graph/Images/Table}} <<lingo Tabs/EntertainmentTaskList $:/plugins/linonetwo/intention-tower-knowledge-graph/language/>>
tags: $:/tags/ITKG/ProjectsOverview

\import [[$:/plugins/linonetwo/intention-tower-knowledge-graph/filters/leaf-task]]
\procedure lingo-base() $:/plugins/linonetwo/intention-tower-knowledge-graph/language/

<<lingo Tabs/EntertainmentTaskList/Description>>

<$basic-table
height="800px"
filter=<<get-all-non-completed-leaf-tasks entertainment:"">>
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',
})),
]
"""
/>
Original file line number Diff line number Diff line change
Expand Up @@ -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/

!! <<lingo Table/PriorityToDoList>> <$count filter=<<get-all-non-completed-leaf-tasks>> />
!! <<lingo Table/PriorityToDoList>> <$count filter=<<get-all-non-completed-leaf-tasks entertainment:"!">> />

<$basic-table
height="800px"
filter=<<get-all-non-completed-leaf-tasks>>
filter=<<get-all-non-completed-leaf-tasks entertainment:"!">>
columns="""
[
{
Expand Down
4 changes: 3 additions & 1 deletion src/intention-tower-knowledge-graph/filters/leaf-task.tid
Original file line number Diff line number Diff line change
Expand Up @@ -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]]

<!-- // TODO: try replace with in-tagtree-of -->
<!-- projects are tasks, so getting all projects under current (intention), then get those is in new task state -->
\define get-non-completed-leaf-projects() [in-tagtree-of<currentTiddler>tag{$:/plugins/linonetwo/intention-tower-knowledge-graph/Config/project-tag}filter<filter-is-new-task>]
Expand All @@ -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<filter-is-new-task>] :map:flat[all[tiddlers]in-tagtree-of<currentTiddler>!filter<filter-is-not-leaf>filter<filter-is-new-task>] :and[filter<has-length>unique[]!sortsub:integer<compareByPriority>]
\define get-all-non-completed-leaf-tasks(entertainment:"") [all[tiddlers]tag{$:/plugins/linonetwo/intention-tower-knowledge-graph/Config/project-tag}filter<filter-is-new-task>] :map:flat[all[tiddlers]in-tagtree-of<currentTiddler>!filter<filter-is-not-leaf>filter<filter-is-new-task>$entertainment$filter<filter-is-entertainment>] :and[filter<has-length>unique[]!sortsub:integer<compareByPriority>]
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ BackToDefaultLayout: 返回默认布局
Configs/Description: 通过这些设置,您可以自定义「意义之塔与知识图谱」插件的行为。
Tabs/TaskArchive: 任务归档
Tabs/PriorityTaskList: 优先任务列表
Tabs/EntertainmentTaskList: 娱乐列表
Tabs/EntertainmentTaskList/Description: 重要性在 P7 及以后的「任务」,算是娱乐,即没玩完,待之后继续玩的事物。
Tabs/MeaningOfLife: 人生意义
Tabs/AddIntention: 添加意义
Tabs/CalendarRecord: 日历记录
Expand Down

0 comments on commit 13529dd

Please sign in to comment.