diff options
author | Byron Jones <bjones@mozilla.com> | 2012-11-07 08:40:53 +0100 |
---|---|---|
committer | Byron Jones <bjones@mozilla.com> | 2012-11-07 08:40:53 +0100 |
commit | 40f5156e2e047efb2d863181ae7afb02c460d313 (patch) | |
tree | 2c754cf75f59bbbadb81f43e5f031a17509b5a47 /extensions/ShadowBugs/template/en | |
parent | 7cd9fd570d61e316e2398a8b9db274d200d73bc4 (diff) | |
download | bugzilla-40f5156e2e047efb2d863181ae7afb02c460d313.tar.gz bugzilla-40f5156e2e047efb2d863181ae7afb02c460d313.tar.xz |
Bug 801713: implement "bug shadowing" feature
Diffstat (limited to 'extensions/ShadowBugs/template/en')
6 files changed, 145 insertions, 0 deletions
diff --git a/extensions/ShadowBugs/template/en/default/hook/bug/comments-aftercomments.html.tmpl b/extensions/ShadowBugs/template/en/default/hook/bug/comments-aftercomments.html.tmpl new file mode 100644 index 000000000..d8dae521a --- /dev/null +++ b/extensions/ShadowBugs/template/en/default/hook/bug/comments-aftercomments.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 is_shadow_bug %] + +[% public_bug = bug.cf_shadow_bug_obj %] +[% count = 0 %] +[% FOREACH comment = shadow_comments %] + [% IF count >= start_at %] + [% PROCESS a_comment %] + [% END %] + [% count = count + increment %] +[% END %] + +[% BLOCK a_comment %] + [% RETURN IF comment.is_private AND NOT (user.is_insider || user.id == comment.author.id) %] + [% comment_text = comment.body_full %] + [% RETURN IF comment_text == '' %] + + <div id="pc[% count %]" class="bz_comment[% " bz_private" IF comment.is_private %] + shadow_bug_comment bz_default_hidden + [% " bz_first_comment" IF count == description %]"> + [% IF count == description %] + [% class_name = "bz_first_comment_head" %] + [% comment_label = "Public Description" %] + [% ELSE %] + [% class_name = "bz_comment_head" %] + [% comment_label = "Public Comment " _ count %] + [% END %] + + <div class="[% class_name FILTER html %]"> + <span class="bz_comment_number"> + <a href="show_bug.cgi?id=[% public_bug.bug_id FILTER none %]#c[% count %]"> + [%- comment_label FILTER html %]</a> + </span> + + <span class="bz_comment_user"> + [% commenter_id = comment.author.id %] + [% UNLESS user_cache.$commenter_id %] + [% user_cache.$commenter_id = BLOCK %] + [% INCLUDE global/user.html.tmpl who = comment.author %] + [% END %] + [% END %] + [% user_cache.$commenter_id FILTER none %] + [% Hook.process('user', 'bug/comments.html.tmpl') %] + </span> + + <span class="bz_comment_user_images"> + [% FOREACH group = comment.author.groups_with_icon %] + <img src="[% group.icon_url FILTER html %]" + alt="[% group.name FILTER html %]" + title="[% group.name FILTER html %] - [% group.description FILTER html %]"> + [% END %] + </span> + + <span class="bz_comment_time"> + [%+ comment.creation_ts FILTER time %] + </span> + </div> + +<pre class="bz_comment_text"> + [%- comment_text FILTER quoteUrls(public_bug, comment) -%] +</pre> + </div> +[% END %] diff --git a/extensions/ShadowBugs/template/en/default/hook/bug/edit-after_comment_textarea.html.tmpl b/extensions/ShadowBugs/template/en/default/hook/bug/edit-after_comment_textarea.html.tmpl new file mode 100644 index 000000000..9873ea3d7 --- /dev/null +++ b/extensions/ShadowBugs/template/en/default/hook/bug/edit-after_comment_textarea.html.tmpl @@ -0,0 +1,13 @@ +[%# 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 is_shadow_bug %] + +<br> +<a href="show_bug.cgi?id=[% bug.cf_shadow_bug FILTER none %]#comment">Add public comment</a> + diff --git a/extensions/ShadowBugs/template/en/default/hook/bug/edit-after_custom_fields.html.tmpl b/extensions/ShadowBugs/template/en/default/hook/bug/edit-after_custom_fields.html.tmpl new file mode 100644 index 000000000..8e8327ef2 --- /dev/null +++ b/extensions/ShadowBugs/template/en/default/hook/bug/edit-after_custom_fields.html.tmpl @@ -0,0 +1,27 @@ +[%# 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 IF Bugzilla.is_cf_shadow_bug_hidden(bug) %] +[% field = Bugzilla.process_cache.shadow_bug_field %] +[% shadowed_by = bug.related_bugs(field).pop %] +<tr> + [% IF shadowed_by && user.can_see_bug(shadowed_by) %] + <th class="field_label"> + [% field.reverse_desc FILTER html %]: + </th> + <td> + [% shadowed_by.id FILTER bug_link(shadowed_by, use_alias => 1) FILTER none %][% " " %] + </td> + [% ELSE %] + [% PROCESS bug/field.html.tmpl + value = bug.cf_shadow_bug + editable = bug.check_can_change_field(field.name, 0, 1) + no_tds = false + value_span = 2 %] + [% END %] +</tr> diff --git a/extensions/ShadowBugs/template/en/default/hook/bug/edit-custom_field.html.tmpl b/extensions/ShadowBugs/template/en/default/hook/bug/edit-custom_field.html.tmpl new file mode 100644 index 000000000..4389b27ad --- /dev/null +++ b/extensions/ShadowBugs/template/en/default/hook/bug/edit-custom_field.html.tmpl @@ -0,0 +1,9 @@ +[%# 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. + #%] + +[% field.hidden = field.name == 'cf_shadow_bug' %] diff --git a/extensions/ShadowBugs/template/en/default/hook/bug/show-header-end.html.tmpl b/extensions/ShadowBugs/template/en/default/hook/bug/show-header-end.html.tmpl new file mode 100644 index 000000000..5786b3df6 --- /dev/null +++ b/extensions/ShadowBugs/template/en/default/hook/bug/show-header-end.html.tmpl @@ -0,0 +1,12 @@ +[%# 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. + #%] + +[% IF is_shadow_bug %] + [% style_urls.push('extensions/ShadowBugs/web/style.css') %] + [% javascript_urls.push('extensions/ShadowBugs/web/shadow-bugs.js') %] +[% END %] diff --git a/extensions/ShadowBugs/template/en/default/hook/global/user-error-errors.html.tmpl b/extensions/ShadowBugs/template/en/default/hook/global/user-error-errors.html.tmpl new file mode 100644 index 000000000..775a7721e --- /dev/null +++ b/extensions/ShadowBugs/template/en/default/hook/global/user-error-errors.html.tmpl @@ -0,0 +1,14 @@ +[%# 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. + #%] + +[% IF error == 'illegal_shadow_bug_public' %] + [% title = "Invalid Shadow " _ terms.Bug %] + You cannot shadow [% terms.bug %] [%+ id FILTER html %] because it is not a + public [% terms.bug %]. +[% END %] + |