Skip to content

Commit 5ff4a99

Browse files
committed
Bug 1153100: add mozreview's table to bug-modal
1 parent 4d44259 commit 5ff4a99

File tree

10 files changed

+113
-37
lines changed

10 files changed

+113
-37
lines changed

extensions/BugModal/template/en/default/bug_modal/edit.html.tmpl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -930,6 +930,10 @@
930930
[% END %]
931931
[% END %]
932932

933+
[%# === extensions which are modules === %]
934+
935+
[% Hook.process('module') %]
936+
933937
[%# === attachments === %]
934938

935939
[% IF active_attachments || obsolete_attachments %]

extensions/MozReview/Extension.pm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ package Bugzilla::Extension::MozReview;
99

1010
use 5.10.1;
1111
use strict;
12+
use warnings;
1213
use parent qw(Bugzilla::Extension);
1314

1415
use Bugzilla::Attachment;
@@ -22,7 +23,7 @@ sub template_before_process {
2223
my $vars = $args->{'vars'};
2324

2425
return unless (($file eq 'bug/show-header.html.tmpl' ||
25-
$file eq 'bug/edit.html.tmpl' ||
26+
$file eq 'bug_modal/header.html.tmpl' ||
2627
$file eq 'attachment/create.html.tmpl') &&
2728
Bugzilla->params->{mozreview_base_url});
2829

extensions/MozReview/template/en/default/hook/bug/edit-after_bug_data.html.tmpl

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,9 @@
66
# defined by the Mozilla Public License, v. 2.0.
77
#%]
88

9-
[% USE Bugzilla %]
10-
[% cgi = Bugzilla.cgi %]
11-
129
[% RETURN UNLESS mozreview %]
1310

14-
<br>
15-
<table
16-
class="mozreview-table"
17-
data-mozreview-url="[% Bugzilla.params.mozreview_base_url FILTER html %]">
11+
<table class="mozreview-table">
1812
<thead>
1913
<tr>
2014
<th>MozReview Requests</th>
@@ -24,28 +18,7 @@
2418
<tbody>
2519
<tr>
2620
<td>
27-
<table class="mozreview-requests">
28-
<thead>
29-
<th>Commit</th>
30-
<th>Status</th>
31-
<th>Open Issues</th>
32-
<th>Last Updated</th>
33-
</thead>
34-
[% FOREACH rrid IN review_request_ids %]
35-
[%# rrid is guaranteed to be an integer %]
36-
<tbody class="mozreview-request"
37-
data-rrid="[% rrid FILTER none %]">
38-
<tr class="mozreview-loading-row">
39-
<td colspan="4">Loading...</td>
40-
</tr>
41-
<tr class="mozreview-loading-error-row bz_default_hidden">
42-
<td colspan="4">Error loading review
43-
request <span class="mozreview-load-error-rrid"></span>:
44-
<span class="mozreview-load-error-string"></span></td>
45-
</tr>
46-
</tbody>
47-
[% END %]
48-
</table>
21+
[% INCLUDE moz_review/table.html.tmpl %]
4922
</td>
5023
</tr>
5124
</tbody>

extensions/MozReview/template/en/default/hook/bug/show-header-end.html.tmpl

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
# defined by the Mozilla Public License, v. 2.0.
77
#%]
88

9-
[% RETURN UNLESS mozreview %]
10-
11-
[% style_urls.push('extensions/MozReview/web/style/mozreview.css') %]
12-
[% javascript_urls.push('extensions/MozReview/web/js/mozreview.js') %]
9+
[%
10+
IF mozreview;
11+
PROCESS moz_review/header.html.tmpl;
12+
END;
13+
%]
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
[%# This Source Code Form is subject to the terms of the Mozilla Public
2+
# License, v. 2.0. If a copy of the MPL was not distributed with this
3+
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
4+
#
5+
# This Source Code Form is "Incompatible With Secondary Licenses", as
6+
# defined by the Mozilla Public License, v. 2.0.
7+
#%]
8+
9+
[% RETURN UNLESS mozreview %]
10+
11+
[% WRAPPER bug_modal/module.html.tmpl
12+
title = "MozReview Requests"
13+
collapsed = 0
14+
%]
15+
[% INCLUDE moz_review/table.html.tmpl %]
16+
<div class="mozreview-hide-discarded-row bz_default_hidden">
17+
<button type="button" class="minor mozreview-hide-discarded-link">
18+
<span class="mozreview-discarded-action">Show</span> discarded requests
19+
</button>
20+
</div>
21+
[% END %]
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[%# This Source Code Form is subject to the terms of the Mozilla Public
2+
# License, v. 2.0. If a copy of the MPL was not distributed with this
3+
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
4+
#
5+
# This Source Code Form is "Incompatible With Secondary Licenses", as
6+
# defined by the Mozilla Public License, v. 2.0.
7+
#%]
8+
9+
[%
10+
IF mozreview;
11+
PROCESS moz_review/header.html.tmpl;
12+
END;
13+
%]
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[%# This Source Code Form is subject to the terms of the Mozilla Public
2+
# License, v. 2.0. If a copy of the MPL was not distributed with this
3+
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
4+
#
5+
# This Source Code Form is "Incompatible With Secondary Licenses", as
6+
# defined by the Mozilla Public License, v. 2.0.
7+
#%]
8+
9+
[% style_urls.push('extensions/MozReview/web/style/mozreview.css') %]
10+
[% javascript_urls.push('extensions/MozReview/web/js/mozreview.js') %]
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
[%# This Source Code Form is subject to the terms of the Mozilla Public
2+
# License, v. 2.0. If a copy of the MPL was not distributed with this
3+
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
4+
#
5+
# This Source Code Form is "Incompatible With Secondary Licenses", as
6+
# defined by the Mozilla Public License, v. 2.0.
7+
#%]
8+
9+
<table class="mozreview-requests" data-mozreview-url="[% Bugzilla.params.mozreview_base_url FILTER html %]">
10+
<thead>
11+
<th>Commit</th>
12+
<th>Status</th>
13+
<th>Open Issues</th>
14+
<th>Last Updated</th>
15+
</thead>
16+
[% FOREACH rrid IN review_request_ids %]
17+
[%# rrid is guaranteed to be an integer %]
18+
<tbody class="mozreview-request"
19+
data-rrid="[% rrid FILTER none %]">
20+
<tr class="mozreview-loading-row">
21+
<td colspan="4">Loading...</td>
22+
</tr>
23+
<tr class="mozreview-loading-error-row bz_default_hidden">
24+
<td colspan="4">Error loading review
25+
request <span class="mozreview-load-error-rrid"></span>:
26+
<span class="mozreview-load-error-string"></span></td>
27+
</tr>
28+
</tbody>
29+
[% END %]
30+
</table>

extensions/MozReview/web/js/mozreview.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ MozReview.elapsedTime = function(d) {
4646
};
4747

4848
MozReview.getReviewRequest = function() {
49-
var hostUrl = $('.mozreview-table').data('mozreviewUrl');
49+
var hostUrl = $('.mozreview-requests').data('mozreviewUrl');
5050
var tr = $('<tr/>');
5151
var td = $('<td/>');
5252

@@ -93,15 +93,15 @@ MozReview.getReviewRequest = function() {
9393
return trCommit;
9494
}
9595

96-
$('.mozreview-hide-discarded-link').click(function() {
96+
$('.mozreview-hide-discarded-link').click(function(event) {
97+
event.preventDefault();
9798
if ($('.bz_default_hidden.mozreview-discarded-request').length) {
9899
$('.mozreview-discarded-request').removeClass('bz_default_hidden');
99100
$('.mozreview-discarded-action').text('Hide');
100101
} else {
101102
$('.mozreview-discarded-request').addClass('bz_default_hidden');
102103
$('.mozreview-discarded-action').text('Show');
103104
}
104-
return false;
105105
});
106106

107107
$('.mozreview-request').each(function() {

extensions/MozReview/web/style/mozreview.css

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,26 @@
5252
.mozreview-child-request-summary {
5353
text-indent: 1em;
5454
}
55+
56+
/* bug-modal specific */
57+
58+
#module-mozreview-requests .module-content {
59+
padding: 0;
60+
}
61+
62+
.bug_modal .mozreview-table {
63+
width: 100%;
64+
}
65+
66+
.bug_modal .mozreview-request td {
67+
padding-left: 8px;
68+
}
69+
70+
.bug_modal .mozreview-requests th {
71+
text-align: left;
72+
padding-left: 8px;
73+
}
74+
75+
.bug_modal .mozreview-hide-discarded-row {
76+
padding: 4px;
77+
}

0 commit comments

Comments
 (0)