diff --git a/app/views/dmsf/_path.html.erb b/app/views/dmsf/_path.html.erb
new file mode 100644
index 00000000..68c9d5a0
--- /dev/null
+++ b/app/views/dmsf/_path.html.erb
@@ -0,0 +1,37 @@
+<%# Redmine plugin for Document Management System "Features"
+#
+# Copyright (C) 2013 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 folder %>
+ <%= link_to l(:link_documents), dmsf_path(:id => @project) %>
+ <% folder.dmsf_path.each do |path_element| %>
+ /
+ <% if !filename && path_element == folder.dmsf_path.last %>
+ <%= h(path_element.title) %>
+ <% else %>
+ <%= link_to h(path_element.title), dmsf_path(:id => @project, :folder_id => path_element) %>
+ <% end %>
+ <% end %>
+ <% else %>
+ <%= l(:link_documents) %>
+ <% end %>
+ <% if filename %>
+ /
+ <%= h(filename) %>
+ <% end %>
+
diff --git a/app/views/dmsf/edit.html.erb b/app/views/dmsf/edit.html.erb
index ef6cf8a1..8aac34da 100644
--- a/app/views/dmsf/edit.html.erb
+++ b/app/views/dmsf/edit.html.erb
@@ -25,17 +25,7 @@
:title => l(:title_copy)) if @folder.id %>
-<% create = @pathfolder == @parent %>
-
-
- <% path = @pathfolder ? @pathfolder.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 %>
- <%= "/ #{l(:heading_new_folder)}" if create %>
-
+<%= render(:partial => 'path', :locals => {:folder => @pathfolder, :filename => @pathfolder == @parent ? l(:heading_new_folder) : nil}) %>
<%= form_for(@folder, :url => {:action => create ? 'create' : 'save', :id => @project, :folder_id => @folder, :parent_id => @parent},
:html => {:method=>:post}) do |f| %>
diff --git a/app/views/dmsf/email_entries.html.erb b/app/views/dmsf/email_entries.html.erb
index a01a92a4..fcd71c98 100644
--- a/app/views/dmsf/email_entries.html.erb
+++ b/app/views/dmsf/email_entries.html.erb
@@ -22,14 +22,7 @@
-
- <% path = @folder ? @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 %>
-
+<%= render(:partial => 'path', :locals => {:folder => @folder}) %>
<%= l(:heading_send_documents_by_email) %>
diff --git a/app/views/dmsf/show.html.erb b/app/views/dmsf/show.html.erb
index 343a414c..81e0e3f9 100644
--- a/app/views/dmsf/show.html.erb
+++ b/app/views/dmsf/show.html.erb
@@ -65,14 +65,7 @@
<% end %>
-
- <% path = @folder ? @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 %>
-
+<%= render(:partial => 'path', :locals => {:folder => @folder}) %>