From: Frédéric Buclin Date: Sun, 5 Apr 2015 19:26:27 +0000 (+0200) Subject: Bug 1143864: Replace |FILTER bug_link| in loops by direct calls to bug/link.html... X-Git-Tag: release-5.1.1~307 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cb8ec961ded401de227b023a7ff813330d0f3a08;p=thirdparty%2Fbugzilla.git Bug 1143864: Replace |FILTER bug_link| in loops by direct calls to bug/link.html.tmpl to improve performance r=dkl a=sgreen --- diff --git a/template/en/default/bug/edit.html.tmpl b/template/en/default/bug/edit.html.tmpl index f23c6b85cf..3ac7f68219 100644 --- a/template/en/default/bug/edit.html.tmpl +++ b/template/en/default/bug/edit.html.tmpl @@ -565,7 +565,7 @@ [% 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 %] ( @@ -1014,10 +1014,9 @@ value="[% bug.${field.name}.join(', ') FILTER html %]"> [% END %] - + [% 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) %] [% IF comment.count %] [% comment_anchor = "#c$comment.count" %] - [% "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 %] + [% 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 %] [% END %] [% comment_div = comment.is_markdown ? "div" : "pre" %] @@ -86,14 +87,14 @@ [% 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 %]
[% IF in_table == 0 %] @@ -117,7 +118,7 @@ [% field_label FILTER html %] [% 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 %] diff --git a/template/en/default/email/flagmail.html.tmpl b/template/en/default/email/flagmail.html.tmpl index d0b61fbbc2..1c8fc07311 100644 --- a/template/en/default/email/flagmail.html.tmpl +++ b/template/en/default/email/flagmail.html.tmpl @@ -47,7 +47,7 @@

- [% "$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 %]