diff options
author | Frédéric Buclin <LpSolit@gmail.com> | 2010-07-18 19:17:26 +0200 |
---|---|---|
committer | Frédéric Buclin <LpSolit@gmail.com> | 2010-07-18 19:17:26 +0200 |
commit | 2addcaadedfe714bd0502911cc85cdab24736465 (patch) | |
tree | 0e58e2ce48866cdf7198d7d45df1348bf1e0859a /template | |
parent | aef5cb18c3f2f6e1a438faed08e944af9db4847c (diff) | |
download | bugzilla-2addcaadedfe714bd0502911cc85cdab24736465.tar.gz bugzilla-2addcaadedfe714bd0502911cc85cdab24736465.tar.xz |
Bug 119703: Create an attachment by pasting it into a text field
r/a=mkanat
Diffstat (limited to 'template')
-rw-r--r-- | template/en/default/admin/params/attachment.html.tmpl | 4 | ||||
-rw-r--r-- | template/en/default/attachment/create.html.tmpl | 8 | ||||
-rw-r--r-- | template/en/default/attachment/createformcontents.html.tmpl | 30 | ||||
-rw-r--r-- | template/en/default/attachment/edit.html.tmpl | 44 | ||||
-rw-r--r-- | template/en/default/attachment/list.html.tmpl | 5 | ||||
-rw-r--r-- | template/en/default/bug/create/create.html.tmpl | 3 | ||||
-rw-r--r-- | template/en/default/bug/show.xml.tmpl | 1 | ||||
-rw-r--r-- | template/en/default/global/code-error.html.tmpl | 6 | ||||
-rw-r--r-- | template/en/default/global/field-descs.none.tmpl | 1 | ||||
-rw-r--r-- | template/en/default/global/user-error.html.tmpl | 14 |
10 files changed, 39 insertions, 77 deletions
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" %] +<script type="text/javascript"> +<!-- +TUI_hide_default('attachment_text_field'); +--> +</script> + <form name="entryform" method="post" action="attachment.cgi" enctype="multipart/form-data" onsubmit="return validateAttachmentForm(this)"> 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 <wurblzap@gmail.com> #%] -<tr> +<tr class="attachment_data"> <th><label for="data">File</label>:</th> <td> - <em>Enter the path to the file on your computer.</em><br> - <input type="file" id="data" name="data" size="50" - [% IF Param("allow_attach_url") %] - onchange="DataFieldHandler()" - [% END %] - > + <em>Enter the path to the file on your computer</em> (or + <a id="attachment_data_controller" href="javascript:TUI_toggle_class('attachment_text_field'); + javascript:TUI_toggle_class('attachment_data')" + >paste text as attachment</a>).<br> + <input type="file" id="data" name="data" size="50" onchange="DataFieldHandler()"> </td> </tr> -[% IF Param("allow_attach_url") %] -<tr class="expert_fields"> - <th><label for="attachurl">AttachURL</label>:</th> +<tr class="attachment_text_field"> + <th><label for="attach_text">File</label>:</th> <td> - <em>URL to be attached instead.</em><br> - <input type="text" id="attachurl" name="attachurl" size="60" - maxlength="2000" - onkeyup="URLFieldHandler()" onblur="URLFieldHandler()"> + <em>Paste the text to be added as an attachment</em> (or + <a id="attachment_text_field_controller" href="javascript:TUI_toggle_class('attachment_text_field'); + javascript:TUI_toggle_class('attachment_data')" + >attach a file</a>).<br> + <textarea id="attach_text" name="attach_text" cols="80" rows="15" + onkeyup="TextFieldHandler()" onblur="TextFieldHandler()"></textarea> </td> </tr> -</tbody> -[% END %] <tr> <th><label for="description">Description</label>:</th> <td> 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 @@ <span class="bz_edit">(<a href="javascript:toggle_attachment_details_visibility()">edit</a>)</span> [% END %] </div> - [% IF NOT attachment.isurl %] - <div class="details"> - [% attachment.filename FILTER html %] ([% attachment.contenttype FILTER html %]) - [% IF attachment.datasize %] - [%+ attachment.datasize FILTER unitconvert %] - [% ELSE %] - <em>deleted</em> - [% END %], created by [%+ INCLUDE global/user.html.tmpl who = attachment.attacher %] - [% IF attachment.isprivate %] - <span class="bz_private">Only visible to <strong>[% Param('insidergroup') FILTER html %]</strong></span> - [% END %] - </div> - [% END %] + <div class="details"> + [% attachment.filename FILTER html %] ([% attachment.contenttype FILTER html %]) + [% IF attachment.datasize %] + [%+ attachment.datasize FILTER unitconvert %] + [% ELSE %] + <em>deleted</em> + [% END %], created by [%+ INCLUDE global/user.html.tmpl who = attachment.attacher %] + [% IF attachment.isprivate %] + <span class="bz_private">Only visible to <strong>[% Param('insidergroup') FILTER html %]</strong></span> + [% END %] + </div> </div> <div id="attachment_information_edit"> <span class="bz_hide"> @@ -99,12 +97,6 @@ %] </div> - [% IF attachment.isurl %] - <input type="hidden" name="filename" - value="[% attachment.filename FILTER html %]"> - <input type="hidden" name="contenttypeentry" - value="[% attachment.contenttype FILTER html %]"> - [% ELSE %] <div id="attachment_filename"> <label for="filename">Filename:</label> <input type="text" size="20" class="text block[% editable_or_hide %]" @@ -138,7 +130,7 @@ [%+ 'checked="checked"' IF attachment.ispatch %]> <label for="ispatch">patch</label> </div> - [% END %] + <div class="readonly"> <div class="checkboxes"> <div id="attachment_isobsolete"> @@ -168,18 +160,6 @@ <div id="attachment_view_window"> [% IF !attachment.datasize %] <div><b>The content of this attachment has been deleted.</b></div> - [% ELSIF attachment.isurl %] - <div> - <a href="[% attachment.data FILTER html %]"> - [% IF attachment.datasize < 120 %] - [% attachment.data FILTER html %] - [% ELSE %] - [% attachment.data FILTER truncate(80) FILTER html %] - ... - [% attachment.data.match(".*(.{20})$").0 FILTER html %] - [% END %] - </a> - </div> [% ELSIF !Param("allow_attachment_display") %] <div id="view_disabled" > <p><b> 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 %] <tr id="a[% count %]" class="[% "bz_contenttype_" _ attachment.contenttype - FILTER css_class_quote UNLESS attachment.isurl %] + FILTER css_class_quote %] [% " bz_patch" IF attachment.ispatch %] - [% " bz_url" IF attachment.isurl %] [% " bz_private" IF attachment.isprivate %] [% " bz_tr_obsolete bz_default_hidden" IF attachment.isobsolete %]"> @@ -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'); --> </script> 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 %]" > <attachid>[% a.id %]</attachid> <date>[% a.attached FILTER time("%Y-%m-%d %T %z") FILTER xml %]</date> 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 (<b>[% addr FILTER html %]</b>) 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" %] - <em>[% url FILTER html %]</em> 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. <br> 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 <b>AttachURL</b> 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. <br>Alternately, if your attachment is an image, you could convert it to a compressible format like JPG or PNG and try again. |