From a83f5317bbb294305ac0c51c3d07cf1ba4e022e8 Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 26 Oct 2016 16:28:40 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8C=E7=A8=8B=E7=A2=91=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E6=B7=BB=E5=8A=A0=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/versions_controller.rb | 6 +++++- app/views/versions/_list.html.erb | 7 ++----- 2 files changed, 7 insertions(+), 6 deletions(-) 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 %>