summaryrefslogtreecommitdiffstats
path: root/extensions/UserStory/template/en/default/hook/bug/comments-comment_banner.html.tmpl
diff options
context:
space:
mode:
Diffstat (limited to 'extensions/UserStory/template/en/default/hook/bug/comments-comment_banner.html.tmpl')
-rw-r--r--extensions/UserStory/template/en/default/hook/bug/comments-comment_banner.html.tmpl70
1 files changed, 70 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
new file mode 100644
index 000000000..a0240471d
--- /dev/null
+++ b/extensions/UserStory/template/en/default/hook/bug/comments-comment_banner.html.tmpl
@@ -0,0 +1,70 @@
+[%# This Source Code Form is subject to the terms of the Mozilla Public
+ # License, v. 2.0. If a copy of the MPL was not distributed with this
+ # file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ #
+ # This Source Code Form is "Incompatible With Secondary Licenses", as
+ # defined by the Mozilla Public License, v. 2.0.
+ #%]
+
+[% RETURN UNLESS bug.user_story_group %]
+[% 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 %]
+ <span id="user_story_edit">
+ (<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 != "" %]
+ <div id="user_story_readonly" class="bz_comment">
+ <pre class="bz_comment_text">
+ [%- bug.cf_user_story FILTER quoteUrls(bug) -%]
+ </pre>
+ </div>
+ [% ELSE %]
+ <br id="user_story_readonly">
+ [% END %]
+
+ [% IF can_edit_story %]
+ <div id="user_story_edit_container" class="bz_default_hidden">
+ [% INCLUDE global/textarea.html.tmpl
+ name = 'cf_user_story'
+ id = 'user_story'
+ minrows = 10
+ maxrows = 10
+ cols = constants.COMMENT_COLS
+ defaultcontent = bug.cf_user_story %]
+ </div>
+ <script type="text/javascript">
+ YAHOO.util.Event.addListener('user_story_edit_action', 'click', function() {
+ YAHOO.util.Dom.addClass('user_story_edit', 'bz_default_hidden');
+ YAHOO.util.Dom.addClass('user_story_readonly', 'bz_default_hidden');
+ YAHOO.util.Dom.removeClass('user_story_edit_container', 'bz_default_hidden');
+ YAHOO.util.Dom.get('user_story').focus();
+ });
+ </script>
+ [% END %]
+</div>