diff --git a/app/controllers/versions_controller.rb b/app/controllers/versions_controller.rb
index 23b5b3c69..f8118c796 100644
--- a/app/controllers/versions_controller.rb
+++ b/app/controllers/versions_controller.rb
@@ -257,7 +257,11 @@ class VersionsController < ApplicationController
@version.destroy
respond_to do |format|
format.js
- format.html { redirect_back_or_default settings_project_path(@project, :tab => 'versions') }
+ if params[:is_index]
+ format.html { redirect_to project_versions_path(@project) }
+ elsif params[:is_show]
+ format.html { redirect_to project_versions_path(@version) }
+ end
format.api { render_api_ok }
end
else
diff --git a/app/views/versions/_list.html.erb b/app/views/versions/_list.html.erb
index 43bceb1c9..732476fc0 100644
--- a/app/views/versions/_list.html.erb
+++ b/app/views/versions/_list.html.erb
@@ -3,11 +3,8 @@
<%= link_to_version version, :name => version_anchor(version) %>
<%= link_to "导出Issue", version_path(version, :format => 'xls'), :class => "btn_newpro_grey fr" %>
- <%= delete_version_link version_path(version, :back_url => url_for(:controller => 'versions',
- :action => 'index',
- :project_id => version.project)),
- :class=>'roadmap_icons_del fr mt5 mr5' if User.current.allowed_to?(:manage_versions, version.project) %>
-
+ <%= link_to "", version_path(version, :is_index => true), :method => "delete", :data => {:confirm => l(:text_are_you_sure)}, :class => "roadmap_icons_del fr mt5 mr5" if User.current.allowed_to?(:manage_versions, version.project) %>
+ <%# {:controller => 'versions', :action => 'destroy', :project_id => version.project, :is_index => true}, :class => "roadmap_icons_del fr mt5 mr5" if User.current.allowed_to?(:manage_versions, version.project) %>
<%= link_to "", edit_version_path(version, :is_index => true), :class => 'roadmap_icons_edit fr mt5', :remote => true %>