<dtml-let form_title="'Actions'">
<dtml-if manage_page_header>
 <dtml-var manage_page_header>
<dtml-else>
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
 <html lang="en">
 <head>
 <title>&dtml-form_title;</title>
 </head>
 <body bgcolor="#FFFFFF" link="#000099" vlink="#555555">
 <h3>&dtml-form_title;</h3>
</dtml-if>
</dtml-let>
<dtml-var manage_tabs>

<form action="&dtml-absolute_url;" method="POST">

<dtml-if actions>
<table>
<dtml-in actions mapping>
<dtml-let index=sequence-index>

<tr>
<td>
  <div class="form-element">
  <input type="checkbox" name="selections:list" value="&dtml-index;" />
  </div>
</td>
<td>
  <div class="form-label">
  Title
  </div>
</td>
<td>
  <div class="form-element">
  <input type="text" name="name_&dtml-index;" value="&dtml-title;" />
  </div>
</td>
</tr>

<tr>
<td></td>
<td>
  <div class="form-label">
  Id
  </div>
</td>
<td>
  <div class="form-element">
  <input type="text" name="id_&dtml-index;" value="&dtml-id;" />
  </div>
</td>
</tr>

<tr>
<td></td>
<td>
  <div class="form-label">
  URL (Expression)
  </div>
</td>
<td>
  <div class="form-element">
  <input type="text" name="action_&dtml-index;" value="&dtml-action;" size="80" />
  </div>
</td>
</tr>

<tr>
<td></td>
<td>
  <div class="form-label">
  Condition (Expression)
  </div>
</td>
<td>
  <div class="form-element">
  <input type="text" name="condition_&dtml-index;" value="&dtml-condition;" size="80"/>
  </div>
</td>
</tr>

<tr>
<td></td>
<td>
  <div class="form-label">
  Permission
  </div>
</td>
<td>
  <div class="form-element">
  <select name="permission_&dtml-index;">
    <dtml-let selected="(not permissions) and 'selected' or ' '">
      <option value="" &dtml-selected;>(none)</option>
    </dtml-let>
    <dtml-in possible_permissions sort>
      <dtml-let selected="(permissions and permissions[0] == _['sequence-item'])
        and 'selected' or ' '">
      <option value="&dtml-sequence-item;" &dtml-selected;>&dtml-sequence-item;</option>
      </dtml-let>
    </dtml-in>
  </select>
  </div>
</td>
</tr>

<tr>
<td></td>
<td>
  <div class="form-label">
  Category
  </div>
</td>
<td>
  <div class="form-element">
  <input type="text" name="category_&dtml-index;" value="&dtml-category;" />
  </div>
</td>
</tr>

<tr>
<td></td>
<td>
  <div class="form-label">
  Visible?
  </div>
</td>
<td>
  <div class="form-element">
  <input type="hidden" name="visible_&dtml-index;:int:default"
         value="0" />
  <dtml-let chk="visible and 'checked' or ''">
  <input type="checkbox" name="visible_&dtml-index;:boolean"
         &dtml-chk; value="1" />
  </dtml-let>
  </div>
</td>
</tr>

</dtml-let>

<tr><td colspan="3">
<hr />
</td></tr>

</dtml-in>
</table>

<div class="form-element">
<table>
<tr>
<td><input type="submit" name="changeActions:method" value="Save" /></td>
<td><input type="submit" name="deleteActions:method" value="Delete" /></td>
<td><input type="submit" name="moveUpActions:method" value="Move up" /></td>
<td><input type="submit" name="moveDownActions:method" value="Move down" /></td>
</tr>
</table>
</div>

</dtml-if>

<h3 class="form-help">
Add an action
</h3>

<table>
<tr>
<td></td>
<td>
  <div class="form-label">
  Title
  </div>
</td>
<td>
  <div class="form-element">
  <input type="text" name="name" value="" />
  </div>
</td>
</tr>

<tr>
<td></td>
<td>
  <div class="form-label">
  Id
  </div>
</td>
<td>
  <div class="form-element">
  <input type="text" name="id" value="" />
  </div>
</td>
</tr>

<tr>
<td></td>
<td>
  <div class="form-label">
  URL (Expression)
  </div>
</td>
<td>
  <div class="form-element">
  <input type="text" name="action" value="" size="80" />
  </div>
</td>
</tr>
<tr>
<td></td>
<td>
  <div class="form-label">
  Condition (Expression)
  </div>
</td>
<td>
  <div class="form-element">
  <input type="text" name="condition" value="" size="80" />
  </div>
</td>
</tr>

<tr>
<td></td>
<td>
  <div class="form-label">
  Permission
  </div>
</td>
<td>
  <div class="form-element">
  <select name="permission">
    <option value="">(none)</option>
    <dtml-in possible_permissions sort>
      <option value="&dtml-sequence-item;">&dtml-sequence-item;</option>
    </dtml-in>
  </select>
  </div>
</td>
</tr>

<tr>
<td></td>
<td>
  <div class="form-label">
  Category
  </div>
</td>
<td>
  <div class="form-element">
  <input type="text" name="category" value="" />
  </div>
</td>
</tr>
<tr>

<td></td>
<td>
  <div class="form-label">
  Visible?
  </div>
</td>
<td>
  <div class="form-element">
  <input type="hidden" name="visible:int:default"
         value="0" />
  <input type="checkbox" name="visible:boolean" checked value="1"/>
  </div>
</td>
</tr>

</table>

<div class="form-element">
<input type="submit" name="addAction:method" value="Add" />
</div>

</form>

<dtml-if manage_page_footer>
  <dtml-var manage_page_footer>
<dtml-else>
  </body></html>
</dtml-if>
