diff --git a/app/controllers/dmsf_controller.rb b/app/controllers/dmsf_controller.rb index 081643c8..9333c0f0 100644 --- a/app/controllers/dmsf_controller.rb +++ b/app/controllers/dmsf_controller.rb @@ -187,7 +187,7 @@ class DmsfController < ApplicationController def send_revision send_file(@revision.disk_file, - :filename => filename_for_content_disposition(@revision.file.name), + :filename => filename_for_content_disposition(@revision.name), :type => @revision.detect_content_type, :disposition => "attachment") end diff --git a/app/controllers/dmsf_state_controller.rb b/app/controllers/dmsf_state_controller.rb index 434df33f..ef05e34f 100644 --- a/app/controllers/dmsf_state_controller.rb +++ b/app/controllers/dmsf_state_controller.rb @@ -31,7 +31,8 @@ class DmsfStateController < ApplicationController @file.lock flash[:notice] = l(:notice_file_locked) end - redirect_to :controller => "dmsf", :action => "index", :id => @project, :folder_id => @file.folder + redirect_to params[:current] ? params[:current] : + {:controller => "dmsf", :action => "index", :id => @project, :folder_id => @file.folder} end def unlock_file @@ -45,7 +46,8 @@ class DmsfStateController < ApplicationController flash[:error] = l(:error_only_user_that_locked_file_can_unlock_it) end end - redirect_to :controller => "dmsf", :action => "index", :id => @project, :folder_id => @file.folder + redirect_to params[:current] ? params[:current] : + {:controller => "dmsf", :action => "index", :id => @project, :folder_id => @file.folder} end def user_pref @@ -66,7 +68,8 @@ class DmsfStateController < ApplicationController @folder.notify_activate flash[:notice] = l(:notice_folder_notifications_activated) end - redirect_to :controller => "dmsf", :action => "index", :id => @project, :folder_id => @folder.folder + redirect_to params[:current] ? params[:current] : + {:controller => "dmsf", :action => "index", :id => @project, :folder_id => @folder.folder} end def folder_notify_deactivate @@ -76,7 +79,8 @@ class DmsfStateController < ApplicationController @folder.notify_deactivate flash[:notice] = l(:notice_folder_notifications_deactivated) end - redirect_to :controller => "dmsf", :action => "index", :id => @project, :folder_id => @folder.folder + redirect_to params[:current] ? params[:current] : + {:controller => "dmsf", :action => "index", :id => @project, :folder_id => @folder.folder} end def file_notify_activate @@ -86,7 +90,8 @@ class DmsfStateController < ApplicationController @file.notify_activate flash[:notice] = l(:notice_file_notifications_activated) end - redirect_to :controller => "dmsf", :action => "index", :id => @project, :folder_id => @file.folder + redirect_to params[:current] ? params[:current] : + {:controller => "dmsf", :action => "index", :id => @project, :folder_id => @file.folder} end def file_notify_deactivate @@ -96,7 +101,8 @@ class DmsfStateController < ApplicationController @file.notify_deactivate flash[:notice] = l(:notice_file_notifications_deactivated) end - redirect_to :controller => "dmsf", :action => "index", :id => @project, :folder_id => @file.folder + redirect_to params[:current] ? params[:current] : + {:controller => "dmsf", :action => "index", :id => @project, :folder_id => @file.folder} end private diff --git a/app/views/dmsf/index.html.erb b/app/views/dmsf/index.html.erb index 9dd4c78d..c55a8d46 100644 --- a/app/views/dmsf/index.html.erb +++ b/app/views/dmsf/index.html.erb @@ -141,7 +141,7 @@ form_tag({:action => "entries_operation", :id => @project, :folder_id => @folder {:controller => "dmsf_detail", :action => "file_detail", :id => @project, :file_id => file }, :title => l(:link_details, :title =>h(file.last_revision.title))) %> -
@@ -94,10 +129,14 @@ jQuery.noConflict(); jQuery(document).ready(function() { - jQuery("a.delete-link").click(function(event) { + jQuery("a.delete-revision").click(function(event) { if(!window.confirm("<%= l(:question_do_you_really_want_to_delete_this_revision) %>")) event.preventDefault(); }) + jQuery("a.delete-entry").click(function(event) { + if(!window.confirm("<%= l(:question_do_you_really_want_to_delete_this_entry) %>")) event.preventDefault(); + }) + jQuery("#fileFileUpload").change(function() { if(jQuery("input[name=\"file[version]\"]:checked").val() == "same") { jQuery("#fileMinorVersionRadio").prop("checked", true); diff --git a/assets/images/download.png b/assets/images/download.png new file mode 100644 index 00000000..64d92be9 Binary files /dev/null and b/assets/images/download.png differ diff --git a/config/locales/en.yml b/config/locales/en.yml index df7f1b8f..913e2eef 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -106,4 +106,5 @@ en: :option_version_minor: "Minor" :option_version_major: "Major" :label_new_content: "New content" + \ No newline at end of file