1 |
1 |
[% USE LxERP %]
|
2 |
2 |
[% USE L %]
|
|
3 |
[% USE T8 %]
|
|
4 |
[% USE Base64 %]
|
3 |
5 |
[% USE HTML %]
|
4 |
6 |
|
5 |
7 |
<!-- PENDENT: Ueberpruefen, Tabelle und Buttons -->
|
... | ... | |
30 |
32 |
</th>
|
31 |
33 |
<th>[% source.chkall_title %]</th>
|
32 |
34 |
[% END %]
|
|
35 |
<th>[% LxERP.t8('Version') %]</th>
|
33 |
36 |
<th>[% LxERP.t8('Date') %]</th>
|
34 |
37 |
<th>[% source.file_title %]</th>
|
35 |
38 |
[% IF file_type == 'image' %]
|
... | ... | |
37 |
40 |
<th>[% LxERP.t8('ImagePreview') %]</th>
|
38 |
41 |
<th>[% LxERP.t8('Description') %]</th>
|
39 |
42 |
[% ELSE %]
|
40 |
|
<th></th>
|
|
43 |
<th>[% LxERP.t8('ImagePreview') %]</th>
|
41 |
44 |
[% END %]
|
42 |
45 |
</tr>
|
43 |
46 |
</thead>
|
44 |
47 |
<tbody>
|
45 |
48 |
[% FOREACH file = source.files %]
|
46 |
|
<tr>
|
|
49 |
[%- is_other_version = 1 IF last_id == file.id %]
|
|
50 |
[%- last_id = file.id %]
|
|
51 |
[%- IF !is_other_version %]
|
|
52 |
<tr>
|
|
53 |
[%- ELSE %]
|
|
54 |
<tr class="[% 'version_row_' _ file.id %] hidden">
|
|
55 |
[%- END %]
|
47 |
56 |
[% IF edit_attachments %]
|
48 |
57 |
<td>[% L.checkbox_tag(checkname _ '[]', 'value'=file.id _ '_' _ file.version, 'class'=checkname) %]</td>
|
49 |
58 |
<td></td>
|
50 |
59 |
[% END %]
|
51 |
|
<td>[% file.mtime_as_timestamp_s %][% L.hidden_tag("version[]", file.version) %]</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) %]
|
|
64 |
</td>
|
|
65 |
<td>[% file.mtime_as_timestamp_s %]</td>
|
52 |
66 |
<td>
|
53 |
67 |
<a href="controller.pl?action=File/download&id=[% file.id %][% IF file.version %]&version=[% file.version %][% END %]">
|
54 |
|
<span id="[% "filename_" _ file.id %][% IF file.version %]_[% file.version %][% END %]">[% file.file_name %]</span></a>
|
|
68 |
<span id="[% "filename_" _ file.id %][% IF file.version %]_[% file.version %][% END %]">[% file.file_name %]</span>
|
|
69 |
</a>
|
55 |
70 |
</td>
|
56 |
71 |
[% IF file_type == 'image' %]
|
57 |
72 |
<td>[% file.title %]</td>
|
58 |
73 |
<td><img src="controller.pl?action=File/download&id=[% file.id %][% IF file.version %]&version=[% file.version %][% END %]" alt="[% file.title %]"></td>
|
59 |
74 |
<td>[% file.description %]</td>
|
60 |
75 |
[% ELSE %]
|
61 |
|
<td></td>
|
|
76 |
<td class="left">
|
|
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 %]">
|
|
85 |
</div>
|
|
86 |
[%- ELSE %]
|
|
87 |
-
|
|
88 |
[%- END %]
|
|
89 |
</td>
|
62 |
90 |
[% END %]
|
63 |
|
</tr>
|
|
91 |
</tr>
|
64 |
92 |
[% END %]
|
65 |
93 |
</tbody>
|
66 |
94 |
</table>
|
... | ... | |
79 |
107 |
[% can_rename = 1 %]
|
80 |
108 |
[% L.button_tag("kivi.File.rename(" _ object_id _ ",'" _ object_type _ "','" _ file_type _ "','" _ checkname _ "'," _ is_global _ ");", source.rename_title ) %]
|
81 |
109 |
[% END %]
|
82 |
|
[% IF source.can_upload %]
|
83 |
|
[% L.button_tag("kivi.File.upload(" _ object_id _ ",'" _ object_type _ "','" _ file_type _ "','" _ source.upload_title _ "'," _ is_global _ ");", source.upload_title ) %]
|
84 |
|
[% END %]
|
85 |
110 |
[% IF source.can_import %]
|
86 |
111 |
[% L.button_tag("kivi.File.import(" _ object_id _ ",'" _ object_type _ "','" _ file_type _ "','" _ source.name _ "','" _ source.path _"');", source.import_title ) %]
|
87 |
112 |
[% END %]
|
|
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 %]
|
|
122 |
</span>
|
|
123 |
[% END %]
|
88 |
124 |
</div><!-- /.buttons -->
|
89 |
125 |
|
90 |
126 |
[% END #FOREACH SOURCES %]
|
... | ... | |
104 |
140 |
[% END %]
|
105 |
141 |
[% END %]
|
106 |
142 |
[% END %]
|
|
143 |
|
|
144 |
<script>
|
|
145 |
$(function() {
|
|
146 |
kivi.File.list_div_id = "[% file_type %]_list_[% object_type %]";
|
|
147 |
kivi.File.init();
|
|
148 |
});
|
|
149 |
</script>
|
design40: Dateimanagment: HTML-Templates angepasst