summaryrefslogtreecommitdiffstats
path: root/extensions
diff options
context:
space:
mode:
Diffstat (limited to 'extensions')
-rw-r--r--extensions/BugModal/template/en/default/bug_modal/edit.html.tmpl4
-rw-r--r--extensions/MozReview/Extension.pm3
-rw-r--r--extensions/MozReview/template/en/default/hook/bug/edit-after_bug_data.html.tmpl31
-rw-r--r--extensions/MozReview/template/en/default/hook/bug/show-header-end.html.tmpl9
-rw-r--r--extensions/MozReview/template/en/default/hook/bug_modal/edit-module.html.tmpl21
-rw-r--r--extensions/MozReview/template/en/default/hook/bug_modal/header-end.html.tmpl13
-rw-r--r--extensions/MozReview/template/en/default/moz_review/header.html.tmpl10
-rw-r--r--extensions/MozReview/template/en/default/moz_review/table.html.tmpl30
-rw-r--r--extensions/MozReview/web/js/mozreview.js6
-rw-r--r--extensions/MozReview/web/style/mozreview.css23
10 files changed, 113 insertions, 37 deletions
diff --git a/extensions/BugModal/template/en/default/bug_modal/edit.html.tmpl b/extensions/BugModal/template/en/default/bug_modal/edit.html.tmpl
index 63bd72dc6..57afb2cfe 100644
--- a/extensions/BugModal/template/en/default/bug_modal/edit.html.tmpl
+++ b/extensions/BugModal/template/en/default/bug_modal/edit.html.tmpl
@@ -930,6 +930,10 @@
[% END %]
[% END %]
+[%# === extensions which are modules === %]
+
+[% Hook.process('module') %]
+
[%# === attachments === %]
[% IF active_attachments || obsolete_attachments %]
diff --git a/extensions/MozReview/Extension.pm b/extensions/MozReview/Extension.pm
index ab7afb18a..296240b49 100644
--- a/extensions/MozReview/Extension.pm
+++ b/extensions/MozReview/Extension.pm
@@ -9,6 +9,7 @@ package Bugzilla::Extension::MozReview;
use 5.10.1;
use strict;
+use warnings;
use parent qw(Bugzilla::Extension);
use Bugzilla::Attachment;
@@ -22,7 +23,7 @@ sub template_before_process {
my $vars = $args->{'vars'};
return unless (($file eq 'bug/show-header.html.tmpl' ||
- $file eq 'bug/edit.html.tmpl' ||
+ $file eq 'bug_modal/header.html.tmpl' ||
$file eq 'attachment/create.html.tmpl') &&
Bugzilla->params->{mozreview_base_url});
diff --git a/extensions/MozReview/template/en/default/hook/bug/edit-after_bug_data.html.tmpl b/extensions/MozReview/template/en/default/hook/bug/edit-after_bug_data.html.tmpl
index a2afa0351..b0e4ce600 100644
--- a/extensions/MozReview/template/en/default/hook/bug/edit-after_bug_data.html.tmpl
+++ b/extensions/MozReview/template/en/default/hook/bug/edit-after_bug_data.html.tmpl
@@ -6,15 +6,9 @@
# defined by the Mozilla Public License, v. 2.0.
#%]
-[% USE Bugzilla %]
-[% cgi = Bugzilla.cgi %]
-
[% RETURN UNLESS mozreview %]
-<br>
-<table
- class="mozreview-table"
- data-mozreview-url="[% Bugzilla.params.mozreview_base_url FILTER html %]">
+<table class="mozreview-table">
<thead>
<tr>
<th>MozReview Requests</th>
@@ -24,28 +18,7 @@
<tbody>
<tr>
<td>
- <table class="mozreview-requests">
- <thead>
- <th>Commit</th>
- <th>Status</th>
- <th>Open Issues</th>
- <th>Last Updated</th>
- </thead>
- [% FOREACH rrid IN review_request_ids %]
- [%# rrid is guaranteed to be an integer %]
- <tbody class="mozreview-request"
- data-rrid="[% rrid FILTER none %]">
- <tr class="mozreview-loading-row">
- <td colspan="4">Loading...</td>
- </tr>
- <tr class="mozreview-loading-error-row bz_default_hidden">
- <td colspan="4">Error loading review
- request <span class="mozreview-load-error-rrid"></span>:
- <span class="mozreview-load-error-string"></span></td>
- </tr>
- </tbody>
- [% END %]
- </table>
+ [% INCLUDE moz_review/table.html.tmpl %]
</td>
</tr>
</tbody>
diff --git a/extensions/MozReview/template/en/default/hook/bug/show-header-end.html.tmpl b/extensions/MozReview/template/en/default/hook/bug/show-header-end.html.tmpl
index 995dd8868..d70e36b57 100644
--- a/extensions/MozReview/template/en/default/hook/bug/show-header-end.html.tmpl
+++ b/extensions/MozReview/template/en/default/hook/bug/show-header-end.html.tmpl
@@ -6,7 +6,8 @@
# defined by the Mozilla Public License, v. 2.0.
#%]
-[% RETURN UNLESS mozreview %]
-
-[% style_urls.push('extensions/MozReview/web/style/mozreview.css') %]
-[% javascript_urls.push('extensions/MozReview/web/js/mozreview.js') %]
+[%
+ IF mozreview;
+ PROCESS moz_review/header.html.tmpl;
+ END;
+%]
diff --git a/extensions/MozReview/template/en/default/hook/bug_modal/edit-module.html.tmpl b/extensions/MozReview/template/en/default/hook/bug_modal/edit-module.html.tmpl
new file mode 100644
index 000000000..9785fa0bd
--- /dev/null
+++ b/extensions/MozReview/template/en/default/hook/bug_modal/edit-module.html.tmpl
@@ -0,0 +1,21 @@
+[%# 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 mozreview %]
+
+[% WRAPPER bug_modal/module.html.tmpl
+ title = "MozReview Requests"
+ collapsed = 0
+%]
+ [% INCLUDE moz_review/table.html.tmpl %]
+ <div class="mozreview-hide-discarded-row bz_default_hidden">
+ <button type="button" class="minor mozreview-hide-discarded-link">
+ <span class="mozreview-discarded-action">Show</span> discarded requests
+ </button>
+ </div>
+[% END %]
diff --git a/extensions/MozReview/template/en/default/hook/bug_modal/header-end.html.tmpl b/extensions/MozReview/template/en/default/hook/bug_modal/header-end.html.tmpl
new file mode 100644
index 000000000..d70e36b57
--- /dev/null
+++ b/extensions/MozReview/template/en/default/hook/bug_modal/header-end.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.
+ #%]
+
+[%
+ IF mozreview;
+ PROCESS moz_review/header.html.tmpl;
+ END;
+%]
diff --git a/extensions/MozReview/template/en/default/moz_review/header.html.tmpl b/extensions/MozReview/template/en/default/moz_review/header.html.tmpl
new file mode 100644
index 000000000..99fb81ba4
--- /dev/null
+++ b/extensions/MozReview/template/en/default/moz_review/header.html.tmpl
@@ -0,0 +1,10 @@
+[%# 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.
+ #%]
+
+[% style_urls.push('extensions/MozReview/web/style/mozreview.css') %]
+[% javascript_urls.push('extensions/MozReview/web/js/mozreview.js') %]
diff --git a/extensions/MozReview/template/en/default/moz_review/table.html.tmpl b/extensions/MozReview/template/en/default/moz_review/table.html.tmpl
new file mode 100644
index 000000000..d167a9651
--- /dev/null
+++ b/extensions/MozReview/template/en/default/moz_review/table.html.tmpl
@@ -0,0 +1,30 @@
+[%# 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.
+ #%]
+
+<table class="mozreview-requests" data-mozreview-url="[% Bugzilla.params.mozreview_base_url FILTER html %]">
+ <thead>
+ <th>Commit</th>
+ <th>Status</th>
+ <th>Open Issues</th>
+ <th>Last Updated</th>
+ </thead>
+ [% FOREACH rrid IN review_request_ids %]
+ [%# rrid is guaranteed to be an integer %]
+ <tbody class="mozreview-request"
+ data-rrid="[% rrid FILTER none %]">
+ <tr class="mozreview-loading-row">
+ <td colspan="4">Loading...</td>
+ </tr>
+ <tr class="mozreview-loading-error-row bz_default_hidden">
+ <td colspan="4">Error loading review
+ request <span class="mozreview-load-error-rrid"></span>:
+ <span class="mozreview-load-error-string"></span></td>
+ </tr>
+ </tbody>
+ [% END %]
+</table>
diff --git a/extensions/MozReview/web/js/mozreview.js b/extensions/MozReview/web/js/mozreview.js
index 714863a74..2d5fdb0fa 100644
--- a/extensions/MozReview/web/js/mozreview.js
+++ b/extensions/MozReview/web/js/mozreview.js
@@ -46,7 +46,7 @@ MozReview.elapsedTime = function(d) {
};
MozReview.getReviewRequest = function() {
- var hostUrl = $('.mozreview-table').data('mozreviewUrl');
+ var hostUrl = $('.mozreview-requests').data('mozreviewUrl');
var tr = $('<tr/>');
var td = $('<td/>');
@@ -93,7 +93,8 @@ MozReview.getReviewRequest = function() {
return trCommit;
}
- $('.mozreview-hide-discarded-link').click(function() {
+ $('.mozreview-hide-discarded-link').click(function(event) {
+ event.preventDefault();
if ($('.bz_default_hidden.mozreview-discarded-request').length) {
$('.mozreview-discarded-request').removeClass('bz_default_hidden');
$('.mozreview-discarded-action').text('Hide');
@@ -101,7 +102,6 @@ MozReview.getReviewRequest = function() {
$('.mozreview-discarded-request').addClass('bz_default_hidden');
$('.mozreview-discarded-action').text('Show');
}
- return false;
});
$('.mozreview-request').each(function() {
diff --git a/extensions/MozReview/web/style/mozreview.css b/extensions/MozReview/web/style/mozreview.css
index 5c021ea96..8efea8950 100644
--- a/extensions/MozReview/web/style/mozreview.css
+++ b/extensions/MozReview/web/style/mozreview.css
@@ -52,3 +52,26 @@
.mozreview-child-request-summary {
text-indent: 1em;
}
+
+/* bug-modal specific */
+
+#module-mozreview-requests .module-content {
+ padding: 0;
+}
+
+.bug_modal .mozreview-table {
+ width: 100%;
+}
+
+.bug_modal .mozreview-request td {
+ padding-left: 8px;
+}
+
+.bug_modal .mozreview-requests th {
+ text-align: left;
+ padding-left: 8px;
+}
+
+.bug_modal .mozreview-hide-discarded-row {
+ padding: 4px;
+}