<!-- 匿评作品列表，显示某一个作品的信息 -->
<tr class="hworkListRow" id="student_work_<%= student_work.id%>">
  <td class="none"><a name="<%= student_work.id%>"></a></td>
  <% if @homework.homework_type != 3 %>
      <% is_my_work = student_work.user == User.current%>
  <% else %>
      <% pro = @homework.student_work_projects.where(:user_id => User.current.id).first %>
      <% is_my_work = pro && pro.student_work_id == student_work.id%>
  <% end %>

  <% if is_my_work%>
      <td class="hworkList30 pl5 pr5" id="work_num_<%=student_work.id %>"><%=index + 1 %></td>
      <td class="hworkPortrait pr10 float-none">
        <%= image_tag(url_to_avatar(student_work.user),width:"40", height: "40", style: "display:block;") %>
      </td>
        <% if @homework.homework_type != 3 %>
          <td class="hworkName pr10 w250 float-none student_work_<%= student_work.id%>">
            <div>
              <% student_work_name = student_work.name.nil? || student_work.name.empty? ? student_work.user.show_name + '的作品' : student_work.name%>
              <%= link_to student_work_name, student_work_path(student_work),:remote => true,:title => student_work_name, :class => "linkGrey f14 StudentName break_word w250"%>
            </div>
          </td>
          <td class="hworkStName float-none w80 student_work_<%= student_work.id%>" title="<%= student_work.user.show_name%>" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;">
            <%= student_work.user.show_name%>
          </td>
          <td class="hworkStID float-none student_work_<%= student_work.id%>" title="<%= student_work.user.user_extensions.nil? ? "--" : student_work.user.user_extensions.student_id%>" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;">
            <span class="hidden fl" style="width:80px;"><%= student_work.user.user_extensions.nil? ? "--" : student_work.user.user_extensions.student_id%></span>
          </td>
        <% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1 %>
          <td class="hworkName pr10 w250 float-none student_work_<%= student_work.id%>">
            <div>
              <% student_work_name = student_work.name.nil? || student_work.name.empty? ? student_work.user.show_name + '的作品' : student_work.name%>
              <%= link_to student_work_name, student_work_path(student_work),:remote => true,:title => student_work_name, :class => "linkGrey f14 StudentName break_word w250"%>
            </div>
          </td>
            <% if student_work.project.is_public || User.current.member_of?(student_work.project) || User.current.admin? %>
              <td  class="hworkPrName float-none mr10 student_work_<%= student_work.id%>" title="项目名称">
                <%= link_to( student_work.project.name, project_path(student_work.project.id))%>
              </td>
            <% else %>
              <td class="hworkPrName float-none mr10 student_work_<%= student_work.id%>" title="该项目是私有的">
                <%= student_work.project.name %>
              </td>
            <% end %>
      <% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 0 %>
          <td class="hworkName pr10 w410 float-none student_work_<%= student_work.id%>">
            <div>
              <% student_work_name = student_work.name.nil? || student_work.name.empty? ? student_work.user.show_name + '的作品' : student_work.name%>
              <%= link_to student_work_name, student_work_path(student_work),:remote => true,:title => student_work_name, :class => "linkGrey f14 StudentName break_word w250"%>
            </div>
          </td>
        <% end %>
  <% else%>
      <td class="hworkList30 pl5 pr5" id="work_num_<%=student_work.id %>"><%=index + 1 %></td>
      <td class="hworkPortrait float-none pr10">
        <%= image_tag(url_to_avatar(""),width:"40", height: "40", style: "display:block;") %>
      </td>
      <td class="hworkName float-none pr10 w250 student_work_<%= student_work.id%>">
        <div>
          <%= link_to "匿名的作品", student_work_path(student_work),:remote => true,:title => student_work_name, :class => "linkGrey f14 StudentName break_word w250"%>
        </div>
      </td>
      <% if @homework.homework_type != 3 %>
          <td class="hworkStName float-none w80" title="姓名" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;">
            匿名
          </td>
          <td class="hworkStID float-none" title="学号">
            --
          </td>
      <% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1 %>
          <td class="hworkPrName mr10 float-none" title="项目名称" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;">
            匿名
          </td>
      <% end %>
  <% end%>
  <td class="hworkList130 pl10 c_grey student_work_<%= student_work.id%>" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;">
    <%= Time.parse(format_time(student_work.created_at)).strftime("%m-%d %H:%M")%>&nbsp;
    <% if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(format_time(student_work.created_at)).strftime("%Y-%m-%d") %>
        <span class="c_red">[迟交]</span>
    <% end %>
  </td>

  <!-- 成绩 -->
  <% if @homework.homework_type == 2%>
      <!-- 系统评分 -->
      <td class="hworkList50 <%= score_color student_work.system_score%>">
        <%= student_work.system_score.nil? ? "--" : format("%.1f",student_work.system_score)%>
      </td>
  <% end%>

  <% my_score = student_work_score(student_work,User.current) %>
  <td class="hworkList50 <%= my_score.nil? ? 'c_grey' : score_color(my_score.score)%> mr10 ml10">
    <%= my_score.nil? ? "--" : format("%.1f",my_score.score)%>
  </td>
  <td><div style="position:relative;"><div class="hworkTip" style="display: none" id="work_click_<%= student_work.id%>"><em></em><span></span><font class="fontGrey2">点击查看详情</font></div></div></td>
</tr>
<script type="text/javascript">
    $(".student_work_<%= student_work.id%>").mouseenter(function(){
        $("#work_click_<%= student_work.id%>").show();
    }).mouseleave(function(){
        $("#work_click_<%= student_work.id%>").hide();
    }).mouse;
</script>

