diff --git a/app/models/dmsf_file.rb b/app/models/dmsf_file.rb index 216383ad..e2294682 100644 --- a/app/models/dmsf_file.rb +++ b/app/models/dmsf_file.rb @@ -129,19 +129,19 @@ class DmsfFile < ActiveRecord::Base end def description - self.last_revision.description + self.last_revision ? self.last_revision.description : '' end def version - self.last_revision.version + self.last_revision ? self.last_revision.version : '0' end def workflow - self.last_revision.workflow + self.last_revision ? self.last_revision.workflow : nil end def size - self.last_revision.size + self.last_revision ? self.last_revision.size : 0 end def dmsf_path diff --git a/app/views/dmsf_files/show.html.erb b/app/views/dmsf_files/show.html.erb index 8235422b..b448740a 100644 --- a/app/views/dmsf_files/show.html.erb +++ b/app/views/dmsf_files/show.html.erb @@ -40,12 +40,16 @@ <%= link_to(image_tag("copy.png"), {:controller => :dmsf_files_copy, :action => "new", :id => @file }, :title => l(:title_copy_or_move)) %> -<% path = @file.folder.nil? ? [] : @file.folder.dmsf_path %> -

-<%= render(:partial => "/dmsf/path", :locals => {:path => path}) %> -/ -<%= h(@file.last_revision.title) %> -<%= image_tag("notify.png", :plugin => "redmine_dmsf", :title => l(:title_notifications_active)) if @file.notification %> +

+ <% path = @file.folder ? @file.folder.dmsf_path : [] %> + <%= link_to l(:link_documents), {:controller => 'dmsf', :action => 'show', :id=> @project } %> + <% path.each do |path_element| %> + / + <%= link_to h(path_element.title), {:controller => 'dmsf', :action => 'show', :id=> @project, :folder_id => path_element} %> + <% end %> + / + <%= h(@file.last_revision.title) %> + <%= image_tag('notify.png', :plugin => 'redmine_dmsf', :title => l(:title_notifications_active)) if @file.notification %>

<%= error_messages_for("file") %>