<% homeworks.each do |homework| %>
<%= homework.name%>
<% if homework.course.is_public == 0 %>
<% end %>
<%=homework.course.name %>(<%=current_time_and_term_short(homework.course) %>)
<% case homework.homework_type %> <% when 1 %> 普通 <% when 2 %> 编程 <% when 3 %> 分组 <% end %>
<%= homework.user.show_name %>
<%= homework.quotes %>
<%=format_date homework.publish_time %>
<% if homework.user != User.current && (homework.course.is_public == 0 && !User.current.allowed_to?(:as_teacher,homework.course)) %>
<% ah = ApplyHomework.where("user_id = ? and homework_common_id = ?", User.current.id, homework.id).first %> <% if ah.nil? %> <%= link_to("请求分享", apply_homework_user_path(User.current.id,:homework_id => homework.id), :class => 'green_btn_share c_white', :remote => true) %> <% elsif ah.status == 1 %> 等待回复 <% elsif ah.status == 2 %> 可引用 <% elsif ah.status == 3 %> 已拒绝 <% end %>
<% else %>
--
<% end %>
<% end %>