Pflichtenhefte: Unterstützung für an Textblöcke angehängte Bilder
[kivitendo-erp.git] / templates / webpages / requirement_spec_text_block / _picture_form.html
1 [%- USE LxERP -%][%- USE L -%][%- USE HTML -%][%- USE JavaScript -%][% USE Base64 %][% SET style="width: 500px" %]
2 [% SET id_base = 'edit_text_block_picture_' _ (SELF.picture.id ? SELF.picture.id : 'new') %]
3 <form method="post" id="[% id_base %]_form" method="POST" enctype="multipart/form-data">
4  [% L.hidden_tag('form_prefix',                    id_base,         id=id_base _ '_form_prefix') %]
5  [% L.hidden_tag('id',                             SELF.picture.id, no_id=1) %]
6  [% L.hidden_tag(id_base _ '.text_block_id',       SELF.text_block.id) %]
7  [% L.hidden_tag(id_base _ '.requirement_spec_id', SELF.text_block.requirement_spec_id) %]
8
9  <h2>
10   [%- IF SELF.picture.id %]
11    [%- LxERP.t8("Edit text block picture #1", SELF.picture.number) %]
12   [%- ELSE %]
13    [%- LxERP.t8("Add picture to text block") %]
14   [%- END %]
15  </h2>
16
17  <table>
18 [% IF SELF.picture.number %]
19   <tr>
20    <th align="right">[%- LxERP.t8("Number") %]:</th>
21    <td>[% HTML.escape(SELF.picture.number) %]</td>
22   </tr>
23 [% END %]
24
25   <tr>
26    <th align="right">[%- LxERP.t8("Description") %]:</th>
27    <td>[% L.input_tag(id_base _ '.description', SELF.picture.description, style=style) %]</td>
28   </tr>
29
30 [% IF SELF.picture.picture_content %]
31   <tr>
32    <th align="right">[%- LxERP.t8("File name") %]:</th>
33    <td>[% HTML.escape(SELF.picture.picture_file_name) %]</td>
34   </tr>
35
36   <tr>
37    <th align="right">[%- LxERP.t8("MIME type") %]:</th>
38    <td>[% HTML.escape(SELF.picture.picture_content_type) %]</td>
39   </tr>
40
41   <tr>
42    <th align="right">[%- LxERP.t8("Dimensions") %]:</th>
43    <td>[% HTML.escape(SELF.picture.picture_width) %]x[% HTML.escape(SELF.picture.picture_height) %]</td>
44   </tr>
45
46   <tr>
47    <th align="right">[%- LxERP.t8("Uploaded at") %]:</th>
48    <td>[% HTML.escape(SELF.picture.picture_mtime.to_kivitendo(precision='second')) %]</td>
49   </tr>
50 [% END %]
51
52   <tr>
53    <th align="right">[%- LxERP.t8("Select file to upload") %]:</th>
54    <td>[% L.input_tag(id_base _ '.picture_content', '', type='file') %]</td>
55   </tr>
56  </table>
57
58  <p>
59   [%- L.ajax_submit_tag('controller.pl?action=RequirementSpecTextBlock/ajax_' _ (SELF.picture.id ? 'update' : 'create') _ '_picture', '#' _ id_base _ '_form', LxERP.t8('Save'), no_id=1) %]
60   <a href="#" onclick="$('#jqueryui_popup_dialog').dialog('close');">[%- LxERP.t8("Cancel") %]</a>
61  </p>
62
63 </form>
64
65 [% IF SELF.picture.id %]
66 <h2>[% LxERP.t8("Current picture") %]</h2>
67
68 <div>
69  <img src="data:[% HTML.escape(SELF.picture.picture_content_type) %];base64,[% SELF.picture.picture_content.encode_base64 %]">
70 </div>
71 [% END %]