This commit is contained in:
z9hang 2014-10-14 14:27:56 +08:00
commit 328b9b5e5b
5 changed files with 10 additions and 9 deletions

View File

@ -17,6 +17,7 @@ class ZipdownController < ApplicationController
@project = obj.courses[0] @project = obj.courses[0]
end end
end end
def assort def assort
obj_class = params[:obj_class] obj_class = params[:obj_class]
obj_id = params[:obj_id] obj_id = params[:obj_id]
@ -76,18 +77,18 @@ class ZipdownController < ApplicationController
homeattaches = bid.homeworks homeattaches = bid.homeworks
#记录所有作业是不是有附件有一个附件就改为true #记录所有作业是不是有附件有一个附件就改为true
has_file = false #has_file = false
# 得到每一个人所有文件打包的zip文件 # 得到每一个人所有文件打包的zip文件
# 并将每一个人的zip打包为一个并返回路径 # 并将每一个人的zip打包为一个并返回路径
user_zip_paths = homeattaches.map do |homeattach| user_zip_paths = homeattaches.map do |homeattach|
if homeattach.attachments.count > 0 if homeattach.attachments.count > 0
zip_homework_by_user homeattach zip_homework_by_user homeattach
has_file = true unless has_file #has_file = true unless has_file
end end
end end
unless has_file #unless has_file
render file: 'public/no_file_fond.html' , :layout => 'course_base' # render file: 'public/no_file_fond.html' , :layout => 'course_base'
end #end
zipping "#{Time.now.to_i}_#{bid.name}.zip", user_zip_paths, OUTPUT_FOLDER zipping "#{Time.now.to_i}_#{bid.name}.zip", user_zip_paths, OUTPUT_FOLDER
#@paths = homeworks_attach_path #@paths = homeworks_attach_path

View File

@ -26,7 +26,7 @@
&nbsp; &nbsp;
<div class="autoscroll"> <div class="autoscroll">
<table class="list" style="width: 100%;table-layout: fixed"> <table class="list" style="width: 100%;table-layout: fixed;">
<thead> <thead>
<tr > <tr >
<%= sort_header_tag('login', :caption => l(:field_login)) %> <%= sort_header_tag('login', :caption => l(:field_login)) %>

View File

@ -78,7 +78,7 @@
<% end %> <% end %>
</td> </td>
<td rowspan="4" style="text-align: center;vertical-align: middle;width: 30px"> <td rowspan="4" style="text-align: center;vertical-align: middle;width: 30px">
<% if Time.parse(@bid.deadline.to_s) < Time.parse(homework.created_at.to_s) %> <% if Time.parse(@bid.deadline.to_s).strftime("%Y-%m-%d") < Time.parse(homework.created_at.to_s).strftime("%Y-%m-%d") %>
<span class="required">迟交</span> <span class="required">迟交</span>
<% end %> <% end %>
</td> </td>

View File

@ -4,7 +4,7 @@
<hr /> <hr />
<% attachments_results.each do |file| %> <% attachments_results.each do |file| %>
<p class="font_description2"> <p class="font_description2">
<table border=0 cellSpacing=0 cellPadding=0> <table border=0 cellSpacing=0 cellPadding=0 style="width: 100%;table-layout: fixed;">
<tbody> <tbody>
<tr> <tr>
<td class="r1"> <td class="r1">

View File

@ -1389,7 +1389,7 @@ a.toggle-all:hover {text-decoration:none;}
table.list tbody tr:hover { background-color:#ffffdd; } table.list tbody tr:hover { background-color:#ffffdd; }
table.list tbody tr.group:hover { background-color:inherit; } table.list tbody tr.group:hover { background-color:inherit; }
table td {padding:2px;} table td {padding:2px;word-break: break-all;word-wrap: break-word;}
table p {margin:0;} table p {margin:0;}
.odd {background-color:#f6f7f8;} .odd {background-color:#f6f7f8;}
.even {background-color: #fff;} .even {background-color: #fff;}