[%# The contents of this file are subject to the Mozilla Public
  # License Version 1.1 (the "License"); you may not use this file
  # except in compliance with the License. You may obtain a copy of
  # the License at http://www.mozilla.org/MPL/
  #
  # Software distributed under the License is distributed on an "AS
  # IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
  # implied. See the License for the specific language governing
  # rights and limitations under the License.
  #
  # The Original Code is the Bugzilla Bug Tracking System.
  #
  # The Initial Developer of the Original Code is Netscape Communications
  # Corporation. Portions created by Netscape are
  # Copyright (C) 1998 Netscape Communications Corporation. All
  # Rights Reserved.
  #
  # Contributor(s): Myk Melez <myk@mozilla.org>
  #                 Joel Peshkin <bugreport@peshkin.net>
  #                 Erik Stambaugh <erik@dasbistro.com>
  #                 Marc Schumann <wurblzap@gmail.com>
  #%]

<tr class="expert_fields">
  [%# Don't remove this hidden text, its purpose is to align columns correctly! %]
  <th style="visibility: hidden; white-space: nowrap">Attachment text:</th>
  <td>
    <input onclick="switchAttype(this)" type="radio" name="attype" id="attype_file" value="file" checked="checked" />
    <label for="attype_file">Attach file</label>
    <input onclick="switchAttype(this)" type="radio" name="attype" id="attype_text" value="text" />
    <label for="attype_text">Enter text</label>
  [% IF Param("use_supa_applet") %]
    <input onclick="switchAttype(this)" type="radio" name="attype" id="attype_supa" value="supa" />
    <label for="attype_supa">Paste image from clipboard</label>
  [% END %]
  </td>
</tr>
<tr id="attype_file_row">
  <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"
        onchange="DataFieldHandler()" />
  </td>
</tr>
<tr class="expert_fields" id="attype_text_row" style="display: none">
  <th><label for="text_attachment">Attachment text:</label></th>
  <td>
    <em>Enter or paste attachment text here:</em><br />
    <textarea wrap="soft" id="text_attachment" name="text_attachment" rows="4" cols="60"></textarea>
  </td>
</tr>
[% IF Param("use_supa_applet") %]
<tr class="expert_fields" id="attype_supa_row" style="display: none">
  <th>
    <a href="javascript:void supaPasteAgain()">Paste again</a>
    <input type="hidden" name="base64_content" id="base64_content" value="" />
  </th>
  <td id="supa_container">
  [% FILTER html %]
    <applet id="SupaApplet" archive="[% Param('supa_jar_url') OR "js/Supa.jar" %]"
      code="de.christophlinder.supa.SupaApplet" width="400" height="300">
      <param name="trace" value="true" />
      <param name="pasteonload" value="true" />
      <param name="clickforpaste" value="true" />
      <param name="imagecodec" value="png" />
      <param name="encoding" value="base64" />
      <param name="previewscaler" value="fit to canvas" />
      Please enable <a href="http://www.java.com/">Java</a> Applet support in your browser.
    </applet>
  [% END %]
  </td>
</tr>
[% END %]
[% IF Param("maxlocalattachment") && !Param("force_attach_bigfile") %]
<tr class="expert_fields">
  <th>BigFile:</th>
  <td>
    <input type="checkbox" id="bigfile" name="bigfile" value="bigfile" />
    <label for="bigfile">
      Big File - Stored locally and may be purged
    </label>
  </td>
</tr>
[% END %]
<tr>
  <th><label for="description">Description</label>:</th>
  <td>
    <em>Describe the attachment briefly.</em><br />
    <input type="text" id="description" name="description" size="60" maxlength="200" onchange="this._changed=true" />
  </td>
</tr>
<tr class="expert_fields" id="content_type_row">
  <th>Content Type:</th>
  <td>
    <em>If the attachment is a patch, check the box below.</em><br />
    <input type="checkbox" id="ispatch" name="ispatch" value="1"
           onchange="setContentTypeDisabledState(this.form);" />
    <label for="ispatch">patch</label><br /><br />
    [%# Reset this whenever the page loads so that the JS state is up to date %]
    <script type="text/javascript">
      <!--
      addListener(window, 'load', function() {
        setContentTypeDisabledState(document.getElementById('ispatch').form);
      });
      //-->
    </script>

    <em>Otherwise, choose a method for determining the content type.</em><br />
    <input type="radio" id="autodetect"
           name="contenttypemethod" value="autodetect" checked="checked" />
      <label for="autodetect">auto-detect</label><br />
    <input type="radio" id="list"
           name="contenttypemethod" value="list" />
      <label for="list">select from list</label>:
      <select name="contenttypeselection" id="contenttypeselection"
              onchange="this.form.contenttypemethod[1].checked = true;">
        [% PROCESS "attachment/content-types.html.tmpl" %]
      </select><br />
    <input type="radio" id="manual"
                 name="contenttypemethod" value="manual" />
      <label for="manual">enter manually</label>:
      <input type="text" name="contenttypeentry" id="contenttypeentry"
             size="30" maxlength="200"
             onchange="if (this.value) this.form.contenttypemethod[2].checked = true;" />
  </td>
</tr>
<tr class="expert_fields">
  <td> </td>
  <td>
    [% IF flag_types && flag_types.size > 0 %]
      [% PROCESS "flag/list.html.tmpl" bug_id=bugid attach_id=attachid %]<br />
    [% END %]
  </td>
</tr>
