实训申请发布阶段不能编辑关卡

This commit is contained in:
cxt 2017-06-23 19:57:33 +08:00
parent 7d34acfc95
commit dfd6b208ae
3 changed files with 17 additions and 9 deletions

View File

@ -4,7 +4,7 @@
<% if @challenges.count != 0 %>
<span class="btn-cir btn-cir-grey ml10 mt12 fl"><%= @challenges.count %></span>
<% end %>
<% if (User.current.manager_of_shixun?(@shixun) || User.current.admin?) && @shixun.status == 0 %>
<% if User.current.manager_of_shixun?(@shixun) && @shixun.status == 0 %>
<a href="<%= new_shixun_challenge_path(@shixun) %>" class="shixun-task-btn task-btn-green fr" style="margin: 5px 0;">新建阶段</a>
<% end %>
</div>
@ -13,11 +13,11 @@
<div class="clearfix shixun-panel-inner" id="shixun_index_<%= index %>">
<h4 class="fl panel-inner-title"><i class="fa fa-dot-circle-o font-18 color-green mr10"></i><span class="color-black mr10">第<%= challenge.position %>关</span>
<%#= link_to challenge.subject, shixun_challenge_path(@shixun.id, challenge), :target => "_blank" %>
<% if allow_to_view_challenge(challenge, @shixun) %>
<%= link_to challenge.subject, myshixun_game_path(challenge.current_user_game, :myshixun_id => challenge.current_user_game.try(:myshixun)), :target => "_blank" %>
<% if User.current.manager_of_shixun?(@shixun) %>
<%= link_to challenge.subject, shixun_challenge_path(@shixun, challenge), :target => "_blank" %>
<% else %>
<% if User.current.manager_of_shixun?(@shixun) || User.current.admin? %>
<%= link_to challenge.subject, shixun_challenge_path(@shixun, challenge), :target => "_blank" %>
<% if allow_to_view_challenge(challenge, @shixun) %>
<%= link_to challenge.subject, myshixun_game_path(challenge.current_user_game, :myshixun_id => challenge.current_user_game.try(:myshixun)), :target => "_blank" %>
<% else %>
<a href="javascript:void(0);" onclick="shixun_authority_top();"><%= challenge.subject %></a>
<% end %>

View File

@ -21,15 +21,19 @@
<div class="task-pm-box mt20">
<div class="panel-header clearfix">
<h3 class="fl mt5">阶段详情</h3>
<a href="<%= new_shixun_challenge_path(@shixun) %>" class="shixun-task-btn task-btn-green fr">新建阶段</a>
<% if @shixun.status == 0 && User.current.manager_of_shixun?(@shixun) %>
<a href="<%= new_shixun_challenge_path(@shixun) %>" class="shixun-task-btn task-btn-green fr">新建阶段</a>
<% end %>
</div>
<div class="panel-form ">
<div class="clearfix mb20">
<h3 class="fl panel-inner-title"><span class="color-red mr10">第<%= @challenge.position %>关</span><%= @challenge.subject %></h3>
<p class="fr">
<!-- <a href="<%#= edit_shixun_challenge_path(@challenge, :shixun_id => @shixun) %>" title="编辑"><i class="fa fa-pencil-square-o color-grey font-16 mr5"></i></a>-->
<a href="<%= edit_shixun_challenge_path(@challenge, :shixun_id => @shixun) %>" class="shixun-task-btn task-btn-green fr">编辑</a>
<!-- <a href="<%#= shixun_challenge_path(@challenge, :shixun_id => @shixun) %>" title="删除" method="delete" ><i class="fa fa-trash-o color-grey font-16 mr5"></i></a>-->
<% if @shixun.status == 0 && User.current.manager_of_shixun?(@shixun) %>
<a href="<%= edit_shixun_challenge_path(@challenge, :shixun_id => @shixun) %>" class="shixun-task-btn task-btn-green fr">编辑</a>
<% end %>
<!-- <a href="<%#= shixun_challenge_path(@challenge, :shixun_id => @shixun) %>" title="删除" method="delete" ><i class="fa fa-trash-o color-grey font-16 mr5"></i></a>-->
<!--<a href="#" title="复制"><i class="fa fa-files-o color-grey font-16 mr5"></i></a>-->
</p>
</div>

View File

@ -17,6 +17,10 @@
<% end %>
</div>
<div class="task-popup-submit02 clearfix" style="padding-left: 47px;">
<a href="javascript:void(0);" class="task-btn task-btn-blue pop_close">知道啦</a>
<% if result && @status == 1 %>
<%= link_to "知道啦", shixun_path(@shixun), :class => "task-btn task-btn-blue pop_close" %>
<% else %>
<a href="javascript:void(0);" class="task-btn task-btn-blue pop_close">知道啦</a>
<% end %>
</div>
</div>