Skip to content

Commit

Permalink
refactor: layout for ITKG
Browse files Browse the repository at this point in the history
  • Loading branch information
linonetwo committed Apr 27, 2024
1 parent 7d232f1 commit 3ae5703
Show file tree
Hide file tree
Showing 14 changed files with 90 additions and 69 deletions.
15 changes: 0 additions & 15 deletions src/intention-tower-knowledge-graph/Sidebar/Buttons.tid

This file was deleted.

18 changes: 0 additions & 18 deletions src/intention-tower-knowledge-graph/Sidebar/IntentionTower.tid

This file was deleted.

21 changes: 0 additions & 21 deletions src/intention-tower-knowledge-graph/Sidebar/ProjectList.tid

This file was deleted.

3 changes: 0 additions & 3 deletions src/intention-tower-knowledge-graph/Sidebar/sidebar.css.meta

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
title: $:/plugins/linonetwo/intention-tower-knowledge-graph/ViewTemplate/UnderIntention
tags: $:/tags/ViewTemplate

\import [[$:/plugins/linonetwo/intention-tower-knowledge-graph/Sidebar/Buttons]] [[$:/plugins/linonetwo/intention-tower-knowledge-graph/Components/Buttons]]
\import [[$:/plugins/linonetwo/intention-tower-knowledge-graph/Components/Buttons]]

<$let graphRootTiddler=<<currentTiddler>> >
<$list filter="[all[current]tag{$:/plugins/linonetwo/intention-tower-knowledge-graph/Config/intention-tag}then<graphRootTiddler>]">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
title: $:/plugins/linonetwo/intention-tower-knowledge-graph/ViewTemplate/UnderProject
tags: $:/tags/ViewTemplate

\import [[$:/plugins/linonetwo/intention-tower-knowledge-graph/Sidebar/Buttons]] [[$:/plugins/linonetwo/intention-tower-knowledge-graph/Components/Buttons]]
\import [[$:/plugins/linonetwo/intention-tower-knowledge-graph/Components/Buttons]]

<$let graphRootTiddler=<<currentTiddler>> >
<$list filter="[all[current]tag{$:/plugins/linonetwo/intention-tower-knowledge-graph/Config/project-tag}then<graphRootTiddler>]">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ tags: $:/tags/ITKG/UnderTask
<summary>子任务、前置任务及后续任务</summary>
<fieldset>
<legend>当前子任务</legend>
<div class="itkg-sidebar-project-list">
<div class="itkg-project-list">
<$list filter="[tag<currentTiddler>]">
<$link><<currentTiddler>></$link>&nbsp;&nbsp;
</$list>
Expand All @@ -32,7 +32,7 @@ tags: $:/tags/ITKG/UnderTask

<fieldset>
<legend>前置任务</legend>
<div class="itkg-sidebar-project-list">
<div class="itkg-project-list">
<$list filter="[enlist{!!tmo_dependency}]">
<$link><<currentTiddler>></$link>&nbsp;&nbsp;
</$list>
Expand All @@ -41,7 +41,7 @@ tags: $:/tags/ITKG/UnderTask

<fieldset>
<legend>后续任务</legend>
<div class="itkg-sidebar-project-list">
<div class="itkg-project-list">
<$list filter="[tmo_dependency<currentTiddler>]">
<$link><<currentTiddler>></$link>&nbsp;&nbsp;
</$list>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ tags: $:/tags/ViewTemplate
<$list filter="[all[current]tag{$:/plugins/linonetwo/intention-tower-knowledge-graph/Config/task-tag}!tag{$:/plugins/linonetwo/intention-tower-knowledge-graph/Config/project-tag}then<graphRootTiddler>]">

<!-- 先用已有的样式,后面如果内容比较多再做样式处理 -->
<div class="itkg-sidebar-project-list-item">
<div class="itkg-project-list-item">
<<create-task-under-current-tiddler>>&nbsp;
<<create-next-task-under-current-tiddler>>&nbsp;
<<counts-number-of-completions>>&nbsp;
Expand Down
5 changes: 5 additions & 0 deletions src/intention-tower-knowledge-graph/icons/tower.tid
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
title: $:/plugins/linonetwo/intention-tower-knowledge-graph/icons/tower
tags: $:/tags/Image

\parameters (size:"22pt")
<svg width=<<size>> height=<<size>> class="tc-image-ipk-eiffel-tower-outline tc-image-button" viewBox="0 0 48 48" fill="none"><path d="M21 8C21 19 17.5 33 11 44" stroke="black" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/><path d="M27 8C27 19 30.5 33 37 44" stroke="black" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/><path d="M4 44H44" stroke="black" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/><path d="M14 30L34 30" stroke="black" stroke-width="4" stroke-linecap="round"/><path d="M17 21L31 21" stroke="black" stroke-width="4" stroke-linecap="round"/><path d="M20 8L28 8" stroke="black" stroke-width="4" stroke-linecap="round"/><path d="M24 4V8" stroke="black" stroke-width="4" stroke-linecap="round"/><path d="M18 44C18 44 18.8125 41.1875 20 40C21 39 22 38 24 38C26 38 27 39 28 40C29.3438 41.3437 30 44 30 44" stroke="black" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/></svg>
44 changes: 44 additions & 0 deletions src/intention-tower-knowledge-graph/layout/IntentionTower.tid
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
title: $:/plugins/linonetwo/intention-tower-knowledge-graph/layout/IntentionTower

\import [[$:/plugins/linonetwo/intention-tower-knowledge-graph/filters/leaf-task]] [[$:/plugins/linonetwo/intention-tower-knowledge-graph/EditTemplate/title]] [[$:/plugins/linonetwo/intention-tower-knowledge-graph/Components/Buttons]]

\define project-list-item()
\whitespace trim
<div class="itkg-project-list-item">
<$link to=<<currentTiddler>> tooltip=<<currentTiddler>>>
<<currentTiddler>>
</$link>
</div>
\end

\define project-list()
\whitespace trim
<div class="itkg-project-list">
<$list
filter="[{$:/plugins/linonetwo/intention-tower-knowledge-graph/Config/project-tag}] +[tagging[]filter<filter-is-new-task>] :and[filter<has-length>unique[]!sortsub:integer<compareByPriority>]"
>
<<project-list-item>>
</$list>
</div>
\end


<$scrollable fallthrough="none" class="itkg-IntentionTower-top-container tc-popup-keep tc-menubar-dropdown-sidebar">

<div class="itkg-create-task">

<<simple-title-edit "$:/state/ITKG/PageLayout/create-tiddler-title" >>

</div>

<div class="itkg-buttons">
<<create-task-without-parent>>
<<create-project-without-parent>>
<<create-intention-without-parent>>
</div>

<<project-list>>

</$scrollable>

{{$:/plugins/linonetwo/intention-tower-knowledge-graph/ViewTemplate/ProjectsOverview}}
19 changes: 19 additions & 0 deletions src/intention-tower-knowledge-graph/layout/layout.tid
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
title: $:/plugins/linonetwo/intention-tower-knowledge-graph/layout/layout
name: <<lingo ShortName $:/plugins/linonetwo/intention-tower-knowledge-graph/language/>>
icon: $:/plugins/linonetwo/intention-tower-knowledge-graph/icons/tower
description: <<lingo Description $:/plugins/linonetwo/intention-tower-knowledge-graph/language/>>
tags: $:/tags/Layout

\whitespace trim
\import [subfilter{$:/core/config/GlobalImportFilter}]
\define containerClasses()
tc-page-container tc-language-$(languageTitle)$ intention-tower-knowledge-graph-container
\end

<$navigator story="$:/StoryList" history="$:/HistoryList" openLinkFromInsideRiver={{$:/config/Navigation/openLinkFromInsideRiver}} openLinkFromOutsideRiver={{$:/config/Navigation/openLinkFromOutsideRiver}} relinkOnRename={{$:/config/RelinkOnRename}}>
<div class=<<containerClasses>>>

{{$:/plugins/linonetwo/intention-tower-knowledge-graph/layout/IntentionTower}}

</div>
</$navigator>
Original file line number Diff line number Diff line change
@@ -1,30 +1,31 @@
/* can't use css variable in tid file, because it will become -— , maybe triggers --- syntax?
Have to move them into a css file like this */
div.itkg-sidebar-container {
div.intention-tower-knowledge-graph-container {
height: 100%;
padding: 1em;
}

.itkg-sidebar-project-list {
.itkg-project-list {
display: flex;
flex-direction: row;
flex-wrap: wrap;
}
.itkg-sidebar-project-list-item {
.itkg-project-list-item {
padding: 5px 0;
margin: 5px;
word-wrap: break-word;
word-break: break-all;
}

.itkg-sidebar-buttons {
.itkg-buttons {
padding: 10px 0;
display: flex;
flex-direction: row;
justify-content: space-between;
}
.itkg-sidebar-buttons button {
.itkg-buttons button {
padding: 15px 20px;
}
.itkg-sidebar-create-task .tc-edit-texteditor {
.itkg-create-task .tc-edit-texteditor {
width: 100%;
}
3 changes: 3 additions & 0 deletions src/intention-tower-knowledge-graph/layout/style.css.meta
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
title: $:/themes/linonetwo/intention-tower-knowledge-graph/layout/style.css
tags: $:/tags/Stylesheet
type: text/css
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
title: $:/themes/linonetwo/intention-tower-knowledge-graph/layout/style.css.variable
tags: $:/tags/Stylesheet

div.itkg-IntentionTower-top-container {
border-bottom: 1px solid <<colour table-border>>;
}

0 comments on commit 3ae5703

Please sign in to comment.