diff options
author | Dexter Morgan <dmorgan@mageia.org> | 2013-02-20 16:07:49 +0000 |
---|---|---|
committer | Colin Guthrie <colin@mageia.org> | 2014-09-15 20:44:40 +0100 |
commit | ba702dcd7ac9b2e6c4d46ad21c7bfacfd6883189 (patch) | |
tree | ece0d9c9d8fa1eff83f8527397da6b2c8c755dd6 /template/en/default/bug/comments.html.tmpl | |
parent | 48a4cb57974b7f1932c3fe31825c02e4dc4ab30c (diff) | |
download | bugzilla-ba702dcd7ac9b2e6c4d46ad21c7bfacfd6883189.tar bugzilla-ba702dcd7ac9b2e6c4d46ad21c7bfacfd6883189.tar.gz bugzilla-ba702dcd7ac9b2e6c4d46ad21c7bfacfd6883189.tar.bz2 bugzilla-ba702dcd7ac9b2e6c4d46ad21c7bfacfd6883189.tar.xz bugzilla-ba702dcd7ac9b2e6c4d46ad21c7bfacfd6883189.zip |
Add 4.0 branch
Diffstat (limited to 'template/en/default/bug/comments.html.tmpl')
-rw-r--r-- | template/en/default/bug/comments.html.tmpl | 93 |
1 files changed, 20 insertions, 73 deletions
diff --git a/template/en/default/bug/comments.html.tmpl b/template/en/default/bug/comments.html.tmpl index 41b91d7..580ba6b 100644 --- a/template/en/default/bug/comments.html.tmpl +++ b/template/en/default/bug/comments.html.tmpl @@ -22,76 +22,8 @@ [% PROCESS bug/time.html.tmpl %] - <script type="text/javascript"> - <!-- - function updateCommentPrivacy(checkbox, id) { - var comment_elem = document.getElementById('comment_text_'+id).parentNode; - if (checkbox.checked) { - if (!comment_elem.className.match('bz_private')) { - comment_elem.className = comment_elem.className.concat(' bz_private'); - } - } - else { - comment_elem.className = - comment_elem.className.replace(/(\s*|^)bz_private(\s*|$)/, '$2'); - } - } - - /* The functions below expand and collapse comments */ - - function toggle_comment_display(link, comment_id) { - var comment = document.getElementById('comment_text_' + comment_id); - var re = new RegExp(/\bcollapsed\b/); - if (comment.className.match(re)) - expand_comment(link, comment); - else - collapse_comment(link, comment); - } - - function toggle_all_comments(action) { - var num_comments = [% comments.size FILTER html %]; - - // If for some given ID the comment doesn't exist, this doesn't mean - // there are no more comments, but that the comment is private and - // the user is not allowed to view it. - - for (var id = 0; id < num_comments; id++) { - var comment = document.getElementById('comment_text_' + id); - if (!comment) - continue; - - var link = document.getElementById('comment_link_' + id); - if (action == 'collapse') - collapse_comment(link, comment); - else - expand_comment(link, comment); - } - } - - function collapse_comment(link, comment) { - link.innerHTML = "[+]"; - link.title = "Expand the comment."; - YAHOO.util.Dom.addClass(comment, 'collapsed'); - } - - function expand_comment(link, comment) { - link.innerHTML = "[-]"; - link.title = "Collapse the comment"; - YAHOO.util.Dom.removeClass(comment, 'collapsed'); - } - - /* This way, we are sure that browsers which do not support JS - * won't display this link */ - - function addCollapseLink(count) { - document.write(' <a href="#" class="bz_collapse_comment"' + - ' id="comment_link_' + count + - '" onclick="toggle_comment_display(this, ' + count + - '); return false;" title="Collapse the comment.">[-]<\/a> '); - } - //--> - </script> - +<script src="[% 'js/comments.js' FILTER mtime %]" type="text/javascript"> +</script> [% DEFAULT start_at = 0 mode = "show" %] [% sort_order = user.settings.comment_sort_order.value %] @@ -133,6 +65,14 @@ [% count = count + increment %] [% END %] +[% IF user.settings.comment_box_position.value == "before_comments" && user.id %] + <div class="bz_add_comment"> + <a href="#" + onclick="return goto_add_comments();"> + Add Comment</a> + </div> +[% END %] + [%# Note: this template is used in multiple places; if you use this hook, # make sure you are aware of this fact. #%] @@ -146,6 +86,11 @@ return false;">Collapse All Comments</a></li> <li><a href="#" onclick="toggle_all_comments('expand'); return false;">Expand All Comments</a></li> + [% IF user.settings.comment_box_position.value == "after_comments" && user.id %] + <li class="bz_add_comment"><a href="#" + onclick="return goto_add_comments('bug_status_bottom');"> + Add Comment</a></li> + [% END %] </ul> [% END %] </td> @@ -157,8 +102,10 @@ [% BLOCK a_comment %] [% RETURN IF comment.is_private AND ! user.is_insider %] + [% comment_text = comment.body_full({ wrap => 1 }) %] + [% RETURN IF comment_text == '' AND (comment.work_time - 0) != 0 AND !user.is_timetracker %] - <div class="bz_comment[% " bz_private" IF comment.is_private %] + <div id="c[% count %]" class="bz_comment[% " bz_private" IF comment.is_private %] [% " bz_comment_hilite" IF marks.$count %] [% " bz_first_comment" IF count == description %]"> [% IF count == description %] @@ -194,7 +141,7 @@ [% END %] <span class="bz_comment_number"> - <a name="c[% count %]" + <a href="show_bug.cgi?id=[% bug.bug_id %]#c[% count %]"> [%- comment_label FILTER html %]</a> </span> @@ -229,7 +176,7 @@ #%] <pre class="bz_comment_text" [% ' id="comment_text_' _ count _ '"' IF mode == "edit" %]> - [%- comment.body_full({ wrap => 1 }) FILTER quoteUrls(bug, comment) -%] + [%- comment_text FILTER quoteUrls(bug, comment) -%] </pre> </div> [% END %] |