1 [%- USE LxERP -%][% USE L %]
6 <div id="[% file_type %]_list_[% object_type %]">
8 <div class="listtop">[% title %]</div>
10 <div style="padding-bottom: 15px">
11 [%- SET can_rename = 0 %]
12 [%- FOREACH source = SOURCES %]
13 <table style="width: 100%" >
15 <tr><th class="listheading" colspan="6">[% source.title %]</th></tr>
17 [%- SET checkname = source.chk_action %]
19 [%- SET checkname = object_type _ '_' _ source.chk_action %]
21 [%- IF edit_attachments %]
22 <script type="text/javascript">
25 $('#[% checkname %]_checkall').checkall('INPUT[name="[% checkname %][]"]');
29 <th class="listheading" width="3%">[% L.checkbox_tag(checkname _ '_checkall') %]</th>
30 <th class="listheading" width="7%">[% source.chkall_title %]</th>
32 <th class="listheading" width="15%"><b>[% LxERP.t8('Date') %]</b></th>
33 <th class="listheading" width="20%"><b>[% source.file_title %]</b></th>
34 [%- IF file_type == 'image' %]
35 <th class="listheading" width="15%"><b>[% LxERP.t8('Title') %]</b></th>
36 <th class="listheading" width="10%">
37 <b>[% LxERP.t8('ImagePreview') %]</b>
39 <th class="listheading" width="30%"><b>[% LxERP.t8('Description') %]</b></th>
41 <th class="listheading" width="40%"><b>[% LxERP.t8('ImagePreview') %]</b></th>
47 [%- FOREACH file = source.files %]
48 <tr class="listrow[% loop.count % 2 %]">
49 [%- IF edit_attachments %]
50 <td>[%- L.checkbox_tag(checkname _ '[]', 'value'=file.id _ '_' _ file.version, 'class'=checkname) %]</td>
53 <td>[% file.mtime_as_timestamp_s %][% L.hidden_tag("version[]", file.version) %]</td>
55 <a href="controller.pl?action=File/download&id=[% file.id %][%- IF file.version %]&version=[%- file.version %][%- END %]">
56 <span id="[% "filename_" _ file.id %][%- IF file.version %]_[% file.version %][%- END %]">[% file.file_name %]</span>
59 [%- IF file_type == 'image' %]
60 <td>[% file.title %]</td>
62 <img src="controller.pl?action=File/download&id=[% file.id %][%- IF file.version %]&version=[%- file.version %][%- END %]" alt="[% file.title %]" width="64px">
64 <td>[% file.description %]</td>
67 [%- IF file.thumbnail %]
68 <div class="overlay_div">
69 <img id="thumb_[% file.id %]" class="thumbnail"
70 data-file-id="[% file.id %]" data-file-version="[% file.version %]"
71 src="data:[% HTML.escape(file.thumbnail.thumbnail_img_content_type) %];base64,[% file.thumbnail.thumbnail_img_content.encode_base64 %]"
72 alt="[% file.file_name %]">
73 <img id="enlarged_thumb_[% file.id %][% IF file.version %]_[% file.version %][% END %]" class="overlay_img" style="display:none;"
74 data-file-id="[% file.id %]" data-file-version="[% file.version %]">
82 [%- END # FOREACH file %]
87 [%- IF edit_attachments %]
88 [%- IF source.can_import %]
89 [% L.button_tag("kivi.File.unimport(" _ object_id _ ",'" _ object_type _ "','" _ file_type _ "','" _ checkname _ "');",source.chk_title) %]
91 [%- IF source.can_delete %]
92 [% L.button_tag("kivi.File.delete(" _ object_id _ ",'" _ object_type _ "','" _ file_type _ "','" _ checkname _ "'," _ is_global _ ");", source.chk_title) %]
96 [%- IF source.can_rename %]
98 [% L.button_tag("kivi.File.rename(" _ object_id _ ",'" _ object_type _ "','" _ file_type _ "','" _ checkname _ "'," _ is_global _ ");", source.rename_title ) %]
100 [%- IF source.can_import %]
101 [% L.button_tag("kivi.File.import(" _ object_id _ ",'" _ object_type _ "','" _ file_type _ "','" _ source.name _ "','" _ source.path _"');", source.import_title ) %]
103 [%- IF source.can_upload %]
104 [% L.button_tag("kivi.File.upload(" _ object_id _ ",'" _ object_type _ "','" _ file_type _ "','" _ source.upload_title _ "'," _ is_global _ ");", source.upload_title ) %]
105 <span class="upload_drop_zone"
106 data-object-type="[% object_type %]"
107 data-object-id="[% object_id %]"
108 data-file-type="[% file_type %]"
109 data-is-global="[% is_global %]"
110 data-maxsize="[% INSTANCE_CONF.get_doc_max_filesize %]">
111 [% 'Drag and drop files here' | $T8 %]
115 [%- END # FOREACH source %]
118 [% L.button_tag("kivi.File.update(" _ object_id _ ",'" _ object_type _ "','" _ file_type _ "'," _ is_global _ ");", LxERP.t8('Update')) %]
124 [%- UNLESS is_global %]
126 [% INCLUDE 'file/rename_dialog.html' -%]
133 kivi.File.list_div_id = "[% file_type %]_list_[% object_type %]";