diff options
author | Dave Lawrence <dlawrence@mozilla.com> | 2012-03-06 18:05:35 +0100 |
---|---|---|
committer | Dave Lawrence <dlawrence@mozilla.com> | 2012-03-06 18:05:35 +0100 |
commit | 2bea3e2abd44e07198199eb9ac86aebc4c3f0f2a (patch) | |
tree | ef462db8ce5b5140f3b644c2bf82891772e249f9 /template/en/default/bug/comments.html.tmpl | |
parent | 22114cb2da0ec6e9939d0d03b4714d74b7cad71f (diff) | |
download | bugzilla-2bea3e2abd44e07198199eb9ac86aebc4c3f0f2a.tar.gz bugzilla-2bea3e2abd44e07198199eb9ac86aebc4c3f0f2a.tar.xz |
Bug 732189 - Backport 731562 to bmo: Cache the global/user.html.tmpl template, r=glob
https://bugzilla.mozilla.org/show_bug.cgi?id=731562
Diffstat (limited to 'template/en/default/bug/comments.html.tmpl')
-rw-r--r-- | template/en/default/bug/comments.html.tmpl | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/template/en/default/bug/comments.html.tmpl b/template/en/default/bug/comments.html.tmpl index 2a00b47ec..3c303afb8 100644 --- a/template/en/default/bug/comments.html.tmpl +++ b/template/en/default/bug/comments.html.tmpl @@ -63,6 +63,7 @@ [% DEFAULT start_at = 0 mode = "show" %] [% sort_order = user.settings.comment_sort_order.value %] +[% user_cache = template_cache.users %] [%# NOTE: (start_at > 0) means we came here from a midair collision, # in which case we don't care what the user's preference is. @@ -176,13 +177,18 @@ </span> <span class="bz_comment_user"> - [% INCLUDE global/user.html.tmpl who = comment.author %] - [% Hook.process('user', 'bug/comments.html.tmpl') %] - </span> + [%# No need to recreate the exact same template if we already have it. %] + [% commenter_id = comment.author.id %] + [% UNLESS user_cache.$commenter_id %] + [% user_cache.$commenter_id = BLOCK %] + [% INCLUDE global/user.html.tmpl who = comment.author %] + [% END %] + [% END %] + [% user_cache.$commenter_id FILTER none %] + </span> <span class="bz_comment_user_images"> - [% FOREACH group = comment.author.direct_group_membership %] - [% NEXT UNLESS group.icon_url %] + [% FOREACH group = comment.author.groups_with_icon %] <img src="[% group.icon_url FILTER html %]" alt="[% group.name FILTER html %]" title="[% group.name FILTER html %] - [% group.description FILTER html %]"> |