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

<p align="center">
<table><tr>
<td><a href="index.wm">Task summary</a></td>
<td width="15">&nbsp;</td>
<td><a href="bycategory.wm">By category</a></td>
<td width="15">&nbsp;</td>
<td>
<form method="POST" action="bulkedit.wm">
Priority:
<select name="priority">
#set ($dpri = "15")
  $form.option("priority", "50", "Urgent", $dpri)
  $form.option("priority", "25", "Next up", $dpri)
  $form.option("priority", "15", "Near term", $dpri)
  $form.option("priority", "10", "Medium term", $dpri)
  $form.option("priority", "5", "Long term", $dpri)
  $form.option("priority", "1", "On the list", $dpri)
</select>
$form.submit("submit", "Go")
</form>
</td>
</td>
</tr></table>

<p>

<b>
Outstanding tasks:
</b>

<form method="POST" action="bulkedit.wm">
$form.hidden("priority", $priority)
$form.hidden("action", "update")
#if ($data.length($xtasks) > 0)
#foreach ($xtask in $xtasks)
<table cellpadding="2" cellspacing="0" border="0" width="100%">

$xcats.clear()
#foreach ($task in $xtask.tasks)
#set ($id = $task.taskId)

<tr>
<td valign="top">$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">$form.text("category$id", "size='10'", $task.category)</td>

<td valign="top"><select name="priority$id">
#set ($cpri = $string.valueOf($task.priority))
  $form.option("priority$id", "50", "Urgent", $cpri)
  $form.option("priority$id", "25", "Next up", $cpri)
  $form.option("priority$id", "15", "Near term", $cpri)
  $form.option("priority$id", "10", "Medium term", $cpri)
  $form.option("priority$id", "5", "Long term", $cpri)
  $form.option("priority$id", "1", "On the list", $cpri)
</select>
</td>

</tr>
#end
</table>
#end
#else
<p>$i18n.xlate("bulkedit.no_tasks")
#end

<center>$form.submit("submit", "Update")</center>
</form>

#import ("/footer.wm")
