% work = cur_user_works_for_work activity %>
<% if activity.work_type == 3 && User.current.contestant_of_contest?(activity.contest) && activity.work_detail_group.base_on_project %>
<% projects = cur_user_projects_for_work activity %>
<% if work.nil? && projects.nil? %>
<%=link_to "关联项目",new_student_work_project_contestant_works_path(:work => activity.id,:hw_status=>hw_status,:user_activity_id=>user_activity_id),remote: true,:class=> 'c_blue', :title=> '请各组长关联作业项目' %>
<% elsif work.nil? %>
<%=link_to "取消关联",cancel_relate_project_contestant_works_path(:work => activity.id,:hw_status=>hw_status,:user_activity_id=>user_activity_id), :confirm => "您确定要取消关联吗?", remote: true,:class => "c_blue", :title=> '取消关联项目' %>
<% end %>
<% end %>
<%= user_for_contest_work activity,User.current.contestant_of_contest?(activity.contest),work %>
<%# if User.current.contestant_of_contest?(activity.contest) && !work.nil? && work.user == User.current && activity.end_time < Date.today %>
<%# end %>
<%# if activity.homework_type == 2 && is_teacher%>
<%# end %>
<%# end %>
<% if activity.work_type == 3 && activity.work_detail_group%>
<% if activity.work_detail_group.base_on_project %>
<%=link_to "项目(#{activity.contestant_work_projects.where(:is_leader => true).count})",contestant_works_path(:work =>activity.id, :tab => 3),:class => "c_blue" %>
<% end %>
分组人数:<%=activity.work_detail_group.min_num %>-<%=activity.work_detail_group.max_num %> 人
<% end %>