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

<p>

<table cellpadding="0" cellspacing="0" border="0">
<tr><td 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" 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>

<p>
<center class="small">Check the box to mark a task as completed.</center>

</td>

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

<td valign="top">
<b>
#if ($query)
Tasks matching '$query':
#else
Outstanding tasks:
#if ($expand == "all")
<a href="index.wm">[trim]</a>
#else
<a href="index.wm?expand=all">[show all]</a>
#end
#end
</b>

<table cellpadding="2" cellspacing="0" border="0" width="100%">
#foreach ($xtask in $xtasks)
#if ($vidx > 0)
<tr><td colspan="4">&nbsp;</td></tr>
#end
<tr bgcolor="$scolor"><td colspan="2" align="left">$xtask.name</td>
<td colspan="2">
#if ($xtask.pruned > 0)
<a href="index.wm?expand=$xtask.name">($xtask.pruned ...)</a>
#else
&nbsp;
#end
</td></tr>

$xcats.clear()
#foreach ($task in $xtask.tasks)

#if ($xcats.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><a href="index.wm?action=claim&task=$task.taskId">
<img src="images/claim.png" border="0" alt="Claim this task"></a></td>
<td $border>$task.summary &nbsp;
<span class="small">[$task.creator]</span>
#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>

<p align="center">
<table width="100%">
<tr><td class="small" valign="top">Click the wrench to claim a task.</td>
<td class="small"><form action="index.wm">
Filter on single word:<br>
<input name="query" size="10">
</form>
</center>

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

</td></tr>

<tr><td colspan="3">&nbsp;</td></tr>

<tr><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>

</td>

<td>&nbsp;</td>

<td valign="top">
<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", "15")
  $form.option("priority", "25", "Next release", "15")
  $form.option("priority", "15", "Soon", "15")
  $form.option("priority", "10", "Before launch", "15")
  $form.option("priority", "5", "Post launch", "15")
  $form.option("priority", "1", "On the list", "15")
</select>
</td></tr>

<tr>
<td colspan="2" align="left" 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")
