diff options
author | Byron Jones <bjones@mozilla.com> | 2014-02-13 06:48:52 +0100 |
---|---|---|
committer | Byron Jones <bjones@mozilla.com> | 2014-02-13 06:48:52 +0100 |
commit | c56d18a3e5c4d022741c6457f5c91122699e482f (patch) | |
tree | 2b18e1d7709f6408021cb63c8b3aef49f20d918f /template/en/default/bug | |
parent | b5ed02725ff4bd4aa4245aa7389130c5935d9c90 (diff) | |
download | bugzilla-c56d18a3e5c4d022741c6457f5c91122699e482f.tar.gz bugzilla-c56d18a3e5c4d022741c6457f5c91122699e482f.tar.xz |
Bug 40896: Bugzilla needs a "preview" mode for comments
Diffstat (limited to 'template/en/default/bug')
-rw-r--r-- | template/en/default/bug/comment.html.tmpl | 36 | ||||
-rw-r--r-- | template/en/default/bug/create/create.html.tmpl | 4 | ||||
-rw-r--r-- | template/en/default/bug/edit.html.tmpl | 4 |
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 b357b3eb0..02256721c 100644 --- a/template/en/default/bug/create/create.html.tmpl +++ b/template/en/default/bug/create/create.html.tmpl @@ -522,9 +522,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 3c2ce47c2..fe6b27bc7 100644 --- a/template/en/default/bug/edit.html.tmpl +++ b/template/en/default/bug/edit.html.tmpl @@ -1156,9 +1156,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 |