From 2addcaadedfe714bd0502911cc85cdab24736465 Mon Sep 17 00:00:00 2001 From: Frédéric Buclin Date: Sun, 18 Jul 2010 19:17:26 +0200 Subject: Bug 119703: Create an attachment by pasting it into a text field r/a=mkanat --- .../en/default/admin/params/attachment.html.tmpl | 4 -- template/en/default/attachment/create.html.tmpl | 8 +++- .../attachment/createformcontents.html.tmpl | 30 +++++++-------- template/en/default/attachment/edit.html.tmpl | 44 ++++++---------------- template/en/default/attachment/list.html.tmpl | 5 +-- template/en/default/bug/create/create.html.tmpl | 3 +- template/en/default/bug/show.xml.tmpl | 1 - template/en/default/global/code-error.html.tmpl | 6 +-- template/en/default/global/field-descs.none.tmpl | 1 - template/en/default/global/user-error.html.tmpl | 14 +------ 10 files changed, 39 insertions(+), 77 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 159588625..69f62e9be 100644 --- a/template/en/default/admin/params/attachment.html.tmpl +++ b/template/en/default/admin/params/attachment.html.tmpl @@ -60,10 +60,6 @@ allow_attachment_deletion => "If this option is on, administrators will be able to delete " _ "the content of attachments.", - 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.", - maxattachmentsize => "The maximum size (in kilobytes) of attachments to be stored " _ "in the database. If a file larger than this size is attached " _ "to ${terms.abug}, $terms.Bugzilla will look at the " _ diff --git a/template/en/default/attachment/create.html.tmpl b/template/en/default/attachment/create.html.tmpl index f440f4583..7ca4d4bba 100644 --- a/template/en/default/attachment/create.html.tmpl +++ b/template/en/default/attachment/create.html.tmpl @@ -34,10 +34,16 @@ header = header subheader = subheader style_urls = [ 'skins/standard/attachment.css' ] - javascript_urls = [ "js/attachment.js", "js/util.js" ] + javascript_urls = [ "js/attachment.js", "js/util.js", "js/TUI.js" ] doc_section = "attachments.html" %] + +
diff --git a/template/en/default/attachment/createformcontents.html.tmpl b/template/en/default/attachment/createformcontents.html.tmpl index ad3a25bc6..9d2fa9f48 100644 --- a/template/en/default/attachment/createformcontents.html.tmpl +++ b/template/en/default/attachment/createformcontents.html.tmpl @@ -21,29 +21,27 @@ # Marc Schumann #%] - + : - Enter the path to the file on your computer.
- + Enter the path to the file on your computer (or + paste text as attachment).
+ -[% IF Param("allow_attach_url") %] - - : + + : - URL to be attached instead.
- + Paste the text to be added as an attachment (or + attach a file).
+ - -[% END %] : diff --git a/template/en/default/attachment/edit.html.tmpl b/template/en/default/attachment/edit.html.tmpl index 6a98a7f05..d1861a7d3 100644 --- a/template/en/default/attachment/edit.html.tmpl +++ b/template/en/default/attachment/edit.html.tmpl @@ -68,19 +68,17 @@ (edit) [% END %] - [% IF NOT attachment.isurl %] -
- [% attachment.filename FILTER html %] ([% attachment.contenttype FILTER html %]) - [% IF attachment.datasize %] - [%+ attachment.datasize FILTER unitconvert %] - [% ELSE %] - deleted - [% END %], created by [%+ INCLUDE global/user.html.tmpl who = attachment.attacher %] - [% IF attachment.isprivate %] - Only visible to [% Param('insidergroup') FILTER html %] - [% END %] -
- [% END %] +
+ [% attachment.filename FILTER html %] ([% attachment.contenttype FILTER html %]) + [% IF attachment.datasize %] + [%+ attachment.datasize FILTER unitconvert %] + [% ELSE %] + deleted + [% END %], created by [%+ INCLUDE global/user.html.tmpl who = attachment.attacher %] + [% IF attachment.isprivate %] + Only visible to [% Param('insidergroup') FILTER html %] + [% END %] +
@@ -99,12 +97,6 @@ %]
- [% IF attachment.isurl %] - - - [% ELSE %]
- [% END %] +
@@ -168,18 +160,6 @@
[% IF !attachment.datasize %]
The content of this attachment has been deleted.
- [% ELSIF attachment.isurl %] - [% ELSIF !Param("allow_attachment_display") %]

diff --git a/template/en/default/attachment/list.html.tmpl b/template/en/default/attachment/list.html.tmpl index 89eef1836..33d9a6c04 100644 --- a/template/en/default/attachment/list.html.tmpl +++ b/template/en/default/attachment/list.html.tmpl @@ -68,9 +68,8 @@ function toggle_display(link) { [% obsolete_attachments = obsolete_attachments + 1 %] [% END %] @@ -87,8 +86,6 @@ function toggle_display(link) { ([% attachment.datasize FILTER unitconvert %], [% IF attachment.ispatch %] patch) - [% ELSIF attachment.isurl %] - url) [% ELSE %] [%+ attachment.contenttype FILTER html %]) [% END %] diff --git a/template/en/default/bug/create/create.html.tmpl b/template/en/default/bug/create/create.html.tmpl index 43fa1646e..425d82343 100644 --- a/template/en/default/bug/create/create.html.tmpl +++ b/template/en/default/bug/create/create.html.tmpl @@ -170,7 +170,8 @@ TUI_alternates['expert_fields'] = 'Show Advanced Fields'; // Hide the Advanced Fields by default, unless the user has a cookie // that specifies otherwise. TUI_hide_default('expert_fields'); - +// Also hide the "Paste text as attachment" textarea by default. +TUI_hide_default('attachment_text_field'); --> diff --git a/template/en/default/bug/show.xml.tmpl b/template/en/default/bug/show.xml.tmpl index 2349602dc..152f3e0a9 100644 --- a/template/en/default/bug/show.xml.tmpl +++ b/template/en/default/bug/show.xml.tmpl @@ -89,7 +89,6 @@ isobsolete="[% a.isobsolete FILTER xml %]" ispatch="[% a.ispatch FILTER xml %]" isprivate="[% a.isprivate FILTER xml %]" - isurl="[% a.isurl FILTER xml %]" > [% a.id %] [% a.attached FILTER time("%Y-%m-%d %T %z") FILTER xml %] diff --git a/template/en/default/global/code-error.html.tmpl b/template/en/default/global/code-error.html.tmpl index dd05c239a..e507c584f 100644 --- a/template/en/default/global/code-error.html.tmpl +++ b/template/en/default/global/code-error.html.tmpl @@ -37,11 +37,7 @@ [% DEFAULT title = "Internal Error" %] [% error_message = BLOCK %] - [% IF error == "attachment_url_disabled" %] - [% title = "Attachment URL Disabled" %] - You cannot attach a URL. This feature is currently disabled. - - [% ELSIF error == "auth_invalid_email" %] + [% IF error == "auth_invalid_email" %] [% title = "Invalid Email Address" %] We received an email address ([% addr FILTER html %]) that didn't pass our syntax checking for a legal email address, diff --git a/template/en/default/global/field-descs.none.tmpl b/template/en/default/global/field-descs.none.tmpl index 2ef558ce4..741eecf83 100644 --- a/template/en/default/global/field-descs.none.tmpl +++ b/template/en/default/global/field-descs.none.tmpl @@ -108,7 +108,6 @@ "attachments.ispatch" => "Attachment is patch", "attachments.isobsolete" => "Attachment is obsolete", "attachments.isprivate" => "Attachment is private", - "attachments.isurl" => "Attachment is a URL", "attachments.submitter" => "Attachment creator", "blocked" => "Blocks", "bug_file_loc" => "URL", diff --git a/template/en/default/global/user-error.html.tmpl b/template/en/default/global/user-error.html.tmpl index 0f094b3a5..8380f7f0c 100644 --- a/template/en/default/global/user-error.html.tmpl +++ b/template/en/default/global/user-error.html.tmpl @@ -222,11 +222,6 @@ [% title = "Attachment Deletion Disabled" %] Attachment deletion is disabled on this installation. - [% ELSIF error == "attachment_illegal_url" %] - [% title = "Illegal Attachment URL" %] - [% url FILTER html %] is not a legal URL for attachments. - It must start either with http://, https:// or ftp://. - [% ELSIF error == "attachment_removed" %] [% title = "Attachment Removed" %] The attachment you are attempting to access has been removed. @@ -582,13 +577,8 @@ [%# Hack to get the max value between both limits %] [%+ max_limit.nsort.last FILTER html %] KB.
We recommend that you store your attachment elsewhere - [% IF Param("allow_attach_url") %] - and then specify the URL to this file on the attachment - creation page in the AttachURL field. - [% ELSE %] - and then insert the URL to it in a comment, or in the URL field - for this [% terms.bug %]. - [% END %] + and then paste the URL to this file on the attachment + creation page in the appropriate text field.
Alternately, if your attachment is an image, you could convert it to a compressible format like JPG or PNG and try again. -- cgit v1.2.3-24-g4f1b