summaryrefslogtreecommitdiffstats
path: root/template/en/default/bug
diff options
context:
space:
mode:
authorByron Jones <bjones@mozilla.com>2013-12-10 21:30:11 +0100
committerByron Jones <bjones@mozilla.com>2013-12-10 21:30:11 +0100
commit7d33443002e5da146e506f92600ff456571ac84a (patch)
tree79b24d20c409ae8ae2b926fe3eac90a9f47a363d /template/en/default/bug
parentf21a2d3506d4c4913d0d0a8c1134188a85b76562 (diff)
downloadbugzilla-7d33443002e5da146e506f92600ff456571ac84a.tar.gz
bugzilla-7d33443002e5da146e506f92600ff456571ac84a.tar.xz
Bug 942725: backport bug 793963 to bmo (add the ability to tag comments with arbitrary tags)
Diffstat (limited to 'template/en/default/bug')
-rw-r--r--template/en/default/bug/comments.html.tmpl54
-rw-r--r--template/en/default/bug/edit.html.tmpl25
-rw-r--r--template/en/default/bug/show-header.html.tmpl3
3 files changed, 68 insertions, 14 deletions
diff --git a/template/en/default/bug/comments.html.tmpl b/template/en/default/bug/comments.html.tmpl
index 773e6a485..e0226257e 100644
--- a/template/en/default/bug/comments.html.tmpl
+++ b/template/en/default/bug/comments.html.tmpl
@@ -133,10 +133,13 @@
<td>
[% IF mode == "edit" %]
<ul class="bz_collapse_expand_comments">
- <li><a href="#" onclick="toggle_all_comments('collapse');
+ <li><a href="#" onclick="toggle_all_comments('collapse');
return false;">Collapse All Comments</a></li>
<li><a href="#" onclick="toggle_all_comments('expand');
return false;">Expand All Comments</a></li>
+ [% IF Param('comment_taggers_group') %]
+ <li><div id="comment_tags_collapse_expand_container"></div></li>
+ [% END %]
</ul>
[% END %]
</td>
@@ -151,15 +154,15 @@
[% comment_text = comment.body_full %]
[% 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 %]
- [% " bz_comment_hilite" IF marks.$count %]
- [% " bz_first_comment" IF count == description %]">
- [% IF count == description %]
+ <div id="c[% comment.count %]" class="bz_comment[% " bz_private" IF comment.is_private %]
+ [% " bz_comment_hilite" IF marks.${comment.count} %]
+ [% " bz_first_comment" IF comment.count == description %]">
+ [% IF comment.count == 0 %]
[% class_name = "bz_first_comment_head" %]
[% comment_label = "Description" %]
[% ELSE %]
[% class_name = "bz_comment_head" %]
- [% comment_label = "Comment " _ count %]
+ [% comment_label = "Comment " _ comment.count %]
[% END %]
<div class="[% class_name FILTER html %]">
@@ -168,17 +171,21 @@
<span class="bz_comment_actions">
[% IF comment_text.search("(?:^>|\n>)") %]
[<a class="bz_wrap_link" href="#"
- onclick="return toggleCommentWrap(this, [% count %])">wrap</a>]
+ onclick="return toggleCommentWrap(this, [% comment.count %])">wrap</a>]
[% END %]
[% IF bug.check_can_change_field('longdesc', 1, 0) %]
+ [% IF user.can_tag_comments %]
+ [<a href="#"
+ onclick="YAHOO.bugzilla.commentTagging.toggle([% comment.id %], [% comment.count %]);return false">tag</a>]
+ [% END %]
[<a class="bz_reply_link" href="#add_comment"
[% 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 %]
>reply</a>]
[% END %]
- <script type="text/javascript"><!--
- addCollapseLink([% count %], 'Toggle comment display'); // -->
+ <script type="text/javascript">
+ addCollapseLink([% comment.count %], [% comment.collapsed FILTER js %], 'Toggle comment display');
</script>
</span>
[% END %]
@@ -190,7 +197,7 @@
<input type="checkbox"
name="isprivate_[% comment.id %]" value="1"
id="isprivate_[% comment.id %]"
- onClick="updateCommentPrivacy(this, [% count %])"
+ onClick="updateCommentPrivacy(this, [% comment.count %])"
[% " checked=\"checked\"" IF comment.is_private %]>
<label for="isprivate_[% comment.id %]">Private</label>
</div>
@@ -198,7 +205,7 @@
<span class="bz_comment_number">
<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>
</span>
@@ -236,11 +243,30 @@
[% PROCESS formattimeunit time_unit=comment.work_time %]
[% END %]
+ [% IF user.id && Param('comment_taggers_group') %]
+ <div id="comment_tag_[% comment.count FILTER html %]"
+ class="bz_comment_tags[% " collapsed" IF comment.collapsed %]
+ [% " bz_default_hidden" UNLESS comment.tags.size %]">
+ <span id="ct_[% comment.count %]">
+ [% IF comment.tags.size %]
+ <script>
+ YAHOO.bugzilla.commentTagging.showTags([% comment.id FILTER none %],
+ [% comment.count FILTER none %], [
+ [% FOREACH tag = comment.tags %]
+ [%~%]'[% tag FILTER js %]'[% "," UNLESS loop.last %]
+ [% END %]
+ [%~%]]);
+ </script>
+ [% END %]
+ </span>
+ </div>
+ [% END %]
+
[%# Don't indent the <pre> block, since then the spaces are displayed in the
# generated HTML
#%]
-<pre class="bz_comment_text"
- [% ' id="comment_text_' _ count _ '"' IF mode == "edit" %]>
+<pre class="bz_comment_text[% " collapsed" IF comment.collapsed %]"
+ [% ' id="comment_text_' _ comment.count _ '"' IF mode == "edit" %]>
[%- comment_text FILTER quoteUrls(bug, comment) -%]
</pre>
</div>
diff --git a/template/en/default/bug/edit.html.tmpl b/template/en/default/bug/edit.html.tmpl
index 696d0739f..fb596f7a7 100644
--- a/template/en/default/bug/edit.html.tmpl
+++ b/template/en/default/bug/edit.html.tmpl
@@ -30,6 +30,31 @@
[% PROCESS bug/time.html.tmpl %]
+[% IF Param('comment_taggers_group') %]
+ [% IF user.can_tag_comments %]
+ <div id="bz_ctag_div" class="bz_default_hidden">
+ <a href="javascript:void(0)" onclick="YAHOO.bugzilla.commentTagging.hideInput()">x</a>
+ <div>
+ <input id="bz_ctag_add" size="10" placeholder="add tag"
+ maxlength="[% constants.MAX_COMMENT_TAG_LENGTH FILTER html %]">
+ <span id="bz_ctag_autocomp"></span>
+ </div>
+ &nbsp;
+ </div>
+ <div id="bz_ctag_error" class="bz_default_hidden">
+ <a href="javascript:void(0)" onclick="YAHOO.bugzilla.commentTagging.hideError()">x</a>
+ <span id="bz_ctag_error_msg"></span>
+ </div>
+ [% END %]
+ [% IF user.id %]
+ <script type="text/javascript">
+ YAHOO.bugzilla.commentTagging.init([% user.can_tag_comments ? 'true' : 'false' %]);
+ YAHOO.bugzilla.commentTagging.min_len = [% constants.MIN_COMMENT_TAG_LENGTH FILTER js %];
+ YAHOO.bugzilla.commentTagging.max_len = [% constants.MAX_COMMENT_TAG_LENGTH FILTER js %];
+ </script>
+ [% END %]
+[% END %]
+
<script type="text/javascript">
<!--
[% IF user.is_timetracker %]
diff --git a/template/en/default/bug/show-header.html.tmpl b/template/en/default/bug/show-header.html.tmpl
index ee1ecf6d2..9f2127d23 100644
--- a/template/en/default/bug/show-header.html.tmpl
+++ b/template/en/default/bug/show-header.html.tmpl
@@ -39,7 +39,10 @@
[% header = "$terms.Bug&nbsp;$bug.bug_id" %]
[% header_addl_info = "Last modified: $filtered_timestamp" %]
[% yui = ['autocomplete', 'calendar'] %]
+[% yui.push('container') IF user.can_tag_comments %]
[% javascript_urls = [ "js/util.js", "js/field.js" ] %]
+[% javascript_urls.push('js/comment-tagging.js')
+ IF user.id && Param('comment_taggers_group') %]
[% IF bug.defined %]
[% unfiltered_title = "$terms.Bug $bug.bug_id – " %]
[% IF bug.alias != '' %]