From: Robert Webb Date: Sat, 19 Nov 2011 00:06:38 +0000 (-0800) Subject: Bug 685363 - Add a sightings table to the show bug page X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0485d60a6dffd17e6b729122f7847fae43eb93b6;p=thirdparty%2Fbugzilla.git Bug 685363 - Add a sightings table to the show bug page r=mkanat, a=mkanat --- diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm index 91d1c72844..894f50eeb3 100644 --- a/Bugzilla/Bug.pm +++ b/Bugzilla/Bug.pm @@ -3375,6 +3375,13 @@ sub comments { return \@comments; } +sub master_bug { + my $self = shift; + return undef if $self->{'error'}; + $self->{'master_bug_obj'} ||= new Bugzilla::Bug($self->master_bug_id); + return $self->{'master_bug_obj'}; +} + sub new_bug_statuses { my ($class, $product) = @_; my $user = Bugzilla->user; diff --git a/skins/standard/global.css b/skins/standard/global.css index e8336d5c1d..b2c36e9599 100644 --- a/skins/standard/global.css +++ b/skins/standard/global.css @@ -409,19 +409,28 @@ dl dl > dt { white-space: normal !important; } -/* Style of the attachment table and time tracking table */ -#attachment_table { +/* Style of the attachment table, sightings table and time tracking table */ +#attachment_table, #sighting_table { border-collapse: collapse; border: 1px solid #333333; + margin: 2ex 0; } -#attachment_table th, .bz_attach_footer, .bz_time_tracking_table th { +#attachment_table th, .bz_attach_footer, .bz_sighting_table th, +.bz_sighting_footer, .bz_time_tracking_table th { background-color: #E0E0E0; color: black; + padding: 0.5em; } -#attachment_table td, .bz_time_tracking_table th, .bz_time_tracking_table td { +#attachment_table td, .bz_sighting_table th, .bz_sighting_table td, +.bz_time_tracking_table th, .bz_time_tracking_table td { border: 1px solid #333333; + padding: 0.5em; +} + +#sighting_table td { + text-align: center; } .bz_attach_extra_info { diff --git a/template/en/default/attachment/list.html.tmpl b/template/en/default/attachment/list.html.tmpl index 4ad5e528af..b922e64692 100644 --- a/template/en/default/attachment/list.html.tmpl +++ b/template/en/default/attachment/list.html.tmpl @@ -54,7 +54,6 @@ function toggle_display(link) { //--> -
@@ -167,4 +166,3 @@ function toggle_display(link) {
-
diff --git a/template/en/default/bug/edit.html.tmpl b/template/en/default/bug/edit.html.tmpl index 75c263e68c..3730218e1a 100644 --- a/template/en/default/bug/edit.html.tmpl +++ b/template/en/default/bug/edit.html.tmpl @@ -138,6 +138,12 @@ + <[% tag %]> + [% target.bug_id FILTER bug_link(target) FILTER none %] + + <[% tag %]> + [% PROCESS bug/status.html.tmpl %] + + +[% END %]
+ [%# *** Sightings *** %] + + [% PROCESS sighting/list.html.tmpl + bug = bug + %] + [% IF user.is_timetracker %] [% PROCESS section_timetracking %] [% END %] @@ -328,13 +334,7 @@ - [% display_value("bug_status", bug.bug_status) FILTER html %] - [% IF bug.resolution %] - [%+ display_value("resolution", bug.resolution) FILTER html %] - [% IF bug.dup_id %] - of [% "${terms.bug} ${bug.dup_id}" FILTER bug_link(bug.dup_id) FILTER none %] - [% END %] - [% END %] + [% PROCESS bug/status.html.tmpl target = bug %] [% IF bug.user.canedit || bug.user.isreporter %] (edit) diff --git a/template/en/default/bug/status.html.tmpl b/template/en/default/bug/status.html.tmpl new file mode 100644 index 0000000000..a624ccc094 --- /dev/null +++ b/template/en/default/bug/status.html.tmpl @@ -0,0 +1,30 @@ +[%# The contents of this file are subject to the Mozilla Public + # License Version 1.1 (the "License"); you may not use this file + # except in compliance with the License. You may obtain a copy of + # the License at http://www.mozilla.org/MPL/ + # + # Software distributed under the License is distributed on an "AS + # IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + # implied. See the License for the specific language governing + # rights and limitations under the License. + # + # The Original Code is the Bugzilla Bug Tracking System. + # + # The Initial Developer of the Original Code is Riverbed Technology + # Portions created by the Initial Developer are Copyright (C) 2011 the + # Initial Developer. All Rights Reserved. + # + # Contributor(s): Robert Webb + #%] + +[%# INTERFACE: + # target: Bugzila::Bug; the bug to render the status of. + #%] + +[% display_value("bug_status", target.bug_status) FILTER html %] +[% IF target.resolution %] + [%+ display_value("resolution", target.resolution) FILTER html %] + [% IF target.dup_id %] + of [% "${terms.bug} ${target.dup_id}" FILTER bug_link(target.dup_id) FILTER none %] + [% END %] +[% END %] diff --git a/template/en/default/global/field-descs.none.tmpl b/template/en/default/global/field-descs.none.tmpl index 58fa688e61..1651c8aa63 100644 --- a/template/en/default/global/field-descs.none.tmpl +++ b/template/en/default/global/field-descs.none.tmpl @@ -130,6 +130,7 @@ "setting" => "Setting", "settings" => "Settings", "short_desc" => "Summary", + "sighting" => "Sighting", "status_whiteboard" => "Whiteboard", "tag.name" => "Tags", "target_milestone" => "Target Milestone", diff --git a/template/en/default/sighting/list.html.tmpl b/template/en/default/sighting/list.html.tmpl new file mode 100644 index 0000000000..a8cf20a5a3 --- /dev/null +++ b/template/en/default/sighting/list.html.tmpl @@ -0,0 +1,59 @@ +[%# The contents of this file are subject to the Mozilla Public + # License Version 1.1 (the "License"); you may not use this file + # except in compliance with the License. You may obtain a copy of + # the License at http://www.mozilla.org/MPL/ + # + # Software distributed under the License is distributed on an "AS + # IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + # implied. See the License for the specific language governing + # rights and limitations under the License. + # + # The Original Code is the Bugzilla Bug Tracking System. + # + # The Initial Developer of the Original Code is Riverbed Technology + # Portions created by the Initial Developer are Copyright (C) 2011 the + # Initial Developer. All Rights Reserved. + # + # Contributor(s): Robert Webb + #%] + +[%# INTERFACE: + # bug: Bugzila::Bug; the master bug of the sightings to list. + #%] + +[% master_bug = bug %] +[% IF bug.master_bug_id %] + [% master_bug = bug.master_bug %] +[% END %] + +[% sightings = master_bug.sightings %] +[% IF sightings.size == 0 %] + [% RETURN %] +[% END %] + + + + + + + [% PROCESS render_sighting_row target = master_bug tag = "th" %] + + [% FOREACH sighting = sightings %] + [% PROCESS render_sighting_row target = sighting tag = "td" %] + [% END %] +
+ [% field_descs.sighting FILTER html %] + + [% field_descs.bug_status FILTER html %] +
+ +[% BLOCK render_sighting_row %] +