aboutsummaryrefslogtreecommitdiffstats
path: root/template/en/default/attachment/show-multiple.html.tmpl
blob: e2c95cb80e73537c2c451a3703f74d71bf0e00f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
[%# 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/.
  #
  # This Source Code Form is "Incompatible With Secondary Licenses", as
  # defined by the Mozilla Public License, v. 2.0.
  #%]

[% filtered_summary = bugsummary FILTER html %]
[% header = BLOCK %]View All Attachments for
  [%+ "$terms.Bug $bug.id" FILTER bug_link(bug) FILTER none %][% END %]

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

[% PROCESS global/header.html.tmpl
  title = title
  header = header
  subheader = filtered_summary
  style_urls = ['skins/standard/bug.css']
%]
[% 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 %]

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

      <td>
        [% IF a.ispatch %]
          <i>patch</i>
        [% ELSE %]
          [% a.contenttype FILTER html %]
        [% END %]
      </td>

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

      <td>
        [% IF a.flags.size == 0 %]
          <i>no flags</i>
        [% ELSE %]
          [% FOREACH flag = a.flags %]
            [% flag.setter.nick FILTER html %]:
            [%+ flag.type.name FILTER html %][% flag.status %]
            [% IF flag.status == "?" && flag.requestee %]
              ([% flag.requestee.nick FILTER html %])
            [% END %]
            [% ", " IF !loop.last %]
          [% END %]
        [% END %]
      </td>

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

  [% IF a.is_viewable %]
    [% 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 %]
      <iframe src="attachment.cgi?id=[% a.id %]" class="viewall_frame" sandbox>
        <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 %]
  [% ELSE %]
    <p><b>
      Attachment cannot be viewed because its MIME type is not text/*, image/*, or application/vnd.mozilla.*.
      <a href="attachment.cgi?id=[% a.id %]">Download the attachment instead</a>.
    </b></p>
  [% END %]
</div>
[% END %]

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