Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
git-svn-id: http://svn.foswiki.org/trunk/FoswikiApplicationsContrib@2836 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
- Loading branch information
SvenDowideit
authored and
SvenDowideit
committed
Mar 3, 2009
1 parent
b187f92
commit 1def352
Showing
3 changed files
with
232 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,230 @@ | ||
%META:TOPICINFO{author="BaseUserMapping_333" date="1234588217" format="1.1" version="1.2"}% | ||
---++ %TOPIC% Usage | ||
To Add the calendar application to any topic, you can use the following TML: | ||
|
||
* =%<nop>INCLUDE{"%SYSTEMWEB%.%TOPIC%"}%= | ||
|
||
items can be filtered using the %SYSTEMWEB%.QuerySearch syntax, change the INCLUDE to | ||
|
||
* %<nop>INCLUDE{ | ||
"%SYSTEMWEB%.%TOPIC%" | ||
FILTER="fields[name='Date'].value != ''" | ||
DATEFIELD="Date" | ||
SUMMARYFIELD="Summary" | ||
WEB="FosikiApplicationData" | ||
TOPICS="TodoApplication*" | ||
CALENDAROPTIONS="" | ||
}% | ||
* (Show anything containing a =Date= Form Field) | ||
|
||
---+++ urlparams | ||
|
||
---+++ Dependancies: | ||
%IF{"context CalendarPluginEnabled" | ||
then="this Application uses the %SYSTEMWEB%.CalendarPlugin." | ||
else="__NOTE__ this Application requires the Foswiki:Extensions.CalendarPlugin." | ||
}% | ||
|
||
---++ TODOs | ||
1 make a small, medium and large widget | ||
* small uses summary as a tooltip | ||
* large == 100% width? | ||
|
||
---++ Application defaults | ||
%STARTINCLUDE% %INCLUDE{"%SYSTEMWEB%.%TOPIC%" | ||
section="calendar" | ||
FILTER="fields[name='Date'].value != ''" | ||
NFILTER="1" | ||
DATEFIELD="Date" | ||
SUMMARYFIELD="Message" | ||
DATEWEB="FoswikiApplicationData" | ||
TOPICS="TodoApplication*" | ||
CALENDAROPTIONS="showweekdayheaders=\"1\" cellclass=\"day $wday $day $month $year\"" | ||
}% %STOPINCLUDE% | ||
|
||
---+++ Application definition | ||
<verbatim> | ||
%STARTSECTION{calendar}% | ||
<div class="foswikiRight"> | ||
PAGER FROM NewsApplication | ||
</div> | ||
<style> | ||
.calendar { | ||
width: 64em; | ||
} | ||
.calendar td { | ||
background-color: transparent | ||
} | ||
.calendar td td, | ||
.calendar td th { | ||
background-color: transparent; | ||
float: left; | ||
padding:2px; | ||
margin: 2px; | ||
width: 8em; | ||
} | ||
.calendar .calendarHeader { | ||
width: auto; | ||
} | ||
.calendar .day { | ||
background:transparent url(http://www.csskarma.com/lab/calendar/styled/images/day-bg.png) no-repeat scroll bottom right; | ||
text-align: left; | ||
vertical-align:top; | ||
height: 8em; | ||
overflow: hidden; | ||
} | ||
</style> | ||
%CALENDAR{%CALENDAROPTIONS%}% | ||
|
||
<!-- | ||
%SEARCH{ | ||
web="%DATEWEB%" | ||
topic="%TOPICS%" | ||
"%FILTER%" | ||
type="query" | ||
nonoise="on" | ||
order="formfield(%DATEFIELD%)" | ||
format=" * $formfield(%DATEFIELD%) - $formfield(%SUMMARYFIELD%)" | ||
}% | ||
--> | ||
%ENDSECTION{"calendar"}% | ||
</verbatim> | ||
|
||
|
||
--- | ||
---+++ view item format | ||
<verbatim> | ||
%STARTSECTION{"view_item"}%|\ | ||
%FORMFIELD{"State" topic="%ITEM%"}% |%FORMFIELD{"Message" topic="%ITEM%"}% | \ | ||
%FORMFIELD{"Date" topic="%ITEM%"}% | \ | ||
[[%SCRIPTURL{view}%/%BASEWEB%/%BASETOPIC%?item=%ITEM%;state=%URLPARAM{"state" default="*"}%][%ICON{uweb-bo}%]] |%ENDSECTION{"view_item"}% | ||
</verbatim> | ||
|
||
---+++ edit item format | ||
<verbatim> | ||
%STARTSECTION{"edit_item"}%| %STARTFORM{ | ||
name="%TOPIC%%BASETOPIC%%CATEGORY%" | ||
action="save" | ||
topic="%IF{"defined 'ITEM'" then="%ITEM%" else="FoswikiApplicationData.%TOPIC%AUTOINC0000"}%" | ||
method="POST" | ||
redirectto="%BASEWEB%.%BASETOPIC%" | ||
sep=" " | ||
showerrors="off" | ||
}% %FORMELEMENT{ | ||
name="State" | ||
format="<span class='formValue'> $e $m $h </span>%BR%" | ||
default="%FORMFIELD{"State" topic="%ITEM%" alttext="new"}%" | ||
type="select" | ||
options="new, inprogress, waiting, done" | ||
title="State" | ||
size="1" | ||
}% | %FORMELEMENT{ | ||
name="Message" | ||
mandatory="on" | ||
format="<span class='formValue'> $e $m $h </span>%BR%" | ||
default="%FORMFIELD{"Message" topic="%ITEM%" alttext=""}%" | ||
type="text" | ||
title="Message" | ||
size="70" | ||
}% %FORMERROR{"%TOPIC%%BASETOPIC%%CATEGORY%"}% | %FORMELEMENT{ | ||
name="Date" | ||
mandatory="on" | ||
format="<span class='formValue'> $e $m $h </span>" | ||
default="%FORMFIELD{"Date" topic="%ITEM%" alttext="%DISPLAYTIME{"$day $month $year"}%"}%" | ||
type="date" | ||
dateformat="%e %b %Y" | ||
title="Date" | ||
size="8" | ||
}% \ | ||
%FORMELEMENT{type="hidden" name="Show" default="%FORMFIELD{"Show" topic="%ITEM%" alttext="show"}%"}% \ | ||
%FORMELEMENT{type="hidden" name="Category" default="%FORMFIELD{"Category" topic="%ITEM%" alttext="%CATEGORY%"}%"}% \ | ||
%FORMELEMENT{type="hidden" name="formtemplate" default="%WEB%.%TOPIC%"}% \ | ||
%FORMELEMENT{type="hidden" name="topicparent" default="%BASEWEB%.%BASETOPIC%"}% \ | ||
%FORMELEMENT{type="hidden" name="%IF{"defined 'ITEM'" then="item" else="nothingtoseehere"}%" default="%ITEM%"}% \ | ||
| %FORMELEMENT{ | ||
type="submit" | ||
buttonlabel="Submit" | ||
}% %IF{"defined 'ITEM'" then="<a class='foswikiButton foswikiCancelButton' href='%SCRIPTURL{view}%/%BASEWEB%/%BASETOPIC%'>Cancel</a>" else=""}% %ENDFORM% |%ENDSECTION{"edit_item"}% | ||
</verbatim> | ||
|
||
--- | ||
---+++ widget-todo | ||
Side bar widget for <nop>WidgetsSkin | ||
* =EDIT="WEB.EditTopic"= - set to the topic that the users to to manipulate these news Items, defaults to the System web's ToDoApplication (which will lose STOREIN and CATEGORY defaults) | ||
* =LIMIT="2"= to show that number of the latest news. | ||
<verbatim> | ||
%STARTSECTION{"widget-todo"}%<div class="widget-archives widget todo"> | ||
%IF{" | ||
(NOT context authenticated) OR | ||
(NOT '%IF{"defined STOREIN" then="%STOREIN%" else="FoswikiApplicationData"}%.NoTopicWithThisName' allows 'CHANGE') OR | ||
((istopic '%USERSWEB%.%TOPIC%Group') AND (NOT '%WIKINAME%' ingroup '%TOPIC%Group')) | ||
" | ||
then="" | ||
else="<div class='todoApplicationEditLink foswikiRight'>[[%IF{"defined EDIT" then="%EDIT%" else="%WEB%.%TOPIC%"}%][manage]]</div>" | ||
}% <h2 class="widget-header">Todo's</h2> | ||
<div class="widget-content"> | ||
<style> | ||
.widget-todo-item .formInputField { | ||
width: 89%; | ||
} | ||
</style> | ||
%SEARCH{ | ||
web="%IF{"defined STOREIN" then="%STOREIN%" else="FoswikiApplicationData"}%" | ||
topic="%TOPIC%*" | ||
"form.name~'%WEB%.%TOPIC%' AND | ||
fields[name='Category'].value ~ '%URLPARAM{"category" default="%CATEGORY%"}%' AND | ||
fields[name='State'].value ~ '%URLPARAM{"state" default="*"}%' | ||
" | ||
type="query" | ||
nonoise="on" | ||
order="formfield(Date)" | ||
limit="%IF{"defined LIMIT" then="%LIMIT%" else="2"}%" | ||
VIEWformat="<div class='widget-todo-item'>$formfield(Message) ... <span class='readMore'>[[$web.$topic][edit]]</span></div>" | ||
format="<div class='widget-todo-item' >$percntINCLUDE{$quot%WEB%.%TOPIC%$quot section=$quotwidget_add_item$quot ITEM=$quot$web.$topic$quot}$percnt</div>" | ||
}% | ||
%INCLUDE{ | ||
"%WEB%.%TOPIC%" | ||
section="%IF{"defined 'item'" then="nothing" else="widget_add_item"}%" | ||
warn="off" | ||
}% | ||
</div> | ||
</div>%ENDSECTION{"widget-todo"}% | ||
</verbatim> | ||
|
||
---+++ widget_add_item format | ||
<verbatim> | ||
%STARTSECTION{"widget_add_item"}% %STARTFORM{ | ||
name="%TOPIC%%BASETOPIC%%CATEGORY%%ITEM%" | ||
action="save" | ||
topic="%IF{"defined 'ITEM'" then="%ITEM%" else="FoswikiApplicationData.%TOPIC%AUTOINC0000"}%" | ||
method="POST" | ||
redirectto="%BASEWEB%.%BASETOPIC%" | ||
sep=" " | ||
showerrors="off" | ||
}% %FORMELEMENT{ | ||
name="Message" | ||
mandatory="on" | ||
format="<span class='formValue %FORMFIELD{"State" topic="%ITEM%" alttext="new"}%State'>$e</span>" | ||
default="%FORMFIELD{"Message" topic="%ITEM%" alttext=""}%" | ||
type="text" | ||
title="Message" | ||
size="30" | ||
}% %FORMELEMENT{type="hidden" name="State" default="%FORMFIELD{"State" topic="%ITEM%" alttext="new"}%" | ||
}% %FORMELEMENT{type="hidden" name="Date" default="%FORMFIELD{"Date" topic="%ITEM%" alttext="%DISPLAYTIME{"$day $month $year"}%"}%" | ||
}% %FORMELEMENT{type="hidden" name="Category" default="%FORMFIELD{"Category" topic="%ITEM%" alttext="%CATEGORY%"}%" | ||
}% %FORMELEMENT{type="hidden" name="formtemplate" default="%WEB%.%TOPIC%" | ||
}% %FORMELEMENT{type="hidden" name="topicparent" default="%BASEWEB%.%BASETOPIC%" | ||
}% %FORMELEMENT{type="hidden" name="%IF{"defined 'ITEM'" then="item" else="nothingtoseehere"}%" default="%ITEM%" | ||
}% %ENDFORM% %ENDSECTION{"widget_add_item"}% | ||
</verbatim> | ||
--- | ||
---+++ DataForm definition | ||
| *Name* | *Type* | *Size* | *Values* | *Tooltip message* | *Attributes* | | ||
| Date | date | 16 | | %DATE% | m | | ||
| Message | text | 64 | | | m | | ||
| State | select | 1 | new, inprogress, waiting, done | | m | | ||
| Category | text | 64 | | || | ||
|
||
|
||
---+++ Defaults for this topic only | ||
* Set CATEGORY=* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters