#from kojiweb import util

#include "includes/header.chtml"

  #if $notif
  <h4>Edit notification</h4>
  #else
  <h4>Create notification</h4>
  #end if

  <form action="#if $notif then 'notificationedit' else 'notificationcreate'#">
    $util.authToken($self, form=True)
    #if $notif
    <input type="hidden" name="notificationID" value="$notif.id"/>
    #end if
    <table>
      <tr>
        <th>Package</th>
        <td>
          <select name="package">
            <option value="all"#if $notif and not $notif.package_id then ' selected="selected"' else ''#>all</option>
            #for $package in $packages
            <option value="$package.package_id"#if $notif and $notif.package_id == $package.package_id then ' selected="selected"' else ''#>$util.escapeHTML($package.package_name)</option>
            #end for
          </select>
        </td>
      </tr>
      <tr>
        <th>Tag</th>
        <td>
          <select name="tag">
            <option value="all"#if $notif and not $notif.tag_id then ' selected="selected"' else ''#>all</option>
            #for $tag in $tags
            <option value="$tag.id"#if $notif and $notif.tag_id == $tag.id then ' selected="selected"' else ''#>$util.escapeHTML($tag.name)</option>
            #end for
          </select>
        </td>
      </tr>
      <tr>
        <th>Success Only?</th>
        <td><input type="checkbox" name="success_only" value="yes"#if $notif and $notif.success_only then ' checked="checked"' else ''#/></td>
      </tr>
      <tr>
        <td>
          #if $notif
          <button type="submit" name="save" value="Save">Save</button>
          #else
          <button type="submit" name="add" value="Add">Add</button>
          #end if
        </td>
        <td><button type="submit" name="cancel" value="Cancel">Cancel</button></td>
      </tr>
    </table>
  </form>

#include "includes/footer.chtml"
