From 1288cb37def46360bcbe05b1eb330161f24af918 Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Thu, 8 Dec 2005 17:14:10 +0000 Subject: Bug 301764: The file size indicates "0" when editing local attachments - Patch by Frédéric Buclin r=myk a=justdave MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- template/en/default/attachment/edit.html.tmpl | 81 ++++++++++++++++----------- template/en/default/filterexceptions.pl | 4 +- 2 files changed, 49 insertions(+), 36 deletions(-) (limited to 'template') diff --git a/template/en/default/attachment/edit.html.tmpl b/template/en/default/attachment/edit.html.tmpl index 65dd5092e..747675f01 100644 --- a/template/en/default/attachment/edit.html.tmpl +++ b/template/en/default/attachment/edit.html.tmpl @@ -17,14 +17,19 @@ # Rights Reserved. # # Contributor(s): Myk Melez + # Frédéric Buclin #%] [% PROCESS global/variables.none.tmpl %] [%# Define strings that will serve as the title and header of this page %] -[% title = BLOCK %]Edit Attachment #[% attachid %] for [% terms.Bug %] #[% bugid %][% END %] -[% h1 = BLOCK %]Edit Attachment #[% attachid %] for - [%+ GetBugLink(bugid, "$terms.Bug $bugid") %][% END %] +[% title = BLOCK %] + Edit Attachment [% attachment.id %] for [% terms.Bug %] [%+ attachment.bug_id %] +[% END %] +[% h1 = BLOCK %] + Edit Attachment [% attachment.id %] for + [%+ GetBugLink(attachment.bug_id, "$terms.Bug ${attachment.bug_id}") %] +[% END %] [% h2 = BLOCK %][% bugsummary FILTER html %][% END %] [% PROCESS global/header.html.tmpl @@ -99,7 +104,7 @@ if (!has_viewed_as_diff) { var viewDiffFrame = document.getElementById('viewDiffFrame'); viewDiffFrame.src = - 'attachment.cgi?id=[% attachid %]&action=diff&headers=0'; + 'attachment.cgi?id=[% attachment.id %]&action=diff&headers=0'; has_viewed_as_diff = 1; } } @@ -197,7 +202,7 @@
- + @@ -207,33 +212,40 @@ Description:
-
- - [% IF isurl %] -
-
+
+ + [% IF attachment.isurl %] +
+
[% ELSE %] Filename:
-
- Size: [% datasize FILTER unitconvert %]
+
+ Size: [% attachment.datasize FILTER unitconvert %]
MIME Type:
-
+
+ [% 'checked="checked"' IF attachment.ispatch %]> [% END %] + [% 'checked="checked"' IF attachment.isobsolete %]>
[% IF (Param("insidergroup") && UserInGroup(Param("insidergroup"))) %] - private

+ private

[% ELSE %]
[% END %] [% IF flag_types.size > 0 %] - [% PROCESS "flag/list.html.tmpl" bug_id=bugid attach_id=attachid %]
+ [% PROCESS "flag/list.html.tmpl" bug_id = attachment.bug_id + attach_id = attachment.id %]
[% END %]
@@ -243,19 +255,20 @@

Actions: - View - [% IF ispatch && patchviewerinstalled %] - | Diff + View + [% IF attachment.ispatch && patchviewerinstalled %] + | Diff [% END %]
[% IF isviewable %] - - - [% ELSIF isurl %] + [% ELSIF attachment.isurl %] - - [% IF datasize < 120 %] - [% thedata FILTER html %] + + [% IF attachment.datasize < 120 %] + [% attachment.data FILTER html %] [% ELSE %] - [% thedata FILTER truncate(80) FILTER html %] + [% attachment.data FILTER truncate(80) FILTER html %]  ... - [% thedata.match(".*(.{20})$").0 FILTER html %] + [% attachment.data.match(".*(.{20})$").0 FILTER html %] [% END %] @@ -290,11 +303,11 @@

Attachment is not viewable in your browser because its MIME type - ([% contenttype FILTER html %]) is not one that your browser is + ([% attachment.contenttype FILTER html %]) is not one that your browser is able to display.

- Download the attachment. + Download the attachment.

[% END %] @@ -305,10 +318,10 @@ Attachments on this [% terms.Bug %]: [% FOREACH a = attachments %] - [% IF a == attachid %] - #[% a %] + [% IF a == attachment.id %] + [% a %] [% ELSE %] - #[% a %] + [% a %] [% END %] [% " |" UNLESS loop.last() %] [% END %] diff --git a/template/en/default/filterexceptions.pl b/template/en/default/filterexceptions.pl index c5334c343..a2cf6c0d3 100644 --- a/template/en/default/filterexceptions.pl +++ b/template/en/default/filterexceptions.pl @@ -451,8 +451,8 @@ ], 'attachment/edit.html.tmpl' => [ - 'attachid', - 'bugid', + 'attachment.id', + 'attachment.bug_id', 'a', ], -- cgit v1.2.3-24-g4f1b