[%# 1.0@bugzilla.org %]
[%# The contents of this file are subject to the Mozilla Public
  # License Version 1.1 (the "License"); you may not use this file
  # except in compliance with the License. You may obtain a copy of
  # the License at http://www.mozilla.org/MPL/
  #
  # Software distributed under the License is distributed on an "AS
  # IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
  # implied. See the License for the specific language governing
  # rights and limitations under the License.
  #
  # The Original Code is the Bugzilla Test Runner System.
  #
  # The Initial Developer of the Original Code is Maciej Maczynski.
  # Portions created by Maciej Maczynski are Copyright (C) 2001
  # Maciej Maczynski. All Rights Reserved.
  #
  # Contributor(s): Greg Hendricks <ghendricks@novell.com>
  #%]

[%# INTERFACE:
  # ...
  #%]
  
<table width="100%">
  <tr class="bz_row_header">
    <th>Attachment</th>
    <th>Submitter</th>
    <th>Type</th>
    <th>Created</th>
    <th>Size</th>
  [% IF item.canedit %]
    <th>Actions</th>
  [% END %]
  </tr>
[% FOREACH a = item.attachments %]
  <tr>
    <td><a href="tr_attachment.cgi?attach_id=[% a.id FILTER none %]&action=view&[% item.type FILTER none %]_id=[% item.id FILTER none %]">[% a.description FILTER html %]</a></td>
    <td>[% a.submitter.login FILTER html %]</td>
    <td>[% a.mime_type FILTER html %]</td>
    <td>[% a.creation_ts FILTER time %]</td>
    <td>[% a.datasize FILTER unitconvert %]</td>
  [% IF item.canedit %]
    <td><a href="tr_attachment.cgi?attach_id=[% a.id FILTER none %]&action=edit&[% item.type FILTER none %]_id=[% item.id FILTER none %]">Edit</a> 
         [% IF Param("allow-test-deletion") %]<a href="tr_attachment.cgi?attach_id=[% a.id FILTER none %]&action=remove&[% item.type FILTER none %]_id=[% item.id FILTER none %]">Remove</a>[% END %]</td>
  [% END %]
  </tr>
[% END %]

[% IF item.canedit %]
<input type="hidden" name="[% item.type FILTER none %]_id" value="[% item.id FILTER none %]">
<table border="0" width="100%" style="border: 1px solid #000;">
  <tr>
    <th align="right">File</td>
    <td><input name="data" type="file"></td>
    <th align="right">Description:</td>
    <td><input name="description"></td>
    <td align="right">
    <input type="submit" name="action" value="Attach"></td>
  </tr>    
</table>
[% END %]
</table>
