Commit 9c1ee9e4 authored by Hugo Seabrook's avatar Hugo Seabrook Committed by Frédéric Buclin

Bug 827983: "[reply]" link besides the original description will insert ("in…

Bug 827983: "[reply]" link besides the original description will insert ("in reply to comment #N+1") when the comments order is "Newest to Oldest, but keep Descritption at the top" r/a=LpSolit
parent b8fcea9b
...@@ -55,34 +55,15 @@ ...@@ -55,34 +55,15 @@
[% sort_order = "oldest_to_newest" %] [% sort_order = "oldest_to_newest" %]
[% END %] [% END %]
[%# Set up the variables as needed, depending on the sort order %]
[% IF sort_order == "oldest_to_newest" %]
[% count = 0 %]
[% description = 0 %]
[% increment = 1 %]
[% ELSE %]
[% increment = -1 %]
[% IF sort_order == "newest_to_oldest" %]
[% count = comments.size - 1 %]
[% description = 0 %]
[% ELSIF sort_order == "newest_to_oldest_desc_first" %]
[% count = comments.size %]
[% description = comments.size %]
[% END %]
[% END %]
<!-- This auto-sizes the comments and positions the collapse/expand links <!-- This auto-sizes the comments and positions the collapse/expand links
to the right. --> to the right. -->
<table class="bz_comment_table" cellpadding="0" cellspacing="0"><tr> <table class="bz_comment_table" cellpadding="0" cellspacing="0"><tr>
<td> <td>
[% FOREACH comment = comments %] [% FOREACH comment = comments %]
[% IF count >= start_at %] [% IF comment.count >= start_at %]
[% PROCESS a_comment %] [% PROCESS a_comment %]
[% END %] [% END %]
[% count = count + increment %]
[% END %] [% END %]
[% IF mode == "edit" && user.id [% IF mode == "edit" && user.id
...@@ -126,15 +107,15 @@ ...@@ -126,15 +107,15 @@
[% comment_text = comment.body_full %] [% comment_text = comment.body_full %]
[% RETURN IF comment_text == '' AND (comment.work_time - 0) != 0 AND !user.is_timetracker %] [% RETURN IF comment_text == '' AND (comment.work_time - 0) != 0 AND !user.is_timetracker %]
<div id="c[% count %]" class="bz_comment[% " bz_private" IF comment.is_private %] <div id="c[% comment.count %]" class="bz_comment[% " bz_private" IF comment.is_private %]
[% " bz_comment_hilite" IF marks.$count %] [% " bz_comment_hilite" IF marks.${comment.count} %]
[% " bz_first_comment" IF count == description %]"> [% " bz_first_comment" IF comment.count == 0 %]">
[% IF count == description %] [% IF comment.count == 0 %]
[% class_name = "bz_first_comment_head" %] [% class_name = "bz_first_comment_head" %]
[% comment_label = "Description" %] [% comment_label = "Description" %]
[% ELSE %] [% ELSE %]
[% class_name = "bz_comment_head" %] [% class_name = "bz_comment_head" %]
[% comment_label = "Comment " _ count %] [% comment_label = "Comment " _ comment.count %]
[% END %] [% END %]
<div class="[% class_name FILTER html %]"> <div class="[% class_name FILTER html %]">
...@@ -144,12 +125,12 @@ ...@@ -144,12 +125,12 @@
[% IF bug.check_can_change_field('longdesc', 0, 1) %] [% IF bug.check_can_change_field('longdesc', 0, 1) %]
[<a class="bz_reply_link" href="#add_comment" [<a class="bz_reply_link" href="#add_comment"
[% IF user.settings.quote_replies.value != 'off' %] [% IF user.settings.quote_replies.value != 'off' %]
onclick="replyToComment('[% count %]', '[% comment.id %]', '[% comment.author.name || comment.author.nick FILTER html FILTER js %]'); return false;" onclick="replyToComment('[% comment.count %]', '[% comment.id %]', '[% comment.author.name || comment.author.nick FILTER html FILTER js %]'); return false;"
[% END %] [% END %]
>reply</a>] >reply</a>]
[% END %] [% END %]
<script type="text/javascript"><!-- <script type="text/javascript"><!--
addCollapseLink([% count %], 'Toggle comment display'); // --> addCollapseLink([% comment.count %], 'Toggle comment display'); // -->
</script> </script>
</span> </span>
[% END %] [% END %]
...@@ -161,7 +142,7 @@ ...@@ -161,7 +142,7 @@
<input type="checkbox" <input type="checkbox"
name="isprivate_[% comment.id %]" value="1" name="isprivate_[% comment.id %]" value="1"
id="isprivate_[% comment.id %]" id="isprivate_[% comment.id %]"
onClick="updateCommentPrivacy(this, [% count %])" onClick="updateCommentPrivacy(this, [% comment.count %])"
[% " checked=\"checked\"" IF comment.is_private %]> [% " checked=\"checked\"" IF comment.is_private %]>
<label for="isprivate_[% comment.id %]">Private</label> <label for="isprivate_[% comment.id %]">Private</label>
</div> </div>
...@@ -169,7 +150,7 @@ ...@@ -169,7 +150,7 @@
<span class="bz_comment_number"> <span class="bz_comment_number">
<a <a
href="show_bug.cgi?id=[% bug.bug_id %]#c[% count %]"> href="show_bug.cgi?id=[% bug.bug_id %]#c[% comment.count %]">
[%- comment_label FILTER html %]</a> [%- comment_label FILTER html %]</a>
</span> </span>
...@@ -208,7 +189,7 @@ ...@@ -208,7 +189,7 @@
# generated HTML # generated HTML
#%] #%]
<pre class="bz_comment_text" <pre class="bz_comment_text"
[% ' id="comment_text_' _ count _ '"' IF mode == "edit" %]> [% ' id="comment_text_' _ comment.count _ '"' IF mode == "edit" %]>
[%- comment_text FILTER quoteUrls(bug, comment) -%] [%- comment_text FILTER quoteUrls(bug, comment) -%]
</pre> </pre>
</div> </div>
......
...@@ -199,6 +199,7 @@ ...@@ -199,6 +199,7 @@
'bug/comments.html.tmpl' => [ 'bug/comments.html.tmpl' => [
'comment.id', 'comment.id',
'comment.count',
'bug.bug_id', 'bug.bug_id',
], ],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment