summaryrefslogtreecommitdiffstats
path: root/template/en/default/attachment/createformcontents.html.tmpl
blob: d0ca336fc5ee47a1c369dee0cc432bb1ee6d66c2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
[%# 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>
  <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 %]
    >
  </td>
</tr>
[% IF Param("maxlocalattachment") %]
<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 %]
[% IF Param("allow_attach_url") %]
<tr class="expert_fields">
  <th><label for="attachurl">AttachURL</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()">
  </td>
</tr>
</tbody>
[% 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">
  </td>
</tr>
<tr class="expert_fields">
  <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">
      YAHOO.util.Event.onDOMReady(function() {
          bz_fireEvent(document.getElementById('ispatch'), 'change');
      });
    </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 content_types %]
      </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>

[% BLOCK content_types %]
  [% mimetypes = [{type => "text/plain", desc => "plain text"},
                  {type => "text/html",  desc => "HTML source"},
                  {type => "application/xml", desc => "XML source"},
                  {type => "image/gif",  desc => "GIF image"},
                  {type => "image/jpeg", desc => "JPEG image"},
                  {type => "image/png",  desc => "PNG image"},
                  {type => "application/octet-stream", desc => "binary file"}]
  %]
  [% Hook.process("mimetypes", "attachment/createformcontents.html.tmpl") %]

  [% FOREACH m = mimetypes %]
    <option value="[% m.type FILTER html %]">[% m.desc FILTER html %] ([% m.type FILTER html %])</option>
  [% END %]
[% END %]