#set ($title = $i18n.xlate("index.title"))
#import ("/header.wm")

<p>

<table cellpadding="0" cellspacing="0" border="0">
<tr><td width="50%" valign="top">

<b>Owned tasks:</b>
<table cellpadding="2" cellspacing="0" border="0" width="100%">

#foreach ($otask in $otasks)
#if ($vidx > 0)
<tr><td colspan="4">&nbsp;</td></tr>
#end
<tr><td colspan="4" align="left" style="color: $fcolor" bgcolor="$scolor">$otask.name</td></tr>

$ocats.clear()
#foreach ($task in $otask.tasks)
#if ($ocats.checkCategory($task.complexity))
<tr><td colspan="4" class="small" style="border-bottom: 1px solid"><i>$task.complexity</i></td></tr>
#set ($border = "")
#else
#set ($border = 'style="border-top: 1px solid"')
#end

<tr><td>
#if ($username == $task.owner)
<a href="index.wm?action=complete&task=$task.taskId">
<img src="images/complete.png" border="0" alt="Mark as completed"></a>
#else
&nbsp;
#end
</td>
<td $border>$task.summary
#if (!$string.blank($task.notes))
&nbsp; <a href="detail.wm?task=$task.taskId">[...]</a>
#end
</td>
<td valign="top" $border>$task.getDisplayCategory()</td>
<td valign="top" $border><a href="edit.wm?task=$task.taskId">
<img src="images/edit.png" border="0" alt="Edit this task"></a></td></tr>
#end
#end
</table>

</td>
<td width="15">&nbsp;</td>
<td valign="top">

<b>Recent completed tasks:</b>
<table cellpadding="2" cellspacing="0" border="0" width="100%">
#foreach ($task in $dtasks)
#if ($vidx%2 == 0)
#set ($rowcolor = "#EEEEEE")
#else
#set ($rowcolor = "#FFFFFF")
#end
<tr bgcolor="$rowcolor">
<td valign="top"><img src="images/completed.png"></td>
<td valign="top" align="center">$task.completion<br>[$task.completor]</td>
<td>$task.summary
#if (!$string.blank($task.notes))
&nbsp; <a href="detail.wm?task=$task.taskId">[...]</a>
#end
</td>
<td valign="top">$task.getDisplayCategory()</td>
<td valign="top"><a href="edit.wm?task=$task.taskId">
<img src="images/edit.png" border="0" alt="Edit this task"></a></td></tr>
#end
</table>

<p><b>Browse:&nbsp;&nbsp;<a href="bycategory.wm">by category</a>
&nbsp;&nbsp;<a href="tasks.wm">by priority</a></b>

<p><b>Create new task:</b>
<form action="index.wm">
$form.fixedHidden("action", "create")

<table cellpadding="2" cellspacing="0" border="0">
<tr><td colspan="3" bgcolor="$scolor">&nbsp;<br></td></tr>

<tr><td colspan="3">Summary:<br>
<textarea name="summary" rows="5" cols="50">
</textarea>
</td></tr>

<tr><td>Category:<br>
$form.text("category", "size='10'", "")
</td>

<td>Complexity:<br>
<select name="complexity">
  $form.option("complexity", "Simple hack", "Simple hack", "Simple hack")
  $form.option("complexity", "Minor feature", "Minor feature", "Simple hack")
  $form.option("complexity", "Major feature", "Major feature", "Simple hack")
  $form.option("complexity", "Subsystem", "Subsystem", "Simple hack")
  $form.option("complexity", "Major refactor", "Major refactor", "Simple hack")
</select>
</td>

<td>Priority:<br>
<select name="priority">
  $form.option("priority", "50", "Urgent", "5")
  $form.option("priority", "25", "Next up", "5")
  $form.option("priority", "15", "Near term", "5")
  $form.option("priority", "10", "Medium term", "5")
  $form.option("priority", "5", "Long term", "5")
  $form.option("priority", "1", "On the list", "5")
</select>
</td></tr>

<tr>
<td colspan="2" align="left" style="color: $fcolor" bgcolor="$scolor">
$form.checkbox("claim", false) Claim created task&nbsp;&nbsp;
$form.checkbox("edit", false) Edit created task</td>
<td align="right" bgcolor="$scolor">
$form.submit("submit", "Create")</td></tr>
</table>
</form>

</td></tr>
</table>

#import ("/footer.wm")
