#import koji
#import koji.util
#from os.path import basename
#from kojiweb import util

#include "includes/header.chtml"

<h4>Information for image <a href="imageinfo?imageID=$image.id">$image.filename</a></h4>

<table>
  <tr>
    <th>ID</th><td>$image.id</td>
  </tr>
  <tr>
    <th>File Name</th><td>$image.filename</a></td>
  </tr>
  <tr>
    <th>File Size</th><td>$image.filesize</td>
  </tr>
  <tr>
    <th>Arch</th><td>$image.arch</td>
  </tr>
  <tr>
    <th>Media Type</th><td>$image.mediatype</td>
  </tr>
  <tr>
    #if $len($image.hash) == 32
      <th>Digest (md5)</th><td>$image.hash</td>
    #elif $len($image.hash) == 40
      <th>Digest (sha1)</th><td>$image.hash</td>
    #elif $len($image.hash) == 64
      <th>Digest (sha256)</th><td>$image.hash</td>
    #elif $len($image.hash) == 96
      <th>Digest (sha384)</th><td>$image.hash</td>
    #elif $len($image.hash) == 128
      <th>Digest (sha512)</th><td>$image.hash</td>
    #else
      <th>Hash </th><td>$image.hash</td>
    #end if
  </tr>
  <tr>
    <th>Task</th><td><a href="taskinfo?taskID=$task.id" class="task$util.taskState($task.state)">$koji.taskLabel($task)</a></td>
  </tr>
  <tr>
    <th>Buildroot</th><td><a href="buildrootinfo?buildrootID=$buildroot.id">/var/lib/mock/$buildroot.tag_name-$buildroot.id-$buildroot.repo_id</a></td>
  </tr>
  <tr>
    <th colspan="2"><a href="rpmlist?imageID=$image.id&amp;type=image" title="RPMs that where installed into the LiveCD">Included RPMs</a></th>
  </tr>
  <tr>
    <th colspan="2"><a href="$imageBase/$image.filename">Download Image</a> (<a href="$imageBase/data/logs/$image.arch/">build logs</a>)</th>
  </tr>
  #if $image.get('xmlfile', None)
  <tr>
    <th colspan="2"><a href="$imageBase/$image.xmlfile">Download XML Description</a></th>
  </tr>
  #end if
</table>

#include "includes/footer.chtml"
