~hokiegeek/tw5-checklist

849832820648a0a032dffbc94c33c15028a5fed2 — HokieGeek 1 year, 11 months ago ba38a3e
Refactored to be more generic
21 files changed, 164 insertions(+), 46 deletions(-)

A Checklist.tid
A Checklist_View.tid
A ItemTemplate.tid
D ShoppingList.tid
A ShoppingList/ShoppingList.tid
R ShoppingList_ItemTemplate.tid => ShoppingList/ShoppingList_ItemTemplate.tid
R ShoppingList_View.tid => ShoppingList/ShoppingList_View.tid
R ShoppingList_buttons_NewItem.tid => ShoppingList/ShoppingList_buttons_NewItem.tid
R ShoppingList_config_Item_tag.tid => ShoppingList/ShoppingList_config_Item_tag.tid
A ShoppingList/ShoppingList_config_List_EmptyMessage.tid
R ShoppingList_config_List_tag.tid => ShoppingList/ShoppingList_config_List_tag.tid
R ShoppingList_config_buttons_NewItem_caption.tid => ShoppingList/ShoppingList_config_buttons_NewItem_caption.tid
R ShoppingList_config_buttons_NewItem_hint.tid => ShoppingList/ShoppingList_config_buttons_NewItem_hint.tid
A config_Item_tag.tid
A config_List_EmptyMessage.tid
A config_List_tag.tid
A macro_NewItem.tid
M plugin.info
M readme.tid
M styles.tid
A view_NewItem.tid
A Checklist.tid => Checklist.tid +31 -0
@@ 0,0 1,31 @@
modified: 20181029024422000
creator: hokiegeek
created: 20181028230933000
tags: $:/tags/Macro
title: $:/plugins/hokiegeek/checklist/Checklist
type: text/vnd.tiddlywiki

\whitespace trim
\define create-list(list-tag, item-tag, item-template, empty-message)
<$set name="listTags" filter="[list[!!tags]]-[[$list-tag$]]">
<$macrocall
    $name="list-tagged-draggable"
    subFilter="enlist<listTags>tagging[]tag[$item-tag$]!has[draft.of]!tag[done]"
    itemTemplate="$item-template$"
    emptyMessage="$empty-message$"/>

<$list filter="[enlist<listTags>tagging[]!has[draft.of]tag[$item-tag$]tag[done]sort[created]]">
<div>
<$checkbox tag="done"> ~~<$link to={{!!title}} class="item-done"><$view field="title"/></$link>~~</$checkbox>
</div>
</$list>
</$set>
\end
\define checklist()
<$macrocall $name="create-list"
    list-tag={{$:/plugins/hokiegeek/checklist/config/List/tag}}
    item-tag={{$:/plugins/hokiegeek/checklist/config/Item/tag}}
    item-template="$:/plugins/hokiegeek/checklist/ItemTemplate"
    empty-message={{$:/plugins/hokiegeek/checklist/config/List/EmptyMessage}}
    />
\end

A Checklist_View.tid => Checklist_View.tid +10 -0
@@ 0,0 1,10 @@
creator: hokiegeek
created: 20181023003033203
modified: 20181023193856558
tags: $:/tags/ViewTemplate
title: $:/plugins/hokiegeek/checklist/View
type: text/vnd.tiddlywiki

<$list filter="[all[current]is[tiddler]!is[system]tag{$:/plugins/hokiegeek/checklist/config/List/tag}]">
<<checklist>>
</$list>

A ItemTemplate.tid => ItemTemplate.tid +7 -0
@@ 0,0 1,7 @@
modified: 20181029002110000
creator: hokiegeek
created: 20181022112932067
title: $:/plugins/hokiegeek/checklist/ItemTemplate
type: text/vnd.tiddlywiki

<$checkbox tag="done"> <$link to={{!!title}}><$view field="title"/></$link></$checkbox>

D ShoppingList.tid => ShoppingList.tid +0 -25
@@ 1,25 0,0 @@
created: 20181022112952159
creator: hokiegeek
modified: 20181024095522082
tag: shopping-list
tags: $:/tags/Macro
title: $:/plugins/hokiegeek/checklist/ShoppingList
type: text/vnd.tiddlywiki

\define shopping-list()
<$set name="list-tags" filter="[list[!!tags]]-[{$:/plugins/hokiegeek/checklist/ShoppingList/config/List/tag}]">
<$set name="item-tag" value="shopping-list-item">
</$set>
<$macrocall
    $name="list-tagged-draggable"
    subFilter="enlist<list-tags>tagging[]tag[shopping-list-item]!has[draft.of]!tag[done]"
    itemTemplate="$:/plugins/hokiegeek/checklist/ShoppingList/ItemTemplate"
    emptyMessage="You bought all the things!"/>

<$list filter="[enlist<list-tags>tagging[]!has[draft.of]tag[shopping-list-item]tag[done]sort[created]]">
<div>
<$checkbox tag="done"> ~~<$link to={{!!title}} class="item-done"><$view field="title"/></$link>~~</$checkbox>
</div>
</$list>
</$set>
\end

A ShoppingList/ShoppingList.tid => ShoppingList/ShoppingList.tid +16 -0
@@ 0,0 1,16 @@
modified: 20181029001850000
created: 20181022112952159
creator: hokiegeek
tags: $:/tags/Macro
title: $:/plugins/hokiegeek/checklist/ShoppingList
type: text/vnd.tiddlywiki

\whitespace trim
\define shopping-list()
<$macrocall $name="create-list"
    list-tag={{$:/plugins/hokiegeek/checklist/ShoppingList/config/List/tag}}
    item-tag={{$:/plugins/hokiegeek/checklist/ShoppingList/config/Item/tag}}
    item-template="$:/plugins/hokiegeek/checklist/ShoppingList/ItemTemplate"
    empty-message={{$:/plugins/hokiegeek/checklist/ShoppingList/config/List/EmptyMessage}}
    />
\end

R ShoppingList_ItemTemplate.tid => ShoppingList/ShoppingList_ItemTemplate.tid +0 -0

R ShoppingList_View.tid => ShoppingList/ShoppingList_View.tid +0 -0

R ShoppingList_buttons_NewItem.tid => ShoppingList/ShoppingList_buttons_NewItem.tid +6 -15
@@ 6,26 6,17 @@ tags: $:/tags/ViewToolbar
title: $:/plugins/hokiegeek/checklist/ShoppingList/buttons/NewItem
type: text/vnd.tiddlywiki

\whitespace trim
\define newShoppingListItem()
<$button tooltip={{$:/plugins/hokiegeek/checklist/ShoppingList/config/buttons/NewItem/hint}} aria-label={{$:/plugins/hokiegeek/checklist/ShoppingList/config/buttons/NewItem/caption}} class=<<tv-config-toolbar-class>>>
<$action-sendmessage $message="tm-new-tiddler" title="Item Name" tags="shopping-list-item $(item-tags)$" />
<$action-sendmessage $message="tm-add-tag" $param={{$:/plugins/hokiegeek/checklist/ShoppingList/config/Item/tag}} title="Item Name" />
<$list filter="[<tv-config-toolbar-icons>prefix[yes]]">
{{$:/core/images/new-button}}
</$list>
<$list filter="[<tv-config-toolbar-text>prefix[yes]]">
<span class="tc-btn-text">
<$text text={{$:/plugins/hokiegeek/checklist/ShoppingList/config/buttons/NewItem/caption}}/>
</span>
</$list>
</$button>
<$set name="item-tags" filter="[{$:/plugins/hokiegeek/checklist/ShoppingList/config/Item/tag}][list[!!tags]]-[{$:/plugins/hokiegeek/checklist/ShoppingList/config/List/tag}]">
<$macrocall $name="newListItem"
            parent-list-tags=<<item-tags>>
            item-tag={{$:/plugins/hokiegeek/checklist/ShoppingList/config/Item/tag}}
            />
</$set>
\end

<$set name="list-tag" value={{$:/plugins/hokiegeek/checklist/ShoppingList/config/List/tag}}>
<$list filter="[all[current]is[tiddler]!is[system]tag<list-tag>]">
<$set name="item-tags" filter="[list[!!tags]]-[{$:/plugins/hokiegeek/checklist/ShoppingList/config/List/tag}]">
<<newShoppingListItem>>
</$set>
</$list>
</$set>

R ShoppingList_config_Item_tag.tid => ShoppingList/ShoppingList_config_Item_tag.tid +1 -1
@@ 4,4 4,4 @@ modified: 20181022145953537
title: $:/plugins/hokiegeek/checklist/ShoppingList/config/Item/tag
type: text/vnd.tiddlywiki

shopping-list-item
shopping-list-item
\ No newline at end of file

A ShoppingList/ShoppingList_config_List_EmptyMessage.tid => ShoppingList/ShoppingList_config_List_EmptyMessage.tid +7 -0
@@ 0,0 1,7 @@
modified: 20181029002350000
creator: hokiegeek
created: 20181022112932067
title: $:/plugins/hokiegeek/checklist/ShoppingList/config/List/EmptyMessage
type: text/vnd.tiddlywiki

You bought all the things!

R ShoppingList_config_List_tag.tid => ShoppingList/ShoppingList_config_List_tag.tid +0 -0

R ShoppingList_config_buttons_NewItem_caption.tid => ShoppingList/ShoppingList_config_buttons_NewItem_caption.tid +2 -2
@@ 1,7 1,7 @@
creator: hokiegeek
created: 20181022134532341
modified: 20181022150020889
title: $:/plugins/hokiegeek/checklist/ShoppingList/config/buttons/NewItem/caption
title: $:/plugins/hokiegeek/checklist/config/buttons/NewItem/caption
type: text/vnd.tiddlywiki

new shopping list item here
new list item here

R ShoppingList_config_buttons_NewItem_hint.tid => ShoppingList/ShoppingList_config_buttons_NewItem_hint.tid +2 -2
@@ 1,7 1,7 @@
creator: hokiegeek
created: 20181022134400295
modified: 20181022150013919
title: $:/plugins/hokiegeek/checklist/ShoppingList/config/buttons/NewItem/hint
title: $:/plugins/hokiegeek/checklist/config/buttons/NewItem/hint
type: text/vnd.tiddlywiki

Create a new shopping list item
Create a new list item

A config_Item_tag.tid => config_Item_tag.tid +7 -0
@@ 0,0 1,7 @@
modified: 20181029021704000
creator: hokiegeek
created: 20181022134150506
title: $:/plugins/hokiegeek/checklist/config/Item/tag
type: text/vnd.tiddlywiki

checklist-item
\ No newline at end of file

A config_List_EmptyMessage.tid => config_List_EmptyMessage.tid +7 -0
@@ 0,0 1,7 @@
modified: 20181029024248000
creator: hokiegeek
created: 20181022134150506
title: $:/plugins/hokiegeek/checklist/config/List/EmptyMessage
type: text/vnd.tiddlywiki

No more items

A config_List_tag.tid => config_List_tag.tid +7 -0
@@ 0,0 1,7 @@
modified: 20181029021704000
creator: hokiegeek
created: 20181022134150506
title: $:/plugins/hokiegeek/checklist/config/List/tag
type: text/vnd.tiddlywiki

checklist
\ No newline at end of file

A macro_NewItem.tid => macro_NewItem.tid +33 -0
@@ 0,0 1,33 @@
creator: hokiegeek
modified: 20181029004217000
created: 20181029004217000
tags: $:/tags/Macro
title: $:/plugins/hokiegeek/checklist/NewItem
type: text/vnd.tiddlywiki

\whitespace trim
\define newListItem(parent-list-tags, item-tag)
<$button tooltip={{$:/plugins/hokiegeek/checklist/config/buttons/NewItem/hint}} aria-label={{$:/plugins/hokiegeek/checklist/config/buttons/NewItem/caption}} class=<<tv-config-toolbar-class>>>
<$action-sendmessage $message="tm-new-tiddler" title="Item Name" tags="$parent-list-tags$" />
<$action-sendmessage $message="tm-add-tag" $param="$item-tag$" />
<$list filter="[<tv-config-toolbar-icons>prefix[yes]]">
<span class="new-item-btn">
{{$:/core/images/new-button}}
</span>
</$list>
<$list filter="[<tv-config-toolbar-text>prefix[yes]]">
<span class="tc-btn-text">
<$text text={{$:/plugins/hokiegeek/checklist/config/buttons/NewItem/caption}}/>
</span>
</$list>
</$button>
\end

\define newChecklistItem()
<$set name="item-tags" filter="[{$:/plugins/hokiegeek/checklist/config/Item/tag}][list[!!tags]]-[{$:/plugins/hokiegeek/checklist/config/List/tag}]">
<$macrocall $name="newListItem"
            parent-list-tags=<<item-tags>>
            item-tag={{$:/plugins/hokiegeek/checklist/config/Item/tag}}
            />
</$set>
\end

M plugin.info => plugin.info +1 -1
@@ 2,7 2,7 @@
    "title": "$:/plugins/hokiegeek/checklist",
    "description": "A bit of a template for creating various checklists",
    "author": "hokiegeek",
    "version": "1.0.0",
    "version": "1.1.0",
    "core-version": ">=5.1.17",
    "source": "https://gitlab.com/HokieGeek/tw5-checklist",
    "plugin-type": "plugin",

M readme.tid => readme.tid +4 -0
@@ 3,5 3,9 @@ title: $:/plugins/hokiegeek/checklist/readme
The plugin $:/plugins/hokiegeek/checklist provides:

```
<<checklist>>
```

```
<<shopping-list>>
```

M styles.tid => styles.tid +10 -0
@@ 8,3 8,13 @@ type: text/vnd.tiddlywiki
.item-done {
    color: #9aaee7 !important;
}

.new-item-btn svg {
/*
    fill: <<colour message-foreground>> !important;
*/
}

.complete-item-btn svg {
    fill: #3ed850 !important;
}

A view_NewItem.tid => view_NewItem.tid +13 -0
@@ 0,0 1,13 @@
modified: 20181029004536000
created: 20181029004434000
creator: hokiegeek
list-before: 
tags: $:/tags/ViewToolbar
title: $:/plugins/hokiegeek/checklist/buttons/NewItem
type: text/vnd.tiddlywiki

<$set name="list-tag" value={{$:/plugins/hokiegeek/checklist/config/List/tag}}>
<$list filter="[all[current]is[tiddler]!is[system]tag<list-tag>]">
<<newChecklistItem>>
</$list>
</$set>