<% # encoding: utf-8 # # Redmine plugin for Document Management System "Features" # # Copyright (C) 2011-17 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. %> <% if dmsf_files.present? %>
<% for dmsf_file in dmsf_files %> <% if dmsf_file.last_revision %>

<% file_view_url = url_for({:controller => :dmsf_files, :action => 'view', :id => dmsf_file}) %> <%= link_to(h(dmsf_file.title), file_view_url, :target => '_blank', :class => "icon icon-file #{DmsfHelper.filetype_css(dmsf_file.name)}", :title => h(dmsf_file.last_revision.try(:tooltip)), 'data-downloadurl' => "#{dmsf_file.last_revision.detect_content_type}:#{h(dmsf_file.name)}:#{file_view_url}") %> <% if dmsf_file.text? || dmsf_file.image? %> <%= link_to l(:button_view), file_view_url, :class => 'icon-only icon-magnifier', :title => l(:button_view) %> <% end %> <%= " - #{dmsf_file.description}" unless dmsf_file.description.blank? %> (<%= number_to_human_size dmsf_file.last_revision.size %>) <%= link_to(image_tag('delete.png'), dmsf_file_path(:id => dmsf_file, :commit => 'yes'), :data => {:confirm => l(:text_are_you_sure)}, :method => :delete, :title => l(:title_delete)) %> <%= dmsf_file.last_revision.user %>, <%= format_time(dmsf_file.last_revision.updated_at) %>

<% end %> <% end %> <% if defined?(thumbnails) && thumbnails %> <% images = dmsf_files.select(&:image?) %> <% if images.any? %>
<% images.each do |file| %>
<%= link_to image_tag(dmsf_thumbnail_path(file)), url_for({:controller => :dmsf_files, :action => 'view', :id => file}), :alt => dmsf_file.title %>
<% end %>
<% end %> <% end %>
<% end %>