From c2c8f774694bd9782fe3310204b626ea20e43b6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Buclin?= Date: Sun, 5 Apr 2015 21:48:58 +0200 Subject: Bug 1143874: Improve load time of bug comments r=dkl a=sgreen --- template/en/default/bug/comments.html.tmpl | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'template/en/default/bug') diff --git a/template/en/default/bug/comments.html.tmpl b/template/en/default/bug/comments.html.tmpl index d040e651d..f4f79ec5c 100644 --- a/template/en/default/bug/comments.html.tmpl +++ b/template/en/default/bug/comments.html.tmpl @@ -46,6 +46,7 @@ [% DEFAULT mode = "show" %] [% user_cache = template_cache.users %] +[% can_edit_comments = bug.check_can_change_field('longdesc', 0, 1) %] @@ -53,9 +54,7 @@ -[% FOREACH comment = comments %] - [% PROCESS a_comment %] -[% END %] +[% PROCESS display_comments %] [% IF mode == "edit" && user.id && user.settings.comment_box_position.value == "before_comments" %] @@ -96,10 +95,11 @@ [%# Block for individual comments #%] [%############################################################################%] -[% BLOCK a_comment %] - [% RETURN IF comment.is_private AND NOT (user.is_insider || user.id == comment.author.id) %] - [% comment_text = comment.body_full %] - [% RETURN IF comment_text == '' AND (comment.work_time - 0) != 0 AND !user.is_timetracker %] +[% BLOCK display_comments %] + [% FOREACH comment = comments %] + [% NEXT IF comment.is_private AND NOT (user.is_insider || user.id == comment.author.id) %] + [% comment_text = comment.body_full %] + [% NEXT IF comment_text == '' AND (comment.work_time - 0) != 0 AND !user.is_timetracker %]
[% END %] - [% IF bug.check_can_change_field('longdesc', 0, 1) %] + [% IF can_edit_comments %] [% IF user.can_tag_comments %] [tag] @@ -145,7 +145,7 @@ [% END %] - [% IF mode == "edit" && user.is_insider && bug.check_can_change_field('longdesc', 0, 1) %] + [% IF mode == "edit" && can_edit_comments && user.is_insider %]
@@ -233,4 +233,5 @@ [% Hook.process('a_comment-end', 'bug/comments.html.tmpl') %]
+ [% END %] [% END %] -- cgit v1.2.1