|
|
|
@ -6,32 +6,36 @@ module SubjectsHelper
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
# 实训路径详情列表,右侧状态显示栏
|
|
|
|
|
def shixun_show_in_subject subject_status, shixun_status
|
|
|
|
|
content = if subject_status < 2
|
|
|
|
|
case shixun_status
|
|
|
|
|
when 0, 1
|
|
|
|
|
'<span class="fr color-grey-c">暂未公开</span>'
|
|
|
|
|
when 2
|
|
|
|
|
'<span class="fr color-grey-9">已发布</span>'
|
|
|
|
|
when 3
|
|
|
|
|
'<span class="fr color-grey-9">已关闭</span>'
|
|
|
|
|
else
|
|
|
|
|
""
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
if shixun_status != 2
|
|
|
|
|
case shixun_status
|
|
|
|
|
when 0, 1
|
|
|
|
|
'<span class="fr color-grey-c">暂未公开</span>'
|
|
|
|
|
when 3
|
|
|
|
|
'<span class="fr color-grey-9">已关闭</span>'
|
|
|
|
|
else
|
|
|
|
|
""
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
""
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
def shixun_show_in_subject subject_status, shixun_status, shixun_hidden
|
|
|
|
|
content = if shixun_hidden
|
|
|
|
|
'<span class="fr color-grey-c">暂未公开</span>'
|
|
|
|
|
else
|
|
|
|
|
if subject_status < 2
|
|
|
|
|
case shixun_status
|
|
|
|
|
when 0, 1
|
|
|
|
|
'<span class="fr color-grey-c">暂未公开</span>'
|
|
|
|
|
when 2
|
|
|
|
|
'<span class="fr color-grey-9">已发布</span>'
|
|
|
|
|
when 3
|
|
|
|
|
'<span class="fr color-grey-9">已关闭</span>'
|
|
|
|
|
else
|
|
|
|
|
""
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
if shixun_status != 2
|
|
|
|
|
case shixun_status
|
|
|
|
|
when 0, 1
|
|
|
|
|
'<span class="fr color-grey-c">暂未公开</span>'
|
|
|
|
|
when 3
|
|
|
|
|
'<span class="fr color-grey-9">已关闭</span>'
|
|
|
|
|
else
|
|
|
|
|
""
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
""
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
return content.html_safe
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
@ -39,7 +43,7 @@ module SubjectsHelper
|
|
|
|
|
def start_shixun_in_subject subject, shixun, myshixun
|
|
|
|
|
is_modify = ShixunModify.where(:myshixun_id => myshixun.try(:id), :shixun_id => shixun.try(:id), :status => 1).first
|
|
|
|
|
content_before = ''
|
|
|
|
|
content = if shixun.status == 2 || User.current.manager_of_shixun?(shixun)
|
|
|
|
|
content = if (shixun.status == 2 && !shixun.hidden) || User.current.manager_of_shixun?(shixun)
|
|
|
|
|
content_before = "<a href=\"#{shixun_path(shixun)}\" class=\"mr30 color-blue_4C shixun_detail pointer fl none\" target=\"_blank\">查看详情</a>"
|
|
|
|
|
if User.current.try(:mail).blank?
|
|
|
|
|
%Q{<a class="btn_auto user_bluebg_btn fl none" onclick="sure_box_redirect_without_newtab_btn('#{security_settings_path}', '开启实训,请先绑定邮箱','绑定邮箱');" id = "shixun_operation">开始实战</a>}
|
|
|
|
|