aboutsummaryrefslogtreecommitdiffstats
path: root/extensions/Mageia/template/en/default/hook/bug/comments-a_comment-end.html.tmpl
blob: cbe11b4ca06933c0f46db7d6f43b3bb937c94e6b (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
[%# 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.
  #%]

[% RETURN IF user.setting('mga_inline_history') == 'off' %]

[% FOREACH activity = comment.inline_history %]
  [% IF activity.after %]
    </div>
    <div class="bz_comment bz_inline_history">
      <div class="bz_comment_head">
        <span class="bz_comment_user">
          [%# No need to recreate the exact same template if we already have it. %]
          [% who_id = activity.who.id %]
          [% UNLESS user_cache.$who_id %]
            [% user_cache.$who_id = BLOCK %]
              [% INCLUDE global/user.html.tmpl who = activity.who %]
            [% END %]
          [% END %]
          [% user_cache.$who_id FILTER none %]
        </span>

        <span class="bz_comment_user_images">
          [% FOREACH group = activity.who.groups_with_icon %]
            <img src="[% group.icon_url FILTER html %]"
                 alt="[% group.name FILTER html %]"
                 title="[% group.name FILTER html %] - [% group.description FILTER html %]">
          [% END %]
        </span>

        <span class="bz_comment_time">
          [%+ activity.when FILTER time %]
        </span>
      </div>
  [% ELSE %]
    <hr>
  [% END %]

  <p class="bz_inline_history">
    [% FOREACH change = activity.changes %]
      [% IF change.attachid AND field_descs.${change.fieldname}.match('^Attachment') %]
        <a href="attachment.cgi?id=[% change.attachid FILTER html %]&amp;action=edit">
          [% field_descs.${change.fieldname}.replace('^Attachment', "Attachment ${change.attachid}</a>") FILTER none %]:
      [% ELSIF activity.comment_id AND field_descs.${change.fieldname}.match('^Comment') %]
        [% comment_num = change.comment.count %]
        <a href="show_bug.cgi?id=[% bug.id FILTER html %]#c[% comment_num FILTER html %]"
           onclick="document.getElementById('c[% comment_num FILTER html %]').classList.add('bz_comment_hilite')">
          [% field_descs.${change.fieldname}.replace('^Comment', "Comment $comment_num</a>") FILTER none %]:
      [% ELSE %]
        [% field_descs.${change.fieldname} FILTER html %]:
      [% END %]
      <span class="change_removed">[% PROCESS format_field_value value = change.removed %]</span> =>
      <span class="change_added">[% PROCESS format_field_value value = change.added %]</span><br>
    [% END %]
  </p>
[% END %]

[% BLOCK format_field_value %]
  [% IF value.length %]
    [% IF change.fieldname == 'assigned_to' ||
          change.fieldname == 'reporter' ||
          change.fieldname == 'qa_contact' ||
          change.fieldname == 'cc' ||
          change.fieldname == 'flagtypes.name' %]
      [% display_value(change.fieldname, value) FILTER email FILTER html %]
    [% ELSE %]
      [% display_value(change.fieldname, value) FILTER html FILTER html_line_break %]
    [% END %]
  [% ELSE %]
    (none)
  [% END %]
[% END %]