Merge branch 'develop' of 10.0.47.245:/home/trustie2 into develop
This commit is contained in:
commit
d43bf49f4c
6
Gemfile
6
Gemfile
|
@ -1,5 +1,11 @@
|
||||||
source 'https://rubygems.org'
|
source 'https://rubygems.org'
|
||||||
|
|
||||||
|
unless RUBY_PLATFORM =~ /w32/
|
||||||
|
# unix-like only
|
||||||
|
gem 'iconv'
|
||||||
|
gem 'rubyzip'
|
||||||
|
gem 'zip-zip'
|
||||||
|
end
|
||||||
gem "rails", "3.2.13"
|
gem "rails", "3.2.13"
|
||||||
gem "jquery-rails", "~> 2.0.2"
|
gem "jquery-rails", "~> 2.0.2"
|
||||||
gem "i18n", "~> 0.6.0"
|
gem "i18n", "~> 0.6.0"
|
||||||
|
|
|
@ -30,7 +30,7 @@ class TestController < ApplicationController
|
||||||
input_filename = files_path
|
input_filename = files_path
|
||||||
zipfile_name = "#{Rails.root}/tmp/archiveZip/archive_#{Time.now.to_i}.zip"
|
zipfile_name = "#{Rails.root}/tmp/archiveZip/archive_#{Time.now.to_i}.zip"
|
||||||
|
|
||||||
Dir.mkdir(File.dirname(zipfile_name)) if File.exist?(File.dirname(zipfile_name))
|
Dir.mkdir(File.dirname(zipfile_name)) unless File.exist?(File.dirname(zipfile_name))
|
||||||
Zip::File.open(zipfile_name, Zip::File::CREATE) do |zipfile|
|
Zip::File.open(zipfile_name, Zip::File::CREATE) do |zipfile|
|
||||||
input_filename.each do |filename|
|
input_filename.each do |filename|
|
||||||
zipfile.add(ic.iconv(filename_to_real(File.basename(filename))), folder + '/' + filename)
|
zipfile.add(ic.iconv(filename_to_real(File.basename(filename))), folder + '/' + filename)
|
||||||
|
|
|
@ -14,6 +14,10 @@
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% display_id = im_watching_student_id? @bid%>
|
<% display_id = im_watching_student_id? @bid%>
|
||||||
|
<%= link_to "作业打包下载", test_zip_path(homework_id: @bid), remote: true, class: "button_submit button_submit_font_white", style: "margin: 5px 10px;display: inline-block;" if( User.current.admin? ||
|
||||||
|
!(User.current.roles_for_project(@bid.courses.first).map(&:id) &
|
||||||
|
([7,9, 10])).empty?
|
||||||
|
) && Rails.env.development? %>
|
||||||
<% @homework_list.each do |homework|%>
|
<% @homework_list.each do |homework|%>
|
||||||
<% if homework.attachments.any?%>
|
<% if homework.attachments.any?%>
|
||||||
<table width="660px" border="0" align="center">
|
<table width="660px" border="0" align="center">
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<!-- fq -->
|
<!-- fq -->
|
||||||
|
|
||||||
<% if @bid.homework_type == 1%>
|
<% if @bid.homework_type == Bid::HomeworkFile %>
|
||||||
<%= render :partial => 'homework' %>
|
<%= render :partial => 'homework' %>
|
||||||
|
|
||||||
<% else %>
|
<% else %>
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
<% course.homeworks.each do |homework| %>
|
<% course.homeworks.each do |homework| %>
|
||||||
<% homeworks_attach_path = [] %>
|
<% homeworks_attach_path = [] %>
|
||||||
<div class="homeworks">
|
<div class="homeworks">
|
||||||
<%= homework.name %>(<%=homework.homeworks.count %>)<%#Bid%>
|
<%= link_to homework.name, respond_path(homework) %>(<%=homework.homeworks.count %>)<%#Bid%>
|
||||||
<div class="attach_item">
|
<div class="attach_item">
|
||||||
<%= link_to "package", test_zip_path(:homework_id => homework.id)%><br/>
|
<%= link_to "package", test_zip_path(:homework_id => homework.id)%><br/>
|
||||||
<% homework.homeworks.each do |homeattach|%><%#homework.class == Bid %>
|
<% homework.homeworks.each do |homeattach|%><%#homework.class == Bid %>
|
||||||
|
|
|
@ -1907,6 +1907,10 @@ input[type="submit"], .button_submit {
|
||||||
text-shadow: 0px -1px 0px rgba(0, 0, 0, 0.2), 0px 1px 0px rgb(255, 255, 255);
|
text-shadow: 0px -1px 0px rgba(0, 0, 0, 0.2), 0px 1px 0px rgb(255, 255, 255);
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
.button_submit_font_white{
|
||||||
|
color: white !important ;
|
||||||
|
font-weight: 400;
|
||||||
|
}
|
||||||
|
|
||||||
input[type="button-submit"] {
|
input[type="button-submit"] {
|
||||||
padding-bottom: 5px;
|
padding-bottom: 5px;
|
||||||
|
|
Loading…
Reference in New Issue