1[%# This Source Code Form is subject to the terms of the Mozilla Public
2  # License, v. 2.0. If a copy of the MPL was not distributed with this
3  # file, You can obtain one at http://mozilla.org/MPL/2.0/.
4  #
5  # This Source Code Form is "Incompatible With Secondary Licenses", as
6  # defined by the Mozilla Public License, v. 2.0.
7  #%]
8
9[% max_local = Param('maxlocalattachment') * 1024 %]
10[% max_limit = Param('maxattachmentsize')> max_local ? Param('maxattachmentsize') : max_local %]
11<tr class="attachment_data">
12  <th><label for="data">ファイル</label>:</th>
13  <td>
14    <em>あなたのコンピュータ内でのファイルのパスを入力してください</em> (もしくは
15    <a id="attachment_data_controller" href="javascript:TUI_toggle_class('attachment_text_field');
16                                             javascript:TUI_toggle_class('attachment_data')"
17    >添付にしたいテキストデータをペーストしてください</a>)。<br>
18    <input type="file" id="data" name="data" size="50" onchange="DataFieldHandler()">
19    <br><em>(最大ファイルサイズ: [% max_limit FILTER html %] KB)</em>
20  </td>
21</tr>
22<tr class="attachment_text_field">
23  <th><label for="attach_text">ファイル</label>:</th>
24  <td>
25    <em>添付として追加するテキストを貼り付けてください</em> (もしくは
26    <a id="attachment_text_field_controller" href="javascript:TUI_toggle_class('attachment_text_field');
27                                                   javascript:TUI_toggle_class('attachment_data')"
28    >ファイルを添付してください</a>)。<br>
29    <textarea id="attach_text" name="attach_text" cols="80" rows="15"
30              onkeyup="TextFieldHandler()" onblur="TextFieldHandler()"></textarea>
31  </td>
32</tr>
33<tr>
34  <th class="required"><label for="description">説明</label>:</th>
35  <td>
36    <em>添付の説明を簡単に入力してください。</em><br>
37    <input type="text" id="description" name="description" class="required"
38           size="60" maxlength="200">
39  </td>
40</tr>
41<tr[% ' class="expert_fields"' UNLESS bug.id %]>
42  <th>ファイル型:</th>
43  <td>
44    <em>添付がパッチなら、次を有効にしてください。</em><br>
45    <input type="checkbox" id="ispatch" name="ispatch" value="1"
46           onchange="setContentTypeDisabledState(this.form);">
47    <label for="ispatch">パッチ</label><br><br>
48    [%# Reset this whenever the page loads so that the JS state is up to date %]
49    <script type="text/javascript">
50      YAHOO.util.Event.onDOMReady(function() {
51          bz_fireEvent(document.getElementById('ispatch'), 'change');
52      });
53    </script>
54
55    <em>そうでなければ、ファイル型の決定方法を選択してください。</em><br>
56    <input type="radio" id="autodetect"
57           name="contenttypemethod" value="autodetect" checked="checked">
58      <label for="autodetect">自動認識</label><br>
59    <input type="radio" id="list"
60           name="contenttypemethod" value="list">
61      <label for="list">リストから選択</label>:
62      <select name="contenttypeselection" id="contenttypeselection"
63              onchange="this.form.contenttypemethod[1].checked = true;">
64        [% PROCESS content_types %]
65      </select><br>
66    <input type="radio" id="manual"
67                 name="contenttypemethod" value="manual">
68      <label for="manual">自分で入力</label>:
69      <input type="text" name="contenttypeentry" id="contenttypeentry"
70             size="30" maxlength="200"
71             onchange="if (this.value) this.form.contenttypemethod[2].checked = true;">
72  </td>
73</tr>
74<tr[% ' class="expert_fields"' UNLESS bug.id %]>
75  <td> </td>
76  <td>
77    [% IF flag_types && flag_types.size > 0 %]
78      [% PROCESS "flag/list.html.tmpl" %]<br>
79    [% END %]
80  </td>
81</tr>
82
83[% BLOCK content_types %]
84  [% mimetypes = [{type => "text/plain", desc => "プレーンテキスト"},
85                  {type => "text/html",  desc => "HTML 文書"},
86                  {type => "application/xml", desc => "XML 文書"},
87                  {type => "image/gif",  desc => "GIF 画像"},
88                  {type => "image/jpeg", desc => "JPEG 画像"},
89                  {type => "image/png",  desc => "PNG 画像"},
90                  {type => "application/pdf", desc => "PDF 文書"},
91                  {type => "application/octet-stream", desc => "バイナリファイル"}]
92  %]
93  [% Hook.process("mimetypes", "attachment/createformcontents.html.tmpl") %]
94
95  [% FOREACH m = mimetypes %]
96    <option value="[% m.type FILTER html %]">[% m.desc FILTER html %] ([% m.type FILTER html %])</option>
97  [% END %]
98[% END %]
99