Wrong path in the file details view

This commit is contained in:
Karel Picman 2013-08-28 15:37:40 +02:00
parent 869118ed1f
commit ff9f3e975c
2 changed files with 14 additions and 10 deletions

View File

@ -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

View File

@ -40,12 +40,16 @@
<%= link_to(image_tag("copy.png"), {:controller => :dmsf_files_copy, :action => "new", :id => @file }, :title => l(:title_copy_or_move)) %>
</div>
<% path = @file.folder.nil? ? [] : @file.folder.dmsf_path %>
<h2>
<%= 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 %>
<h2>
<% 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 %>
</h2>
<%= error_messages_for("file") %>