Todo Macro

Last modified by Gunter Ohrner on 2021/03/17 22:05

note_editView and edit TODOs right from XWiki pages
TypeXAR
Category
Developed by

Ludovic Dubost

Rating
0 Votes
LicenseGNU Lesser General Public License 2.1

Installable with the Extension Manager

Description

The Todo macro allows to view and edit any Todo right from XWiki pages. It is a very practical and efficient way to manage tasks list.

Usage

You can insert a new Todo in 2 ways:

  • Edit the page in WYSIWYG mode and add a new Todo Macro to the page:
    TodoMacro.png
  • Write the macro code in Wiki mode:
    {{todo status="resolved" priority="high" assignee="ludovic"}}Publish the Todo macro{{/todo}}

Parameters definition

NameOptionalAllowed valuesDefault valuesDescription
Assigneeyesstringnonethe name of the person assigned for the task
Statusyesopen, resolvedopenthis parameter specifies whether the task is open or resolved
Priorityyeslow, normal, highnormalthe priority of the task
ContentNostringnonethe name of the task

Examples

Simple Todo

You can have a simple list of Todos that you can manipulate.

Code:

This is a simple todo demo with three todos that you can manipulate. You can add a todo using the Wysiwyg editor and the "Macro" menu:

{{todo status="resolved" priority="high" assignee="ludovic"}}Finish the demo pages{{/todo}}

{{todo status="open" priority="normal" assignee="ludovic"}}Publish the application on xwiki.org{{/todo}}

{{todo status="open" priority="low" assignee="ludovic"}}Improve the todo application{{/todo}}

Result

simpleTodo.png

On this page you can change the status for any Todo or mark as resolved the ones that you completed.

If you want to change the status you have to click on the little pencil icon to the right of the Todo:

changeStatus.png

Make the necessary modifications:

changeStatus2.png

And then click on "Change status":

changeStatus3.png

In order to mark a Todo as Resolved you just need to click on the green checkmark to the right of the Todo:

resolved.png

After clicking on it the green checkmark will disappear, the status will change from "open" to "resolved" and the Todo name will become strikethrough.

Advanced Todo

You can have a more advanced page of tasks where you can either hide finished todos or list all of them.

Code:

{{velocity}}
#if($request.hide)
[[See all todos>>$doc.fullName]]
#else
[[Hide finished todos>>${doc.fullName}?hide=1]]
#end
{{/velocity}}

This is a more advanced todo demo with a special button to allow to hide finished todos:

{{todo status="resolved" priority="high" assignee="ludovic"}}Finish the demo pages{{/todo}}

{{todo status="open" priority="normal" assignee="ludovic"}}Publish the application on xwiki.org{{/todo}}

{{todo status="open" priority="low" assignee="ludovic"}}Improve the todo application{{/todo}}

Result

See all todos:
AdvancedTodo.png

Hide finished todos:
AdvancedTodo2.png

Listing Todos

There is also a macro that allows you to list all the todos in a space or in the whole Wiki.

  • Edit the page in WYSIWYG mode and add a new Todo List Macro to the page:
    TodoListMacro.png
  • Write the macro code in Wiki mode:
    This demo shows how to list todos in a specific space:

    {{todolist space="Todo" /}}

Result

listingTodos.png

Prerequisites & Installation Instructions

We recommend using the Extension Manager to install this extension (Make sure that the text "Installable with the Extension Manager" is displayed at the top right location on this page to know if this extension can be installed with the Extension Manager). Note that installing Extensions when being offline is currently not supported and you'd need to use some complex manual method.

You can also use the following manual method, which is useful if this extension cannot be installed with the Extension Manager or if you're using an old version of XWiki that doesn't have the Extension Manager:

  1. Log in the wiki with a user having Administration rights
  2. Go to the Administration page and select the Import category
  3. Follow the on-screen instructions to upload the downloaded XAR
  4. Click on the uploaded XAR and follow the instructions
  5. You'll also need to install all dependent Extensions that are not already installed in your wiki

Visit XWiki.TodoMacroInstall after importing the XAR file. The TODO samples are on the Todo.WebHome page.

If you are running this macro on an XWIki FARM (XEM) you need to install the XAR and visit the XWiki.TodoMacroInstall on both the Main Wiki and on each Wiki you want to use the TODO macro in.

Release Notes

v1.0

First version of the TODO macro

Tags: productivity
    

Get Connected