<% # encode: utf-8 # # Redmine plugin for Document Management System "Features" # # Copyright © 2011-19 Karel Pičman # # This program 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 2 # of the License, or (at your option) any later version. # # This program 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 this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. %> <% wf = DmsfWorkflow.find_by(id: file.last_revision.dmsf_workflow_id) if file.last_revision.dmsf_workflow_id %> <%= check_box_tag('ids[]', "#{name}-#{id}", false, :id => "file_#{id}") %> <% if DmsfFolder.is_column_on?('id') %> <%= link_to(file.id, dmsf_file_path(:id => file)) %> <% end %> <% if DmsfFolder.is_column_on?('title') %> <% if @tree_view %> <% end %> <% file_view_url = url_for({:controller => :dmsf_files, :action => 'view', :id => file}) %> <%= link_to(h(title), file_view_url, :target => '_blank', :class => "icon icon-file #{DmsfHelper.filetype_css(file.name)}", :title => h(file.last_revision.try(:tooltip)), 'data-downloadurl' => "#{file.last_revision.detect_content_type}:#{h(file.name)}:#{file_view_url}") %>
<%= h(link ? link.path : file.display_name) %>
<% end %> <% if DmsfFolder.is_column_on?('extension') %> <%= file.extension %> <% end %> <% if DmsfFolder.is_column_on?('size') %> <%= number_to_human_size(file.last_revision.size) %> <% end %> <% if DmsfFolder.is_column_on?('modified') %> <%= format_time(file.last_revision.updated_at) %> <% end %> <% if DmsfFolder.is_column_on?('version') %> <%= file.last_revision.version %> <% end %> <% if DmsfFolder.is_column_on?('workflow') %> <% if wf && @file_approval_allowed %> <%= link_to( file.last_revision.workflow_str(false), log_dmsf_workflow_path( :project_id => project.id, :id => wf.id, :dmsf_file_revision_id => file.last_revision.id), :title => file.last_revision.workflow_tooltip, :remote => true) %> <% else %> <%= file.last_revision.workflow_str(false) %> <% end %> <% end %> <% if DmsfFolder.is_column_on?('author') %> <%= h(file.last_revision.user) %> <% end %> <% CustomField.where(type: 'DmsfFileRevisionCustomField').order(:position).each do |c| %> <% if DmsfFolder.is_column_on?(c.name) %> <%= show_value file.custom_value(c) %> <% end %> <% end %> <% if @file_manipulation_allowed %> <%= link_to('', dmsf_file_path(:id => file), :title => l(:link_details, :title => h(file.last_revision.title)), :class => 'icon-only icon-edit') %> <% if !file.locked? %> <%= link_to('', lock_dmsf_files_path(:id => file), :title => l(:title_lock_file), :class => 'icon-only icon-lock') %> <% elsif file.unlockable? && (!file.locked_for_user? || @force_file_unlock_allowed) %> <%= link_to('', unlock_dmsf_files_path(:id => file), :title => file.get_locked_title, :class => 'icon-only icon-unlock') %> <% else %> <% end %> <% if !file.locked? %> <% if file.notification %> <%= link_to('', notify_deactivate_dmsf_files_path(:id => file), :title => l(:title_notifications_active_deactivate), :class => 'icon-only icon-email') %> <% else %> <%= link_to('', notify_activate_dmsf_files_path(:id => file), :title => l(:title_notifications_not_active_activate), :class => 'icon-only icon-email-add') %> <% end %> <% if link %> <%= link_to('', dmsf_link_path(link), :data => {:confirm => l(:text_are_you_sure)}, :title => l(:title_delete), :method => :delete, :class => 'icon-only icon-del') %> <% else %> <% if @file_delete_allowed %> <%= link_to('', dmsf_file_path(:id => file), :data => {:confirm => l(:text_are_you_sure)}, :title => l(:title_delete), :method => :delete, :class => 'icon-only icon-del') %> <% else %> <% end %> <% end %> <% else %> <% end %> <% end %> <%= render(:partial => 'dmsf_workflows/approval_workflow_button', :locals => {:file => file, :file_approval_allowed => @file_approval_allowed, :workflows_available => @workflows_available, :project => project, :wf => wf, :dmsf_link_id => nil }) %> <%= position %> <%= file.last_revision.size %> <%= file.last_revision.updated_at.to_i %> <%= file.last_revision.iversion %> <%= title %>