里程碑列表页面添加删除

This commit is contained in:
huang 2016-10-26 16:28:40 +08:00
parent c76b0d75f8
commit a83f5317bb
2 changed files with 7 additions and 6 deletions

View File

@ -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

View File

@ -3,11 +3,8 @@
<div class="clear">
<h4 class="fl new_roadmap_listtitle"><%= link_to_version version, :name => version_anchor(version) %></h4><span class="fl <%= get_version_type(version.status) %> mt3 ml5"></span>
<%= 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) %>
<!--<a href="<%#= edit_version_path(version, :is_setting => true) %>" class="roadmap_icons_edit fr mt5 " alt="编辑"></a>-->
<%= 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 %>
</div>
<ul class="new_roadmap_list_txt clear mb5">