<% # encoding: utf-8 # # Redmine plugin for Document Management System "Features" # # Karel Pičman # # This file is part of Redmine DMSF plugin. # # Redmine DMSF plugin is free software: you can redistribute it and/or modify it under the terms of the GNU General # Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any # later version. # # Redmine DMSF plugin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even # the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for # more details. # # You should have received a copy of the GNU General Public License along with Redmine DMSF plugin. If not, see # . %> <% folders = DmsfFolder.visible.joins( 'JOIN dmsf_locks ON dmsf_folders.id = dmsf_locks.entity_id').where( ['dmsf_locks.entity_type = ? AND dmsf_locks.user_id = ? AND (dmsf_locks.expires_at IS NULL OR dmsf_locks.expires_at > ?)', 1, @user&.id, Time.current]) %> <% files = DmsfFile.visible.joins( 'JOIN dmsf_locks ON dmsf_files.id = dmsf_locks.entity_id').where( ['dmsf_locks.entity_type = ? AND dmsf_locks.user_id = ? AND (dmsf_locks.expires_at IS NULL OR dmsf_locks.expires_at > ?)', 0, @user&.id, Time.current]) %>

<%= l(:locked_documents)%> (<%= "#{folders.all.size} #{l(:label_number_of_folders).downcase}" %> / <%= "#{files.all.size} #{l(:label_number_of_documents).downcase}" %>)

<% if folders.any? || files.any?%> <%= form_tag({}, data: { cm_url: dmsf_context_menu_path }) do %> <%= hidden_field_tag 'back_url', my_page_path, id: nil %> <% folders.each do |folder| %> <% end %> <% files.each do |file| %> <% end %>
<%= check_box_tag 'check_all', '', false, class: 'toggle-selection', title: "#{l(:button_check_all)}/#{l(:button_uncheck_all)}" %> <%= l(:field_project) %> <%= l(:label_document) %>/<%= l(:field_folder) %> <%= l(:field_folder) %>
<%= check_box_tag 'ids[]', "folder-#{folder.id}", false, id: nil %> <%= link_to_project folder.project %> <%= link_to sprite_icon('folder', h(folder.title)), dmsf_folder_path(id: folder.project, folder_id: folder), class: 'icon icon-folder' %> <% if folder.dmsf_folder %> <%= link_to h(folder.dmsf_folder.title), dmsf_folder_path(id: folder.project, folder_id: folder.dmsf_folder) %> <% else %> <%= link_to l(:link_documents), dmsf_folder_path(id: folder.project) %> <% end %> <%= link_to_context_menu %>
<%= check_box_tag 'ids[]', "file-#{file.id}", false, id: nil %> <%= link_to_project file.project %> <% icon_name = icon_for_mime_type(Redmine::MimeType.css_class_of(file.name)) %> <%= link_to sprite_icon(icon_name, h(file.title)), dmsf_file_path(id: file), class: 'icon icon-file' %> <% if file.dmsf_folder %> <%= link_to h(file.dmsf_folder.title), dmsf_folder_path(id: file.project, folder_id: file.dmsf_folder) %> <% else %> <%= link_to_if file.project, l(:link_documents), dmsf_folder_path(id: file.project) %> <% end %> <%= link_to_context_menu %>
<% end %> <%= context_menu %> <% else %>

<%= l(:label_no_data) %>

<% end %>