<!-- 匿评作品列表，显示某一个作品的信息 -->
<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="hworkList40 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="hworkStName float-none <%= @homework.homework_type == 2 ? 'w180' : 'w190' %> 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 <%= @homework.homework_type == 2 ? 'w180' : 'w190' %> 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"><%= 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 w220 float-none student_work_<%= student_work.id%>" onclick="show_student_work('<%= student_work_path(student_work)%>');">
            <div>
              <%= link_to student_work.user.show_name,"javascript:void(0)" ,:title => student_work.user.show_name, :class => "linkGrey f14 StudentName break_word"%>
            </div>
          </td>
            <% if student_work.project_id == 0 || student_work.project_id.nil?%>
              <td  class="hworkPrName float-none mr10 student_work_<%= student_work.id%>" title="项目名称">
                --
              </td>
            <% elsif 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 w380 float-none student_work_<%= student_work.id%>" onclick="show_student_work('<%= student_work_path(student_work)%>');">
            <div>
              <%= link_to student_work.user.show_name,"javascript:void(0)" ,:title => student_work.user.show_name, :class => "linkGrey f14 StudentName break_word"%>
            </div>
          </td>
        <% end %>
  <% else%>
      <td class="hworkList40 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>
      <% if @homework.homework_type != 3 %>
          <td class="hworkStName float-none <%= @homework.homework_type == 2 ? 'w180' : 'w190' %>" title="姓名" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;">
            匿名
          </td>
          <td class="hworkStID <%= @homework.homework_type == 2 ? 'w180' : 'w190' %> float-none" title="学号">
            --
          </td>
      <% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1 %>
          <td class="hworkName pr10 w220 float-none student_work_<%= student_work.id%>">
            <div style="text-align: left">匿名</div>
          </td>
           <td class="hworkPrName float-none mr10 student_work_<%= student_work.id%>" title="">
             匿名
           </td>
      <% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 0 %>
          <td class="hworkPrName mr10 float-none" title="" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer; text-align: left;">
            匿名
          </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;">
    <% if student_work.work_status%>
        <%=get_status student_work.work_status %>
    <% end %>
  </td>

  <!-- 成绩 -->
  <% if @homework.homework_type == 2%>
      <!-- 系统评分 -->
      <td class="hworkList70 <%= 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,3) %>
  <td class="hworkList70 <%= 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>

