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="[% IF file_type == 'image' %]8[% ELSE %]6[% END %]">[% 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="2%"><b>[%  LxERP.t8('Version') %]</b></th>
 
  33      <th class="listheading" width="15%"><b>[%  LxERP.t8('Date') %]</b></th>
 
  34      <th class="listheading" width="20%"><b>[%  source.file_title %]</b></th>
 
  35      [%- IF file_type == 'image' %]
 
  36       <th class="listheading" width="15%"><b>[%  LxERP.t8('Title') %]</b></th>
 
  37       <th class="listheading" width="10%">
 
  38        <b>[%  LxERP.t8('ImagePreview') %]</b>
 
  40       <th class="listheading" width="30%"><b>[%  LxERP.t8('Description') %]</b></th>
 
  42       <th class="listheading" width="40%"><b>[%  LxERP.t8('ImagePreview') %]</b></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 %]
 
  52       [%- row_cnt = row_cnt + 1 %]
 
  53       <tr class="listrow[% row_cnt % 2 %]">
 
  55       <tr class="[% 'version_row_' _ file.id %] listrow[% row_cnt % 2 %] hidden">
 
  57       [%- IF edit_attachments %]
 
  58        <td>[%- L.checkbox_tag(checkname _ '[]', 'value'=file.id _ '_' _ file.version, 'class'=checkname) %]</td>
 
  61       <td align="right" [%- IF file.version_count > 1 && !is_other_version %] class="cursor-pointer" onclick="kivi.File.toggle_versions('[% file.id %]')"[%- END %]>
 
  62        [%- IF file.version_count > 1 && !is_other_version %]<span id="[% 'version_toggle_' _ file.id %]">⏷ </span>[% END %]
 
  63        [% file.version _ '/' _ file.version_count %]
 
  64        [% L.hidden_tag("version[]", file.version) %]
 
  66       <td>[% file.mtime_as_timestamp_s %]</td>
 
  68        <a href="controller.pl?action=File/download&id=[% file.id %][%- IF file.version %]&version=[%- file.version %][%- END %]">
 
  69         <span id="[% "filename_" _ file.id %][%- IF file.version %]_[% file.version %][%- END %]">[% file.file_name %]</span>
 
  72       [%- IF file_type == 'image' %]
 
  73        <td>[% file.title %]</td>
 
  75         <img src="controller.pl?action=File/download&id=[% file.id %][%- IF file.version %]&version=[%- file.version %][%- END %]" alt="[% file.title %]" width="64px">
 
  77        <td>[% file.description %]</td>
 
  80         [%- IF file.thumbnail %]
 
  81          <div class="overlay_div">
 
  82           <img id="thumb_[% file.id %]" class="thumbnail"
 
  83                data-file-id="[% file.id %]" data-file-version="[% file.version %]"
 
  84                src="data:[% HTML.escape(file.thumbnail.thumbnail_img_content_type) %];base64,[% file.thumbnail.thumbnail_img_content.encode_base64 %]"
 
  85                alt="[% file.file_name %]">
 
  86           <img id="enlarged_thumb_[% file.id %][% IF file.version %]_[% file.version %][% END %]" class="overlay_img" style="display:none;"
 
  87                data-file-id="[% file.id %]" data-file-version="[% file.version %]">
 
  95     [%- END # FOREACH file %]
 
 100    [%- IF edit_attachments %]
 
 101     [%- IF source.can_import %]
 
 102      [% L.button_tag("kivi.File.unimport(" _ object_id _ ",'" _ object_type _ "','" _ file_type _ "','" _ checkname _ "');",source.chk_title) %]
 
 104      [%- IF source.can_delete %]
 
 105       [% L.button_tag("kivi.File.delete("   _ object_id _ ",'" _ object_type _ "','" _ file_type _ "','" _ checkname _ "'," _ is_global _ ");",  source.chk_title) %]
 
 109    [%- IF source.can_rename %]
 
 110     [%- can_rename = 1 %]
 
 111     [% L.button_tag("kivi.File.rename(" _ object_id _ ",'" _ object_type _ "','" _ file_type _ "','" _ checkname _ "'," _ is_global _ ");",  source.rename_title ) %]
 
 113    [%- IF source.can_import %]
 
 114     [% L.button_tag("kivi.File.import("   _ object_id _ ",'" _ object_type _ "','" _ file_type _ "','" _ source.name _ "','" _ source.path _"');",  source.import_title ) %]
 
 116    [%- IF source.can_upload %]
 
 117     [% L.button_tag("kivi.File.upload(" _ object_id _ ",'" _ object_type _ "','" _ file_type _ "','" _ source.upload_title _ "'," _ is_global _ ");", source.upload_title ) %]
 
 118     <span class="upload_drop_zone"
 
 119           data-object-type="[% object_type %]"
 
 120           data-object-id="[% object_id %]"
 
 121           data-file-type="[% file_type %]"
 
 122           data-is-global="[% is_global %]"
 
 123           data-maxsize="[% INSTANCE_CONF.get_doc_max_filesize %]">
 
 124       [% 'Drag and drop files here' | $T8 %]
 
 128  [%- END # FOREACH source %]
 
 131   [% L.button_tag("kivi.File.update(" _ object_id _ ",'" _ object_type _ "','" _ file_type _ "'," _ is_global _ ");", LxERP.t8('Update')) %]
 
 137  [%- UNLESS is_global %]
 
 139    [% INCLUDE 'file/rename_dialog.html' -%]
 
 146     kivi.File.list_div_id = "[% file_type %]_list_[% object_type %]";