From d11b56c3e9379b3cb0e704bf1b3627a58c48e78c Mon Sep 17 00:00:00 2001 From: Karel Picman Date: Wed, 15 Feb 2017 14:59:25 +0100 Subject: [PATCH] User should be redirected to the parent folder after a deletition in the document detail form --- app/controllers/dmsf_files_controller.rb | 2 +- app/views/dmsf_files/show.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/dmsf_files_controller.rb b/app/controllers/dmsf_files_controller.rb index 7c7ae35c..03f7ae2a 100644 --- a/app/controllers/dmsf_files_controller.rb +++ b/app/controllers/dmsf_files_controller.rb @@ -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) diff --git a/app/views/dmsf_files/show.html.erb b/app/views/dmsf_files/show.html.erb index 34bba7d0..163204dd 100644 --- a/app/views/dmsf_files/show.html.erb +++ b/app/views/dmsf_files/show.html.erb @@ -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),