show-multiple.html.tmpl 3.07 KB
Newer Older
1 2 3
[%# This Source Code Form is subject to the terms of the Mozilla Public
  # License, v. 2.0. If a copy of the MPL was not distributed with this
  # file, You can obtain one at http://mozilla.org/MPL/2.0/.
4
  #
5 6
  # This Source Code Form is "Incompatible With Secondary Licenses", as
  # defined by the Mozilla Public License, v. 2.0.
7 8 9
  #%]

[% filtered_summary = bugsummary FILTER html %]
10
[% header = BLOCK %]View All Attachments for
11
  [%+ "$terms.Bug $bug.id" FILTER bug_link(bug) FILTER none %][% END %]
12 13 14 15 16

[% title = BLOCK %]
  View All Attachments for [% terms.Bug %] [%+ bug.bug_id FILTER html %]
[% END %]

17
[% PROCESS global/header.html.tmpl
18
  title = title
19 20
  header = header
  subheader = filtered_summary
21
  style_urls = ['skins/standard/bug.css']
22
%]
23 24 25 26 27 28
[% IF hide_obsolete %]
  <div id="hidden_obsolete_message">
    Obsolete attachments are hidden. To view all attachments (including obsolete) 
    <a href="attachment.cgi?bugid=[% bug.id FILTER html %]&amp;action=viewall">click here</a>.
  </div>
[% END %]
29 30

[% FOREACH a = attachments %]
31
<div class="viewall_frame_container">
32
  <table class="viewall_desc">
33
    <tr>
34
      <th colspan="6" class="bz_attach_footer">Attachment #[% a.id %]</th>
35 36
    </tr>
    <tr>
37
      <td>[% a.description FILTER html FILTER obsolete(a.isobsolete) %]</td>
38

39
      <td>
40 41 42 43 44 45 46
        [% IF a.ispatch %]
          <i>patch</i>
        [% ELSE %]
          [% a.contenttype FILTER html %]
        [% END %]
      </td>

47 48
      <td>[% a.attached FILTER time %]</td>
      <td>[% a.datasize FILTER unitconvert %]</td>
49

50
      <td>
51 52
        [% IF a.flags.size == 0 %]
          <i>no flags</i>
53
        [% ELSE %]
54
          [% FOREACH flag = a.flags %]
55
            [% flag.setter.nick FILTER html %]:
56 57 58 59 60
            [%+ flag.type.name FILTER html %][% flag.status %]
            [% IF flag.status == "?" && flag.requestee %]
              ([% flag.requestee.nick FILTER html %])
            [% END %]
            [% ", " IF !loop.last %]
61 62 63 64
          [% END %]
        [% END %]
      </td>

65
      <td><a href="attachment.cgi?id=[% a.id %]&amp;action=edit">Details</a></td>
66 67 68
    </tr>
  </table>

69
  [% IF a.is_viewable %]
70 71 72 73 74 75 76 77 78 79 80
    [% IF a.contenttype == "text/html" %]
      [%# For security reasons (clickjacking, embedded scripts), we never
        # render HTML pages from here. The source code is displayed instead. %]
      [% INCLUDE global/textarea.html.tmpl
         minrows = 10
         cols    = 80
         defaultcontent = a.data
         readonly = 'readonly'
         classes = 'viewall_frame'
      %]
    [% ELSE %]
81
      <iframe src="attachment.cgi?id=[% a.id %]" class="viewall_frame" sandbox>
82 83 84 85
        <b>You cannot view the attachment on this page because your browser does not support IFRAMEs.
        <a href="attachment.cgi?id=[% a.id %]">View the attachment on a separate page</a>.</b>
      </iframe>
    [% END %]
86 87 88
  [% ELSE %]
    <p><b>
      Attachment cannot be viewed because its MIME type is not text/*, image/*, or application/vnd.mozilla.*.
89
      <a href="attachment.cgi?id=[% a.id %]">Download the attachment instead</a>.
90 91
    </b></p>
  [% END %]
92
</div>
93 94 95
[% END %]

[% PROCESS global/footer.html.tmpl %]