Merge branch 'dev_aliyun' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

dev_winse
caishi 6 years ago
commit 2da8dd592b

@ -239,7 +239,7 @@ class ApplicationController < ActionController::Base
uid_logger("user_setup: " + (User.current.logged? ? "#{User.current.try(:login)} (id=#{User.current.try(:id)})" : "anonymous"))
if !User.current.logged? && Rails.env.development?
User.current = User.find 8686
User.current = User.find 1
end

@ -14,7 +14,7 @@ module RenderExpand
kit.stylesheets << Rails.root.join('app/templates', path)
end
send_data kit.to_pdf, filename: options[:filename], type: 'application/pdf'
send_data kit.to_pdf, filename: options[:filename], disposition: options[:disposition] || 'attachment', type: 'application/pdf'
end
end
end

@ -1290,20 +1290,8 @@ class ExercisesController < ApplicationController
if params[:export].present? && params[:export]
normal_status(0,"正在下载中")
else
file = File.open(Rails.root.join('exercise_export/blank_exercise.html.erb'))
html = ERB.new(file.read)
kit = PDFKit.new(html)
base_css = %w(app/templates/exercise_export/exercise_export.css)
base_css.each { |css| kit.stylesheets << Rails.root.join(css) }
# file = Tempfile.new(filename_)
# kit.to_pdf(file.path)
# file
send_file kit.to_pdf, filename: filename_ ,disposition: 'inline', type:"application/pdf"
# set_export_cookies
# render pdf: 'exercise_export/blank_exercise', filename: filename_, stylesheets: stylesheets, disposition: 'inline', type:"pdf_attachment.content_type",stream:false
set_export_cookies
render pdf: 'exercise_export/blank_exercise', filename: filename_, stylesheets: stylesheets, disposition: 'inline', type:"pdf_attachment.content_type",stream:false
end
end

@ -474,7 +474,7 @@ class StudentWorksController < ApplicationController
filename_ = "#{@use&.student_id}_#{@use&.real_name}_#{@shixun&.name}_#{Time.now.strftime('%Y%m%d_%H%M%S')}"
filename = Base64.urlsafe_encode64(filename_.strip)
stylesheets = %w(shixun_work/shixun_work.css shared/codemirror.css)
render pdf: 'shixun_work/shixun_work', filename: filename, stylesheets: stylesheets
render pdf: 'shixun_work/shixun_work', filename: filename, stylesheets: stylesheets, disposition: 'inline', type:"pdf_attachment.content_type",stream:false
end
# 作品调分

@ -1,4 +1,4 @@
json.id user.id
json.name user.full_name
json.name user.real_name
json.login user.login
json.image_url url_to_avatar(user)

@ -0,0 +1,16 @@
defaults: &defaults
access_key_id: 'test'
access_key_secret: 'test'
base_url: 'http://vod.cn-shanghai.aliyuncs.com'
cate_id: '-1'
callback_url: 'http://47.96.87.25:48080/api/callbacks/aliyun_vod.json'
signature_key: 'test12345678'
development:
<<: *defaults
test:
<<: *defaults
production:
<<: *defaults

@ -0,0 +1,8 @@
class ModifyClassPeriodForCourses < ActiveRecord::Migration[5.2]
def change
Course.find_each do |c|
c.update_column(:class_period, c.class_period.to_i)
end
change_column :courses, :class_period, :integer
end
end

@ -261,7 +261,7 @@ class Fileslistitem extends Component{
</p>}
<p className="color-grey panel-lightgrey mt8 fl ml30" style={{width:'100%'}}>
<p className={this.props.isAdmin===true?"color-grey panel-lightgrey mt8 fl ml30":"color-grey panel-lightgrey mt8 fl ml13"} style={{width:'100%'}}>
<span className="mr50">
<span className="mr15 color-dark">{discussMessage.author.name}</span>
<span className="mr15 color-grey9">大小 {discussMessage.filesize}</span>
@ -302,7 +302,7 @@ class Fileslistitem extends Component{
<p className="color-grey panel-lightgrey mt8 fl ml30" style={{width:'100%'}}>
<p className={this.props.isAdmin===true?"color-grey panel-lightgrey mt8 fl ml30":"color-grey panel-lightgrey mt8 fl ml13"} style={{width:'100%'}}>
<pre className="color-dark">资源描述 :{discussMessage.description===null?"暂无描述":discussMessage.description}</pre>
{/*<span className="mr50">*/}
{/*/!*<span className="mr15 color-dark"></span>*!/*/}

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save