<% if homeworks.empty? %>
    <div class="icons_tishi"><img src="/images/sy/icons_tan.png" width="110" height="110" alt="" ></div>
    <p class="sy_tab_con_p">暂无可显示的内容~</p>
<% else %>
    <% homeworks.each do |homework| %>
    <ul class="sy_classlist">
      <span class="hw_icons_cir fl mt5 mr5"></span>
      <div class="fl ">
        <h3 class="sy_classlist_title fl">
          <% if type == "1" %>
              <%=link_to homework.name, student_work_index_path(:homework => homework), :class => 'linkGrey5', :target => "_blank" %>
          <% else %>
              <%=homework.name %>
          <% end %>
        </h3>
        <span class="<%=homework.course.is_public? ? 'hw_icon_open' : 'hw_icon_private'%> fl mt3"></span>
        <div class="cl"></div>
        <div class="sy_cgrey">
            <span class="fl">来源：</span>
            <p class="fl hw_list_classname mr15">
            <%=link_to homework.course.syllabus.title, syllabus_path(homework.course.syllabus_id), :class => 'hw_cgrey', :target => '_blank' %>
            <span> • </span>
            <%=link_to homework.course.name.to_s + "（#{current_time_and_term_short(homework.course)}）", course_path(homework.course), :class => 'hw_cgrey', :target => '_blank' %>
            </p>
          <% if type == "2" %>
              <span class="mr15 fl">
                <span class="fl">贡献者：</span>
                <%=link_to homework.user.show_name, user_path(homework.user_id), :class => 'hw_cgrey hw_list_teachername fl', :target => '_blank'%>
              </span>
          <% end %>
          <span class="mr15 fl">类别：
            <% case homework.homework_type %>
            <% when 1 %>
                普通
            <% when 2 %>
                编程
            <% when 3 %>
                分组
            <% end %>
          </span>
          <span class="fl mr15">引用数：<span id="subject_count_homework_<%=homework.id %>"><%= homework.quotes %></span></span>
          <% if homework.publish_time.nil? %>
            <span class="fl mr15">发布时间：&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- -</span>
          <% else %>
            <span class="fl mr15">发布时间：<%= format_date(homework.publish_time) %></span>
        <% end %>
        </div>
        <div class="cl"></div>
      </div>
      <% student_ids = homework.course.student.empty? ? [] : homework.course.student.map{|student| student.student_id}.join(',') %>
      <% if student_ids.include?(User.current.id.to_s) %>
          <a href="javascript:void(0);" class="hw_btn_grey fr mt5" title="您选中的题是“我收到的作业”，不能发送">发送</a>
      <% else %>
          <a href="javascript:void(0);" class="hw_btn_green fr mt5" onclick="choose_course('<%=User.current.id%>', '<%=homework.id %>');" data-remote="true">发送</a>
      <% end %>
      <a href="javascript:void(0);" class="hw_btn_green fr mt5 mr5" onclick="show_homework_detail('<%=show_homework_detail_user_path(@user,:homework=>homework.id,:is_import => 0) %>')" data-remote="true">预览</a>
      <div class="cl"></div>
    </ul>
<% end %>
<% end %>