|
|
|
@ -60,7 +60,7 @@ class ZipdownController < ApplicationController
|
|
|
|
|
unless homework.attachments.empty?
|
|
|
|
|
zipfile = zip_homework_by_user homework
|
|
|
|
|
send_file zipfile.file_path, :filename => ((homework.user.user_extensions.nil? || homework.user.user_extensions.student_id.nil?) ? "" : homework.user.user_extensions.student_id) +
|
|
|
|
|
"_" + (homework.user.lastname.nil? ? "" : homework.user.lastname) + (homework.user.firstname.nil? ? "" : homework.user.firstname) +
|
|
|
|
|
"_" + homework.user.show_name +
|
|
|
|
|
"_" + homework.name + ".zip", :type => detect_content_type(zipfile.file_path) if(zipfile)
|
|
|
|
|
else
|
|
|
|
|
render file: 'public/no_file_found.html'
|
|
|
|
@ -148,7 +148,7 @@ class ZipdownController < ApplicationController
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
out_file = find_or_pack(homework_attach.bid_id, homework_attach.user_id, digests.sort){
|
|
|
|
|
zipping("#{homework_attach.user.lastname}#{homework_attach.user.firstname}_#{((homework_attach.user.user_extensions.nil? || homework_attach.user.user_extensions.student_id.nil?) ? "" : homework_attach.user.user_extensions.student_id)}_#{Time.now.to_i.to_s}.zip",
|
|
|
|
|
zipping("#{homework_attach.user.show_name}_#{((homework_attach.user.user_extensions.nil? || homework_attach.user.user_extensions.student_id.nil?) ? "" : homework_attach.user.user_extensions.student_id)}_#{Time.now.to_i.to_s}.zip",
|
|
|
|
|
homeworks_attach_path, OUTPUT_FOLDER, true, not_exist_file)
|
|
|
|
|
}
|
|
|
|
|
end
|
|
|
|
@ -168,7 +168,7 @@ class ZipdownController < ApplicationController
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
out_file = find_or_pack(work.homework_common_id, work.user_id, digests.sort){
|
|
|
|
|
zipping("#{work.user.lastname}#{work.user.firstname}_#{((work.user.user_extensions.nil? || work.user.user_extensions.student_id.nil?) ? "" : work.user.user_extensions.student_id)}_#{Time.now.to_i.to_s}.zip",
|
|
|
|
|
zipping("#{work.user.show_name}_#{((work.user.user_extensions.nil? || work.user.user_extensions.student_id.nil?) ? "" : work.user.user_extensions.student_id)}_#{Time.now.to_i.to_s}.zip",
|
|
|
|
|
homeworks_attach_path, OUTPUT_FOLDER, true, not_exist_file)
|
|
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|