diff options
author | Byron Jones <bjones@mozilla.com> | 2013-11-25 16:21:03 +0800 |
---|---|---|
committer | Byron Jones <bjones@mozilla.com> | 2013-11-25 16:21:03 +0800 |
commit | ba0765bf4dc468815e4fa45509010c0cd675e5b2 (patch) | |
tree | 32d979d1172495770a326f87f294c6f10a1eaa68 /template/en | |
parent | 0aade93cebf4192b240347e092a7e53a62436ea2 (diff) | |
download | bugs-ba0765bf4dc468815e4fa45509010c0cd675e5b2.tar bugs-ba0765bf4dc468815e4fa45509010c0cd675e5b2.tar.gz bugs-ba0765bf4dc468815e4fa45509010c0cd675e5b2.tar.bz2 bugs-ba0765bf4dc468815e4fa45509010c0cd675e5b2.tar.xz bugs-ba0765bf4dc468815e4fa45509010c0cd675e5b2.zip |
Bug 793963: add the ability to tag comments with arbitrary tags
r=dkl, a=glob
Diffstat (limited to 'template/en')
-rw-r--r-- | template/en/default/admin/params/bugfields.html.tmpl | 6 | ||||
-rw-r--r-- | template/en/default/admin/params/groupsecurity.html.tmpl | 3 | ||||
-rw-r--r-- | template/en/default/bug/comments.html.tmpl | 39 | ||||
-rw-r--r-- | template/en/default/bug/edit.html.tmpl | 25 | ||||
-rw-r--r-- | template/en/default/bug/show-header.html.tmpl | 3 | ||||
-rw-r--r-- | template/en/default/global/user-error.html.tmpl | 27 |
6 files changed, 94 insertions, 9 deletions
diff --git a/template/en/default/admin/params/bugfields.html.tmpl b/template/en/default/admin/params/bugfields.html.tmpl index 07b200825..961833d89 100644 --- a/template/en/default/admin/params/bugfields.html.tmpl +++ b/template/en/default/admin/params/bugfields.html.tmpl @@ -41,5 +41,9 @@ "entry form.<br> " _ "You can leave this empty: " _ "$terms.Bugzilla will then use the operating system that the browser " _ - "reports to be running on as the default." } + "reports to be running on as the default.", + + collapsed_comment_tags => "A comma separated list of tags which, when applied " _ + "to comments, will cause them to be collapsed by default", + } %] diff --git a/template/en/default/admin/params/groupsecurity.html.tmpl b/template/en/default/admin/params/groupsecurity.html.tmpl index 7e30f0723..4f0b4919b 100644 --- a/template/en/default/admin/params/groupsecurity.html.tmpl +++ b/template/en/default/admin/params/groupsecurity.html.tmpl @@ -29,6 +29,9 @@ querysharegroup => "The name of the group of users who can share their " _ "saved searches with others.", + comment_taggers_group => "The name of the group of users who can tag comment." _ + " Setting this to empty disables comment tagging.", + debug_group => "The name of the group of users who can view the actual " _ "SQL query generated when viewing $terms.bug lists and reports.", diff --git a/template/en/default/bug/comments.html.tmpl b/template/en/default/bug/comments.html.tmpl index a2fe4e52f..7aa9a34a6 100644 --- a/template/en/default/bug/comments.html.tmpl +++ b/template/en/default/bug/comments.html.tmpl @@ -13,7 +13,7 @@ <script type="text/javascript"> <!-- - /* Adds the reply text to the `comment' textarea */ + /* Adds the reply text to the 'comment' textarea */ function replyToComment(id, real_id, name) { var prefix = "(In reply to " + name + " from comment #" + id + ")\n"; var replytext = ""; @@ -74,15 +74,18 @@ <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 %] [% 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 %] + [% END %] </ul> [% END %] </td> @@ -109,18 +112,21 @@ [% END %] <div class="[% class_name FILTER html %]"> - [% IF mode == "edit" %] <span class="bz_comment_actions"> [% IF bug.check_can_change_field('longdesc', 0, 1) %] + [% 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('[% 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([% comment.count %], 'Toggle comment display'); // --> + <script type="text/javascript"> + addCollapseLink([% comment.count %], [% comment.collapsed FILTER js %], 'Toggle comment display'); </script> </span> [% END %] @@ -175,10 +181,29 @@ [% 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 %]"> + <span id="ct_[% comment.count %]" + class="[% 'bz_default_hidden' UNLESS comment.tags.size %]"> + [% 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" +<pre class="bz_comment_text[% " collapsed" IF comment.collapsed %]" [% ' id="comment_text_' _ comment.count _ '"' IF mode == "edit" %]> [%- comment_text FILTER quoteUrls(bug, comment) -%] </pre> diff --git a/template/en/default/bug/edit.html.tmpl b/template/en/default/bug/edit.html.tmpl index a6857f0d5..202a981ea 100644 --- a/template/en/default/bug/edit.html.tmpl +++ b/template/en/default/bug/edit.html.tmpl @@ -8,6 +8,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> + + </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 1aba5c35a..1061b9014 100644 --- a/template/en/default/bug/show-header.html.tmpl +++ b/template/en/default/bug/show-header.html.tmpl @@ -24,7 +24,10 @@ [% END %] [% title = title _ filtered_desc %] [% 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 %] [% header = "$terms.Bug $bug.bug_id" %] [% header_addl_info = "Last modified: $filtered_timestamp" %] diff --git a/template/en/default/global/user-error.html.tmpl b/template/en/default/global/user-error.html.tmpl index 7ca346188..9ba52f733 100644 --- a/template/en/default/global/user-error.html.tmpl +++ b/template/en/default/global/user-error.html.tmpl @@ -170,6 +170,8 @@ classifications [% ELSIF object == "components" %] components + [% ELSIF object == "comment_tags" %] + comment tags [% ELSIF object == "custom_fields" %] custom fields [% ELSIF object == "field_values" %] @@ -318,6 +320,25 @@ Comments cannot be longer than [%+ constants.MAX_COMMENT_LENGTH FILTER html %] characters. + [% ELSIF error == "comment_tag_disabled" %] + [% title = "Comment Tagging Disabled" %] + The comment tagging is not enabled. + + [% ELSIF error == "comment_tag_invalid" %] + [% title = "Invalid Comment Tag" %] + The comment tag "[% tag FILTER html %]" contains invalid characters or + words. + + [% ELSIF error == "comment_tag_too_long" %] + [% title = "Comment Tag Too Long" %] + Comment tags cannot be longer than + [%+ constants.MAX_COMMENT_TAG_LENGTH FILTER html %] characters. + + [% ELSIF error == "comment_tag_too_short" %] + [% title = "Comment Tag Too Short" %] + Comment tags must be at least + [%+ constants.MIN_COMMENT_TAG_LENGTH FILTER html %] characters. + [% ELSIF error == "auth_classification_not_enabled" %] [% title = "Classification Not Enabled" %] Sorry, classification is not enabled. @@ -1720,9 +1741,13 @@ [% ELSIF error == "tag_name_too_long" %] [% title = "Tag Name Too Long" %] - The tag name must be less than [% constants.MAX_LEN_QUERY_NAME FILTER html %] + The tag must be less than [% constants.MAX_LEN_QUERY_NAME FILTER html %] characters long. + [% ELSIF error == "tag_name_invalid" %] + [% title = "Invalid Tag Name" %] + A tag cannot contain a space or a comma. + [% ELSIF error == "token_does_not_exist" %] [% title = "Token Does Not Exist" %] The token you submitted does not exist, has expired, or has |