summaryrefslogtreecommitdiffstats
path: root/template/en/default/bug/comments.html.tmpl
diff options
context:
space:
mode:
authorFrédéric Buclin <LpSolit@gmail.com>2015-04-05 21:46:33 +0200
committerFrédéric Buclin <LpSolit@gmail.com>2015-04-05 21:46:33 +0200
commitb1886835c81c014c1423fa2f2d83e157cbde1406 (patch)
tree7b2286b8768e97632ff6510efefad067db493c31 /template/en/default/bug/comments.html.tmpl
parent0d95dec384fc94b6ebaa5158a579aa099574cd59 (diff)
downloadbugzilla-b1886835c81c014c1423fa2f2d83e157cbde1406.tar.gz
bugzilla-b1886835c81c014c1423fa2f2d83e157cbde1406.tar.xz
Bug 1143874: Improve load time of bug comments
r=dkl a=sgreen
Diffstat (limited to 'template/en/default/bug/comments.html.tmpl')
-rw-r--r--template/en/default/bug/comments.html.tmpl19
1 files changed, 10 insertions, 9 deletions
diff --git a/template/en/default/bug/comments.html.tmpl b/template/en/default/bug/comments.html.tmpl
index 63196a1ce..fdefa9b19 100644
--- a/template/en/default/bug/comments.html.tmpl
+++ b/template/en/default/bug/comments.html.tmpl
@@ -19,6 +19,7 @@
[% DEFAULT mode = "show" %]
[% user_cache = template_cache.users %]
[% markdown_enabled = feature_enabled('jsonrpc') AND user.settings.use_markdown.value == "on" %]
+[% can_edit_comments = bug.check_can_change_field('longdesc', 0, 1) %]
<!-- This auto-sizes the comments and positions the collapse/expand links
to the right. -->
@@ -26,9 +27,7 @@
<tr>
<td>
-[% FOREACH comment = comments %]
- [% PROCESS a_comment %]
-[% END %]
+[% PROCESS display_comments %]
[% IF mode == "edit" && user.id
&& user.settings.comment_box_position.value == "before_comments" %]
@@ -69,10 +68,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 %]
<div id="c[% comment.count %]" class="bz_comment[% " bz_private" IF comment.is_private %]
[% " bz_default_collapsed" IF comment.collapsed %]
@@ -92,7 +92,7 @@
[% IF comment.collapsed %]
<span class="bz_collapsed_actions">
[% END %]
- [% IF bug.check_can_change_field('longdesc', 0, 1) %]
+ [% IF can_edit_comments %]
[% IF user.can_tag_comments %]
[<a href="#"
onclick="YAHOO.bugzilla.commentTagging.toggle([% comment.id %], [% comment.count %]);return false">tag</a>]
@@ -125,7 +125,7 @@
</span>
[% END %]
- [% IF mode == "edit" && user.is_insider && bug.check_can_change_field('longdesc', 0, 1) %]
+ [% IF mode == "edit" && can_edit_comments && user.is_insider %]
<div class="bz_private_checkbox">
<input type="hidden" value="1"
name="defined_isprivate_[% comment.id %]">
@@ -214,4 +214,5 @@
</[% user.use_markdown(comment) ? "div" : "pre" %]>
[% Hook.process('a_comment-end', 'bug/comments.html.tmpl') %]
</div>
+ [% END %]
[% END %]