<% revise_attachment = work.attachments.where("attachtype = 7").first %>
<% if @homework.end_time < Date.today %>
    <% if revise_attachment && @is_teacher %>
        <div class="resubAtt mb15">
          <span class="resubTitle">追加修订附件</span>
        </div>
        <div class="mb10" id="revise_attachment_div_<%=revise_attachment.id %>">
          <span class="tit_fb"> 追加附件：</span>
          <%= render :partial => 'work_attachments_status', :locals => {:attachments => work.attachments.where("attachtype = 7"), :status => 2} %>
          <span class="tit_fb">追加时间：</span><%=format_time revise_attachment.created_on.to_s %>&nbsp;&nbsp;(<%=revise_attachment_status @homework,revise_attachment %>)<br />
          <% unless revise_attachment.description == "" %>
            <span class="tit_fb">追加理由：</span><p class="showHworkP"><%=revise_attachment.description %></p>
          <% end %>
        </div>
        <div class="cl"></div>
    <% end %>
    <% if work.user == User.current %>
        <div class="resubAtt mb15">
          <span class="resubTitle">追加修订附件</span>
        </div>
        <% if revise_attachment %>
            <div class="mb10" id="revise_attachment_div_<%=revise_attachment.id %>">
              <span class="tit_fb"> 追加附件：</span>
              <%= render :partial => 'work_attachments_status', :locals => {:attachments => work.attachments.where("attachtype = 7"), :status => 1} %>
              <span class="tit_fb">追加时间：</span><%=format_time revise_attachment.created_on.to_s %><br />
              <% unless revise_attachment.description == "" %>
                  <span class="tit_fb">追加理由：</span><p class="showHworkP"><%=revise_attachment.description %></p>
              <% end %>
            </div>
        <% end %>
        <div class="cl"></div>
        <div class="mb10 mt5">
          <a href="javascript:void(0);" id="upload_revise_attachment" onclick="show_upload();" class="blueCir ml5" title="请选择文件上传">上传附件</a>
        </div>
    <% end %>
<% end %>
