From 74c6f9974fddc33163ae78c5927c6569f2eb28c0 Mon Sep 17 00:00:00 2001 From: Byron Jones Date: Wed, 23 Mar 2016 11:25:52 +0800 Subject: Bug 1251236 - Please show the diff on the attachment details page when a patch has been reviewed in MozReview --- template/en/default/attachment/edit.html.tmpl | 135 +++++++++++++------------- 1 file changed, 70 insertions(+), 65 deletions(-) (limited to 'template') diff --git a/template/en/default/attachment/edit.html.tmpl b/template/en/default/attachment/edit.html.tmpl index 8dc29c1e6..c7d85e270 100644 --- a/template/en/default/attachment/edit.html.tmpl +++ b/template/en/default/attachment/edit.html.tmpl @@ -175,73 +175,78 @@

[% ELSIF attachment.is_viewable %] -
- [% INCLUDE global/textarea.html.tmpl - id = 'editFrame' - name = 'comment' - classes = 'bz_default_hidden' - minrows = 10 - cols = 80 - wrap = 'soft' - disabled = 'disabled' - defaultcontent = (attachment.contenttype.match('^text\/')) ? - attachment.data.replace('(.*\n|.+)', '>$1') : undef - %] - [% IF attachment.contenttype == 'text/plain' AND is_safe_url(attachment.data) %] -

- - [% IF attachment.datasize < 120 %] - [% attachment.data FILTER html %] - [% ELSE %] - [% attachment.data FILTER truncate(80) FILTER html %] - ... - [% attachment.data.match('.*(.{20})$').0 FILTER html %] - [% END %] - -

- [% ELSIF attachment.contenttype == "text/html" %] - [%# For security reasons (clickjacking, embedded scripts), we never - # render HTML pages from here. The source code is displayed instead. %] + [%# to override attachment viewing, hook edit-view and set custom_attachment_viewer to 1 %] + [% custom_attachment_viewer = 0 %] + [% Hook.process('view') %] + [% UNLESS custom_attachment_viewer %] +
[% INCLUDE global/textarea.html.tmpl - id = 'viewFrame' - minrows = 10 - cols = 80 - defaultcontent = attachment.data - readonly = 'readonly' + id = 'editFrame' + name = 'comment' + classes = 'bz_default_hidden' + minrows = 10 + cols = 80 + wrap = 'soft' + disabled = 'disabled' + defaultcontent = (attachment.contenttype.match('^text\/')) ? + attachment.data.replace('(.*\n|.+)', '>$1') : undef %] - [% ELSE %] - - [% END %] - -
+ [% IF attachment.contenttype == 'text/plain' AND is_safe_url(attachment.data) %] +

+ + [% IF attachment.datasize < 120 %] + [% attachment.data FILTER html %] + [% ELSE %] + [% attachment.data FILTER truncate(80) FILTER html %] + ... + [% attachment.data.match('.*(.{20})$').0 FILTER html %] + [% END %] + +

+ [% ELSIF attachment.contenttype == "text/html" %] + [%# For security reasons (clickjacking, embedded scripts), we never + # render HTML pages from here. The source code is displayed instead. %] + [% INCLUDE global/textarea.html.tmpl + id = 'viewFrame' + minrows = 10 + cols = 80 + defaultcontent = attachment.data + readonly = 'readonly' + %] + [% ELSE %] + + [% END %] + +
+ [% END %] [% ELSE %]

-- cgit v1.2.3-24-g4f1b