<% # encoding: utf-8 # # Redmine plugin for Document Management System "Features" # # Copyright (C) 2011-16 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. %> <% parent = @folder ? @folder : @project %> <% DmsfHelper.dmsf_tree(parent, parent).each do |obj, level, position| %> <% classes = "dmsf_tree idnt-#{level}" %> <% if obj.is_a?(DmsfFolder) && ((obj.dmsf_folders.visible.count > 0) || (obj.dmsf_files.visible.count > 0) || (obj.dmsf_links.visible.count > 0)) %> <% classes += ' idnt dmsf_collapsed' %> <% id = "id='#{obj.id}span'".html_safe %> <% onclick = "onclick=\"dmsf_toggle('#{obj.id}','#{obj.id}span')\"" %> <% else %> <% classes += ' dmsf_child' %> <% onclick = '' %> <% end %> <%if obj.dmsf_folder && obj.dmsf_folder != @folder %> <% classes += ' dmsf_hidden' %> <% else %> <%# Force odd/even backgroung style for visible items %> <% classes += " dmsf_#{cycle('odd', 'even')}" %> <% end %> <% parent = obj.dmsf_folder %> <% while parent %> <% classes += " #{parent.id}" %> <% parent = parent.dmsf_folder %> <% end %> <% if obj.is_a? DmsfFolder %> class="dir <%= classes %>"> <%= render(:partial => 'dir', :locals => { :project => @project, :subfolder => obj, :link => nil, :id => obj.id, :name => 'subfolders[]', :title => obj.title, :onclick => onclick, :position => position}) %> <% elsif obj.is_a?(DmsfLink) && (obj.target_type == 'DmsfFolder') %> <% unless obj.target_project %> <% Rails.logger.error "Error: dmsf_link id #{obj.id} has no target!" %> <% next %> <% end %> class="dmsf_gray <%= classes %>"> <%= render(:partial => 'dir', :locals => { :project => obj.target_project, :subfolder => obj.target_folder, :link => obj, :id => obj.id, :name => 'dir_links[]', :title => obj.name, :onclick => onclick, :position => position}) %> <% elsif obj.is_a?(DmsfFile) %> <% unless obj.last_revision %> <% Rails.logger.error "Error: dmsf_file id #{obj.id} has no revision!" %> <% next %> <% end %> class="file <%= classes %>"> <%= render(:partial => 'file', :locals => { :project => @project, :file => obj, :link => nil, :id => obj.id, :name => 'files[]', :title => obj.title, :onclick => onclick, :position => position}) %> <% elsif obj.is_a?(DmsfLink) && (obj.target_type == 'DmsfFile') %> <% unless obj.target_file.last_revision %> <% Rails.logger.error "Error: dmsf_file id #{obj.target_id} has no revision!" %> <% next %> <% end %> class="dmsf_gray <%= classes %>"> <%= render(:partial => 'file', :locals => { :project => obj.target_project, :file => obj.target_file, :link => obj, :id => obj.id, :name => 'file_links[]', :title => obj.name, :onclick => onclick, :position => position}) %> <% elsif obj.is_a?(DmsfLink) && (obj.target_type == 'DmsfUrl') %> class="dmsf_gray <%= classes %>"> <%= render(:partial => 'url', :locals => { :project => obj.target_project, :file => obj.target_file, :link => obj, :id => obj.id, :name => 'file_links[]', :title => obj.name, :onclick => onclick, :position => position}) %> <% end %> <% end %>
<%= l(:link_title) %> <%= l(:link_size) %> <%= l(:link_modified) %> <%= l(:link_ver) %> <%= l(:link_workflow) %> <%= l(:link_author) %>