diff options
author | myk%mozilla.org <> | 2001-10-26 05:37:50 +0200 |
---|---|---|
committer | myk%mozilla.org <> | 2001-10-26 05:37:50 +0200 |
commit | a87a5b411b4f173a7b1de2b919e71335306349ed (patch) | |
tree | fb0f27f18007cacb84f677178b47aef429f5047b /template/default | |
parent | 3a866ab78f91873f42a13710f299bcb0f176b49c (diff) | |
download | bugzilla-a87a5b411b4f173a7b1de2b919e71335306349ed.tar.gz bugzilla-a87a5b411b4f173a7b1de2b919e71335306349ed.tar.xz |
Fix for bug 98602: re-implementation of "create attachment" page.
Patch by Myk Melez <myk@mozilla.org>.
r=gerv@mozilla.org,jake@acutex.net
Diffstat (limited to 'template/default')
-rw-r--r-- | template/default/attachment/contenttypes | 6 | ||||
-rw-r--r-- | template/default/attachment/created.atml | 35 | ||||
-rwxr-xr-x | template/default/attachment/edit.atml | 7 | ||||
-rw-r--r-- | template/default/attachment/enter.atml | 108 | ||||
-rwxr-xr-x | template/default/attachment/list.atml | 8 | ||||
-rwxr-xr-x | template/default/attachment/viewall.atml | 6 |
6 files changed, 160 insertions, 10 deletions
diff --git a/template/default/attachment/contenttypes b/template/default/attachment/contenttypes new file mode 100644 index 000000000..0328da2ec --- /dev/null +++ b/template/default/attachment/contenttypes @@ -0,0 +1,6 @@ + <option value="text/plain">plain text (text/plain)</option> + <option value="text/html">HTML source (text/html)</option> + <option value="image/gif">GIF image (image/gif)</option> + <option value="image/jpeg">JPEG image (image/jpeg)</option> + <option value="image/png">PNG image (image/png)</option> + <option value="application/octet-stream">binary file (application/octet-stream)</option> diff --git a/template/default/attachment/created.atml b/template/default/attachment/created.atml new file mode 100644 index 000000000..f58884fdd --- /dev/null +++ b/template/default/attachment/created.atml @@ -0,0 +1,35 @@ +[% INCLUDE global/header + title = "Changes Submitted" + style = "th { text-align: left; }" +%] + +<table border="1"> + <tr> + <td> + <h2> + <a title="[% description %]" href="attachment.cgi?id=[% attachid %]&action=edit">Attachment #[% attachid %]</a> + to <a href="show_bug.cgi?id=[% bugid %]">Bug #[% bugid %]</a> Created + </h2> + + [% mailresults %] + + [% IF contenttypemethod == 'autodetect' %] + <p> + <b>Note:</b> Bugzilla automatically detected the content type + <em>[% contenttype %]</em> for this attachment. If this is + incorrect, correct the value by + <a href="attachment.cgi?id=[% attachid %]&action=edit">editing the attachment</a>. + </p> + [% END %] + </td> + <td> + <a href="show_bug.cgi?id=[% bugid %]">Go back to bug #[% bugid %]</a> + </td> + </tr> +</table> + +<p> +<a href="attachment.cgi?bugid=[% bugid %]&action=enter">Create Another Attachment to Bug #[% bugid %]</a> +</p> + +[% INCLUDE global/footer %] diff --git a/template/default/attachment/edit.atml b/template/default/attachment/edit.atml index 5981a692f..ac9f327d0 100755 --- a/template/default/attachment/edit.atml +++ b/template/default/attachment/edit.atml @@ -19,6 +19,7 @@ <form method="post" action="attachment.cgi" onsubmit="normalizeComments();"> <input type="hidden" name="id" value="[% attachid %]"> <input type="hidden" name="action" value="update"> + <input type="hidden" name="contenttypemethod" value="manual"> <table width="100%"> @@ -29,7 +30,7 @@ <textarea rows="3" cols="25" name="description" wrap="soft">[% description %]</textarea><br> <b>MIME Type:</b><br> - <input type="text" size="20" name="mimetype" value="[% mimetype %]"><br> + <input type="text" size="20" name="contenttypeentry" value="[% contenttype %]"><br> <b>Flags:</b><br> <input type="checkbox" name="ispatch" value="1"[% " checked" IF ispatch %]>patch @@ -100,8 +101,8 @@ // If this is a plaintext document, remove cruft that Mozilla adds // because it treats it as an HTML document with a big PRE section. // http://bugzilla.mozilla.org/show_bug.cgi?id=86012 - var mimeType = '[% mimetype %]'; - if ( mimeType == 'text/plain' ) + var contentType = '[% contenttype %]'; + if ( contentType == 'text/plain' ) { theContent = theContent.replace( /^<html><head\/><body><pre>/ , "" ); theContent = theContent.replace( /<\/pre><\/body><\/html>$/ , "" ); diff --git a/template/default/attachment/enter.atml b/template/default/attachment/enter.atml new file mode 100644 index 000000000..8bbdd3a3a --- /dev/null +++ b/template/default/attachment/enter.atml @@ -0,0 +1,108 @@ +[%# Define strings that will serve as the title and header of this page %] +[% title = BLOCK %]Create New Attachment for Bug #[% bugid %][% END %] +[% h1 = BLOCK %]Create New Attachment for <a href="show_bug.cgi?id=[% bugid %]">Bug #[% bugid %]</a>[% END %] +[% h2 = BLOCK %][% bugsummary FILTER html %][% END %] + +[% INCLUDE global/header + title = title + h1 = h1 + h2 = h2 + style = " + th { text-align: right; vertical-align: baseline; white-space: nowrap; } + td { text-align: left; vertical-align: baseline; padding-bottom: 5px; } + " +%] + +<form name="entryform" method="post" action="attachment.cgi" enctype="multipart/form-data"> + <input type="hidden" name="bugid" value="[% bugid %]"> + <input type="hidden" name="action" value="insert"> + + <table> + <tr> + <th>File:</th> + <td> + <em>Enter the path to the file on your computer.</em><br> + <input type="file" name="data" size="50"> + </td> + </tr> + <tr> + <th>Description:</th> + <td> + <em>Describe the attachment briefly.</em><br> + <input type="text" name="description" size="60" maxlength="200"> + </td> + </tr> + <tr> + <th></th> + <td> + </td> + </tr> + <tr> + <th>Content Type:</th> + <td> + <em>If the attachment is a patch, check the box below.</em><br> + <input type="checkbox" name="ispatch" value="1" onchange="setContentTypeDisabledState();"> patch<br><br> + + <em>Otherwise, choose a method for determining the content type.</em><br> + <input type="radio" name="contenttypemethod" value="autodetect"> + auto-detect<br> + <input type="radio" name="contenttypemethod" value="list"> + select from list: <select name="contenttypeselection" onchange="this.form.contenttypemethod[1].checked = true;"> + [% PROCESS attachment/contenttypes %] + </select><br> + <input type="radio" name="contenttypemethod" value="manual"> + enter manually: <input type="text" name="contenttypeentry" size="30" maxlength="200" onchange="if (this.value) this.form.contenttypemethod[2].checked = true;"> + </td> + </tr> + <tr> + <th>Obsoletes:</th> + <td> + <em>(optional) Check each existing attachment made obsolete by your new attachment.</em><br> + [% IF attachments.size %] + [% FOREACH attachment = attachments %] + <input type="checkbox" name="obsolete" value="[% attachment.id %]"> + <a href="attachment.cgi?id=[% attachment.id %]&action=edit">[% attachment.id %]: [% attachment.description FILTER html %]</a><br> + [% END %] + [% ELSE %] + [no attachments can be made obsolete] + [% END %] + </td> + </tr> + <tr> + <th>Comment:</th> + <td> + <em>(optional) Add a comment about this attachment to the bug.</em><br> + <textarea wrap="soft" name="comment" rows="6" cols="80"></textarea> + </td> + </tr> + <tr> + <th> </th> + <td><input type="submit" value="Submit"></td> + </tr> + </table> + +</form> + +<script language="JavaScript" type="text/javascript"> + <!-- + function setContentTypeDisabledState() + { + var entryform = document.entryform; + + var isdisabled = false; + if (entryform.ispatch.checked) + isdisabled = true; + + for (var i=0 ; i<entryform.contenttypemethod.length ; i++) + entryform.contenttypemethod[i].disabled = isdisabled; + + entryform.contenttypeselection.disabled = isdisabled; + entryform.contenttypeentry.disabled = isdisabled; + } + //--> +</script> + +[% INCLUDE global/footer %] + + + diff --git a/template/default/attachment/list.atml b/template/default/attachment/list.atml index 3086c8dc0..9dd3931d0 100755 --- a/template/default/attachment/list.atml +++ b/template/default/attachment/list.atml @@ -12,9 +12,9 @@ <tr> <td valign="top"> [% IF attachment.isobsolete %] - <strike><a href="attachment.cgi?id=[% attachment.attachid %]&action=view">[% attachment.description %]</a></strike> + <strike><a href="attachment.cgi?id=[% attachment.attachid %]&action=view">[% attachment.description FILTER html %]</a></strike> [% ELSE %] - <a href="attachment.cgi?id=[% attachment.attachid %]&action=view">[% attachment.description %]</a> + <a href="attachment.cgi?id=[% attachment.attachid %]&action=view">[% attachment.description FILTER html %]</a> [% END %] </td> @@ -22,7 +22,7 @@ [% IF attachment.ispatch %] <i>patch</i> [% ELSE %] - [% attachment.mimetype %] + [% attachment.contenttype %] [% END %] </td> @@ -48,7 +48,7 @@ <tr> <td colspan="4"> - <a href="createattachment.cgi?id=[% bugid %]">Create a new attachment</a> (proposed patch, testcase, etc.) + <a href="attachment.cgi?bugid=[% bugid %]&action=enter">Create a New Attachment</a> (proposed patch, testcase, etc.) </td> <td colspan="1"> <a href="attachment.cgi?bugid=[% bugid %]&action=viewall">View All</a> diff --git a/template/default/attachment/viewall.atml b/template/default/attachment/viewall.atml index 9a22b716a..f7284b431 100755 --- a/template/default/attachment/viewall.atml +++ b/template/default/attachment/viewall.atml @@ -24,9 +24,9 @@ <tr> <td valign="top"> [% IF a.isobsolete %] - <strike>[% a.description %]</strike> + <strike>[% a.description FILTER html %]</strike> [% ELSE %] - [% a.description %] + [% a.description FILTER html %] [% END %] </td> @@ -34,7 +34,7 @@ [% IF a.ispatch %] <i>patch</i> [% ELSE %] - [% a.mimetype %] + [% a.contenttype FILTER html %] [% END %] </td> |