User should be redirected to the parent folder after a deletition in the document detail form

This commit is contained in:
Karel Picman 2017-02-15 14:59:25 +01:00
parent 09828943d3
commit d11b56c3e9
2 changed files with 2 additions and 2 deletions

View File

@ -206,7 +206,7 @@ class DmsfFilesController < ApplicationController
flash[:error] = @file.errors.full_messages.join(', ')
end
end
if commit || @tree_view
if commit || (@tree_view && params[:details].blank?)
redirect_to :back
else
redirect_to dmsf_folder_path(:id => @project, :folder_id => @file.dmsf_folder)

View File

@ -51,7 +51,7 @@
:class => 'icon dmsf_icon-link') %>
<%= link_to("#{l(:button_copy)}/#{l(:button_move)}", copy_file_path(:id => @file),
:title => l(:title_copy), :class => 'icon icon-copy') %>
<%= delete_link @file if @file_delete_allowed %>
<%= delete_link(dmsf_file_path(:id => @file, :details => true)) if @file_delete_allowed %>
<% else %>
<% if User.current.allowed_to?(:force_file_unlock, @project) %>
<%= link_to_if(@file.unlockable?, l(:button_unlock), unlock_dmsf_files_path(:id => @file),