<script type="text/javascript">
    function show_homework_detail(url){
        $.get(
                url,
                {

                },
                function (data) {
                }
        );
    };
</script>

<div class="h450">
    <% homeworks.each do |homework| %>
      <ul class="subject-list-row">
        <li class="subject-list-name fl">
            <label onclick="show_homework_detail('<%=show_homework_detail_user_path(@user,:homework=>homework.id,:is_import => 0) %>')">
              <input type="radio" name="checkMenu" class="mr5 subject-name-middle" value="<%= homework.id%>"/>
              <span title="<%= homework.name%>" class="subject-name-middle subject-name-hidden"><%= homework.name%></span>
            </label>
            <% if homework.course.is_public == 0 %>
                <img src="/images/locked.png" width="16" height="16" alt="私有" title="私有" class="subject-name-middle" />
            <% end %>
          </li>
          <li class="subject-list-from fl hidden"><span title="<%=homework.course.name %>(<%=current_time_and_term(homework.course) %>)"><%=homework.course.name %>(<%=current_time_and_term_short(homework.course) %>)</span></li>
          <li class="subject-list-type fl">
            <% case homework.homework_type %>
            <% when 1 %>
                普通
            <% when 2 %>
                编程
            <% when 3 %>
                分组
            <% end %>
          </li>
          <li class="subject-list-publisher fl hidden"><%= homework.user.show_name %></li>
          <li class="subject-list-count fl" id="subject_count_homework_<%=homework.id %>"><%= homework.quotes %></li>
          <li class="fl subject-list-date"><%=format_date homework.publish_time %></li>
          <% if homework.user != User.current && (homework.course.is_public == 0 && !User.current.allowed_to?(:as_teacher,homework.course)) %>
            <li class="fl subject-list-option" id="homework_apply_status_<%=homework.id %>">
              <% 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 %>
            </li>
          <% else %>
            <li class="fl subject-list-option" id="homework_apply_status_<%=homework.id %>"><a href="javascript:void(0);">--</a></li>
      <% end %>
        </ul>
    <% end %>
</div>