Difference between revisions of "Template:Due"

From 2value wiki 2
Jump to navigation Jump to search
Line 1: Line 1:
 +
<!--
 +
Warning: "Due" works on week-numbers, NOT on dates!!
 +
"Due" is a template that enables us to attach a due date to an action (edit mode) and then shows the consequences of that due date in the text (view)
 +
 +
FORMAT: {{Due|<weeknumber>|<milestone-year>|milestone-week>}}
 +
Valid Calls:
 +
{{Due|10}}
 +
{{Due|10|2011|23}}
 +
 +
DO NOT call as follows:
 +
{{Due | 10}}
 +
{{Due|10|2011}}; this is a valid but error prone call, it suggests an certain year and exactly the same week as the default week
 +
{{Due|10||20}}; this is a valid but error prone call, it suggests an certain week and exactly the same year as default, which is hidden in the template.
 +
 +
 +
The explanation of the sub templates - calls
 +
Urgency: calculates the urgency of an action (current date versus Focalweek-Focalyear) and colorizes characters. We use symbols suchs as &hearts and &diams.
 +
Weekdiff: in this call the default date is set to year and weeknumber pair of our main milestone. If there is only 1 argument to the template call of Due, then Weekdiff will get this defaults passed.
 +
FocalWeek: calculates back the weeknumber when this action will be due (given the milestone).
 +
FocalYear: calculates back the year when this action will be due (given the milestone).
 +
 +
The other fields should be self-explanatory.
 +
 +
BE CAREFULL NOT TO INTRODUCE unintentional SPACES AND CR'S in the following statement
 +
-->
 
<span style="color:{{Urgency | {{WeekDiff |{{{2|2010}}}|{{{3|16}}} }} }}; background:#ccc">
 
<span style="color:{{Urgency | {{WeekDiff |{{{2|2010}}}|{{{3|16}}} }} }}; background:#ccc">
 
{{{1}}} wkB4</span><sup>[[Associate:Due|{{WeekDiff | {{ FocalYear |{{{1}}}|{{{2|2010}}}|{{{3|16}}} |3 }}| {{ FocalWeek |{{{1}}}|{{{3|16}}} }} }}_buf]]</sup><span style="color:{{Urgency | {{WeekDiff | {{ FocalYear |{{{1}}}|{{{2|2010}}}|{{{3|6}}} }}| {{ FocalWeek |{{{1}}}|{{{3|16}}} }} }} |4 }}; background:#ccc">&diams;</span>
 
{{{1}}} wkB4</span><sup>[[Associate:Due|{{WeekDiff | {{ FocalYear |{{{1}}}|{{{2|2010}}}|{{{3|16}}} |3 }}| {{ FocalWeek |{{{1}}}|{{{3|16}}} }} }}_buf]]</sup><span style="color:{{Urgency | {{WeekDiff | {{ FocalYear |{{{1}}}|{{{2|2010}}}|{{{3|6}}} }}| {{ FocalWeek |{{{1}}}|{{{3|16}}} }} }} |4 }}; background:#ccc">&diams;</span>

Revision as of 12:40, 11 January 2010