Merge branch 'develop' of https://bdgit.trustie.net/hushasha/bigdata into develop
This commit is contained in:
commit
3602ecfad2
|
|
@ -547,6 +547,10 @@ class ShixunsController < ApplicationController
|
|||
end
|
||||
|
||||
def copy
|
||||
unless (@shixun.can_copy && User.current.user_extensions.try(:identity) == 0 && User.current.professional_certification)
|
||||
render_403
|
||||
return
|
||||
end
|
||||
ActiveRecord::Base.transaction do
|
||||
begin
|
||||
new_shixun = Shixun.new
|
||||
|
|
@ -575,7 +579,7 @@ class ShixunsController < ApplicationController
|
|||
gshixun = g.fork(@shixun.gpid, user_gid)
|
||||
raise "版本库创建失败" if gshixun.try(:id).blank?
|
||||
gshixun = g.edit_project(gshixun.id, new_shixun.identifier, new_shixun.identifier)
|
||||
raise "版本库创建失败" if (gshixun.try(:name) != new_shixun.identifier || gshixun.try(:path) != new_shixun.identifier)
|
||||
raise "实训复制失败" if (gshixun.try(:name) != new_shixun.identifier || gshixun.try(:path) != new_shixun.identifier)
|
||||
new_shixun.update_column(:gpid, gshixun.id)
|
||||
|
||||
# 同步复制合作者,合作者加入到gitlab
|
||||
|
|
@ -722,7 +726,7 @@ class ShixunsController < ApplicationController
|
|||
ActiveRecord::Base.transaction do
|
||||
begin
|
||||
@shixun.save!
|
||||
if language != params[:language]
|
||||
if language != params[:language] && @shixun.status != 2 # 已发布不触发重置
|
||||
add_shixun_modify_status(@shixun, 1)
|
||||
end
|
||||
rescue
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@
|
|||
<% end %>
|
||||
<a href="javascript:void(0);" class="fr shixun-task-ban-btn mr15">已关闭</a>
|
||||
<% end %>
|
||||
<% if @shixun.can_copy %>
|
||||
<% if @shixun.can_copy && User.current.user_extensions.try(:identity) == 0 && User.current.professional_certification %>
|
||||
<%#= link_to "复制", copy_shixun_path(@shixun), :class => "fr shixun-task-btn task-btn-green mr15" %>
|
||||
<div class="fr" data-tip-down = "基于这个实训修改形成新的实训"><a href="javascript:void(0);" onclick="op_confirm_box_loading('<%= copy_shixun_path(@shixun) %>', '复制将在后台执行</br>平台将为你创建一个新的同名实训和内容,请问是否继续?');" class = " shixun-task-btn task-btn-green mr15">复制</a></div>
|
||||
<% end %>
|
||||
|
|
|
|||
Loading…
Reference in New Issue