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

#if ($task)

<p>
<table cellpadding="0" cellspacing="0" border="0">
<tr><td>
<table cellpadding="2" cellspacing="0" border="0">

#if ($task.completor)
<form action="edit.wm">
$form.fixedHidden("action", "reopen")
<input type="hidden" name="task" value="$task.taskId">
<tr><td colspan="3" valign="center">
Task is completed.
</td></tr>
<tr><td colspan="3" bgcolor="$scolor" align="right">
$form.submit("submit", "Reopen")</td></tr>
<tr><td colspan="3">&nbsp;</td></tr>
</form>
#end

<form action="edit.wm">
$form.fixedHidden("action", "update")
<input type="hidden" name="task" value="$task.taskId">

<tr><td rowspan="3" valign="top">Summary:<br>
<textarea name="summary" rows="8" cols="50">
$task.summary
</textarea>
</td>

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

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

<tr><td valign="top">Creator:<br>
$form.text("creator", "size='10'", $task.creator)
</td>

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

<tr><td>Owner:<br>
#if ($task.owner)
$form.text("owner", "size='10'", $task.owner)
#else
$form.text("owner", "size='10'", "")
#end
</td>
<td>&nbsp;</td></tr>

<tr><td colspan="4" align="right" bgcolor="$scolor">
$form.submit("submit", "Update")</td></tr>
</form>
</table>

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

<table cellpadding="2" cellspacing="0" border="0">
<tr><td>Other actions:</td></tr>
<tr><td align="right" bgcolor="$scolor">

<form action="edit.wm">
$form.fixedHidden("action", "delete")
<input type="hidden" name="task" value="$task.taskId">
$form.submit("submit", "Delete")
</form>

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

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

<p>
<table cellpadding="2" cellspacing="0" border="0">

<form action="edit.wm">
$form.fixedHidden("action", "addnote")
<input type="hidden" name="task" value="$task.taskId">

<tr><td>Add a note:<br>
<code>
<textarea name="note" rows="5" cols="80" wrap="hard">
</textarea>
</code>
</td></tr>

<tr><td align="right" bgcolor="$scolor">
$form.submit("submit", "Add")</td></tr>
</form>

<tr><td>&nbsp;</td></tr>

<form action="edit.wm">
$form.fixedHidden("action", "editnotes")
<input type="hidden" name="task" value="$task.taskId">

<tr><td>Notes:<br>
<code>
<textarea name="notes" rows="10" cols="80" wrap="hard">
$task.notes
</textarea>
</code>
</td></tr>

<tr><td align="right" bgcolor="$scolor">
$form.submit("submit", "Update")</td></tr>
</form>

</table>

#end

#import ("/footer.wm")
