educoder/app/views/challenges/_content_list.html.erb

71 lines
4.8 KiB
Plaintext

<div class="task-pm-box mt20 mb20">
<div class="panel-header clearfix" style="height: 40px;border-bottom:0px;">
<h3 class="fl mt5 shixun_title">全部任务</h3>
<% 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) && @shixun.status == 0 %>
<a href="<%= new_shixun_challenge_path(@shixun, :st => 0) %>" class="shixun-task-btn task-btn-green fr mt5">+实践任务</a>
<a href="<%= new_shixun_challenge_path(@shixun, :st => 1) %>" class="shixun-task-btn task-btn-green fr mr10 mt5">+多选任务</a>
<a href="<%= new_shixun_challenge_path(@shixun, :st => 2) %>" class="shixun-task-btn task-btn-green fr mr10 mt5">+单选任务</a>
<!--<a href="<%#= new_shixun_challenge_path(@shixun, :st => 0) %>" class="shixun-task-btn task-btn-green fr mr5" style="margin: 5px 0;">新建阶段</a>-->
<% end %> </div>
<div class="panel-list shixun-panel-list">
<% @challenges.each_with_index do |challenge, index| -%>
<div class="clearfix shixun-panel-inner" id="shixun_index_<%= index %>">
<h4 class="fl panel-inner-title">
<span class="panel-inner-icon mr10 fl mt5">
<% if challenge.st == 0 %>
<i class="fa fa-code font-16 color_white" title="实践任务"></i>
<% elsif challenge.st == 1 %>
<i class="fa fa-th-list color_white" title="多选任务"></i>
<% elsif challenge.st == 2 %>
<img src="/images/bigdata/singel.png" style="margin-bottom: 3px" title="单选任务">
<% end%>
</span>
<!-- <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 User.current.manager_of_shixun?(@shixun) %>
<%= link_to challenge.subject, edit_shixun_challenge_path(challenge, :shixun_id => @shixun), :target => "_blank" %>
<% else %>
<% 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="<%= operation_shixun_path(@shixun, :myshixun_id => challenge.current_user_game.try(:myshixun)) %>" data-remote="true"><%= challenge.subject %></a>
<% end %>
<% end %>
</h4>
<% if User.current.manager_of_shixun?(@shixun) %>
<p class="fr" id="shixun_icon_<%= index %>">
<% if @shixun.status == 0 %>
<a href="javascript:void(0);" class="mr5" onclick="delete_confirm_box_2('<%= shixun_challenge_path(challenge, :shixun_id => @shixun) %>', '确定要删除该任务吗?')" data-tip-down="删除" ><i class="fa fa-trash-o color-grey font-16" ></i></a>
<% unless challenge.position < 2 %>
<a href="<%= index_up_shixun_challenge_path(challenge, :shixun_id => @shixun) %>" data-tip-down="上移" data-remote="true"><i class="fa fa-long-arrow-up color-grey font-16 mr5" ></i></a>
<% end %>
<% if @shixun.challenges.count != challenge.position %>
<a href="<%= index_down_shixun_challenge_path(challenge, :shixun_id => @shixun) %>" data-tip-down="下移" data-remote="true"><i class="fa fa-long-arrow-down color-grey font-16 mr5" ></i></a>
<% end %>
<% end %>
<a href="<%= edit_shixun_challenge_path(challenge, :shixun_id => @shixun) %>" data-tip-down="编辑"><i class="fa fa-pencil-square-o color-grey font-16 mr5" ></i></a>
<!-- <a href="#" title="删除" ><i class="fa fa-trash-o color-grey font-16 mr5" ></i></a>-->
<!--<a href="#" title="排名" ><i class="fa fa-signal color-grey font-16 mr5 " ></i></a>-->
</p>
<% end %>
<div class="cl"></div>
<p class="ml25 color-grey challenge_details">
<span class="mr100 itoblock_w150"><%= shixun_done(@shixun, challenge.position).to_i %>人&nbsp;完成挑战</span>
<span class="mr100 itoblock_w150"><%= shixun_running(@shixun, challenge.position).to_i %>人&nbsp;正在挑战</span>
<span class="mr100 w150 g_frame"><%= challenge.score %>经验值</span>
<span class="mr390 fr"><%= find_game_status challenge.id %></span>
</p>
</div>
<% end %>
</div>
</div>
<script>
function shixun_authority_top(){
var htmlvalue = "<%= escape_javascript(render :partial => 'shixuns/authority_pop') %>";
pop_box_new(htmlvalue,460,300);
}
</script>