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) %]
10 [%- IF SELF.picture.id %]
11 [%- LxERP.t8("Edit text block picture #1", SELF.picture.number) %]
13 [%- LxERP.t8("Add picture to text block") %]
18 [% IF SELF.picture.number %]
20 <th align="right">[%- LxERP.t8("Number") %]:</th>
21 <td>[% HTML.escape(SELF.picture.number) %]</td>
26 <th align="right">[%- LxERP.t8("Description") %]:</th>
27 <td>[% L.input_tag(id_base _ '.description', SELF.picture.description, style=style) %]</td>
30 [% IF SELF.picture.picture_content %]
32 <th align="right">[%- LxERP.t8("File name") %]:</th>
33 <td>[% HTML.escape(SELF.picture.picture_file_name) %]</td>
37 <th align="right">[%- LxERP.t8("MIME type") %]:</th>
38 <td>[% HTML.escape(SELF.picture.picture_content_type) %]</td>
42 <th align="right">[%- LxERP.t8("Dimensions") %]:</th>
43 <td>[% HTML.escape(SELF.picture.picture_width) %]x[% HTML.escape(SELF.picture.picture_height) %]</td>
47 <th align="right">[%- LxERP.t8("Uploaded at") %]:</th>
48 <td>[% HTML.escape(SELF.picture.picture_mtime.to_kivitendo(precision='second')) %]</td>
53 <th align="right">[%- LxERP.t8("Select file to upload") %]:</th>
54 <td>[% L.input_tag(id_base _ '.picture_content', '', type='file') %]</td>
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>
65 [% IF SELF.picture.id %]
66 <h2>[% LxERP.t8("Current picture") %]</h2>
69 <img src="data:[% HTML.escape(SELF.picture.picture_content_type) %];base64,[% SELF.picture.picture_content.encode_base64 %]">