summaryrefslogtreecommitdiffstats
path: root/extensions/BugModal/template/en/default/bug_modal/attachments.html.tmpl
blob: a2763705621f9cd2a6d951f374ebf71075fde2ef (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
96
97
98
99
100
101
102
103
104
105
[%# 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.
  #%]

[%#
  # bug: (bug object) the main bug object
  # active_attachments: array of active attachment objects
  # obsolete_attachments: array of obsolete attachment objects
  #%]

<table role="table" class="layout-table" id="attachments">
  [% FOREACH attachment IN bug.attachments %]
    [%
      NEXT IF attachment.isprivate && !(user.is_insider || attachment.attacher.id == user.id);
      attachment_rendered = 0;
      Hook.process("row");
      NEXT IF attachment_rendered;
    %]
    <tr class="
        [%~ " bz_private" IF attachment.isprivate %]
        [%~ " attach-obsolete" IF attachment.isobsolete %]
        [%~ " attach-patch" IF attachment.can_review %]
    " [% IF attachment.isobsolete %]style="display:none"[% END %]>
      <td class="attach-desc-td">
        <div class="attach-desc">
          [% IF attachment.is_image %]
            <a href="attachment.cgi?id=[% attachment.id FILTER none %]"
              title="[% attachment.description FILTER html %]"
              class="lightbox">
              <img src="extensions/BugModal/web/image.png" width="16" height="16">
              [%~ attachment.description FILTER html %]
            </a>
          [% ELSE %]
            <a href="attachment.cgi?id=[% attachment.id FILTER none %]">
              [%~ attachment.description FILTER html %]</a>
          [% END %]
        </div>
        <div>
          [% activity_id = bug.find_activity_id_for_attachment(attachment) %]
          [% IF activity_id %]
            <a href="#[% activity_id FILTER none %]" class="attach-time activity-ref">
              [% INCLUDE bug_modal/rel_time.html.tmpl ts=attachment.attached %]</a>
          [% ELSE %]
            <span class="attach-time">[% INCLUDE bug_modal/rel_time.html.tmpl ts=attachment.attached %]</span>
          [% END %]
          <span class="attach-author">[% INCLUDE bug_modal/user.html.tmpl u=attachment.attacher %]</span>
        </div>
        <div class="attach-info">
          [% IF attachment.datasize %]
            [%- attachment.datasize FILTER unitconvert %]
          [% ELSE %]
            (deleted)
          [% END %],
          [%+ attachment.ispatch ? "patch" : attachment.contenttype FILTER html -%]
        </div>
      </td>
      <td>
        [% FOREACH flag IN attachment.flags %]
          <div class="attach-flag">
            [% INCLUDE bug_modal/user.html.tmpl u=flag.setter simple=1 %]:
            [% activity_id = bug.find_activity_id_for_flag(flag) %]
            [% IF activity_id %]
              <a href="#[% activity_id FILTER none %]"
            [% ELSE %]
              <span
            [% END %]
              [% IF user.setting("ui_use_absolute_time") == "on" %]
                  class="flag-name-status abs-time-title[% " activity-ref" IF activity_id %]"
                  title="[% flag.creation_date FILTER time("%Y-%m-%d %H:%M %Z") FILTER html %]"
              [% ELSE %]
                  class="flag-name-status rel-time-title[% " activity-ref" IF activity_id %]"
                  title="[% flag.creation_date FILTER time_duration FILTER html %]"
              [% END %]
              data-time="[% flag.creation_date FILTER epoch FILTER none %]"
            >
              [%+ flag.type.name FILTER html %][% flag.status FILTER none %]
            [% activity_id ? "</a>" : "</span>" %]
            [% IF flag.requestee %]
              [%+ INCLUDE bug_modal/user.html.tmpl u=flag.requestee simple=1 %]
            [% END %]
          </div>
        [% END %]
      </td>
      <td class="attach-actions">
        <a href="attachment.cgi?id=[% attachment.id FILTER none %]&amp;action=edit">Details</a>
        [% IF attachment.ispatch %]
          | <a href="attachment.cgi?id=[% attachment.id FILTER none %]&amp;action=diff">Diff</a>
        [% END %]
        [% Hook.process("action", "attachment/list.html.tmpl") %]
    </tr>
  [% END %]
</table>

<div id="attachments-actions">
  [% IF obsolete_attachments %]
    <button type="button" id="attachments-obsolete-btn" class="minor">Show Obsolete Attachments</button>
  [% END %]
</div>

[%# BMO - attachment related warnings %]
[% Hook.process("warnings") %]