]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1143864: Replace |FILTER bug_link| in loops by direct calls to bug/link.html...
authorFrédéric Buclin <LpSolit@gmail.com>
Sun, 5 Apr 2015 19:26:27 +0000 (21:26 +0200)
committerFrédéric Buclin <LpSolit@gmail.com>
Sun, 5 Apr 2015 19:26:27 +0000 (21:26 +0200)
r=dkl a=sgreen

template/en/default/bug/edit.html.tmpl
template/en/default/bug/link.html.tmpl
template/en/default/email/bugmail.html.tmpl
template/en/default/email/flagmail.html.tmpl

index f23c6b85cf558bd6280ff6c225e5834cbfb807f7..3ac7f68219454ce366d54083435bf81d830e94f4 100644 (file)
     <td class="field_value" colspan="2">
       <span id="duplicates">
         [% FOREACH dupe = bug.duplicates %]
-          [% dupe.id FILTER bug_link(dupe, use_alias => 1) FILTER none %][% " " %]
+          [% INCLUDE bug/link.html.tmpl bug = dupe, link_text = dupe.id, use_alias = 1 %][% " " %]
         [% END %]
       </span>
       (<a href="buglist.cgi?bug_id=[% bug.duplicate_ids.join(",") FILTER html %]">
                value="[% bug.${field.name}.join(', ') FILTER html %]">
       [% END %]
     </span>
-    
+
     [% FOREACH dep_bug = deps %]
-      [% dep_bug.id FILTER bug_link(dep_bug, use_alias => 1)
-                    FILTER none %][% " " %]
+      [% INCLUDE bug/link.html.tmpl bug = dep_bug, link_text = dep_bug.id, use_alias = 1 %][% " " %]
     [% END %]
     [% IF bug.check_can_change_field(field.name, 0, 1) %]
       <span id="[% field.name FILTER html %]_edit_container" 
index b63093302c73782b304ade33ed38879fdefb2c7e..f1e8d041aec15586cb084cfec1231384793a661f 100644 (file)
@@ -8,6 +8,8 @@
 
 [%# INTERFACE:
   #   bug: a Bugzilla::Bug object
+  #   user: the Bugzilla::User object to which this template is addressed.
+  #         If not set, the currently logged in user object is used.
   #   link_text: the text that we're highlighting.
   #   use_alias: boolean; If true, we display the bug's alias as the link
   #              text instead of link_text.
index c3b8b357f38cf781a293fd04b83dd1136995f8a8..1a74db4dcf0a9f1034cc6582239888c418fa2d30 100644 (file)
         <div>
           [% IF comment.count %]
             [% comment_anchor = "#c$comment.count" %]
-            <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 %]
+            <b>[% INCLUDE bug/link.html.tmpl bug = bug, link_text = "Comment # ${comment.count}",
+                                             comment_num = comment.count, full_url = 1, user = to_user %]
+              on [% INCLUDE bug/link.html.tmpl bug = bug, link_text = "$terms.bug $bug.id",
+                                               full_url = 1, user = to_user %]
               from [% INCLUDE global/user.html.tmpl user = to_user, who = comment.author %]</b>
           [% END %]
         [% comment_div = comment.is_markdown ? "div" : "pre" %]
           [% SET in_table = 0 %]
         [% END %]
         [% IF change.blocker %]
-              [% "${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 %],
-              which changed state.
+          [% INCLUDE bug/link.html.tmpl bug = bug, link_text = "$terms.Bug $bug.id", full_url = 1, user = to_user %]
+          depends on
+          [%+ INCLUDE bug/link.html.tmpl bug = change.blocker, link_text = "$terms.bug $change.blocker.id",
+                                         full_url = 1, user = to_user %],
+          which changed state.
         [% ELSE %]
-              [% INCLUDE global/user.html.tmpl user = to_user, who = change.who %] changed
-              [%+ "${terms.bug} ${bug.id}" FILTER bug_link(bug, {full_url => 1, user => to_user}) FILTER none %]
+          [% INCLUDE global/user.html.tmpl user = to_user, who = change.who %] changed
+          [%+ INCLUDE bug/link.html.tmpl bug = bug, link_text = "$terms.bug $bug.id", full_url = 1, user = to_user %]
         [% END %]
           <br>
           [% IF in_table == 0 %]
           <th>[% field_label FILTER html %]</th>
           <td>
             [% IF change.field_name == "bug_id" %]
-              [% new_value FILTER bug_link(bug, {full_url => 1, user => to_user}) FILTER none %]
+              [% INCLUDE bug/link.html.tmpl bug = bug, link_text = new_value, full_url = 1, user = to_user %]
             [% ELSE %]
               [% new_value FILTER html %]
             [% END %]
index d0b61fbbc2dba7e3793bd58da5959479a7ce5036..1c8fc073117445bf8c4f16da2801bea6c3641524 100644 (file)
@@ -47,7 +47,7 @@
     </p>
 
     <p>
-      [% "$terms.Bug $bug.bug_id" FILTER bug_link(bug, {full_url => 1, user => to_user}) FILTER none %]:
+      [% INCLUDE bug/link.html.tmpl bug = bug, link_text = "$terms.Bug $bug.id", full_url = 1, user = to_user %]:
       [%= bug.short_desc FILTER html %]
     </p>