#from kojiweb import util

#include "includes/header.chtml"

  <h4>Edit host $util.escapeHTML($host.name)</h4>

  <form action="hostedit">
    $util.authToken($self, form=True)
    <table>
      <tr>
        <th>Name</th>
        <td>$util.escapeHTML($host.name)</td>
      </tr>
      <tr>
        <th>ID</th>
        <td>
          $host.id
          <input type="hidden" name="hostID" value="$host.id"/>
        </td>
      </tr>
      <tr>
        <th>Arches</th>
        <td><input type="text" name="arches" value="$util.escapeHTML($host.arches)"/></td>
      </tr>
      <tr>
        <th>Capacity</th>
        <td><input type="text" name="capacity" value="$host.capacity"/></td>
      </tr>
      <tr>
        <th>Description</th>
        <td><textarea name="description" rows="6" cols="50">$util.escapeHTML($host.description)</textarea></td>
      </tr>
      <tr>
        <th>Comment</th>
        <td><textarea name="comment" rows="2" cols="50">$util.escapeHTML($host.comment)</textarea></td>
      </tr>
      <tr>
        <th>Enabled?</th>
        <td><input type="checkbox" name="enabled" value="yes" #if $host.enabled then 'checked="checked"' else ''#/>
      </tr>
      <tr>
        <th>Channels</th>
        <td>
          <select name="channels" multiple="multiple">
            #for $channel in $allChannels
            <option value="$channel.name" #if $channel in $hostChannels then 'selected="selected"' else ''#>$util.escapeHTML($channel.name)</option>
            #end for
          </select>
        </td>
      <tr>
        <td><button type="submit" name="save" value="Save">Save</button></td>
        <td><button type="submit" name="cancel" value="Cancel">Cancel</button></td>
      </tr>
    </table>
  </form>

#include "includes/footer.chtml"
