From 7cb54f32c6ee2d98f3f13ddda39f92281d419afd Mon Sep 17 00:00:00 2001 From: Jermolene Date: Wed, 7 Mar 2018 15:52:58 +0000 Subject: [PATCH] Add draggable task management example --- core/wiki/macros/list.tid | 4 ++-- .../Tasks/TaskManagementExample.tid | 4 +++- .../Tasks/TaskManagementExampleDraggable.tid | 23 +++++++++++++++++++ ...TaskManagementExampleDraggableTemplate.tid | 7 ++++++ .../macros/list-tagged-draggable Macro.tid | 2 ++ 5 files changed, 37 insertions(+), 3 deletions(-) create mode 100644 editions/tw5.com/tiddlers/demonstrations/Tasks/TaskManagementExampleDraggable.tid create mode 100644 editions/tw5.com/tiddlers/demonstrations/Tasks/TaskManagementExampleDraggableTemplate.tid diff --git a/core/wiki/macros/list.tid b/core/wiki/macros/list.tid index f249f1e6a..b8797e2de 100644 --- a/core/wiki/macros/list.tid +++ b/core/wiki/macros/list.tid @@ -67,9 +67,9 @@ tags: $:/tags/Macro \end -\define list-tagged-draggable(tag,emptyMessage,itemTemplate,elementTag:"div") +\define list-tagged-draggable(tag,subFilter,emptyMessage,itemTemplate,elementTag:"div") <$set name="tag" value="""$tag$"""> -<$list filter="[tagging[]]" emptyMessage=<<__emptyMessage__>>> +<$list filter="[tagging[]$subFilter$]" emptyMessage=<<__emptyMessage__>>> <$elementTag$ class="tc-menu-list-item"> <$droppable actions=<>> <$elementTag$ class="tc-droppable-placeholder"> diff --git a/editions/tw5.com/tiddlers/demonstrations/Tasks/TaskManagementExample.tid b/editions/tw5.com/tiddlers/demonstrations/Tasks/TaskManagementExample.tid index 3197a0daf..494b28ac4 100644 --- a/editions/tw5.com/tiddlers/demonstrations/Tasks/TaskManagementExample.tid +++ b/editions/tw5.com/tiddlers/demonstrations/Tasks/TaskManagementExample.tid @@ -1,11 +1,13 @@ created: 20130825213300000 -modified: 20140919161411400 +modified: 20180307153530187 tags: Learning title: TaskManagementExample type: text/vnd.tiddlywiki TiddlyWiki5 can be used as a simple task management system without further customisation. The idea is that tasks be tagged `task`, with those that are completed also tagged `done`. In this way it is straightforward to generate task lists. +<<.tip """There is [[an enhanced version of this demo|TaskManagementExample (Draggable)]] that adds the ability to drag and drop the tasks to re-order them.""">> + ! Outstanding tasks <$list filter="[!has[draft.of]tag[task]!tag[done]sort[created]]"> diff --git a/editions/tw5.com/tiddlers/demonstrations/Tasks/TaskManagementExampleDraggable.tid b/editions/tw5.com/tiddlers/demonstrations/Tasks/TaskManagementExampleDraggable.tid new file mode 100644 index 000000000..503b1fcaf --- /dev/null +++ b/editions/tw5.com/tiddlers/demonstrations/Tasks/TaskManagementExampleDraggable.tid @@ -0,0 +1,23 @@ +created: 20180307153530187 +modified: 20180307153530187 +tags: Learning +title: TaskManagementExample (Draggable) +type: text/vnd.tiddlywiki + +This is a version of the TaskManagementDemo enhanced with the ability to drag and drop the task list to re-order them. + +! Outstanding tasks + +//Drag the tasks to re-order them// + +<> + +! Completed tasks + +//(Listed in reverse order of completion)// + +<$list filter="[!has[draft.of]tag[task]tag[done]sort[created]]"> +
+<$checkbox tag="done"> ~~<$link to={{!!title}}><$view field="title"/>~~ +
+ diff --git a/editions/tw5.com/tiddlers/demonstrations/Tasks/TaskManagementExampleDraggableTemplate.tid b/editions/tw5.com/tiddlers/demonstrations/Tasks/TaskManagementExampleDraggableTemplate.tid new file mode 100644 index 000000000..3ccdd98e0 --- /dev/null +++ b/editions/tw5.com/tiddlers/demonstrations/Tasks/TaskManagementExampleDraggableTemplate.tid @@ -0,0 +1,7 @@ +created: 20180307153530187 +modified: 20180307153530187 +tags: Learning +title: TaskManagementExampleDraggableTemplate +type: text/vnd.tiddlywiki + +<$checkbox tag="done"> <$link to={{!!title}}><$view field="title"/> \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/macros/list-tagged-draggable Macro.tid b/editions/tw5.com/tiddlers/macros/list-tagged-draggable Macro.tid index d62805a6c..b0e4bbbed 100644 --- a/editions/tw5.com/tiddlers/macros/list-tagged-draggable Macro.tid +++ b/editions/tw5.com/tiddlers/macros/list-tagged-draggable Macro.tid @@ -11,6 +11,8 @@ The <<.def list-tagged-draggable>> [[macro|Macros]] renders the tiddlers with a ;tag : The title of the tag +;subFilter +: An optional subfilter to filter out unwanted items (eg `!tag[done]`) ;itemTemplate : Optional title of a tiddler to use as the template for rendering list items ;emptyMessage