From dc519b098fac5c18b3807e8a7dfd37334799c951 Mon Sep 17 00:00:00 2001 From: David Lawrence Date: Tue, 12 Jul 2016 14:44:03 +0000 Subject: Bug 1283649 - When an attachment is a github pull request link, the pull request diff should be displayed in the edit page --- .../en/default/hook/attachment/edit-view.html.tmpl | 51 ++++++++++++++++++++++ .../default/hook/attachment/list-action.html.tmpl | 2 +- 2 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 extensions/BMO/template/en/default/hook/attachment/edit-view.html.tmpl (limited to 'extensions/BMO/template/en/default') diff --git a/extensions/BMO/template/en/default/hook/attachment/edit-view.html.tmpl b/extensions/BMO/template/en/default/hook/attachment/edit-view.html.tmpl new file mode 100644 index 000000000..60159fcb2 --- /dev/null +++ b/extensions/BMO/template/en/default/hook/attachment/edit-view.html.tmpl @@ -0,0 +1,51 @@ +[%# 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 attachment.mimetype == "text/x-github-pull-request" && attachment.can_review; + custom_attachment_viewer = 1; +%] + +[% IF NOT user.id %] +
+ Display of Github pull requests only available to logged in users. +
+ [% RETURN %] +[% END %] + +[% attachment_data = attachment.fetch_github_pr_diff %] + +
+ [% INCLUDE global/textarea.html.tmpl + id = 'editFrame' + name = 'comment' + classes = 'bz_default_hidden' + minrows = 10 + cols = 80 + wrap = 'soft' + disabled = 'disabled' + defaultcontent = attachment_data.replace('(.*\n|.+)', '>$1'); + %] +
+    [% attachment_data FILTER html %]
+  
+ [% IF user.id %] + + [% END %] +
diff --git a/extensions/BMO/template/en/default/hook/attachment/list-action.html.tmpl b/extensions/BMO/template/en/default/hook/attachment/list-action.html.tmpl index 6982b3338..494ab59ef 100644 --- a/extensions/BMO/template/en/default/hook/attachment/list-action.html.tmpl +++ b/extensions/BMO/template/en/default/hook/attachment/list-action.html.tmpl @@ -12,5 +12,5 @@ [% IF !attachment.ispatch && attachment.can_review %] | - Review + Ext Review [% END %] -- cgit v1.2.3-24-g4f1b