7 <!-- PENDENT: Ueberpruefen, Tabelle und Buttons -->
9 <div id="[% file_type %]_list_[% object_type %]">
12 <div class="wrapper scroll">
15 [% SET can_rename = 0 %]
16 [% FOREACH source = SOURCES %]
18 <table class="tbl-list">
19 <caption>[% source.title %]</caption>
22 [% SET checkname = source.chk_action %]
24 [% SET checkname = object_type _ '_' _ source.chk_action %]
26 [% IF edit_attachments %]
28 <script type="text/javascript"><!--
29 $(function() { $('#[% checkname %]_checkall').checkall('INPUT[name="[% checkname %][]"]'); });
31 [% L.checkbox_tag(checkname _ '_checkall') %]
33 <th>[% source.chkall_title %]</th>
35 <th>[% LxERP.t8('Version') _ ' (' _ LxERP.t8('Count') _ ')' %]</th>
36 <th>[% LxERP.t8('Date') %]</th>
37 <th>[% source.file_title %]</th>
38 [% IF file_type == 'image' %]
39 <th>[% LxERP.t8('Title') %]</th>
40 <th>[% LxERP.t8('ImagePreview') %]</th>
41 <th>[% LxERP.t8('Description') %]</th>
43 <th>[% LxERP.t8('ImagePreview') %]</th>
48 [% FOREACH file = source.files %]
49 [%- is_other_version = 1 IF last_id == file.id %]
50 [%- last_id = file.id %]
51 [%- IF !is_other_version %]
54 <tr class="[% 'version_row_' _ file.id %] hidden">
56 [% IF edit_attachments %]
57 <td>[% L.checkbox_tag(checkname _ '[]', 'value'=file.file_version.guid, 'class'=checkname) %]</td>
60 <td class="right[%- IF file.version_count > 1 && !is_other_version %] cursor-pointer" onclick="kivi.File.toggle_versions('[% file.id %]')"[%- ELSE -%]"[%- END %]>[%#"%]
61 [%- IF file.version_count > 1 && !is_other_version %]<span id="[% 'version_toggle_' _ file.id %]">⏷ </span>[% END %]
62 [% file.version _ ' (' _ file.version_count _ ')' %]
63 [% L.hidden_tag("version[]", file.version) %]
65 <td>[% file.mtime_as_timestamp_s %]</td>
67 <a href="controller.pl?action=File/download&id=[% file.id %][% IF file.version %]&version=[% file.version %][% END %]">
68 <span id="[% "filename_" _ file.id %][% IF file.version %]_[% file.version %][% END %]">[% file.file_name %]</span>
71 [% IF file_type == 'image' %]
72 <td>[% file.title %]</td>
73 <td><img src="controller.pl?action=File/download&id=[% file.id %][% IF file.version %]&version=[% file.version %][% END %]" alt="[% file.title %]"></td>
74 <td>[% file.description %]</td>
77 [%- IF file.thumbnail %]
78 <div class="overlay_div">
79 <img id="thumb_[% file.id %]" class="thumbnail"
80 data-file-id="[% file.id %]" data-file-version="[% file.version %]"
81 src="data:[% HTML.escape(file.thumbnail.thumbnail_img_content_type) %];base64,[% file.thumbnail.thumbnail_img_content.encode_base64 %]"
82 alt="[% file.file_name %]">
83 <img id="enlarged_thumb_[% file.id %][% IF file.version %]_[% file.version %][% END %]" class="overlay_img" style="display:none;"
84 data-file-id="[% file.id %]" data-file-version="[% file.version %]">
97 [% IF edit_attachments %]
98 [% IF source.can_import %]
99 [% L.button_tag("kivi.File.unimport(" _ object_id _ ",'" _ object_type _ "','" _ file_type _ "','" _ checkname _ "');",source.chk_title) %]
101 [% IF source.can_delete %]
102 [% L.button_tag("kivi.File.delete(" _ object_id _ ",'" _ object_type _ "','" _ file_type _ "','" _ checkname _ "'," _ is_global _ ");", source.chk_title) %]
106 [% IF source.can_rename %]
108 [% L.button_tag("kivi.File.rename(" _ object_id _ ",'" _ object_type _ "','" _ file_type _ "','" _ checkname _ "'," _ is_global _ ");", source.rename_title ) %]
110 [% IF source.can_import %]
111 [% L.button_tag("kivi.File.import(" _ object_id _ ",'" _ object_type _ "','" _ file_type _ "','" _ source.name _ "','" _ source.path _"');", source.import_title ) %]
113 [% IF source.can_upload %]
114 [% L.button_tag("kivi.File.upload(" _ object_id _ ",'" _ object_type _ "','" _ file_type _ "','" _ source.upload_title _ "'," _ is_global _ ");", source.upload_title ) %]
115 <span class="upload_drop_zone"
116 data-object-type="[% object_type %]"
117 data-object-id="[% object_id %]"
118 data-file-type="[% file_type %]"
119 data-is-global="[% is_global %]"
120 data-maxsize="[% INSTANCE_CONF.get_doc_max_filesize %]">
121 [% 'Drag and drop files here' | $T8 %]
124 </div><!-- /.buttons -->
126 [% END #FOREACH SOURCES %]
128 <div class="buttons">
129 [% L.button_tag("kivi.File.update(" _ object_id _ ",'" _ object_type _ "','" _ file_type _ "'," _ is_global _ ");", LxERP.t8('Update')) %]
132 </div><!-- /.wrapper -->
137 [% UNLESS is_global %]
139 [% INCLUDE 'file/rename_dialog.html' %]
146 kivi.File.list_div_id = "[% file_type %]_list_[% object_type %]";