parent
51558b419a
commit
d7ce826e56
@ -0,0 +1,118 @@
|
|||||||
|
<div class="educontent mb50">
|
||||||
|
<p class="edu-back-white mb20 padding30 mt10 clearfix lineh-20">
|
||||||
|
<span class="color-grey-3 font-18 fl">战队详情</span>
|
||||||
|
<%= link_to '返回', enroll_competition_path(@competition), class: 'color-grey-9 fr' %>
|
||||||
|
</p>
|
||||||
|
<div class="edu-back-white mb20">
|
||||||
|
<p class="pt20 pb20 font-16"><span class="modalTitle">实训项目</span></p>
|
||||||
|
<table width="100%" class="tBodyScroll edu-txt-center" cellpadding="0" cellspacing="0">
|
||||||
|
<thead class="lastPart">
|
||||||
|
<tr>
|
||||||
|
<th width="10%">创建者</th>
|
||||||
|
<th width="40%" class="edu-txt-left">名称</th>
|
||||||
|
<th width="10%">学习人数</th>
|
||||||
|
<th width="15%">fork版的学习人数</th>
|
||||||
|
<th width="10%">有效作品数</th>
|
||||||
|
<th width="15%">经验值</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<%
|
||||||
|
total_myshixun_count = 0
|
||||||
|
total_forked_myshixun_count = 0
|
||||||
|
%>
|
||||||
|
<% @shixuns.each do |shixun| %>
|
||||||
|
<%
|
||||||
|
total_myshixun_count += shixun.myshixuns_count
|
||||||
|
total_forked_myshixun_count += shixun['forked_myshixun_count'].to_i
|
||||||
|
%>
|
||||||
|
<tr>
|
||||||
|
<td width="10%"><%= shixun.creator.show_real_name %></td>
|
||||||
|
<td width="40%" class="edu-txt-left">
|
||||||
|
<%= link_to shixun_path(shixun), target: '_blank' do %>
|
||||||
|
<span class="task-hide fl" style="max-width: 410px;"><%= shixun.name %></span>
|
||||||
|
<% end %>
|
||||||
|
<% if shixun.fork_from.blank? %>
|
||||||
|
<span class="connectTag ml10">原创</span>
|
||||||
|
<% end %>
|
||||||
|
</td>
|
||||||
|
<td width="10%"><%= shixun.myshixuns_count.to_i.zero? ? '--' : shixun.myshixuns_count.to_i %></td>
|
||||||
|
<td width="15%"><%= shixun['forked_myshixun_count'].to_i.zero? ? '--' : shixun['forked_myshixun_count'].to_i %></td>
|
||||||
|
<th width="10%"><%= @myshixun_count_map.fetch(shixun.id, '--') %></th>
|
||||||
|
<td width="15%">--</td>
|
||||||
|
</tr>
|
||||||
|
<% end %>
|
||||||
|
</tbody>
|
||||||
|
<tfoot class="tfootLastPart">
|
||||||
|
<tr class="color-orange font-16">
|
||||||
|
<th width="10%" class="color-grey-6">合计</th>
|
||||||
|
<th width="40%" class="edu-txt-left"><%= @shixuns.size %></th>
|
||||||
|
<th width="10%"><%= total_myshixun_count %></th>
|
||||||
|
<th width="15%"><%= total_forked_myshixun_count %></th>
|
||||||
|
<th width="10%"><%= @myshixun_count_map.values.reduce(:+) %></th>
|
||||||
|
<th width="15%">--</th>
|
||||||
|
</tr>
|
||||||
|
</tfoot>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="edu-back-white mb20">
|
||||||
|
<p class="pt20 pb20 font-16"><span class="modalTitle">翻转课堂</span></p>
|
||||||
|
<table width="100%" class="tBodyScroll edu-txt-center" cellpadding="0" cellspacing="0">
|
||||||
|
<thead class="lastPart">
|
||||||
|
<tr>
|
||||||
|
<th width="10%">创建者</th>
|
||||||
|
<th width="40%" class="edu-txt-left">名称</th>
|
||||||
|
<th width="10%">学生数量</th>
|
||||||
|
<th width="15%">发布的实训作业数量</th>
|
||||||
|
<th width="10%">有效作品数</th>
|
||||||
|
<th width="15%">经验值</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<%
|
||||||
|
total_members_count = 0
|
||||||
|
total_shixun_homework_count = 0
|
||||||
|
%>
|
||||||
|
<% @courses.each do |course| %>
|
||||||
|
<%
|
||||||
|
total_members_count += course.members_count.to_i
|
||||||
|
total_shixun_homework_count += course['shixun_homework_count'].to_i
|
||||||
|
%>
|
||||||
|
<tr>
|
||||||
|
<td width="10%"><%= course.teachers.where(user_id: @team_user_ids).first.user.show_real_name %></td>
|
||||||
|
<td width="40%" class="edu-txt-left">
|
||||||
|
<span class="task-hide fl" style="max-width: 480px;"><%= course.name %></span>
|
||||||
|
</td>
|
||||||
|
<td width="10%"><%= course.members_count %></td>
|
||||||
|
<td width="15%"><%= course['shixun_homework_count'].presence || '--' %></td>
|
||||||
|
<th width="10%"><%= @course_myshixun_map.fetch(course.id, '--') %></th>
|
||||||
|
<td width="15%">--</td>
|
||||||
|
</tr>
|
||||||
|
<% end %>
|
||||||
|
</tbody>
|
||||||
|
<tfoot class="tfootLastPart">
|
||||||
|
<tr class="color-orange font-16">
|
||||||
|
<th width="10%" class="color-grey-6">合计</th>
|
||||||
|
<th width="40%" class="edu-txt-left"><%= @courses.size %></th>
|
||||||
|
<th width="10%"><%= total_members_count %></th>
|
||||||
|
<th width="15%"><%= total_shixun_homework_count %></th>
|
||||||
|
<th width="10%"><%= @course_myshixun_map.values.reduce(:+) %></th>
|
||||||
|
<th width="15%">--</th>
|
||||||
|
</tr>
|
||||||
|
</tfoot>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
$(function(){
|
||||||
|
if($(".tBodyScroll tbody").get(0).scrollHeight > 420){
|
||||||
|
$(".tBodyScroll thead").addClass("lastPart");
|
||||||
|
$(".tBodyScroll tfoot").addClass("tfootLastPart");
|
||||||
|
}else{
|
||||||
|
$(".tBodyScroll thead").removeClass("lastPart");
|
||||||
|
$(".tBodyScroll tfoot").removeClass("tfootLastPart");
|
||||||
|
}
|
||||||
|
})
|
||||||
|
</script>
|
@ -0,0 +1 @@
|
|||||||
|
notice_box_redirect('<%= competition_managements_path %>', '发布成功')
|
@ -0,0 +1,5 @@
|
|||||||
|
class AddPublishedAtToCompetitions < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
add_column :competitions, :published_at, :datetime
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in new issue