]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 685363 - Add a sightings table to the show bug page
authorRobert Webb <rowebb@gmail.com>
Sat, 19 Nov 2011 00:06:38 +0000 (16:06 -0800)
committerMax Kanat-Alexander <mkanat@bugzilla.org>
Sat, 19 Nov 2011 00:06:38 +0000 (16:06 -0800)
r=mkanat, a=mkanat

Bugzilla/Bug.pm
skins/standard/global.css
template/en/default/attachment/list.html.tmpl
template/en/default/bug/edit.html.tmpl
template/en/default/bug/status.html.tmpl [new file with mode: 0644]
template/en/default/global/field-descs.none.tmpl
template/en/default/sighting/list.html.tmpl [new file with mode: 0644]

index 91d1c728440c28af2d8fcc827ccd620285d4e495..894f50eeb3c5846423cac04ad503f32ae89be5be 100644 (file)
@@ -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;
index e8336d5c1d5bc258350a9eccb94d192d00c574a3..b2c36e95999b30cad570fa310ba6c539c0fbff38 100644 (file)
@@ -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 {
index 4ad5e528af1914bf57d80aab2696bff4ba987d52..b922e64692d869842845291bea19e2bc3265f900 100644 (file)
@@ -54,7 +54,6 @@ function toggle_display(link) {
 //-->
 </script>
 
-<br>
 <table id="attachment_table" cellspacing="0" cellpadding="4">
   <tr id="a0">
     <th colspan="[% show_attachment_flags ? 3 : 2 %]" align="left">
@@ -167,4 +166,3 @@ function toggle_display(link) {
     </td>
   </tr>
 </table>
-<br>
index 75c263e68c7d447890a0fb6536eef48c39f46144..3730218e1ad81b325ed67f1b460eb0e778c319f8 100644 (file)
 
   <table id="bz_big_form_parts" cellspacing="0" cellpadding="0"><tr>
   <td>
+    [%# *** Sightings *** %]
+
+    [% PROCESS sighting/list.html.tmpl
+               bug = bug
+    %]
+
     [% IF user.is_timetracker %]
       [% PROCESS section_timetracking %]
     [% END %]
     </td>
     <td id="bz_field_status">
       <span id="static_bug_status">
-        [% 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 %]
           (<a href="#add_comment" 
               onclick="window.setTimeout(function() { document.getElementById('bug_status').focus(); }, 10)">edit</a>)
diff --git a/template/en/default/bug/status.html.tmpl b/template/en/default/bug/status.html.tmpl
new file mode 100644 (file)
index 0000000..a624ccc
--- /dev/null
@@ -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 <rowebb@gmail.com>
+  #%]
+
+[%# 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 %]
index 58fa688e612422d65188e49ca8121a4e6b4bcdfc..1651c8aa630eef05d2e84652c180d7bc7f791dd5 100644 (file)
      "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 (file)
index 0000000..a8cf20a
--- /dev/null
@@ -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 <rowebb@gmail.com>
+  #%]
+
+[%# 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 %]
+<table id="sighting_table" class="bz_sighting_table">
+  <tr>
+    <th>
+      [% field_descs.sighting FILTER html %]
+    </th>
+    <th>
+      [% field_descs.bug_status FILTER html %]
+    </th>
+  </tr>
+
+  [% PROCESS render_sighting_row target = master_bug tag = "th" %]
+
+  [% FOREACH sighting = sightings %]
+    [% PROCESS render_sighting_row target = sighting tag = "td" %]
+  [% END %]
+</table>
+
+[% BLOCK render_sighting_row %]
+    <tr id="s[% target.id FILTER html %]">
+      <[% tag %]>
+        [% target.bug_id FILTER bug_link(target) FILTER none %]
+      </[% tag %]>
+      <[% tag %]>
+        [% PROCESS bug/status.html.tmpl %]
+      </[% tag %]>
+    </tr>
+[% END %]