summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Lawrence <dlawrence@mozilla.com>2014-01-20 07:07:09 +0100
committerDave Lawrence <dlawrence@mozilla.com>2014-01-20 07:07:09 +0100
commit74de7ef88ebcf091dc4d2122c6baa9611ab9f7e0 (patch)
treedff3be13ab2da5fc2dcb09ac52d1d7a3da72c276
parent98a6885065b7e53e9b8ec2e402ef24924801723f (diff)
downloadbugzilla-74de7ef88ebcf091dc4d2122c6baa9611ab9f7e0.tar.gz
bugzilla-74de7ef88ebcf091dc4d2122c6baa9611ab9f7e0.tar.xz
Bug 958335 - Add comment button to user story field
r=glob
-rw-r--r--extensions/UserStory/template/en/default/hook/bug/comments-comment_banner.html.tmpl19
-rw-r--r--extensions/UserStory/web/style/user_story.css15
2 files changed, 34 insertions, 0 deletions
diff --git a/extensions/UserStory/template/en/default/hook/bug/comments-comment_banner.html.tmpl b/extensions/UserStory/template/en/default/hook/bug/comments-comment_banner.html.tmpl
index 0f5c0bcd6..a0240471d 100644
--- a/extensions/UserStory/template/en/default/hook/bug/comments-comment_banner.html.tmpl
+++ b/extensions/UserStory/template/en/default/hook/bug/comments-comment_banner.html.tmpl
@@ -10,6 +10,18 @@
[% can_edit_story = bug.check_can_change_field('cf_user_story', 0, 1) %]
<div class="user_story">
+ <script type="text/javascript">
+ function userStoryComment() {
+ var commenttext = "(Commenting on User Story)\n";
+ var text_elem = document.getElementById('user_story');
+ var commenttext = commenttext + wrapReplyText(text_elem.value);
+ var textarea = document.getElementById('comment');
+ if (textarea.value != commenttext) {
+ textarea.value += commenttext;
+ }
+ textarea.focus();
+ }
+ </script>
<div id="user_story_header">
<b>User Story</b>
[% IF can_edit_story %]
@@ -17,6 +29,13 @@
(<a href="javascript:void(0)" id="user_story_edit_action" >edit</a>)
</span>
[% END %]
+ [% IF bug.cf_user_story != "" %]
+ <span id="user_story_comment">
+ [<a class="bz_reply_link" href="#user_story_comment"
+ onclick="userStoryComment(); return false;"
+ >comment</a>]
+ </span>
+ [% END %]
</div>
[% IF bug.cf_user_story != "" %]
diff --git a/extensions/UserStory/web/style/user_story.css b/extensions/UserStory/web/style/user_story.css
index 51affd359..f1a457f75 100644
--- a/extensions/UserStory/web/style/user_story.css
+++ b/extensions/UserStory/web/style/user_story.css
@@ -5,6 +5,21 @@
* This Source Code Form is "Incompatible With Secondary Licenses", as
* defined by the Mozilla Public License, v. 2.0. */
+.user_story {
+ width: 50em;
+}
+
+.skin-Mozilla .user_story {
+ width: 65em;
+}
+
+textarea#user_story {
+ width: 100%;
+}
+
+#user_story_comment {
+ float: right;
+}
#user_story_readonly {
border: 1px solid black;