#from kojiweb import util
#import urllib
#import datetime

#include "includes/header.chtml"
  #if $rpm
  <h4>Information for file <a href="fileinfo?rpmID=$rpm.id&amp;filename=$urllib.quote($file.name)">$file.name</a></h4>
  #elif $archive
  <h4>Information for file <a href="fileinfo?archiveID=$archive.id&amp;filename=$urllib.quote($file.name)">$file.name</a></h4>
  #end if

  <table>
    <tr>
      <th>Name</th><td>$file.name</td>
    </tr>
    #if $rpm
    <tr>
      <th>Digest ($file.digest_algo)</th><td>$file.digest</td>
    </tr>
    #end if
    <tr>
      <th>Size</th><td>$file.size</td>
    </tr>
    #if 'mtime' in $file and $file.mtime
    <tr>
      <th>Modification time</th><td>$util.formatTimeLong($datetime.datetime.fromtimestamp($file.mtime))</td>
    </tr>
    #end if
    #if 'user' in $file and $file.user
    <tr>
      <th>User</th><td>$file.user</td>
    </tr>
    #end if
    #if 'group' in $file and $file.group
    <tr>
      <th>Group</th><td>$file.group</td>
    </tr>
    #end if
    #if 'mode' in $file and $file.mode
    <tr>
      <th>Mode</th><td class="rpmheader">$util.formatMode($file.mode)</td>
    </tr>
    #end if
    #if $rpm
    <tr>
      <th>Flags</th>
      <td>
        #for flag in $util.formatFileFlags($file.flags)
        $flag<br/>
        #end for
      </td>
    </tr>
    <tr>
      #set $epoch = ($rpm.epoch != None and $str($rpm.epoch) + ':' or '')
      <th>RPM</th><td><a href="rpminfo?rpmID=$rpm.id">$rpm.name-$epoch$rpm.version-$rpm.release.${rpm.arch}.rpm</a></td>
    </tr>
    #elif $archive
    <tr>
      <th>Archive</th><td><a href="archiveinfo?archiveID=$archive.id">$archive.filename</a></td>
    </tr>
    #end if
  </table>

#include "includes/footer.chtml"
