aboutsummaryrefslogtreecommitdiffstats
path: root/template/en/default/bug
diff options
context:
space:
mode:
authorByron Jones <bjones@mozilla.com>2014-02-13 13:45:42 +0800
committerByron Jones <bjones@mozilla.com>2014-02-13 13:45:42 +0800
commitadceb1cda6441d2969ed5a3d6d45add6f33c6df7 (patch)
treeb97e5509c54029d6cb5d1873ba83c02da93c0e6b /template/en/default/bug
parenta7ca86321e295e6df44386826aee90deca50ba20 (diff)
downloadbugs-adceb1cda6441d2969ed5a3d6d45add6f33c6df7.tar
bugs-adceb1cda6441d2969ed5a3d6d45add6f33c6df7.tar.gz
bugs-adceb1cda6441d2969ed5a3d6d45add6f33c6df7.tar.bz2
bugs-adceb1cda6441d2969ed5a3d6d45add6f33c6df7.tar.xz
bugs-adceb1cda6441d2969ed5a3d6d45add6f33c6df7.zip
Bug 40896: Bugzilla needs a "preview" mode for comments
r=gerv, a=justdave
Diffstat (limited to 'template/en/default/bug')
-rw-r--r--template/en/default/bug/comment.html.tmpl36
-rw-r--r--template/en/default/bug/create/create.html.tmpl4
-rw-r--r--template/en/default/bug/edit.html.tmpl4
3 files changed, 38 insertions, 6 deletions
diff --git a/template/en/default/bug/comment.html.tmpl b/template/en/default/bug/comment.html.tmpl
new file mode 100644
index 000000000..1d8cf0b30
--- /dev/null
+++ b/template/en/default/bug/comment.html.tmpl
@@ -0,0 +1,36 @@
+[%# 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.
+ #%]
+
+[%# INTERFACE:
+ #
+ # This template supports the same parameters as global/textarea.html.tmpl
+ # with the exception of "name" and "id", which will always be "comment".
+ #%]
+
+[% IF feature_enabled('jsonrpc') %]
+ <div id="comment_tabs">
+ <div id="comment_tab" class="comment_tab active_comment_tab"
+ onclick="show_comment_edit()">Comment</div>
+ <div id="comment_preview_tab" class="comment_tab"
+ onclick="show_comment_preview([% bug.id FILTER none %])">Preview</div>
+ </div>
+[% END %]
+
+[% INCLUDE global/textarea.html.tmpl
+ name = "comment"
+ id = "comment"
+%]
+<br>
+
+[% IF feature_enabled('jsonrpc') %]
+ <div id="comment_preview" class="bz_default_hidden bz_comment">
+ <div id="comment_preview_loading" class="bz_default_hidden">Generating Preview...</div>
+ <div id="comment_preview_error" class="bz_default_hidden"></div>
+ <pre id="comment_preview_text" class="bz_comment_text"></pre>
+ </div>
+[% END %]
diff --git a/template/en/default/bug/create/create.html.tmpl b/template/en/default/bug/create/create.html.tmpl
index 6adf75102..d372c4d08 100644
--- a/template/en/default/bug/create/create.html.tmpl
+++ b/template/en/default/bug/create/create.html.tmpl
@@ -542,9 +542,7 @@ TUI_hide_default('attachment_text_field');
# by global/textarea.html.tmpl. So we must not escape the comment here. %]
[% comment FILTER none %]
[%- END %]
- [% INCLUDE global/textarea.html.tmpl
- name = 'comment'
- id = 'comment'
+ [% INCLUDE bug/comment.html.tmpl
minrows = 10
maxrows = 25
cols = constants.COMMENT_COLS
diff --git a/template/en/default/bug/edit.html.tmpl b/template/en/default/bug/edit.html.tmpl
index 3b93ebe2b..89b78bc9f 100644
--- a/template/en/default/bug/edit.html.tmpl
+++ b/template/en/default/bug/edit.html.tmpl
@@ -1110,9 +1110,7 @@
<!-- This table keeps the submit button aligned with the box. -->
<table><tr><td>
[% IF bug.check_can_change_field('longdesc', 0, 1) %]
- [% INCLUDE global/textarea.html.tmpl
- name = 'comment'
- id = 'comment'
+ [% INCLUDE bug/comment.html.tmpl
minrows = 10
maxrows = 25
cols = constants.COMMENT_COLS