From b2966165174d850b13be0e25eba6e9053142ed00 Mon Sep 17 00:00:00 2001 From: "bugreport%peshkin.net" <> Date: Thu, 20 Oct 2005 03:16:12 +0000 Subject: Bug 149504 Permit a reference to a URL to be treated as an attachment Patch by Joel Peshkin r=lpsolit, a=justdave --- .../en/default/admin/params/attachment.html.tmpl | 5 +- template/en/default/attachment/create.html.tmpl | 76 +++++++++++++++++++++- template/en/default/attachment/edit.html.tmpl | 30 +++++++-- template/en/default/attachment/list.html.tmpl | 2 + 4 files changed, 103 insertions(+), 10 deletions(-) (limited to 'template') diff --git a/template/en/default/admin/params/attachment.html.tmpl b/template/en/default/admin/params/attachment.html.tmpl index 963d89e08..ef89c4af0 100644 --- a/template/en/default/admin/params/attachment.html.tmpl +++ b/template/en/default/admin/params/attachment.html.tmpl @@ -25,6 +25,9 @@ %] [% param_descs = { + allow_attach_url => "If this option is on, it will be possible to " _ + "specify a URL when creating an attachment and " _ + "treat the URL itself as if it were an attachment.", maxpatchsize => "The maximum size (in kilobytes) of patches. $terms.Bugzilla will not " _ "accept patches greater than this number of kilobytes in size. " _ "To accept patches of any size (subject to the limitations of " _ @@ -44,4 +47,4 @@ convert_uncompressed_images => "If this option is on, attachments with content type image/bmp " _ "will be converted to image/png and compressed before uploading to " _ "the database to conserve disk space." } -%] \ No newline at end of file +%] diff --git a/template/en/default/attachment/create.html.tmpl b/template/en/default/attachment/create.html.tmpl index 43af6e638..ba725eae7 100644 --- a/template/en/default/attachment/create.html.tmpl +++ b/template/en/default/attachment/create.html.tmpl @@ -17,6 +17,8 @@ # Rights Reserved. # # Contributor(s): Myk Melez + # Joel Peshkin + # Erik Stambaugh #%] [% PROCESS global/variables.none.tmpl %] @@ -53,6 +55,58 @@ onload="setContentTypeDisabledState();" %] +[% IF Param("allow_attach_url") %] + +[% END %] + +
@@ -62,7 +116,11 @@ Enter the path to the file on your computer.
- + [% IF Param("maxlocalattachment") %] @@ -77,6 +135,17 @@ [% END %] + [% IF Param("allow_attach_url") %] + + + + URL to be attached instead.
+ + + + [% END %] @@ -104,14 +173,15 @@ -
- diff --git a/template/en/default/attachment/edit.html.tmpl b/template/en/default/attachment/edit.html.tmpl index e46d5e552..7addd3278 100644 --- a/template/en/default/attachment/edit.html.tmpl +++ b/template/en/default/attachment/edit.html.tmpl @@ -209,16 +209,21 @@ Description:

- Filename:
-
- Size: [% datasize FILTER unitconvert %]
+ [% IF isurl %] +
+
+ [% ELSE %] + Filename:
+
+ Size: [% datasize FILTER unitconvert %]
- MIME Type:
-
+ MIME Type:
+
+ [% END %]
@@ -237,7 +242,8 @@

- Actions: View + Actions: + View [% IF ispatch && patchviewerinstalled %] | Diff [% END %] @@ -268,6 +274,18 @@ //--> + [% ELSIF isurl %] + + + [% IF datasize < 120 %] + [% thedata FILTER html %] + [% ELSE %] + [% thedata FILTER truncate(80) FILTER html %] +  ... + [% thedata.match(".*(.{20})$").0 FILTER html %] + [% END %] + + [% ELSE %]

diff --git a/template/en/default/attachment/list.html.tmpl b/template/en/default/attachment/list.html.tmpl index 61b68ee53..7de5fb371 100644 --- a/template/en/default/attachment/list.html.tmpl +++ b/template/en/default/attachment/list.html.tmpl @@ -43,6 +43,8 @@ [% IF attachment.ispatch %] patch + [% ELSIF attachment.isurl %] + url [% ELSE %] [% attachment.contenttype FILTER html %] [% END %] -- cgit v1.2.3-24-g4f1b