summaryrefslogtreecommitdiffstats
path: root/template/en/default/bug
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2005-04-09 09:37:50 +0200
committerlpsolit%gmail.com <>2005-04-09 09:37:50 +0200
commit61898d18479013cfbcc820ff25f39377db071536 (patch)
treeb575fb4c72da32a5b641e9bad1fafd9499c5e9c1 /template/en/default/bug
parent940a96d61b436ebc94de8023395ddbbc0d9c7272 (diff)
downloadbugzilla-61898d18479013cfbcc820ff25f39377db071536.tar.gz
bugzilla-61898d18479013cfbcc820ff25f39377db071536.tar.xz
Bug 199048: Preference option to reverse sort the comments stack - Patch by Shane H. W. Travis <shane.h.w.travis@gmail.com> r=mkanat a=myk
Diffstat (limited to 'template/en/default/bug')
-rw-r--r--template/en/default/bug/comments.html.tmpl51
-rw-r--r--template/en/default/bug/edit.html.tmpl13
2 files changed, 46 insertions, 18 deletions
diff --git a/template/en/default/bug/comments.html.tmpl b/template/en/default/bug/comments.html.tmpl
index 7a9dfb4ef..58eaa376c 100644
--- a/template/en/default/bug/comments.html.tmpl
+++ b/template/en/default/bug/comments.html.tmpl
@@ -18,21 +18,48 @@
#
# Contributor(s): Gervase Markham <gerv@gerv.net>
# Maxwell Kanat-Alexander <mkanat@kerio.com>
+ # Shane H. W. Travis <travis@sedsystems.ca>
#%]
+[% PROCESS bug/time.html.tmpl %]
+
[% DEFAULT start_at = 0 mode = "show" %]
-[% count = 0 %]
[% isinsider = Param("insidergroup") && UserInGroup(Param("insidergroup")) %]
+[% sort_order = user.settings.comment_sort_order.value %]
+
+[%# 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.
+ %]
+[% IF (start_at > 0) %]
+ [% sort_order = "oldest_to_newest" %]
+[% 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 %]
+
+
[% FOREACH comment = comments %]
[% IF count >= start_at %]
[% PROCESS a_comment %]
[% END %]
- [% count = count + 1 %]
+ [% count = count + increment %]
[% END %]
-[% PROCESS bug/time.html.tmpl %]
-
[%# Note: this template is used in multiple places; if you use this hook,
# make sure you are aware of this fact.
#%]
@@ -46,7 +73,21 @@
[% IF NOT comment.isprivate || isinsider %]
<div [% "class=\"bz_private\" " IF comment.isprivate %]
[% "class=\"bz_comment_hilite\" " IF marks.$count %]>
- [% IF count > 0 %]
+ [% IF count == description %]
+ <table>
+ <tr>
+ <td align="left">
+ <b><a name="c0" href="#c0">Description</a>:</b>&nbsp;&nbsp;<script
+ type="text/javascript"><!--
+ addReplyLink(0);
+ //--></script>
+ </td>
+ <td align="left" width="30%">
+ Opened: [% bug.creation_ts FILTER time %]
+ </td>
+ </tr>
+ </table>
+ [% ELSE %]
<br>
<span class="bz_comment">
------- <i>Comment
diff --git a/template/en/default/bug/edit.html.tmpl b/template/en/default/bug/edit.html.tmpl
index 86fb4c6b6..d15cf9102 100644
--- a/template/en/default/bug/edit.html.tmpl
+++ b/template/en/default/bug/edit.html.tmpl
@@ -566,19 +566,6 @@
[%# *** Additional Comments *** %]
<hr>
-<table>
- <tr>
- <td align="left">
- <b><a name="c0" href="#c0">Description</a>:</b>&nbsp;&nbsp;<script
- type="text/javascript"><!--
- addReplyLink(0);
- //--></script>
- </td>
- <td align="right" width="100%">
- Opened: [% bug.creation_ts FILTER time %]
- </td>
- </tr>
-</table>
[% PROCESS bug/comments.html.tmpl
comments = bug.longdescs