bugmail.html.tmpl 3.87 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 10 11 12 13
  #%]
  
[% PROCESS "global/reason-descs.none.tmpl" %]

[% isnew = bug.lastdiffed ? 0 : 1 %]
<html>
    <head>
14
      <base href="[% urlbase FILTER html %]" />
15 16
    </head>
    <body>
17
      [% Hook.process('start') %]
18 19 20 21 22
      [% PROCESS generate_diffs %]
      <p>
      [% FOREACH comment = new_comments.reverse %]
        <div>
          [% IF comment.count %]
23 24 25
            <b>[% "Comment # ${comment.count}" FILTER bug_link(bug,
              {comment_num => comment.count, full_url => 1, user => to_user}) FILTER none %]
              on [% "$terms.bug $bug.id" FILTER bug_link(bug, { full_url => 1, user => to_user }) FILTER none %]
26 27
              from [% INCLUDE global/user.html.tmpl who = comment.author %]</b>
          [% END %]
28
        <pre>[% comment.body_full({ wrap => 1 }) FILTER quoteUrls(bug, comment, to_user) %]</pre>
29 30 31
        </div>
      [% END %]
      </p>
32
      <hr>
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
      <span>You are receiving this mail because:</span>
      
      <ul>
      [% FOREACH reason = reasons %]
        [%  IF reason_descs.$reason  %]
          <li>[% reason_descs.$reason FILTER html %]</li>
        [% END %]
      [% END %]
      [% FOREACH reason = reasons_watch %]
        [% IF watch_reason_descs.$reason %]
          <li>[% watch_reason_descs.$reason FILTER html %]</li>
        [% END %]
      [% END %]
      </ul>
    </body>
</html>

[% BLOCK generate_diffs %]
51
  [% SET in_table = 0 %]
52
  [% last_changer = 0 %]
53
    [% FOREACH change = diffs %]
54 55
      [% IF !isnew && changer.id != last_changer %]
        [% last_changer = changer.id %]
56
        [% IF in_table == 1 %]
57
          </table>
58 59
          [% SET in_table = 0 %]
        [% END %]
60
        [% IF change.blocker %]
61 62 63 64
              [% "${terms.Bug} ${bug.id}" FILTER bug_link(bug, {full_url => 1, user => to_user}) FILTER none %]
              depends on
              [%+ "${terms.bug} ${change.blocker.id}"
                  FILTER bug_link(change.blocker, {full_url => 1, user => to_user}) FILTER none %],
65 66
              which changed state.
        [% ELSE %]
67 68
              [% INCLUDE global/user.html.tmpl who = change.who %] changed
              [%+ "${terms.bug} ${bug.id}" FILTER bug_link(bug, {full_url => 1, user => to_user}) FILTER none %]
69
        [% END %]
70 71 72 73 74 75 76 77 78 79
          <br>
          [% IF in_table == 0 %]
             <table border="1" cellspacing="0" cellpadding="8">
             [% SET in_table = 1 %]
          [% END %]
          <tr>
            <th>What</th>
            <th>Removed</th>
            <th>Added</th>
          </tr>
80 81
      [% END %]

82
      [% PROCESS "email/bugmail-common.txt.tmpl" %]
83
      [% IF in_table == 0 %]
84
         <table border="1" cellspacing="0" cellpadding="8">
85 86
         [% SET in_table = 1 %]
      [% END %]
87 88 89
      [% IF isnew %]
        <tr>
          <th>[% field_label FILTER html %]</th>
90 91
          <td>
            [% IF change.field_name == "bug_id" %]
92
              [% new_value FILTER bug_link(bug, {full_url => 1, user => to_user}) FILTER none %]
93 94 95 96
            [% ELSE %]
              [% new_value FILTER html %]
            [% END %]
          </td>
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117
        </tr>
      [% ELSE %]
         <tr>
           <td style="text-align:right;">[% field_label FILTER html %]</td>
           <td>
             [% IF old_value %]
               [% old_value FILTER html %]
             [% ELSE %]
               &nbsp;
             [% END%]
           </td>
           <td>
             [% IF new_value %]
               [% new_value FILTER html %]
             [% ELSE %]
               &nbsp;
             [% END%]
           </td>
         </tr>
      [% END %]
    [% END %]
118
  [% '</table>' IF in_table %]
119
[% END %]