[pmwiki-devel] How to make a TODO List?

The Editor editor at fast.st
Wed Jan 31 20:50:35 CST 2007


On 1/31/07, Hans <design5 at softflow.co.uk> wrote:
> i just hope to implement a more generic way of inserting fox form
> elements themselves, which would allow further inserts of many kinds.
>
> But the replacement "FoxEngine" needs to be rewritten for this.
> so no quick solutions here...
> Still pondering....


In the meantime, here's a Calendar snippet I pulled together in basic
ZAP you could use, that works great--using a rather creative approach
to the problem...  ZAP's listing capabilities.

The first part allows you to enter a page name (a date, or anything
actually) and it takes you to that page in the Calendar.

The second part creates a new todo item.  Each is a separate page (I
know, I know), in the same Calendar group, but specially named to make
pagelisting fast.

The third form (partly generated by a pagelist) allows you to
check/uncheck any of the todo items and then immediately redisplays
them as stricken out or not stricken out.  On my home machine, it's
very fast and almost fun.

To use, you just enable zap (no extra modules needed), cut and paste
this snippet below into Calendar.GroupHeader (or Calendar.GroupFooter)
and add the calendar template to Site.LocalTemplates.  You can see it
in action by going to:

http://www.fast.st/zap/pmwiki.php?n=Calendar.2007-01-31 or anyother
page in the group.  You gotta at least take a peek Kathryn.  It's
really pretty neat, just for the fun of it?


*********************
\\

(:zapform name=go:)(:zap nextpage="Calendar.{date}" go:)
(:table width=95%:)
(:cellnr colspan=2 align=right:)[-''Enter Date (YYYY-MM-DD):'' (:input
text date size=10:)&nbsp;(:input submit value="Go":)-]
(:zapend:)

(:cellnr:)
!!{$Name}
(:messages:)

(:cellnr:)
(:zapform name=Calendar:)(:input text ToDo size=50:)&nbsp;(:input
submit value="Add Todo":)(:zap datapage="Calendar.{$Name}-{#t +}"
Calendar:)(:zap savedata="ToDo" Calendar:)(:zapend:)

(:cellnr:)
(:zapform name=Done:)
(:pagelist group=Calendar name={$Name}-* fmt=#Calendar:)
(:zap savedata="donelist" Done:)

(:input submit value="Mark Complete" Done:)
(:zapend:)
(:tableend:)

*********************

!!!fmt=#Calendar

Calendar Template

[@
[[#Calendar]]
(:if ! inlist {=$Name}|donelist|Calendar.{$Name}:)
(:input checkbox donelist[] '{=$Name}':) {=$:ToDo}\\
(:if inlist {=$Name}|donelist|Calendar.{$Name}:)
(:input checkbox donelist[] '{=$Name}' checked:){-{=$:ToDo}-}\\
(:if:)
[[#Calendarend]]
@]



More information about the pmwiki-devel mailing list