Merge branch 'develop' of https://git.trustie.net/jacknudt/trustieforge into develop

Conflicts:
	app/views/files/_org_subfield_list.html.erb
	db/schema.rb
This commit is contained in:
huang 2016-03-17 16:06:05 +08:00
commit 28cb1755d8
45 changed files with 3132 additions and 2669 deletions

View File

@ -91,8 +91,12 @@ class BlogCommentsController < ApplicationController
def edit def edit
@article = BlogComment.find(params[:id]) @article = BlogComment.find(params[:id])
respond_to do |format| if User.current.admin? || User.current.id == @article.author_id
format.html {render :layout=>'new_base_user'} respond_to do |format|
format.html { render :layout => 'new_base_user' }
end
else
render_403
end end
end end

View File

@ -1,378 +1,380 @@
class HomeworkCommonController < ApplicationController class HomeworkCommonController < ApplicationController
require 'net/http' require 'net/http'
require 'json' require 'json'
require "base64" require "base64"
layout "base_courses" layout "base_courses"
include StudentWorkHelper include StudentWorkHelper
before_filter :find_course, :only => [:index,:new,:create] before_filter :find_course, :only => [:index,:new,:create]
before_filter :find_homework, :only => [:edit,:update,:alert_anonymous_comment,:start_anonymous_comment,:stop_anonymous_comment,:destroy,:start_evaluation_set,:set_evaluation_attr,:score_rule_set,:alert_forbidden_anonymous_comment,:alert_open_student_works,:open_student_works] before_filter :find_homework, :only => [:edit,:update,:alert_anonymous_comment,:start_anonymous_comment,:stop_anonymous_comment,:destroy,:start_evaluation_set,:set_evaluation_attr,:score_rule_set,:alert_forbidden_anonymous_comment,:alert_open_student_works,:open_student_works]
before_filter :teacher_of_course, :only => [:new, :create, :edit, :update, :destroy, :start_anonymous_comment, :stop_anonymous_comment, :alert_anonymous_comment,:start_evaluation_set,:set_evaluation_attr,:score_rule_set,:alert_forbidden_anonymous_comment,:alert_open_student_works,:open_student_works] before_filter :teacher_of_course, :only => [:new, :create, :edit, :update, :destroy, :start_anonymous_comment, :stop_anonymous_comment, :alert_anonymous_comment,:start_evaluation_set,:set_evaluation_attr,:score_rule_set,:alert_forbidden_anonymous_comment,:alert_open_student_works,:open_student_works]
before_filter :member_of_course, :only => [:index] before_filter :member_of_course, :only => [:index]
def index def index
@new_homework = HomeworkCommon.new @new_homework = HomeworkCommon.new
@new_homework.homework_detail_manual = HomeworkDetailManual.new @new_homework.homework_detail_manual = HomeworkDetailManual.new
@new_homework.course = @course @new_homework.course = @course
@page = params[:page] ? params[:page].to_i + 1 : 0 @page = params[:page] ? params[:page].to_i + 1 : 0
@is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,@course)) @is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,@course))
if @is_teacher if @is_teacher
@homeworks = @course.homework_commons.order("updated_at desc").limit(10).offset(@page * 10) @homeworks = @course.homework_commons.order("updated_at desc").limit(10).offset(@page * 10)
else else
@homeworks = @course.homework_commons.where("publish_time <= '#{Date.today}'").order("updated_at desc").limit(10).offset(@page * 10) @homeworks = @course.homework_commons.where("publish_time <= '#{Date.today}'").order("updated_at desc").limit(10).offset(@page * 10)
end end
@is_student = User.current.logged? && (User.current.admin? || (User.current.member_of_course?(@course) && !@is_teacher)) @is_student = User.current.logged? && (User.current.admin? || (User.current.member_of_course?(@course) && !@is_teacher))
@is_new = params[:is_new] @is_new = params[:is_new]
#设置at已读 #设置at已读
@homeworks.each do |homework| @homeworks.each do |homework|
homework.journals_for_messages.each do |j| homework.journals_for_messages.each do |j|
User.current.at_messages.unviewed('JournalsForMessage', j.id).each {|x| x.viewed!} User.current.at_messages.unviewed('JournalsForMessage', j.id).each {|x| x.viewed!}
end end
end end
respond_to do |format| respond_to do |format|
format.js format.js
format.html format.html
end end
end end
#新建作业,在个人作业列表创建作业 #新建作业,在个人作业列表创建作业
def new def new
render_404 render_404
end end
#新建作业,在个人作业列表创建作业 #新建作业,在个人作业列表创建作业
def create def create
redirect_to user_homeworks_user_path(User.current.id) redirect_to user_homeworks_user_path(User.current.id)
end end
def edit def edit
@user = User.current @user = User.current
@is_in_course = params[:is_in_course].to_i @is_in_course = params[:is_in_course].to_i
@course_activity = params[:course_activity].to_i @course_activity = params[:course_activity].to_i
respond_to do |format| respond_to do |format|
format.html{render :layout => 'new_base_user'} format.html{render :layout => 'new_base_user'}
end end
end end
def update def update
if params[:homework_common] if params[:homework_common]
@homework.name = params[:homework_common][:name] @homework.name = params[:homework_common][:name]
@homework.description = params[:homework_common][:description] @homework.description = params[:homework_common][:description]
if params[:homework_common][:publish_time] == "" if params[:homework_common][:publish_time] == ""
@homework.publish_time = Date.today @homework.publish_time = Date.today
else else
@homework.publish_time = params[:homework_common][:publish_time] @homework.publish_time = params[:homework_common][:publish_time]
end end
@homework.end_time = params[:homework_common][:end_time] || Time.now @homework.end_time = params[:homework_common][:end_time] || Time.now
@homework.course_id = params[:course_id] @homework.course_id = params[:course_id]
@homework.anonymous_comment = params[:homework_common][:anonymous_comment] ? params[:homework_common][:anonymous_comment] : 0 @homework.anonymous_comment = params[:homework_common][:anonymous_comment] ? params[:homework_common][:anonymous_comment] : 0
homework_detail_manual = @homework.homework_detail_manual || HomeworkDetailManual.new homework_detail_manual = @homework.homework_detail_manual || HomeworkDetailManual.new
if @homework.publish_time <= Date.today && homework_detail_manual.comment_status == 0 if @homework.publish_time <= Date.today && homework_detail_manual.comment_status == 0
homework_detail_manual.comment_status = 1 homework_detail_manual.comment_status = 1
end end
homework_detail_manual.evaluation_start = params[:evaluation_start].blank? ? @homework.end_time + 7 : params[:evaluation_start] eval_start = homework_detail_manual.evaluation_start
homework_detail_manual.evaluation_end = params[:evaluation_end].blank? ? homework_detail_manual.evaluation_start + 7 : params[:evaluation_end] if eval_start <= @homework.end_time && homework_detail_manual.comment_status <= 1
homework_detail_manual.evaluation_start = @homework.end_time + 7
@homework.save_attachments(params[:attachments]) homework_detail_manual.evaluation_end = homework_detail_manual.evaluation_start + 7
render_attachment_warning_if_needed(@homework) end
@homework.save_attachments(params[:attachments])
#编程作业相关属性 render_attachment_warning_if_needed(@homework)
if @homework.homework_type == 2
@homework.homework_detail_programing ||= HomeworkDetailPrograming.new #编程作业相关属性
@homework_detail_programing = @homework.homework_detail_programing if @homework.homework_type == 2
@homework_detail_programing.language = params[:language_type].to_i @homework.homework_detail_programing ||= HomeworkDetailPrograming.new
@homework_detail_programing = @homework.homework_detail_programing
@homework.homework_tests.delete_all @homework_detail_programing.language = params[:language_type].to_i
inputs = params[:program][:input]
if Array === inputs @homework.homework_tests.delete_all
inputs.each_with_index do |val, i| inputs = params[:program][:input]
@homework.homework_tests << HomeworkTest.new( if Array === inputs
input: val, inputs.each_with_index do |val, i|
output: params[:program][:output][i] @homework.homework_tests << HomeworkTest.new(
) input: val,
end output: params[:program][:output][i]
end )
end end
end
#分组作业 end
if @homework.homework_type == 3
@homework.homework_detail_group ||= HomeworkDetailGroup.new #分组作业
@homework_detail_group = @homework.homework_detail_group if @homework.homework_type == 3
@homework_detail_group.min_num = params[:min_num].to_i @homework.homework_detail_group ||= HomeworkDetailGroup.new
@homework_detail_group.max_num = params[:max_num].to_i @homework_detail_group = @homework.homework_detail_group
@homework_detail_group.base_on_project = params[:base_on_project].to_i @homework_detail_group.min_num = params[:min_num].to_i
end @homework_detail_group.max_num = params[:max_num].to_i
@homework_detail_group.base_on_project = params[:base_on_project].to_i
if @homework.save end
@homework_detail_manual.save if @homework_detail_manual
@homework_detail_programing.save if @homework_detail_programing if @homework.save
@homework_detail_group.save if @homework_detail_group @homework_detail_manual.save if @homework_detail_manual
@homework_detail_programing.save if @homework_detail_programing
if params[:is_in_course] == "1" @homework_detail_group.save if @homework_detail_group
redirect_to homework_common_index_path(:course => @course.id)
elsif params[:is_in_course] == "0" if params[:is_in_course] == "1"
redirect_to user_homeworks_user_path(User.current.id) redirect_to homework_common_index_path(:course => @course.id)
elsif params[:is_in_course] == "-1" && params[:course_activity] == "0" elsif params[:is_in_course] == "0"
redirect_to user_path(User.current.id) redirect_to user_homeworks_user_path(User.current.id)
elsif params[:is_in_course] == "-1" && params[:course_activity] == "1" elsif params[:is_in_course] == "-1" && params[:course_activity] == "0"
redirect_to course_path(@course.id) redirect_to user_path(User.current.id)
end elsif params[:is_in_course] == "-1" && params[:course_activity] == "1"
end redirect_to course_path(@course.id)
end end
end end
end
def destroy end
if @homework.destroy
respond_to do |format| def destroy
format.html { if @homework.destroy
if params[:is_in_course] == "1" respond_to do |format|
redirect_to homework_common_index_path(:course => @course.id) format.html {
elsif params[:is_in_course] == "0" if params[:is_in_course] == "1"
redirect_to user_homeworks_user_path(User.current.id) redirect_to homework_common_index_path(:course => @course.id)
elsif params[:is_in_course] == "-1" && params[:course_activity] == "0" elsif params[:is_in_course] == "0"
redirect_to user_path(User.current.id) redirect_to user_homeworks_user_path(User.current.id)
elsif params[:is_in_course] == "-1" && params[:course_activity] == "1" elsif params[:is_in_course] == "-1" && params[:course_activity] == "0"
redirect_to course_path(@course.id) redirect_to user_path(User.current.id)
end elsif params[:is_in_course] == "-1" && params[:course_activity] == "1"
} redirect_to course_path(@course.id)
end end
end }
end end
end
#开启匿评 end
#statue 1:启动成功2启动失败作业总数大于等于2份时才能启动匿评3:已开启匿评,请务重复开启,4:没有开启匿评的权限
def start_anonymous_comment #开启匿评
@statue = 4 and return unless User.current.admin? || User.current.allowed_to?(:as_teacher,@course) #statue 1:启动成功2启动失败作业总数大于等于2份时才能启动匿评3:已开启匿评,请务重复开启,4:没有开启匿评的权限
@statue = 5 and return if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d") def start_anonymous_comment
if @homework_detail_manual.comment_status == 1 @statue = 4 and return unless User.current.admin? || User.current.allowed_to?(:as_teacher,@course)
student_works = @homework.student_works @statue = 5 and return if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d")
if student_works && student_works.size >= 2 if @homework_detail_manual.comment_status == 1
if @homework.homework_type == 3 student_works = @homework.student_works
student_work_projects = @homework.student_work_projects.where("student_work_id is not null") if student_works && student_works.size >= 2
student_work_projects.each_with_index do |pro_work, pro_index| if @homework.homework_type == 3
n = @homework_detail_manual.evaluation_num student_work_projects = @homework.student_work_projects.where("student_work_id is not null")
n = n < student_works.size ? n : student_works.size - 1 student_work_projects.each_with_index do |pro_work, pro_index|
work_index = -1 n = @homework_detail_manual.evaluation_num
student_works.each_with_index do |stu_work, stu_index| n = n < student_works.size ? n : student_works.size - 1
if stu_work.id.to_i == pro_work.student_work_id.to_i work_index = -1
work_index = stu_index student_works.each_with_index do |stu_work, stu_index|
end if stu_work.id.to_i == pro_work.student_work_id.to_i
end work_index = stu_index
assigned_homeworks = get_assigned_homeworks(student_works, n, work_index) end
assigned_homeworks.each do |h| end
student_works_evaluation_distributions = StudentWorksEvaluationDistribution.new(user_id: pro_work.user_id, student_work_id: h.id) assigned_homeworks = get_assigned_homeworks(student_works, n, work_index)
student_works_evaluation_distributions.save assigned_homeworks.each do |h|
end student_works_evaluation_distributions = StudentWorksEvaluationDistribution.new(user_id: pro_work.user_id, student_work_id: h.id)
end student_works_evaluation_distributions.save
else end
student_works.each_with_index do |work, index| end
user = work.user else
n = @homework_detail_manual.evaluation_num student_works.each_with_index do |work, index|
n = n < student_works.size ? n : student_works.size - 1 user = work.user
assigned_homeworks = get_assigned_homeworks(student_works, n, index) n = @homework_detail_manual.evaluation_num
assigned_homeworks.each do |h| n = n < student_works.size ? n : student_works.size - 1
student_works_evaluation_distributions = StudentWorksEvaluationDistribution.new(user_id: user.id, student_work_id: h.id) assigned_homeworks = get_assigned_homeworks(student_works, n, index)
student_works_evaluation_distributions.save assigned_homeworks.each do |h|
end student_works_evaluation_distributions = StudentWorksEvaluationDistribution.new(user_id: user.id, student_work_id: h.id)
end student_works_evaluation_distributions.save
end end
@homework_detail_manual.update_column('comment_status', 2) end
@homework_detail_manual.update_column('evaluation_start', Date.today) end
@statue = 1 @homework_detail_manual.update_column('comment_status', 2)
# 匿评开启消息邮件通知 @homework_detail_manual.update_column('evaluation_start', Date.today)
send_message_anonymous_comment(@homework, m_status = 2) @statue = 1
Mailer.send_mail_anonymous_comment_open(@homework).deliver # 匿评开启消息邮件通知
else send_message_anonymous_comment(@homework, m_status = 2)
@statue = 2 Mailer.send_mail_anonymous_comment_open(@homework).deliver
else
end @statue = 2
else
@statue = 3 end
end else
@user_activity_id = params[:user_activity_id].to_i @statue = 3
@is_in_course = params[:is_in_course].to_i end
@course_activity = params[:course_activity].to_i @user_activity_id = params[:user_activity_id].to_i
end @is_in_course = params[:is_in_course].to_i
@course_activity = params[:course_activity].to_i
#关闭匿评 end
def stop_anonymous_comment
@homework_detail_manual.update_column('comment_status', 3) #关闭匿评
@homework_detail_manual.update_column('evaluation_end', Date.today) def stop_anonymous_comment
#计算缺评扣分 @homework_detail_manual.update_column('comment_status', 3)
work_ids = "(" + @homework.student_works.map(&:id).join(",") + ")" @homework_detail_manual.update_column('evaluation_end', Date.today)
@homework.student_works.each do |student_work| #计算缺评扣分
absence_penalty_count = student_work.user.student_works_evaluation_distributions.where("student_work_id IN #{work_ids}").count - student_work.user.student_works_scores.where("student_work_id IN #{work_ids}").count work_ids = "(" + @homework.student_works.map(&:id).join(",") + ")"
student_work.absence_penalty = absence_penalty_count > 0 ? absence_penalty_count * @homework_detail_manual.absence_penalty : 0 @homework.student_works.each do |student_work|
student_work.save absence_penalty_count = student_work.user.student_works_evaluation_distributions.where("student_work_id IN #{work_ids}").count - student_work.user.student_works_scores.where("student_work_id IN #{work_ids}").count
end student_work.absence_penalty = absence_penalty_count > 0 ? absence_penalty_count * @homework_detail_manual.absence_penalty : 0
# 匿评关闭消息邮件通知 student_work.save
send_message_anonymous_comment(@homework, m_status = 3) end
Mailer.send_mail_anonymous_comment_close(@homework).deliver # 匿评关闭消息邮件通知
@user_activity_id = params[:user_activity_id].to_i send_message_anonymous_comment(@homework, m_status = 3)
@is_in_course = params[:is_in_course].to_i Mailer.send_mail_anonymous_comment_close(@homework).deliver
@course_activity = params[:course_activity].to_i @user_activity_id = params[:user_activity_id].to_i
respond_to do |format| @is_in_course = params[:is_in_course].to_i
format.js @course_activity = params[:course_activity].to_i
end respond_to do |format|
end format.js
end
# 开启/关闭匿评消息通知 end
def send_message_anonymous_comment(homework, m_status )
# status 标记匿评状态 1为关闭 0为开启 # 开启/关闭匿评消息通知
course = homework.course def send_message_anonymous_comment(homework, m_status )
course.members.each do |m| # status 标记匿评状态 1为关闭 0为开启
@homework.course_messages << CourseMessage.new(:user_id => m.user_id, :course_id => course.id, :viewed => false, :status => m_status) course = homework.course
end course.members.each do |m|
end @homework.course_messages << CourseMessage.new(:user_id => m.user_id, :course_id => course.id, :viewed => false, :status => m_status)
#提示 end
def alert_anonymous_comment end
@cur_size = 0 #提示
@totle_size = 0 def alert_anonymous_comment
if @homework_detail_manual.comment_status == 1 @cur_size = 0
@totle_size = @course.student.count @totle_size = 0
@cur_size = @homework.student_works.size if @homework_detail_manual.comment_status == 1
elsif @homework_detail_manual.comment_status == 2 @totle_size = @course.student.count
@homework.student_works.map { |work| @totle_size += work.student_works_evaluation_distributions.count} @cur_size = @homework.student_works.size
@cur_size = 0 elsif @homework_detail_manual.comment_status == 2
@homework.student_works.map { |work| @cur_size += work.student_works_scores.where(:reviewer_role => 3).count} @homework.student_works.map { |work| @totle_size += work.student_works_evaluation_distributions.count}
end @cur_size = 0
@percent = format("%.2f",(@cur_size.to_f / ( @totle_size == 0 ? 1 : @totle_size)) * 100) @homework.student_works.map { |work| @cur_size += work.student_works_scores.where(:reviewer_role => 3).count}
@user_activity_id = params[:user_activity_id].to_i end
@is_in_course = params[:is_in_course].to_i @percent = format("%.2f",(@cur_size.to_f / ( @totle_size == 0 ? 1 : @totle_size)) * 100)
@course_activity = params[:course_activity].to_i @user_activity_id = params[:user_activity_id].to_i
respond_to do |format| @is_in_course = params[:is_in_course].to_i
format.js @course_activity = params[:course_activity].to_i
end respond_to do |format|
end format.js
end
def alert_forbidden_anonymous_comment end
if params[:user_activity_id]
@user_activity_id = params[:user_activity_id] def alert_forbidden_anonymous_comment
else if params[:user_activity_id]
@user_activity_id = -1 @user_activity_id = params[:user_activity_id]
end else
@is_in_course = params[:is_in_course] if params[:is_in_course] @user_activity_id = -1
@course_activity = params[:course_activity] if params[:course_Activity] end
respond_to do |format| @is_in_course = params[:is_in_course] if params[:is_in_course]
format.js @course_activity = params[:course_activity] if params[:course_Activity]
end respond_to do |format|
end format.js
end
def open_student_works end
if @homework.is_open == 0
@homework.update_attribute(:is_open, 1) def open_student_works
else if @homework.is_open == 0
@homework.update_attribute(:is_open, 0) @homework.update_attribute(:is_open, 1)
end else
@user_activity_id = params[:user_activity_id] @homework.update_attribute(:is_open, 0)
@is_in_course = params[:is_in_course] if params[:is_in_course] end
@course_activity = params[:course_activity] if params[:course_Activity] @user_activity_id = params[:user_activity_id]
end @is_in_course = params[:is_in_course] if params[:is_in_course]
@course_activity = params[:course_activity] if params[:course_Activity]
def alert_open_student_works end
if params[:user_activity_id]
@user_activity_id = params[:user_activity_id] def alert_open_student_works
else if params[:user_activity_id]
@user_activity_id = -1 @user_activity_id = params[:user_activity_id]
end else
@is_in_course = params[:is_in_course] if params[:is_in_course] @user_activity_id = -1
@course_activity = params[:course_activity] if params[:course_Activity] end
respond_to do |format| @is_in_course = params[:is_in_course] if params[:is_in_course]
format.js @course_activity = params[:course_activity] if params[:course_Activity]
end respond_to do |format|
end format.js
end
def programing_test end
test = {language:params[:language],src:Base64.encode64(params[:src]),input:[params[:input]],output:[params[:output]]}
@index = params[:index] def programing_test
uri = URI('http://192.168.80.21:8080/api/realtime.json') test = {language:params[:language],src:Base64.encode64(params[:src]),input:[params[:input]],output:[params[:output]]}
body = test.to_json @index = params[:index]
res = Net::HTTP.new(uri.host, uri.port).start do |client| uri = URI('http://192.168.80.21:8080/api/realtime.json')
request = Net::HTTP::Post.new(uri.path) body = test.to_json
request.body = body res = Net::HTTP.new(uri.host, uri.port).start do |client|
request["Content-Type"] = "application/json" request = Net::HTTP::Post.new(uri.path)
client.request(request) request.body = body
end request["Content-Type"] = "application/json"
result = JSON.parse(res.body) client.request(request)
@err_msg = result["compile_error_msg"] end
result["results"].each do |re| result = JSON.parse(res.body)
@result = re["status"] @err_msg = result["compile_error_msg"]
end result["results"].each do |re|
end @result = re["status"]
end
#启动匿评参数设置 end
def start_evaluation_set
if params[:user_activity_id] #启动匿评参数设置
@user_activity_id = params[:user_activity_id] def start_evaluation_set
else if params[:user_activity_id]
@user_activity_id = -1 @user_activity_id = params[:user_activity_id]
end else
@is_in_course = params[:is_in_course] @user_activity_id = -1
@course_activity = params[:course_activity].to_i end
end @is_in_course = params[:is_in_course]
@course_activity = params[:course_activity].to_i
#设置匿评参数 end
def set_evaluation_attr
if @homework_detail_manual #设置匿评参数
unless params[:evaluation_start].to_s == @homework_detail_manual.evaluation_start.to_s def set_evaluation_attr
@homework_detail_manual.evaluation_start = params[:evaluation_start] if @homework_detail_manual
end unless params[:evaluation_start].to_s == @homework_detail_manual.evaluation_start.to_s
@homework_detail_manual.evaluation_start = params[:evaluation_start]
unless @homework_detail_manual.evaluation_end.to_s == params[:evaluation_end].to_s end
@homework_detail_manual.evaluation_end = params[:evaluation_end]
end unless @homework_detail_manual.evaluation_end.to_s == params[:evaluation_end].to_s
@homework_detail_manual.evaluation_end = params[:evaluation_end]
@homework_detail_manual.evaluation_num = params[:evaluation_num] end
@homework_detail_manual.save
@user_activity_id = params[:user_activity_id].to_i @homework_detail_manual.evaluation_num = params[:evaluation_num]
@is_in_course = params[:is_in_course].to_i @homework_detail_manual.save
@course_activity = params[:course_activity].to_i @user_activity_id = params[:user_activity_id].to_i
end @is_in_course = params[:is_in_course].to_i
end @course_activity = params[:course_activity].to_i
end
#评分设置 end
def score_rule_set
if params[:user_activity_id] #评分设置
@user_activity_id = params[:user_activity_id] def score_rule_set
else if params[:user_activity_id]
@user_activity_id = -1 @user_activity_id = params[:user_activity_id]
end else
@is_in_course = params[:is_in_course] @user_activity_id = -1
@course_activity = params[:course_activity].to_i end
end @is_in_course = params[:is_in_course]
@course_activity = params[:course_activity].to_i
private end
#获取课程
def find_course private
@course = Course.find params[:course] #获取课程
rescue def find_course
render_404 @course = Course.find params[:course]
end rescue
#获取作业 render_404
def find_homework end
@homework = HomeworkCommon.find params[:id] #获取作业
@homework_detail_manual = @homework.homework_detail_manual def find_homework
@homework_detail_programing = @homework.homework_detail_programing @homework = HomeworkCommon.find params[:id]
@homework_detail_group = @homework.homework_detail_group @homework_detail_manual = @homework.homework_detail_manual
@course = @homework.course @homework_detail_programing = @homework.homework_detail_programing
rescue @homework_detail_group = @homework.homework_detail_group
render_404 @course = @homework.course
end rescue
#是不是课程的老师 render_404
def teacher_of_course end
render_403 unless User.current.allowed_to?(:as_teacher,@course) || User.current.admin? #是不是课程的老师
end def teacher_of_course
render_403 unless User.current.allowed_to?(:as_teacher,@course) || User.current.admin?
#当前用户是不是课程的成员 end
def member_of_course
render_403 unless @course.is_public==1 || User.current.member_of_course?(@course) || User.current.admin? #当前用户是不是课程的成员
end def member_of_course
render_403 unless @course.is_public==1 || User.current.member_of_course?(@course) || User.current.admin?
def get_assigned_homeworks(student_works, n, index) end
student_works += student_works
student_works[index + 1 .. index + n] def get_assigned_homeworks(student_works, n, index)
end student_works += student_works
end student_works[index + 1 .. index + n]
end
end

View File

@ -388,12 +388,12 @@ class UsersController < ApplicationController
@homeworks = HomeworkCommon.where("user_id = #{@user.id} and publish_time <= '#{Date.today}'").order("#{@order} #{@b_sort}") @homeworks = HomeworkCommon.where("user_id = #{@user.id} and publish_time <= '#{Date.today}'").order("#{@order} #{@b_sort}")
end end
@type = params[:type] @type = params[:type]
@limit = 15 @limit = 25
@is_remote = true @is_remote = true
@hw_count = @homeworks.count @hw_count = @homeworks.count
@hw_pages = Paginator.new @hw_count, @limit, params['page'] || 1 @hw_pages = Paginator.new @hw_count, @limit, params['page'] || 1
@offset ||= @hw_pages.offset @offset ||= @hw_pages.offset
@homeworks = paginateHelper @homeworks,15 @homeworks = paginateHelper @homeworks,25
respond_to do |format| respond_to do |format|
format.js format.js
format.html {render :layout => 'static_base'} format.html {render :layout => 'static_base'}
@ -547,13 +547,13 @@ class UsersController < ApplicationController
end end
@type = params[:type] @type = params[:type]
@property = params[:property] @property = params[:property]
@limit = 15 @is_import = params[:is_import]
@limit = params[:is_import].to_i == 1 ? 15 : 25
@is_remote = true @is_remote = true
@hw_count = @homeworks.count @hw_count = @homeworks.count
@hw_pages = Paginator.new @hw_count, @limit, params['page'] || 1 @hw_pages = Paginator.new @hw_count, @limit, params['page'] || 1
@offset ||= @hw_pages.offset @offset ||= @hw_pages.offset
@homeworks = paginateHelper @homeworks,15 @homeworks = paginateHelper @homeworks,@limit
@is_import = params[:is_import]
respond_to do |format| respond_to do |format|
format.js format.js
end end
@ -573,6 +573,7 @@ class UsersController < ApplicationController
@r_sort = @b_sort == "desc" ? "asc" : "desc" @r_sort = @b_sort == "desc" ? "asc" : "desc"
@user = User.current @user = User.current
search = params[:name].to_s.strip.downcase search = params[:name].to_s.strip.downcase
type_ids = params[:property] ? "(" + params[:property] + ")" : "(1, 2, 3)"
if(params[:type].blank? || params[:type] == "1") #全部 if(params[:type].blank? || params[:type] == "1") #全部
visible_course = Course.where("is_public = 1 && is_delete = 0") visible_course = Course.where("is_public = 1 && is_delete = 0")
visible_course_ids = visible_course.empty? ? "(-1)" : "(" + visible_course.map{|course| course.id}.join(",") + ")" visible_course_ids = visible_course.empty? ? "(-1)" : "(" + visible_course.map{|course| course.id}.join(",") + ")"
@ -580,24 +581,40 @@ class UsersController < ApplicationController
all_user_ids = all_homeworks.map{|hw| hw.user_id} all_user_ids = all_homeworks.map{|hw| hw.user_id}
user_str_ids = search_user_by_name all_user_ids, search user_str_ids = search_user_by_name all_user_ids, search
user_ids = user_str_ids.empty? ? "(-1)" : "(" + user_str_ids.join(",") + ")" user_ids = user_str_ids.empty? ? "(-1)" : "(" + user_str_ids.join(",") + ")"
@homeworks = HomeworkCommon.where("course_id in #{visible_course_ids} and publish_time <= '#{Date.today}' and (name like '%#{search}%' or user_id in #{user_ids})").order("#{@order} #{@b_sort}") if @order == "course_name"
sql = "SELECT homework_commons.* FROM homework_commons INNER JOIN courses ON homework_commons.course_id = courses.id where homework_type in #{type_ids} and course_id in #{visible_course_ids} and publish_time <= '#{Date.today}' and (homework_commons.name like '%#{search}%' or homework_commons.user_id in #{user_ids}) order by CONVERT (courses.name USING gbk) COLLATE gbk_chinese_ci #{@b_sort}"
@homeworks = HomeworkCommon.find_by_sql(sql)
elsif @order == "user_name"
@homeworks = HomeworkCommon.where("course_id in #{visible_course_ids} and publish_time <= '#{Date.today}' and homework_type in #{type_ids} and (name like '%#{search}%' or user_id in #{user_ids})").joins(:user).order("CONVERT (lastname USING gbk) COLLATE gbk_chinese_ci #{@b_sort}, CONVERT (firstname USING gbk) COLLATE gbk_chinese_ci #{@b_sort},login #{@b_sort}")
else
@homeworks = HomeworkCommon.where("course_id in #{visible_course_ids} and publish_time <= '#{Date.today}' and homework_type in #{type_ids} and (name like '%#{search}%' or user_id in #{user_ids})").order("#{@order} #{@b_sort}")
end
elsif params[:type] == "2" #课程资源 elsif params[:type] == "2" #课程资源
@homeworks = HomeworkCommon.where("user_id = #{@user.id} and publish_time <= '#{Date.today}' and (name like '%#{search}%')").order("#{@order} #{@b_sort}") if @order == "course_name"
sql = "SELECT homework_commons.* FROM homework_commons INNER JOIN courses ON homework_commons.course_id = courses.id where homework_commons.user_id = #{@user.id} and homework_type in #{type_ids} and publish_time <= '#{Date.today}' and (homework_commons.name like '%#{search}%') order by CONVERT (courses.name USING gbk) COLLATE gbk_chinese_ci #{@b_sort}"
@homeworks = HomeworkCommon.find_by_sql(sql)
elsif @order == "user_name"
@homeworks = HomeworkCommon.where("user_id = #{@user.id} and publish_time <= '#{Date.today}' and (name like '%#{search}%') and homework_type in #{type_ids}").joins(:user).order("CONVERT (lastname USING gbk) COLLATE gbk_chinese_ci #{@b_sort}, CONVERT (firstname USING gbk) COLLATE gbk_chinese_ci #{@b_sort},login #{@b_sort}")
else
@homeworks = HomeworkCommon.where("user_id = #{@user.id} and publish_time <= '#{Date.today}' and (name like '%#{search}%') and homework_type in #{type_ids}").order("#{@order} #{@b_sort}")
end
end end
=begin
if params[:property] && params[:property] == "1" if params[:property] && params[:property] == "1"
@homeworks = @homeworks.where("homework_type = 1").reorder("#{@order} #{@b_sort}") @homeworks = @homeworks.where("homework_type = 1")
elsif params[:property] && params[:property] == "2" elsif params[:property] && params[:property] == "2"
@homeworks = @homeworks.where("homework_type = 2").reorder("#{@order} #{@b_sort}") @homeworks = @homeworks.where("homework_type = 2")
elsif params[:property] && params[:property] == "3" elsif params[:property] && params[:property] == "3"
@homeworks = @homeworks.where("homework_type = 3").reorder("#{@order} #{@b_sort}") @homeworks = @homeworks.where("homework_type = 3")
end end
=end
@type = params[:type] @type = params[:type]
@limit = 15 @limit = params[:is_import].to_i == 1 ? 15 : 25
@is_remote = true @is_remote = true
@hw_count = @homeworks.count @hw_count = @homeworks.count
@hw_pages = Paginator.new @hw_count, @limit, params['page'] || 1 @hw_pages = Paginator.new @hw_count, @limit, params['page'] || 1
@offset ||= @hw_pages.offset @offset ||= @hw_pages.offset
@homeworks = paginateHelper @homeworks,15 @homeworks = paginateHelper @homeworks,@limit
@is_import = params[:is_import] @is_import = params[:is_import]
@property = params[:property] @property = params[:property]
@search = search @search = search

View File

@ -1044,9 +1044,9 @@ module ApplicationHelper
elsif @organization elsif @organization
title << @organization.name title << @organization.name
elsif @user elsif @user
title << @user.login title << @user.try(:realname)
else else
title << User.current.login title << User.current.try(:realname)
end end
if first_page.nil? || first_page.web_title.nil? if first_page.nil? || first_page.web_title.nil?
title << Setting.app_title unless Setting.app_title == title.last title << Setting.app_title unless Setting.app_title == title.last
@ -2945,20 +2945,16 @@ end
def user_url_in_org(user_id) def user_url_in_org(user_id)
if Rails.env.development? if Rails.env.development?
return "http://localhost:3000/users/" + user_id.to_s return "http://localhost:3000/users/" + user_id.to_s
elsif Rails.env.test?
return "https://www.test.forge.trustie.net/users/" + user_id.to_s
else else
return "https://www.trustie.net/users/" + user_id.to_s return "https://" + Setting.host_name + "/users/" + user_id.to_s
end end
end end
def logout_url_without_domain def logout_url_without_domain
if Rails.env.development? if Rails.env.development?
return "http://localhost:3000/logout" return "http://localhost:3000/logout"
elsif Rails.env.test?
return "https://test.forge.trustie.net/logout"
else else
return "https://www.trustie.net/logout" return "https://" + Setting.host_name + "/logout"
end end
end end

View File

@ -71,7 +71,8 @@ class CourseActivity < ActiveRecord::Base
name = lead_message.subject name = lead_message.subject
content = lead_message.content content = lead_message.content
# message的status状态为0为正常为1表示创建课程时发送的message # message的status状态为0为正常为1表示创建课程时发送的message
message = Message.create(:subject => name, :content => content, :board_id => self.course.boards.first.id, :author_id => self.course.tea_id , :sticky => true, :status => true ) # author_id 默认为课程使者创建
message = Message.create(:subject => name, :content => content, :board_id => self.course.boards.first.id, :author_id => 1 , :sticky => true, :status => true )
# 更新的目的是为了排序,因为该条动态的时间可能与课程创建的动态创建时间一直 # 更新的目的是为了排序,因为该条动态的时间可能与课程创建的动态创建时间一直
message.course_acts.first.update_attribute(:updated_at, message.course_acts.first.updated_at + 1) if message.course_acts.first message.course_acts.first.update_attribute(:updated_at, message.course_acts.first.updated_at + 1) if message.course_acts.first
end end

View File

@ -1,6 +1,5 @@
<% if User.current.logged? && User.current.id == @user.id %>
<%= form_for @article, :url =>{:controller=>'blog_comments',:action => 'update',:user_id=>@user.id , :blog_id => @article.id, :is_homepage => params[:is_homepage],:in_act => params[:in_act]},:method=>'PUT', <%= form_for @article, :url =>{:controller=>'blog_comments',:action => 'update',:user_id=>@user.id , :blog_id => @article.id, :is_homepage => params[:is_homepage],:in_act => params[:in_act]},:method=>'PUT',
:html => {:nhname=>'form',:multipart => true, :id => 'message-form'} do |f| %> :html => {:nhname=>'form',:multipart => true, :id => 'message-form'} do |f| %>
<%= render :partial => 'blog_comments/edit', :locals => {:f => f, :article => @article, :edit_mode => true, :user => @user} %> <%= render :partial => 'blog_comments/edit', :locals => {:f => f, :article => @article, :edit_mode => true, :user => @user} %>
<% end %> <% end %>
<% end %>

View File

@ -38,7 +38,7 @@
<%= link_to image_tag(url_to_avatar(@article.author),:width=>50,:height => 50,:alt=>'图像' ),user_path(@article.author) %> <%= link_to image_tag(url_to_avatar(@article.author),:width=>50,:height => 50,:alt=>'图像' ),user_path(@article.author) %>
</div> </div>
<div class="postThemeWrap"> <div class="postThemeWrap">
<% if @article.author.id == User.current.id%> <% if @article.author.id == User.current.id || User.current.admin? %>
<div class="homepagePostSetting" id="message_setting_<%= @article.id%>" style="display: none"> <div class="homepagePostSetting" id="message_setting_<%= @article.id%>" style="display: none">
<ul> <ul>
<li class="homepagePostSettingIcon"> <li class="homepagePostSettingIcon">
@ -48,7 +48,7 @@
l(:button_edit), l(:button_edit),
{:action => 'edit', :id => @article.id,:in_act => params[:in_act]}, {:action => 'edit', :id => @article.id,:in_act => params[:in_act]},
:class => 'postOptionLink' :class => 'postOptionLink'
) if User.current && User.current.id == @article.author.id %> ) if User.current.admin? || User.current.id == @article.author.id %>
</li> </li>
<li> <li>
<%= link_to( <%= link_to(
@ -57,7 +57,7 @@
:method => :delete, :method => :delete,
:data => {:confirm => l(:text_are_you_sure)}, :data => {:confirm => l(:text_are_you_sure)},
:class => 'postOptionLink' :class => 'postOptionLink'
) if User.current && User.current.id == @article.author.id %> ) if User.current.admin? || User.current.id == @article.author.id %>
</li> </li>
<li> <li>
<% if @article.id == @article.blog.homepage_id %> <% if @article.id == @article.blog.homepage_id %>

View File

@ -4,7 +4,7 @@
<%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id,:host=>Setting.host_user), :alt => "用户头像" %> <%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id,:host=>Setting.host_user), :alt => "用户头像" %>
</div> </div>
<div class="homepagePostDes"> <div class="homepagePostDes">
<% if activity.author.id == User.current.id%> <% if activity.author.id == User.current.id || User.current.admin? %>
<div class="homepagePostSetting" id="message_setting_<%= activity.id%>" style="display: none"> <div class="homepagePostSetting" id="message_setting_<%= activity.id%>" style="display: none">
<ul> <ul>
<li class="homepagePostSettingIcon"> <li class="homepagePostSettingIcon">
@ -14,7 +14,7 @@
l(:button_edit), l(:button_edit),
{:controller => 'blog_comments',:action => 'edit',:user_id=>activity.author_id,:blog_id=>activity.blog_id, :id => activity.id}, {:controller => 'blog_comments',:action => 'edit',:user_id=>activity.author_id,:blog_id=>activity.blog_id, :id => activity.id},
:class => 'postOptionLink' :class => 'postOptionLink'
) if User.current && User.current.id == activity.author.id %> ) if User.current.admin? || User.current.id == activity.author.id %>
</li> </li>
<li> <li>
<%= link_to( <%= link_to(
@ -23,7 +23,7 @@
:method => :delete, :method => :delete,
:data => {:confirm => l(:text_are_you_sure)}, :data => {:confirm => l(:text_are_you_sure)},
:class => 'postOptionLink' :class => 'postOptionLink'
) if User.current && User.current.id == activity.author.id %> ) if User.current.admin? || User.current.id == activity.author.id %>
</li> </li>
<li> <li>
<% if activity.id == activity.blog.homepage_id %> <% if activity.id == activity.blog.homepage_id %>

View File

@ -43,6 +43,8 @@
<%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>user_activity_id, :content=>activity.content} %> <%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>user_activity_id, :content=>activity.content} %>
<div class="cl"></div> <div class="cl"></div>
<div id="intro_content_show_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
<div id="intro_content_hide_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>

View File

@ -1,7 +1,123 @@
<%= content_for(:header_tags) do %> <%= content_for(:header_tags) do %>
<%= import_ke(enable_at: true, prettify: false) %> <%= import_ke(enable_at: true, prettify: false, init_activity: false) %>
<% end %> <% end %>
<script type="text/javascript">
function nh_check_field(params){
var result=true;
if(!regexTopicSubject()) {
result=false;
return result;
}
if(params.content!=undefined){
if(params.content.isEmpty()){
result=false;
}
if(params.content.html()!=params.textarea.html() || params.issubmit==true){
params.textarea.html(params.content.html());
params.content.sync();
if(params.content.isEmpty())
{
params.contentmsg.text("描述不能为空");
params.contentmsg.css('color','#ff0000');
}
else if(params.content.html().length >=20000){
params.contentmsg.text("描述最多20000个汉字(或40000个英文字符)");
params.contentmsg.css('color','#ff0000');
result=false;
}
else
{
params.contentmsg.text("填写正确");
params.contentmsg.css('color','#008000');
}
}
}
return result;
}
function init_homework_form(params){
params.form.submit(function(){
params.textarea.html(params.editor.html());
params.editor.sync();
var flag = false;
if(params.form.attr('data-remote') != undefined ){
flag = true
}
var is_checked = false;
is_checked = nh_check_field({
issubmit:true,
content:params.editor,
contentmsg:params.contentmsg,
textarea:params.textarea
});
if(is_checked){
if(flag){
return true;
}else{
$(this)[0].submit();
return false;
}
}
return false;
});
}
function init_homework_editor(params){
params.textarea.removeAttr('placeholder');
var editor = params.kindutil.create(params.textarea, {
resizeType : 1,minWidth:"1px",width:"100%",minHeight:"30px",height:"30px",
items : ['code','emoticons','fontname',
'forecolor', 'hilitecolor', 'bold', '|', 'justifyleft', 'justifycenter', 'insertorderedlist','insertunorderedlist', '|',
'formatblock', 'fontsize', '|','indent', 'outdent',
'|','imagedirectupload','table', 'media', 'preview',"more"
],
afterChange:function(){//按键事件
var edit = this.edit;
var body = edit.doc.body;
//paramsHeight = params.kindutil.removeUnit(this.height);
edit.iframe.height(150);
this.resize(null, Math.max((params.kindutil.IE ? body.scrollHeight : body.offsetHeight) + 33, 150));
},
afterCreate:function(){
//init
var edit = this.edit;
var body = edit.doc.body;
edit.iframe[0].scroll = 'no';
body.style.overflowY = 'hidden';
//reset height
var edit = this.edit;
var body = edit.doc.body;
edit.html(params.textarea.innerHTML);
//paramsHeight = params.kindutil.removeUnit(this.height);
edit.iframe.height(150);
this.resize(null, Math.max((params.kindutil.IE ? body.scrollHeight : body.offsetHeight) , 150));
elocalStorage(message_content_editor,'topic_course_<%=course.id %>');
}
}).loadPlugin('paste');
return editor;
}
KindEditor.ready(function(K){
$("div[nhname='topic_form']").each(function(){
var params = {};
params.kindutil = K;
params.div_form = $(this);
params.form = $("form",params.div_form);
if(params.form==undefined || params.form.length==0){
return;
}
params.textarea = $("textarea[nhname='topic_textarea']",params.div_form);
params.contentmsg = $("#message_content_span");
params.submit_btn = $("#new_message_submit_btn");
if(params.textarea.data('init') == undefined) {
params.editor = init_homework_editor(params);
message_content_editor = params.editor;
init_homework_form(params);
params.submit_btn.click(function () {
params.form.submit();
});
params.textarea.data('init', 1);
}
});
});
</script>
<%= error_messages_for 'message' %> <%= error_messages_for 'message' %>
<div class="resources mt10"> <div class="resources mt10">
<div id="new_course_topic"> <div id="new_course_topic">
@ -25,7 +141,7 @@
<%= text_area :quote,:quote,:style => 'display:none' %> <%= text_area :quote,:quote,:style => 'display:none' %>
<%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %> <%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %>
<%= f.kindeditor :content, :editor_id => 'message_content_editor', <%#= f.kindeditor :content, :editor_id => 'message_content_editor',
:owner_id => topic.nil? ? 0: topic.id, :owner_id => topic.nil? ? 0: topic.id,
:owner_type => OwnerTypeHelper::MESSAGE, :owner_type => OwnerTypeHelper::MESSAGE,
:width => '100%', :width => '100%',
@ -37,8 +153,11 @@
:maxlength => 5000 }, :maxlength => 5000 },
at_id: topic.id, at_type: topic.class.to_s at_id: topic.id, at_type: topic.class.to_s
%> %>
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='topic_textarea' name="message[content]"><%=topic.content %></textarea>
<div class="cl"></div> <div class="cl"></div>
<p id="message_content_span"></p> <p id="message_content_span"></p>
<p id="e_tip" class="c_grey"></p>
<p id="e_tips" class="c_grey"></p>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<div class="mt10"> <div class="mt10">
@ -49,11 +168,11 @@
<div class="cl"></div> <div class="cl"></div>
<div class="mt5"> <div class="mt5">
<%if !edit_mode %> <%if !edit_mode %>
<a href="javascript:void(0);" class="BlueCirBtnMini fr" onclick="submit_topic();">确定</a> <a href="javascript:void(0);" class="BlueCirBtnMini fr" id="new_message_submit_btn">确定</a>
<span class="fr mr10 mt3">或</span> <span class="fr mr10 mt3">或</span>
<a href="javascript:void(0);" class="fr mr10 mt3" onclick="reset_topic();">取消</a> <a href="javascript:void(0);" class="fr mr10 mt3" onclick="reset_topic();">取消</a>
<% else %> <% else %>
<a href="javascript:void(0);" class="BlueCirBtnMini fr" onclick="submit_topic();">确定</a> <a href="javascript:void(0);" class="BlueCirBtnMini fr" id="new_message_submit_btn" onclick="submit_topic();">确定</a>
<span class="fr mr10 mt3">或</span> <span class="fr mr10 mt3">或</span>
<%= link_to "取消",board_message_url(topic.board, topic.root, :r => (topic.parent_id && topic.id)), :class => "fr mr10 mt3"%> <%= link_to "取消",board_message_url(topic.board, topic.root, :r => (topic.parent_id && topic.id)), :class => "fr mr10 mt3"%>
<% end %> <% end %>

View File

@ -25,11 +25,13 @@
课程问答区 课程问答区
</div> </div>
</div> </div>
<div nhname="topic_form">
<% if User.current.logged? %> <% if User.current.logged? %>
<%= labelled_form_for @message, :url =>{:controller=>'messages',:action => 'new', :board_id => @board.id, :is_board => 'true'}, <%= labelled_form_for @message, :url =>{:controller=>'messages',:action => 'new', :board_id => @board.id, :is_board => 'true'},
:html => {:nhname=>'form',:multipart => true, :id => 'message-form'} do |f| %> :html => {:nhname=>'form',:multipart => true, :id => 'message-form'} do |f| %>
<%= render :partial => 'course_new', :locals => {:f => f, :topic => @message, :edit_mode => false, :course => @board.course} %> <%= render :partial => 'course_new', :locals => {:f => f, :topic => @message, :edit_mode => false, :course => @board.course} %>
<% end %> <% end %>
<% end %> <% end %>
</div>
<%= render :partial=> 'course_show_detail',:locals =>{:topics => @topics, :page => 0} %> <%= render :partial=> 'course_show_detail',:locals =>{:topics => @topics, :page => 0} %>
</div> </div>

View File

@ -11,7 +11,7 @@
<div class="homepagePostTitle break_word mt-4"> <div class="homepagePostTitle break_word mt-4">
<%# 如果有历史版本则提供历史版本下载 %> <%# 如果有历史版本则提供历史版本下载 %>
<% if file.attachment_histories.count == 0 %> <% if file.attachment_histories.count == 0 %>
<%= link_to truncate(file.filename,length: 35, omission: '...'), <%= link_to file.is_public? ? truncate(file.filename, length: 45) : truncate(file.filename,length: 35, omission: '...'),
download_named_attachment_path(file.id, file.filename), download_named_attachment_path(file.id, file.filename),
:title => file.filename+"\n"+file.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;",:class => "linkGrey3 f_14" %> :title => file.filename+"\n"+file.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;",:class => "linkGrey3 f_14" %>
<% else %> <% else %>

View File

@ -34,11 +34,7 @@
<div class="postRightContainer ml10" onmouseover="$('#message_setting_<%= @topic.id%>').show();" onmouseout="$('#message_setting_<%= @topic.id%>').hide();"> <div class="postRightContainer ml10" onmouseover="$('#message_setting_<%= @topic.id%>').show();" onmouseout="$('#message_setting_<%= @topic.id%>').hide();">
<div class="postThemeContainer"> <div class="postThemeContainer">
<div class="postDetailPortrait"> <div class="postDetailPortrait">
<% if @topic.status == 1 %> <%= link_to image_tag(url_to_avatar(@topic.author), :width => 50, :height => 50,:alt=>'图像' ), user_path(@topic.author) %>
<%= image_tag("/images/trustie_logo1.png", width: "50px", height: "50px") %>
<% else %>
<%= link_to image_tag(url_to_avatar(@topic.author), :width => 50, :height => 50,:alt=>'图像' ), user_path(@topic.author) %>
<% end %>
</div> </div>
<div class="postThemeWrap"> <div class="postThemeWrap">
<% if User.current.logged? %> <% if User.current.logged? %>
@ -74,16 +70,11 @@
<a href="javascript:void(0);" class="f14 linkGrey4 fb" style="overflow:hidden;">主题: <%= @topic.subject%></a> <a href="javascript:void(0);" class="f14 linkGrey4 fb" style="overflow:hidden;">主题: <%= @topic.subject%></a>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<div class="postDetailCreater"> <div class="postDetailCreater">
<% if @topic.status == 1 %> <% if @topic.try(:author).try(:realname) == ' ' %>
<span class="fontBlue2">确实团队</span> <%= link_to @topic.try(:author), user_path(@topic.author,:host=>Setting.host_user), :class => "linkBlue2", :target=> "_blank" %>
<% else %> <% else %>
<% if @topic.try(:author).try(:realname) == ' ' %> <%= link_to @topic.try(:author).try(:realname), user_path(@topic.author,:host=>Setting.host_user), :class => "linkBlue2", :target=> "_blank" %>
<%= link_to @topic.try(:author), user_path(@topic.author,:host=>Setting.host_user), :class => "linkBlue2", :target=> "_blank" %>
<% else %>
<%= link_to @topic.try(:author).try(:realname), user_path(@topic.author,:host=>Setting.host_user), :class => "linkBlue2", :target=> "_blank" %>
<% end %>
<% end %> <% end %>
</div> </div>
<div class="postDetailDate mb5"><%= format_time( @topic.created_on)%></div> <div class="postDetailDate mb5"><%= format_time( @topic.created_on)%></div>

View File

@ -12,6 +12,7 @@
<% end %> <% end %>
<% elsif @message.course %> <% elsif @message.course %>
<div nhname="topic_form">
<%= form_for @message, { <%= form_for @message, {
:as => :message, :as => :message,
:url => {:action => 'edit',:is_course=>@is_course,:is_board=>@is_board}, :url => {:action => 'edit',:is_course=>@is_course,:is_board=>@is_board},
@ -22,7 +23,7 @@
<%= render :partial => 'boards/course_message_edit', <%= render :partial => 'boards/course_message_edit',
:locals => {:f => f, :edit_mode => true, :topic => @message, :course => @message.course} %> :locals => {:f => f, :edit_mode => true, :topic => @message, :course => @message.course} %>
<% end %> <% end %>
</div>
<% elsif @message.board.org_subfield %> <% elsif @message.board.org_subfield %>
<%= form_for @message, { <%= form_for @message, {
:as => :message, :as => :message,

View File

@ -50,6 +50,8 @@
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<p id="homework_course_id_span" class="c_red mt5"></p> <p id="homework_course_id_span" class="c_red mt5"></p>
<p id="e_tip" class="c_grey"></p>
<p id="e_tips" class="c_grey"></p>
<div class="cl"></div> <div class="cl"></div>
<div class="mt10"> <div class="mt10">
<div class="fl" id="topic_attachments"> <div class="fl" id="topic_attachments">

View File

@ -39,6 +39,8 @@
<div class="cl"></div> <div class="cl"></div>
<p id="homework_course_id_span" class="c_red mt5"></p> <p id="homework_course_id_span" class="c_red mt5"></p>
<p id="e_tip" class="c_grey"></p>
<p id="e_tips" class="c_grey"></p>
<div class="cl"></div> <div class="cl"></div>
<div class="mt10"> <div class="mt10">

View File

@ -46,6 +46,8 @@
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<p id="homework_course_id_span" class="c_red mt5"></p> <p id="homework_course_id_span" class="c_red mt5"></p>
<p id="e_tip" class="c_grey"></p>
<p id="e_tips" class="c_grey"></p>
<div class="cl"></div> <div class="cl"></div>
<div class="mt10"> <div class="mt10">
<div class="fl" id="topic_attachments"> <div class="fl" id="topic_attachments">

View File

@ -25,7 +25,7 @@
<li > <li >
<span class="tit_fb ">编程代码:</span> <span class="tit_fb ">编程代码:</span>
<div class="showHworkP break_word"><pre id="work-src" style="display: none;"><%= work.description if work.description%></pre><div class="fontGrey2 font_cus" id="work-code_<%= work.id%>"> <div class="showHworkP break_word"><pre id="work-src_<%= work.id%>" style="display: none;"><%= work.description if work.description%></pre><div class="fontGrey2 font_cus" id="work-code_<%= work.id%>">
</div> </div>
</div> </div>
<div class="cl"></div> <div class="cl"></div>

View File

@ -59,8 +59,8 @@
<li > <li >
<span class="tit_fb ">内容:</span> <span class="tit_fb ">内容:</span>
<div class="showHworkP break_word"> <div class="showHworkP break_word upload_img" id="student_work_img_<%=work.id %>">
<%= text_format(work.description) if work.description%> <%= work.description.html_safe if work.description%>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</li> </li>
@ -105,6 +105,9 @@
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
$(function(){
showNormalImage('student_work_img_<%=work.id %>');
});
function show_upload(){ function show_upload(){
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'student_work/upload_attachment' ,:locals => {:work=>work})%>'); $("#ajax-modal").html('<%= escape_javascript( render :partial => 'student_work/upload_attachment' ,:locals => {:work=>work})%>');
showModal('ajax-modal', '452px'); showModal('ajax-modal', '452px');

View File

@ -71,7 +71,7 @@
indentUnit: 2, indentUnit: 2,
matchBrackets: true, matchBrackets: true,
readOnly: true, readOnly: true,
value: $("#work-src").text() value: $("#work-src_<%= work.id%>").text()
}); });
<% elsif @homework.homework_type == 1 %> <% elsif @homework.homework_type == 1 %>
$("#about_hwork_<%= work.id%>").html("<%= escape_javascript(render :partial => 'show',:locals => {:work => work, :score =>student_work_score(work,User.current),:student_work_scores => work.student_works_scores.order("updated_at desc")}) %>"); $("#about_hwork_<%= work.id%>").html("<%= escape_javascript(render :partial => 'show',:locals => {:work => work, :score =>student_work_score(work,User.current),:student_work_scores => work.student_works_scores.order("updated_at desc")}) %>");

View File

@ -4,9 +4,11 @@
<p class="f14 mt5"> <p class="f14 mt5">
<span class="fb">作品名称:</span><%=@student_work.name%> <span class="fb">作品名称:</span><%=@student_work.name%>
</p> </p>
<p class="f14 mt5"> <div class="f14 mt5" style="max-width: 425px; color:#808181">
<span class="fb">作品描述:</span><%=@student_work.description%> <div class="fb fl dis">作品描述:</div>
</p> <div class="upload_img fl" style="max-width: 350px;"><%=@student_work.description.html_safe %></div>
<div class="cl"></div>
</div>
<p class="mt5"> <p class="mt5">
<span class="fl fb mr30">附</span><span class="fb fl">件:</span> <span class="fl fb mr30">附</span><span class="fb fl">件:</span>
<% if @student_work.attachments.empty? %> <% if @student_work.attachments.empty? %>

View File

@ -4,9 +4,11 @@
<p class="f14 mt5"> <p class="f14 mt5">
<span class="fb">作品名称:</span><%=@student_work.name%> <span class="fb">作品名称:</span><%=@student_work.name%>
</p> </p>
<p class="f14 mt5"> <div class="f14 mt5" style="max-width: 425px; color:#808181">
<span class="fb">作品描述:</span><%=@student_work.description%> <div class="fb fl dis">作品描述:</div>
</p> <div class="upload_img fl" style="max-width: 350px;"><%=@student_work.description.html_safe %></div>
<div class="cl"></div>
</div>
<p class="mt5"> <p class="mt5">
<span class="fl fb mr30">附</span><span class="fb fl">件:</span> <span class="fl fb mr30">附</span><span class="fb fl">件:</span>
<% if @student_work.attachments.empty? %> <% if @student_work.attachments.empty? %>

View File

@ -1,3 +1,7 @@
<% content_for :header_tags do %>
<%= import_ke(enable_at: true, prettify: false, init_activity: false) %>
<%= javascript_include_tag 'homework','baiduTemplate' %>
<% end %>
<div class="homepageRightBanner mb10"> <div class="homepageRightBanner mb10">
<div class="NewsBannerName">编辑作品</div> <div class="NewsBannerName">编辑作品</div>
</div> </div>
@ -25,7 +29,7 @@
</div><!----HomeWorkBox end--> </div><!----HomeWorkBox end-->
<div class="cl"></div> <div class="cl"></div>
<div class="HomeWorkCon mt15"> <div class="HomeWorkCon mt15" nhname='student_work_form'>
<%= labelled_form_for @work,:html => { :multipart => true },:remote=>true do |f|%> <%= labelled_form_for @work,:html => { :multipart => true },:remote=>true do |f|%>
<div class=" c_red mb10"> <div class=" c_red mb10">
提示:作品名称和描述中不要出现真实的姓名信息 提示:作品名称和描述中不要出现真实的姓名信息
@ -46,13 +50,16 @@
<p id="student_work_name_span" class="c_red mb10"></p> <p id="student_work_name_span" class="c_red mb10"></p>
</div> </div>
<div class="mt10"> <div class="mt10">
<textarea name="student_work[description]" id="student_work_description" placeholder="请输入作品描述" class="InputBox W700 H150" maxlength="6000" onkeyup="regexStudentWorkDescription();"><%= @work.description%></textarea> <textarea placeholder="请输入作品描述" style="display: none" nhname='student_work_textarea' name="student_work[description]"><%= @work.description%></textarea>
<script> <!--<textarea name="student_work[description]" id="student_work_description" placeholder="请输入作品描述" class="InputBox W700 H150" maxlength="6000" onkeyup="regexStudentWorkDescription();"><%#= @work.description%></textarea>-->
<!--<script>
var text = document.getElementById("student_work_description"); var text = document.getElementById("student_work_description");
autoTextarea(text);// 调用 autoTextarea(text);// 调用
</script> </script>-->
<div class="cl"></div> <div class="cl"></div>
<p id="student_work_description_textarea" class="c_red mb10"></p> <p id="student_work_description_textarea" class="c_red mb10"></p>
<p id="e_tip" class="c_grey"></p>
<p id="e_tips" class="c_grey"></p>
</div> </div>
<div id="homework_attachments"> <div id="homework_attachments">
@ -66,7 +73,7 @@
<% end %> <% end %>
<div class="mt5"> <div class="mt5">
<a href="javascript:void(0);" class="BlueCirBtnMini fr" onclick="popupRegex();edit_student_work(<%= @work.id%>);">确定</a> <a href="javascript:void(0);" class="BlueCirBtnMini fr" id="new_message_submit_btn">确定</a>
<span class="fr mr10 mt3">或</span> <span class="fr mr10 mt3">或</span>
<%= link_to "取消", student_work_index_path(:homework => @homework), :class => "fr mr10 mt3"%> <%= link_to "取消", student_work_index_path(:homework => @homework), :class => "fr mr10 mt3"%>
</div> </div>
@ -96,23 +103,130 @@
} }
function popupRegex(){ function popupRegex(){
if(regexStudentWorkName()&&regexStudentWorkDescription()) if($("#group_member_ids").length > 0) {
{ if(regexStudentWorkMember(parseInt($.trim($("#min_num_member").html())),parseInt($.trim($("#max_num_member").html())))) {
if($("#group_member_ids").length > 0) {
if(regexStudentWorkMember(parseInt($.trim($("#min_num_member").html())),parseInt($.trim($("#max_num_member").html())))) {
$('#ajax-modal').html("<div><p align='center' style='margin-top: 35px'>作品信息完整性校验中,请稍等...</p></div>");
showModal('ajax-modal', '500px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9");
$('#ajax-modal').parent().addClass("anonymos");
}
} else {
$('#ajax-modal').html("<div><p align='center' style='margin-top: 35px'>作品信息完整性校验中,请稍等...</p></div>"); $('#ajax-modal').html("<div><p align='center' style='margin-top: 35px'>作品信息完整性校验中,请稍等...</p></div>");
showModal('ajax-modal', '500px'); showModal('ajax-modal', '500px');
$('#ajax-modal').siblings().remove(); $('#ajax-modal').siblings().remove();
$('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9"); $('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9");
$('#ajax-modal').parent().addClass("anonymos"); $('#ajax-modal').parent().addClass("anonymos");
} }
} else {
$('#ajax-modal').html("<div><p align='center' style='margin-top: 35px'>作品信息完整性校验中,请稍等...</p></div>");
showModal('ajax-modal', '500px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9");
$('#ajax-modal').parent().addClass("anonymos");
} }
} }
function nh_check_field(params){
var result=true;
if(!regexStudentWorkName()) {
result=false;
return result;
}
if(params.content!=undefined){
if(params.content.isEmpty()){
result=false;
}
if(params.content.html()!=params.textarea.html() || params.issubmit==true){
params.textarea.html(params.content.html());
params.content.sync();
if(params.content.isEmpty()){
params.contentmsg.html('作品描述不能为空');
}else{
params.contentmsg.html('');
}
}
}
return result;
}
function init_homework_form(params){
params.form.submit(function(){
params.textarea.html(params.editor.html());
params.editor.sync();
var flag = false;
if(params.form.attr('data-remote') != undefined ){
flag = true
}
var is_checked = nh_check_field({
issubmit:true,
content:params.editor,
contentmsg:params.contentmsg,
textarea:params.textarea
});
if(is_checked){
if(flag){
popupRegex();
return true;
}else{
$(this)[0].submit();
$("#ajax-indicator").hide();
return false;
}
}
return false;
});
}
function init_homework_editor(params){
params.textarea.removeAttr('placeholder');
var editor = params.kindutil.create(params.textarea, {
resizeType : 1,minWidth:"1px",width:"100%",minHeight:"30px",height:"30px",
items : ['code','emoticons','fontname',
'forecolor', 'hilitecolor', 'bold', '|', 'justifyleft', 'justifycenter', 'insertorderedlist','insertunorderedlist', '|',
'formatblock', 'fontsize', '|','indent', 'outdent',
'|','imagedirectupload','table', 'media', 'preview',"more"
],
afterChange:function(){//按键事件
var edit = this.edit;
var body = edit.doc.body;
//paramsHeight = params.kindutil.removeUnit(this.height);
edit.iframe.height(150);
this.resize(null, Math.max((params.kindutil.IE ? body.scrollHeight : body.offsetHeight) + 33, 150));
},
afterCreate:function(){
//init
var edit = this.edit;
var body = edit.doc.body;
edit.iframe[0].scroll = 'no';
body.style.overflowY = 'hidden';
//reset height
var edit = this.edit;
var body = edit.doc.body;
edit.html(params.textarea.innerHTML);
//paramsHeight = params.kindutil.removeUnit(this.height);
edit.iframe.height(150);
this.resize(null, Math.max((params.kindutil.IE ? body.scrollHeight : body.offsetHeight) , 150));
elocalStorage(editor2,'student_work_<%=@work.id %>');
}
}).loadPlugin('paste');
return editor;
}
KindEditor.ready(function(K){
$("div[nhname='student_work_form']").each(function(){
var params = {};
params.kindutil = K;
params.div_form = $(this);
params.form = $("form",params.div_form);
if(params.form==undefined || params.form.length==0){
return;
}
params.textarea = $("textarea[nhname='student_work_textarea']",params.div_form);
params.contentmsg = $("#student_work_description_textarea");
params.submit_btn = $("#new_message_submit_btn");
if(params.textarea.data('init') == undefined) {
params.editor = init_homework_editor(params);
editor2 = params.editor;
init_homework_form(params);
params.submit_btn.click(function () {
params.form.submit();
$("#ajax-indicator").hide();
});
params.textarea.data('init', 1);
}
});
});
</script> </script>

View File

@ -172,7 +172,7 @@
<div class="mt5"> <div class="mt5">
<% if @homework.homework_detail_manual && @homework.homework_detail_manual.comment_status < 2 %> <% if @homework.homework_detail_manual && @homework.homework_detail_manual.comment_status < 2 %>
<div class="fontGrey2 db fl">提交截止时间:<%= @homework.end_time %>&nbsp;23:59</div> <div class="fontGrey2 db fl">提交截止时间:<%= @homework.end_time %>&nbsp;23:59</div>
<% elsif @homework.homework_detail_manual && @homework.homework_detail_manual.comment_status >= 2 %> <% elsif @homework.homework_detail_manual && @homework.homework_detail_manual.comment_status >= 2 && @homework.anonymous_comment == 0 %>
<div class="fontGrey2 db fl">匿评截止时间:<%= @homework.homework_detail_manual.evaluation_end %>&nbsp;23:59</div> <div class="fontGrey2 db fl">匿评截止时间:<%= @homework.homework_detail_manual.evaluation_end %>&nbsp;23:59</div>
<% end %> <% end %>
<% if @homework.homework_detail_manual.comment_status == 0 %> <% if @homework.homework_detail_manual.comment_status == 0 %>

View File

@ -1,4 +1,9 @@
<!-- 此界面只用来新建匿评作业作品 --> <!-- 此界面只用来新建匿评作业作品 -->
<% content_for :header_tags do %>
<%= import_ke(enable_at: true, prettify: false, init_activity: false) %>
<%= javascript_include_tag 'homework','baiduTemplate' %>
<% end %>
<script type="text/javascript"> <script type="text/javascript">
<%if @homework.homework_detail_manual.comment_status != 1%> <%if @homework.homework_detail_manual.comment_status != 1%>
$(function(){ $(function(){
@ -57,26 +62,136 @@
} }
// 作品校验 // 作品校验
function popupRegex(){ function popupRegex(){
if(regexStudentWorkName()&&regexStudentWorkDescription()) if($("#group_member_ids").length > 0) {
{ if(regexStudentWorkMember(parseInt($.trim($("#min_num_member").html())),parseInt($.trim($("#max_num_member").html())))) {
if($("#group_member_ids").length > 0) {
if(regexStudentWorkMember(parseInt($.trim($("#min_num_member").html())),parseInt($.trim($("#max_num_member").html())))) {
$('#ajax-modal').html("<div><p align='center' style='margin-top: 35px'>作品信息完整性校验中,请稍等...</p></div>");
showModal('ajax-modal', '500px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9");
$('#ajax-modal').parent().addClass("anonymos");
}
} else {
$('#ajax-modal').html("<div><p align='center' style='margin-top: 35px'>作品信息完整性校验中,请稍等...</p></div>"); $('#ajax-modal').html("<div><p align='center' style='margin-top: 35px'>作品信息完整性校验中,请稍等...</p></div>");
showModal('ajax-modal', '500px'); showModal('ajax-modal', '500px');
$('#ajax-modal').siblings().remove(); $('#ajax-modal').siblings().remove();
$('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9"); $('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9");
$('#ajax-modal').parent().addClass("anonymos"); $('#ajax-modal').parent().addClass("anonymos");
} }
} else {
$('#ajax-modal').html("<div><p align='center' style='margin-top: 35px'>作品信息完整性校验中,请稍等...</p></div>");
showModal('ajax-modal', '500px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9");
$('#ajax-modal').parent().addClass("anonymos");
} }
} }
var KE = {
MDU: "1234455",//当前文章标识符
};
function nh_check_field(params){
var result=true;
if(!regexStudentWorkName()) {
result=false;
return result;
}
if(params.content!=undefined){
if(params.content.isEmpty()){
result=false;
}
if(params.content.html()!=params.textarea.html() || params.issubmit==true){
params.textarea.html(params.content.html());
params.content.sync();
if(params.content.isEmpty()){
params.contentmsg.html('作品描述不能为空');
}else{
params.contentmsg.html('');
}
}
}
return result;
}
function init_homework_form(params){
params.form.submit(function(){
params.textarea.html(params.editor.html());
params.editor.sync();
var flag = false;
if(params.form.attr('data-remote') != undefined ){
flag = true
}
var is_checked = nh_check_field({
issubmit:true,
content:params.editor,
contentmsg:params.contentmsg,
textarea:params.textarea
});
if(is_checked){
if(flag){
popupRegex();
return true;
}else{
$(this)[0].submit();
$("#ajax-indicator").hide();
return false;
}
}
return false;
});
}
function init_homework_editor(params){
params.textarea.removeAttr('placeholder');
var editor = params.kindutil.create(params.textarea, {
resizeType : 1,minWidth:"1px",width:"100%",minHeight:"30px",height:"30px",
items : ['code','emoticons','fontname',
'forecolor', 'hilitecolor', 'bold', '|', 'justifyleft', 'justifycenter', 'insertorderedlist','insertunorderedlist', '|',
'formatblock', 'fontsize', '|','indent', 'outdent',
'|','imagedirectupload','table', 'media', 'preview',"more"
],
afterChange:function(){//按键事件
var edit = this.edit;
var body = edit.doc.body;
//paramsHeight = params.kindutil.removeUnit(this.height);
edit.iframe.height(150);
this.resize(null, Math.max((params.kindutil.IE ? body.scrollHeight : body.offsetHeight) + 33, 150));
},
afterCreate:function(){
//init
var edit = this.edit;
var body = edit.doc.body;
edit.iframe[0].scroll = 'no';
body.style.overflowY = 'hidden';
//reset height
var edit = this.edit;
var body = edit.doc.body;
edit.html(params.textarea.innerHTML);
//paramsHeight = params.kindutil.removeUnit(this.height);
edit.iframe.height(150);
this.resize(null, Math.max((params.kindutil.IE ? body.scrollHeight : body.offsetHeight) , 150));
elocalStorage(editor2,'student_work_<%=@homework.id %>');
}
}).loadPlugin('paste');
return editor;
}
KindEditor.ready(function(K){
$("div[nhname='student_work_form']").each(function(){
var params = {};
params.kindutil = K;
params.div_form = $(this);
params.form = $("form",params.div_form);
if(params.form==undefined || params.form.length==0){
return;
}
params.textarea = $("textarea[nhname='student_work_textarea']",params.div_form);
params.contentmsg = $("#student_work_description_textarea");
params.submit_btn = $("#new_message_submit_btn");
if(params.textarea.data('init') == undefined) {
params.editor = init_homework_editor(params);
editor2 = params.editor;
init_homework_form(params);
params.submit_btn.click(function () {
params.form.submit();
$("#ajax-indicator").hide();
});
params.textarea.data('init', 1);
}
});
});
</script> </script>
<div class="homepageRightBanner mb10"> <div class="homepageRightBanner mb10">
@ -110,7 +225,7 @@
</div><!----HomeWorkBox end--> </div><!----HomeWorkBox end-->
<div class="cl"></div> <div class="cl"></div>
<div class="HomeWorkCon mt15"> <div class="HomeWorkCon mt15" nhname='student_work_form'>
<%= form_for(@student_work, <%= form_for(@student_work,
:html => { :multipart => true }, :html => { :multipart => true },
:url => {:controller => 'student_work', :url => {:controller => 'student_work',
@ -127,18 +242,21 @@
<%=hidden_field_tag 'group_member_ids', params[:group_member_ids], :value=>User.current.id %> <%=hidden_field_tag 'group_member_ids', params[:group_member_ids], :value=>User.current.id %>
<% end %> <% end %>
<div> <div>
<%= f.text_field "name", :required => true, :size => 60, :class => "InputBox W700", :maxlength => 200, :placeholder => "请输入作品名称", :onkeyup => "regexStudentWorkName();" %> <%= f.text_field "name", :required => true, :size => 60, :class => "InputBox W700", :maxlength => 200, :placeholder => "请输入作品名称",:value=>"#{@homework.name}的作品提交", :onkeyup => "regexStudentWorkName();" %>
<div class="cl"></div> <div class="cl"></div>
<p id="student_work_name_span" class="c_red mb10"></p> <p id="student_work_name_span" class="c_red mb10"></p>
</div> </div>
<div class="mt10"> <div class="mt10">
<%= f.text_area "description", :class => "InputBox W700 H150", :placeholder => "请输入作品描述", :onkeyup => "regexStudentWorkDescription();"%> <textarea placeholder="请输入作品描述" style="display: none" nhname='student_work_textarea' name="student_work[description]"></textarea>
<script> <%#= f.text_area "description", :class => "InputBox W700 H150", :placeholder => "请输入作品描述", :onkeyup => "regexStudentWorkDescription();"%>
<!--<script>
var text = document.getElementById("student_work_description"); var text = document.getElementById("student_work_description");
autoTextarea(text);// 调用 autoTextarea(text);// 调用
</script> </script>-->
<div class="cl"></div> <div class="cl"></div>
<p id="student_work_description_textarea" class="c_red mb10"></p> <p id="student_work_description_textarea" class="c_red mb10"></p>
<p id="e_tip" class="c_grey"></p>
<p id="e_tips" class="c_grey"></p>
</div> </div>
<div id="homework_attachments"> <div id="homework_attachments">
@ -167,9 +285,9 @@
</div>--> </div>-->
<div class="mt5"> <div class="mt5">
<a href="javascript:void(0);" class="BlueCirBtnMini fr" onclick="popupRegex();new_student_work();">提交</a> <a href="javascript:void(0);" class="BlueCirBtnMini fr" id="new_message_submit_btn">提交</a>
<span class="fr mr10 mt3">或</span> <span class="fr mr10 mt3">或</span>
<%= link_to "取消", delete_work_student_work_index_path(:homework =>@homework.id), :class => "fr mr10 mt3"%> <%= link_to "取消", delete_work_student_work_index_path(:homework =>@homework.id),:id => 'new_message_cancel_btn', :class => "fr mr10 mt3"%>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<% end%> <% end%>

View File

@ -1,36 +1,36 @@
if($("#about_hwork_<%= @work.id%>").children().length > 0){ if($("#about_hwork_<%= @work.id%>").children().length > 0){
$("#about_hwork_<%= @work.id%>").html(""); $("#about_hwork_<%= @work.id%>").html("");
} }
else{ else{
<% if @homework.homework_type == 2%> <% if @homework.homework_type == 2%>
$("#about_hwork_<%= @work.id%>").html("<%= escape_javascript(render :partial => 'programing_work_show',:locals => {:work =>@work,:score =>@score,:student_work_scores => @student_work_scores}) %>"); $("#about_hwork_<%= @work.id%>").html("<%= escape_javascript(render :partial => 'programing_work_show',:locals => {:work =>@work,:score =>@score,:student_work_scores => @student_work_scores}) %>");
var program_name = "text/x-csrc"; var program_name = "text/x-csrc";
var language = <%= @homework.language %>; var language = <%= @homework.language %>;
if (language == 1) { if (language == 1) {
program_name = 'text/x-csrc'; program_name = 'text/x-csrc';
} else if(language==2){ } else if(language==2){
program_name = 'text/x-c++src'; program_name = 'text/x-c++src';
}else if(language==3){ }else if(language==3){
program_name = 'text/x-cython'; program_name = 'text/x-cython';
} else if(language==4){ } else if(language==4){
program_name = 'text/x-java'; program_name = 'text/x-java';
} }
var editor = CodeMirror(document.getElementById("work-code_<%= @work.id%>"), { var editor = CodeMirror(document.getElementById("work-code_<%= @work.id%>"), {
mode: {name: program_name, mode: {name: program_name,
version: 2, version: 2,
singleLineStringErrors: false}, singleLineStringErrors: false},
lineNumbers: true, lineNumbers: true,
indentUnit: 2, indentUnit: 2,
matchBrackets: true, matchBrackets: true,
readOnly: true, readOnly: true,
value: $("#work-src").text() value: $("#work-src_<%= @work.id%>").text()
} }
); );
<% else%> <% else%>
$("#about_hwork_<%= @work.id%>").html("<%= escape_javascript(render :partial => 'show',:locals => {:work =>@work,:score =>@score,:student_work_scores => @student_work_scores}) %>"); $("#about_hwork_<%= @work.id%>").html("<%= escape_javascript(render :partial => 'show',:locals => {:work =>@work,:score =>@score,:student_work_scores => @student_work_scores}) %>");
<% end%> <% end%>
$('#score_<%= @work.id%>').peSlider({range: 'min'}); $('#score_<%= @work.id%>').peSlider({range: 'min'});
} }

View File

@ -1,23 +1,15 @@
<div class="resources mt10" id="user_activity_<%= user_activity_id%>" onmouseover="$('#message_setting_<%= user_activity_id%>').show();" onmouseout="$('#message_setting_<%= user_activity_id%>').hide();"> <div class="resources mt10" id="user_activity_<%= user_activity_id%>" onmouseover="$('#message_setting_<%= user_activity_id%>').show();" onmouseout="$('#message_setting_<%= user_activity_id%>').hide();">
<div class="homepagePostBrief"> <div class="homepagePostBrief">
<div class="homepagePostPortrait"> <div class="homepagePostPortrait">
<% if activity.status == 1 %> <%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id,:host=>Setting.host_user), :alt => "用户头像" %>
<%= image_tag("/images/trustie_logo1.png", width: "50px", height: "50px") %> <%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
<% else %>
<%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id,:host=>Setting.host_user), :alt => "用户头像" %>
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
<% end %>
</div> </div>
<div class="homepagePostDes"> <div class="homepagePostDes">
<div class="homepagePostTo break_word mt-4"> <div class="homepagePostTo break_word mt-4">
<% if activity.status == 1 %> <% if activity.try(:author).try(:realname) == ' ' %>
<span class="fontBlue2">确实团队</span> <%= link_to activity.try(:author), user_path(activity.author_id,:host=>Setting.host_user), :class => "newsBlue mr15" %>
<% else %> <% else %>
<% if activity.try(:author).try(:realname) == ' ' %> <%= link_to activity.try(:author).try(:realname), user_path(activity.author_id,:host=>Setting.host_user), :class => "newsBlue mr15" %>
<%= link_to activity.try(:author), user_path(activity.author_id,:host=>Setting.host_user), :class => "newsBlue mr15" %>
<% else %>
<%= link_to activity.try(:author).try(:realname), user_path(activity.author_id,:host=>Setting.host_user), :class => "newsBlue mr15" %>
<% end %>
<% end %> <% end %>
TO TO
<%= link_to activity.course.name.to_s+" | 课程问答区", course_boards_path(activity.course,:host=> Setting.host_course), :class => "newsBlue ml15 mr5"%> <%= link_to activity.course.name.to_s+" | 课程问答区", course_boards_path(activity.course,:host=> Setting.host_course), :class => "newsBlue ml15 mr5"%>

View File

@ -1,7 +1,17 @@
<div class="subject-pop-info">题目信息</div> <div class="subject-pop-info">题目信息</div>
<div class="subject-pop-wrap"> <div class="subject-pop-wrap">
<% if homework.nil? %> <% if homework.nil? %>
<span class="c_red" id="homework_notice_span">请先在左侧选择作业</span> <span id="homework_notice_span">本题库遵循创作共用许可证<br/><br/>
教师给学生出题本质上是一种创作行为,题目的作者通常为此付出大量时间和精力。好的题目不仅能加深学生对知识点的理解,还能激发学生兴趣,提升学习效率。为此,本网站的题库许可证基于创作共用许可证( Creative Commons License )建立,其核心条款包括:<br/><br/>
1. 署名:必须提到原作者。<br/><br/>
2. 非商业用途:不得用于盈利性目的。<br/><br/>
3. 相同方式共享:允许修改原作品,但必须使用相同的许可证发布。<br/><br/>
对此许可证的支持或反对,请在网站中留言,我们不断完善,谢谢!</span>
<% else %> <% else %>
<div class="subject-pop-intro mb15">标题:<%=homework.name %><br /> <div class="subject-pop-intro mb15">标题:<%=homework.name %><br />
来源:<%=homework.course.name %><br /> 来源:<%=homework.course.name %><br />

View File

@ -2,7 +2,18 @@
<div class="subjectInfo">题目信息</div> <div class="subjectInfo">题目信息</div>
<div class="subject-content-wrapper"> <div class="subject-content-wrapper">
<% if homework.nil? %> <% if homework.nil? %>
<span class="c_red" id="homework_notice_span">请先在左侧选择作业</span> <span id="homework_notice_span"><span class="center db">本题库遵循创作共用许可证</span><br>
教师给学生出题本质上是一种创作行为,题目的作者通常为此付出大量时间和精力。好的题目不仅能加深学生对知识点的理解,还能激发学生兴趣,提升学习效率。为此,本网站的题库许可证基于创作共用许可证( Creative Commons License )建立,其核心条款包括:<br/><br/>
1. 署名:必须提到原作者。<br/><br/>
2. 非商业用途:不得用于盈利性目的。<br/><br/>
3. 相同方式共享:允许修改原作品,但必须使用相同的许可证发布。<br/><br/>
对此许可证的支持或反对,请在网站中留言,我们不断完善,谢谢!
</span>
<% else %> <% else %>
<div class="subjectIntro mb15">标题:<%=homework.name %><br /> <div class="subjectIntro mb15">标题:<%=homework.name %><br />
来源:<%=homework.course.name %><br /> 来源:<%=homework.course.name %><br />

View File

@ -1,18 +1,33 @@
<ul class="subject-list-banner"> <ul class="subject-list-banner">
<li class="subject-list-name fl hidden"><span style="padding-left:15px;">作业名称</span></li> <li class="subject-list-name fl hidden"><span style="padding-left:15px;">作业名称</span></li>
<li class="subject-list-from fl">来源</li> <li class="subject-list-from fl">
<li class="subject-list-type fl">类别</li> <%= link_to "来源",user_search_homeworks_user_path(@user,:name=>search,:type => type,:is_import=>is_import,:property=>property,:order => "course_name", :sort => @r_sort),:class => "fl ml30",:remote => true%>
<li class="subject-list-publisher fl">贡献者</li> <% if @order == "course_name"%>
<%= link_to "", user_search_homeworks_user_path(@user,:name=>search,:type => type,:is_import=>is_import,:property=>property,:order => "course_name", :sort => @r_sort),:class => "#{@r_sort == 'desc' ? 'st_up' : 'st_down'} mt12 fl" ,:remote => true%>
<% end%>
</li>
<li class="subject-list-type fl">
<%= link_to "类别",user_search_homeworks_user_path(@user,:name=>search,:type => type,:is_import=>is_import,:property=>property,:order => "homework_type", :sort => @r_sort),:class => "fl ml10",:remote => true%>
<% if @order == "homework_type"%>
<%= link_to "", user_search_homeworks_user_path(@user,:name=>search,:type => type,:is_import=>is_import,:property=>property,:order => "homework_type", :sort => @r_sort),:class => "#{@r_sort == 'desc' ? 'st_up' : 'st_down'} mt12 fl" ,:remote => true%>
<% end%>
</li>
<li class="subject-list-publisher fl">
<%= link_to "贡献者",user_search_homeworks_user_path(@user,:name=>search,:type => type,:is_import=>is_import,:property=>property,:order => "user_name", :sort => @r_sort),:class => "fl ml20",:remote => true%>
<% if @order == "user_name"%>
<%= link_to "", user_search_homeworks_user_path(@user,:name=>search,:type => type,:is_import=>is_import,:property=>property,:order => "user_name", :sort => @r_sort),:class => "#{@r_sort == 'desc' ? 'st_up' : 'st_down'} mt12 fl" ,:remote => true%>
<% end%>
</li>
<li class="subject-list-count fl"> <li class="subject-list-count fl">
<%= link_to "引用数",user_search_homeworks_user_path(@user,:name=>search,:type => type,:is_import=>is_import,:property=>property,:order => "quotes", :sort => @r_sort),:class => "fl",:remote => true%> <%= link_to "引用数",user_search_homeworks_user_path(@user,:name=>search,:type => type,:is_import=>is_import,:property=>property,:order => "quotes", :sort => @r_sort),:class => "fl ml5",:remote => true%>
<% if @order == "quotes"%> <% if @order == "quotes"%>
<%= link_to "", user_search_homeworks_user_path(@user,:name=>search,:type => type,:is_import=>is_import,:property=>property,:order => "quotes", :sort => @r_sort),:class => "#{@r_sort == 'desc' ? 'st_up' : 'st_down'} mt12" ,:remote => true%> <%= link_to "", user_search_homeworks_user_path(@user,:name=>search,:type => type,:is_import=>is_import,:property=>property,:order => "quotes", :sort => @r_sort),:class => "#{@r_sort == 'desc' ? 'st_up' : 'st_down'} mt12 fl" ,:remote => true%>
<% end%> <% end%>
</li> </li>
<li class="fl subject-list-date"> <li class="fl subject-list-date">
<%= link_to "发布时间",user_search_homeworks_user_path(@user,:name=>search,:type => type,:is_import=>is_import,:property=>property,:order => "created_at", :sort => @r_sort),:class => "fl",:remote => true%> <%= link_to "发布时间",user_search_homeworks_user_path(@user,:name=>search,:type => type,:is_import=>is_import,:property=>property,:order => "created_at", :sort => @r_sort),:class => "fl",:remote => true%>
<% if @order == "created_at"%> <% if @order == "created_at"%>
<%= link_to "", user_search_homeworks_user_path(@user,:name=>search,:type => type,:is_import=>is_import,:property=>property,:order => "created_at", :sort => @r_sort),:class => "#{@r_sort == 'desc' ? 'st_up' : 'st_down'} mt12" ,:remote => true%> <%= link_to "", user_search_homeworks_user_path(@user,:name=>search,:type => type,:is_import=>is_import,:property=>property,:order => "created_at", :sort => @r_sort),:class => "#{@r_sort == 'desc' ? 'st_up' : 'st_down'} mt12 fl" ,:remote => true%>
<% end%> <% end%>
</li> </li>
</ul> </ul>

View File

@ -1,6 +1,6 @@
<div class="userCard boxShadow" style="<%= User.current == user ? 'top:-153px;':'' %>"> <div class="userCard boxShadow" style="<%= User.current == user ? 'top:-153px;':'' %>">
<div class="userAvatarWrap fl"> <div class="userAvatarWrap fl">
<%= link_to image_tag(url_to_avatar(user), :width => "50", :height => "50"), user_url_in_org(user), :alt => "用户头像", :target => '_blank' %> <%= link_to image_tag(url_to_avatar(user), :width => "50", :height => "50"), user_url_in_org(user.id), :alt => "用户头像", :target => '_blank' %>
<%#= image_tag(url_to_avatar(user), :width => "50", :height => "50") %> <%#= image_tag(url_to_avatar(user), :width => "50", :height => "50") %>
<!--<img src="images/homepageImage.jpg" width="50" height="50" alt="个人头像" />--> <!--<img src="images/homepageImage.jpg" width="50" height="50" alt="个人头像" />-->
</div> </div>

View File

@ -30,7 +30,7 @@
<a href="javascript:void(0);" class="sendSourceText" onclick="hideModal()">取消</a> <a href="javascript:void(0);" class="sendSourceText" onclick="hideModal()">取消</a>
</div> </div>
<div > <div >
<ul class="wlist" id="homewrok_ref_pages" style="margin-top: 5px;margin-right: 20px"> <ul class="wlist" id="homewrok_ref_pages" style="margin-top: 5px">
<%= pagination_links_full @hw_pages, @hw_count, :per_page_links => false, :remote => @is_remote, :flag => true%> <%= pagination_links_full @hw_pages, @hw_count, :per_page_links => false, :remote => @is_remote, :flag => true%>
</ul> </ul>
</div> </div>

View File

@ -16,7 +16,6 @@
$("#GroupPopupBox a.group_save_btn").click(); $("#GroupPopupBox a.group_save_btn").click();
<% end %> <% end %>
}); });
var homework_description_editor;
function checked_val() { function checked_val() {
if ($("#anonymous_comment").is(":checked")) { if ($("#anonymous_comment").is(":checked")) {
$("#anonymous_comment").val(1); $("#anonymous_comment").val(1);
@ -106,7 +105,7 @@
//paramsHeight = params.kindutil.removeUnit(this.height); //paramsHeight = params.kindutil.removeUnit(this.height);
edit.iframe.height(150); edit.iframe.height(150);
this.resize(null, Math.max((params.kindutil.IE ? body.scrollHeight : body.offsetHeight) , 150)); this.resize(null, Math.max((params.kindutil.IE ? body.scrollHeight : body.offsetHeight) , 150));
elocalStorage(homework_description_editor,'homework_<%=User.current.id %>');
} }
}).loadPlugin('paste'); }).loadPlugin('paste');
return editor; return editor;
@ -150,7 +149,7 @@
<div class="cl"></div> <div class="cl"></div>
<div class=" mt10"> <div class=" mt10">
<%= link_to("导入作业", user_import_homeworks_user_path(User.current.id,:select_course => defined?(select_course)),:class => "BlueCirBtn fl mr10",:remote => true,:title=>"导入自己发布过的作业,或者共享题库中的作业") unless edit_mode%> <%= link_to("从题库选用", user_import_homeworks_user_path(User.current.id,:select_course => defined?(select_course)),:class => "BlueCirBtn fl mr10",:remote => true,:title=>"导入自己发布过的作业,或者共享题库中的作业") unless edit_mode%>
<% unless edit_mode %> <% unless edit_mode %>
<input type="hidden" name="quotes" id="ref_homework_id" value=""/> <input type="hidden" name="quotes" id="ref_homework_id" value=""/>
<% end %> <% end %>
@ -159,7 +158,7 @@
<% end %> <% end %>
<div class="calendar_div fl mr10"> <div class="calendar_div fl mr10">
<input type="text" name="homework_common[end_time]" id="homework_end_time" placeholder="截止日期" class="InputBox fl W120 calendar_input" readonly="readonly" value="<%= homework.end_time%>" > <input type="text" name="homework_common[end_time]" id="homework_end_time" placeholder="截止日期" class="InputBox fl W120 calendar_input" readonly="readonly" value="<%= homework.end_time%>" >
<% if homework.homework_detail_manual.comment_status.to_i < 3 %> <% if homework.homework_detail_manual.comment_status.to_i < 2 %>
<%= calendar_for('homework_end_time')%> <%= calendar_for('homework_end_time')%>
<% end %> <% end %>
</div> </div>
@ -199,6 +198,8 @@
<%= select_tag :course_id, options_for_select(get_as_teacher_courses(User.current), homework.course_id), {:class => "InputBox w709",:value => "请选择发布作业的课程"} %> <%= select_tag :course_id, options_for_select(get_as_teacher_courses(User.current), homework.course_id), {:class => "InputBox w709",:value => "请选择发布作业的课程"} %>
</div> </div>
<p id="homework_course_id_span" class="c_red mt5"></p> <p id="homework_course_id_span" class="c_red mt5"></p>
<p id="e_tip" class="c_grey"></p>
<p id="e_tips" class="c_grey"></p>
<div class="cl"></div> <div class="cl"></div>
<div id="homework_attachments"> <div id="homework_attachments">

View File

@ -85,7 +85,7 @@
<span data-language=<%=@homework.language%> style="display-hidden" id="data-language"></span> <span data-language=<%=@homework.language%> style="display-hidden" id="data-language"></span>
</div> </div>
<div class="mt10"> <div class="mt10">
<%= f.text_area :name, id: 'program-title', class:"InputBox W700", placeholder:"请概括你的代码的功能" %> <%= f.text_area :name, id: 'program-title', class:"InputBox W700", placeholder:"请概括你的代码的功能", value:"#{@homework.name}的作品提交" %>
</div> </div>
<div class="mt10"> <div class="mt10">
<%= f.text_area :description, id: 'program-src', class:"InputBox W700 H150", placeholder:"请贴入你的代码", rows: 10 %> <%= f.text_area :description, id: 'program-src', class:"InputBox W700 H150", placeholder:"请贴入你的代码", rows: 10 %>

View File

@ -33,7 +33,7 @@
<div class="homepageContentContainer"> <div class="homepageContentContainer">
<div class="homepageContent"> <div class="homepageContent">
<div class="resource-wrapper mt10"> <div class="resource-wrapper">
<ul class="resource-banner"> <ul class="resource-banner">
<li class="fl resource-switch"> <li class="fl resource-switch">
<a href="<%= user_homework_type_user_path(@user,:is_import => 0) %>" id="public_homeworks_choose" class="resource-tab resource-tab-active" data-remote="true">公共题库</a> <a href="<%= user_homework_type_user_path(@user,:is_import => 0) %>" id="public_homeworks_choose" class="resource-tab resource-tab-active" data-remote="true">公共题库</a>
@ -46,7 +46,7 @@
<ul class="resourcesSelect"> <ul class="resourcesSelect">
<li class="resourcesSelected"><a href="javascript:void(0);" class="resourcesIcon"></a> <li class="resourcesSelected"><a href="javascript:void(0);" class="resourcesIcon"></a>
<ul class="resourcesType"> <ul class="resourcesType">
<li> <a href="<%= user_homework_type_user_path(@user,:type => @type,:is_import => 0,:property => 0) %>" id="homework_type_all" class="resourcesTypeAll resourcesGrey" data-method="get" data-remote="true">全部</a> </li> <li> <a href="<%= user_homework_type_user_path(@user,:type => @type,:is_import => 0) %>" id="homework_type_all" class="resourcesTypeAll resourcesGrey" data-method="get" data-remote="true">全部</a> </li>
<li> <a href="<%= user_homework_type_user_path(@user,:type => @type,:is_import => 0,:property => 1) %>" id="homework_type_nor" class="homepagePostTypeAssignment postTypeGrey" data-method="get" data-remote="true">普通作业</a> </li> <li> <a href="<%= user_homework_type_user_path(@user,:type => @type,:is_import => 0,:property => 1) %>" id="homework_type_nor" class="homepagePostTypeAssignment postTypeGrey" data-method="get" data-remote="true">普通作业</a> </li>
<li> <a href="<%= user_homework_type_user_path(@user,:type => @type,:is_import => 0,:property => 2) %>" id="homework_type_pro" class="program-btn postTypeGrey" data-method="get" data-remote="true" style="white-space:nowrap;">编程作业</a> </li> <li> <a href="<%= user_homework_type_user_path(@user,:type => @type,:is_import => 0,:property => 2) %>" id="homework_type_pro" class="program-btn postTypeGrey" data-method="get" data-remote="true" style="white-space:nowrap;">编程作业</a> </li>
<li> <a href="<%= user_homework_type_user_path(@user,:type => @type,:is_import => 0,:property => 3) %>" id="homework_type_gro" class="group-btn resourcesGrey" data-method="get" data-remote="true">分组作业</a> </li> <li> <a href="<%= user_homework_type_user_path(@user,:type => @type,:is_import => 0,:property => 3) %>" id="homework_type_gro" class="group-btn resourcesGrey" data-method="get" data-remote="true">分组作业</a> </li>
@ -61,7 +61,7 @@
<%=render :partial=>'homework_repository_search', :locals=>{:type => @type,:is_import => 0,:property => @property} %> <%=render :partial=>'homework_repository_search', :locals=>{:type => @type,:is_import => 0,:property => @property} %>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<div class="w583 fl mr10 mt10" id="homework_repository_list"> <div class="w683 fl mr10 mt10" id="homework_repository_list">
<%=render :partial => 'homework_repository_list', :locals => {:homeworks => @homeworks,:type=>@type,:is_import => 0,:property => @property,:search=>''} %> <%=render :partial => 'homework_repository_list', :locals => {:homeworks => @homeworks,:type=>@type,:is_import => 0,:property => @property,:search=>''} %>
</div> </div>
<div id="homework_repository_detail"> <div id="homework_repository_detail">
@ -69,7 +69,7 @@
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<div> <div>
<ul class="wlist mt10" id="homework_pository_ref_pages" style="margin-top: 5px;margin-right: 395px"> <ul class="wlist mt10" id="homework_pository_ref_pages" style="margin-top: 5px;margin-right: 295px">
<%= pagination_links_full @hw_pages, @hw_count, :per_page_links => false, :remote => @is_remote, :flag => true%> <%= pagination_links_full @hw_pages, @hw_count, :per_page_links => false, :remote => @is_remote, :flag => true%>
</ul> </ul>
</div> </div>

View File

@ -0,0 +1,8 @@
class UpdateCourseLead < ActiveRecord::Migration
def up
Message.where("status =? ", 1).update_all(:author_id => 1)
end
def down
end
end

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +1,4 @@
var editor2;
function init_des_editor(params){ function init_des_editor(params){
// var minHeight; //最小高度 // var minHeight; //最小高度
var paramsHeight = params.height; //设定的高度 var paramsHeight = params.height; //设定的高度
@ -32,7 +33,7 @@ function init_des_editor(params){
paramsHeight = paramsHeight == undefined ? params.kindutil.removeUnit(this.height) : paramsHeight; paramsHeight = paramsHeight == undefined ? params.kindutil.removeUnit(this.height) : paramsHeight;
edit.iframe.height(paramsHeight); edit.iframe.height(paramsHeight);
this.resize(null, Math.max((params.kindutil.IE ? body.scrollHeight : body.offsetHeight), paramsHeight)); this.resize(null, Math.max((params.kindutil.IE ? body.scrollHeight : body.offsetHeight), paramsHeight));
elocalStorage(editor2,'org_document');
} }
}).loadPlugin('paste'); }).loadPlugin('paste');
return editor; return editor;
@ -123,6 +124,7 @@ function init_des_data(){
params.width = width; params.width = width;
if (params.textarea.data('init') == undefined) { if (params.textarea.data('init') == undefined) {
params.editor = init_des_editor(params); params.editor = init_des_editor(params);
editor2 = params.editor;
init_form(params); init_form(params);
params.cancel_btn.click(function () { params.cancel_btn.click(function () {
nh_reset_form(params); nh_reset_form(params);

View File

@ -1,109 +1,109 @@
/* CSS Document */ /* CSS Document */
/* 2015-06-26 */ /* 2015-06-26 */
.navContainer h1,h2,h3,h4,h5,h6,hr,blockquote,dl,dt,dd,ul,ol,li,pre,form,fieldset,legend,button,input,textarea,th,td{ margin:0; padding:0;} .navContainer h1,h2,h3,h4,h5,h6,hr,blockquote,dl,dt,dd,ul,ol,li,pre,form,fieldset,legend,button,input,textarea,th,td{ margin:0; padding:0;}
.navContainer body,table,input,textarea,select,button { font-family: "微软雅黑","宋体"; font-size:12px;line-height:1.5;} .navContainer body,table,input,textarea,select,button { font-family: "微软雅黑","宋体"; font-size:12px;line-height:1.5;}
div,img,tr,td,table{ border:0;} div,img,tr,td,table{ border:0;}
table,tr,td{border:0;cellspacing:0; cellpadding:0;} table,tr,td{border:0;cellspacing:0; cellpadding:0;}
ol,ul,li{ list-style-type:none} ol,ul,li{ list-style-type:none}
a:link,a:visited{text-decoration:none;} a:link,a:visited{text-decoration:none;}
/*a:hover,a:active{color:#000;}*/ /*a:hover,a:active{color:#000;}*/
/*常用*/ /*常用*/
/*#RSide{ background:#fff;}*/ /*#RSide{ background:#fff;}*/
/*上传图片处理*/ /*上传图片处理*/
.navSearchTypeBox{margin-top: 32px;} .navSearchTypeBox{margin-top: 32px;}
#navHomepageSearch{margin-top: 11px;background-color: white;} #navHomepageSearch{margin-top: 11px;background-color: white;}
.upload_img img{max-width: 100%;} .upload_img img{max-width: 100%;}
blockquote img{max-width: 100%;} blockquote img{max-width: 100%;}
.hidden{overflow:hidden; white-space: nowrap; text-overflow:ellipsis;} .hidden{overflow:hidden; white-space: nowrap; text-overflow:ellipsis;}
.none{display: none;} .none{display: none;}
.rside_back{ width:670px; margin-left:10px; background:#fff; margin-bottom:10px;} .rside_back{ width:670px; margin-left:10px; background:#fff; margin-bottom:10px;}
.break_word{ word-break:break-all; word-wrap: break-word;} .break_word{ word-break:break-all; word-wrap: break-word;}
select,input,textarea{ border:1px solid #64bdd9; background:#fff; color:#000; padding-left:5px; } select,input,textarea{ border:1px solid #64bdd9; background:#fff; color:#000; padding-left:5px; }
.sub_btn{ cursor:pointer; -moz-border-radius:3px; -webkit-border-radius:3px; border:1px solid #707070; color:#000; border-radius:3px; padding:1px 10px; background:#dbdbdb;} .sub_btn{ cursor:pointer; -moz-border-radius:3px; -webkit-border-radius:3px; border:1px solid #707070; color:#000; border-radius:3px; padding:1px 10px; background:#dbdbdb;}
.sub_btn:hover{ background:#b5e2fa; color:#000; border:1px solid #3c7fb1;} .sub_btn:hover{ background:#b5e2fa; color:#000; border:1px solid #3c7fb1;}
/*table{ background:#fff;}*/ /*table{ background:#fff;}*/
.more{ font-weight:normal; color:#999; font-size:12px;} .more{ font-weight:normal; color:#999; font-size:12px;}
.no_line{ border-bottom:none;} .no_line{ border-bottom:none;}
.line{border-bottom:1px dashed #d4d4d4; padding-bottom:10px; margin-bottom:10px;} .line{border-bottom:1px dashed #d4d4d4; padding-bottom:10px; margin-bottom:10px;}
.no_border{ border:none;background:none;} .no_border{ border:none;background:none;}
.min_search{ width:150px; height:20px; border:1px solid #d0d0d0; color:#666; background:url(../images/public_icon.png) 135px -193px no-repeat; cursor:pointer;} .min_search{ width:150px; height:20px; border:1px solid #d0d0d0; color:#666; background:url(../images/public_icon.png) 135px -193px no-repeat; cursor:pointer;}
.db {display:block;} .db {display:block;}
/* font & color */ /* font & color */
.f12{font-size:12px; font-weight:normal;} .f12{font-size:12px; font-weight:normal;}
.f14{font-size:14px;} .f14{font-size:14px;}
.f16{font-size:16px;} .f16{font-size:16px;}
.f18{font-size:18px;} .f18{font-size:18px;}
.fb{font-weight:bold;} .fb{font-weight:bold;}
/* Float & Clear */ /* Float & Clear */
.cl{ clear:both; overflow:hidden; } .cl{ clear:both; overflow:hidden; }
.fl{float:left;display:inline;} .fl{float:left;display:inline;}
.fr{float:right;display:inline;} .fr{float:right;display:inline;}
.f_l{ float:left;} .f_l{ float:left;}
.f_r{ float:right;} .f_r{ float:right;}
.clearfix:after{clear:both;content:".";display:block;font-size:0;height:0;line-height:0;visibility:hidden} .clearfix:after{clear:both;content:".";display:block;font-size:0;height:0;line-height:0;visibility:hidden}
.clearfix{clear:both;zoom:1} .clearfix{clear:both;zoom:1}
.break_word{ word-break:break-all; word-wrap: break-word;} .break_word{ word-break:break-all; word-wrap: break-word;}
.white_space{white-space:nowrap;} .white_space{white-space:nowrap;}
a.c_white{ color:#fff !important;} a.c_white{ color:#fff !important;}
input.c_white { color:#fff !important;} input.c_white { color:#fff !important;}
/* Spacing */ /* Spacing */
.ml2{ margin-left:2px;} .ml2{ margin-left:2px;}
.ml3{ margin-left:3px;} .ml3{ margin-left:3px;}
.ml4{ margin-left:4px;} .ml4{ margin-left:4px;}
.ml5{ margin-left:5px;} .ml5{ margin-left:5px;}
.ml8{ margin-left:8px;} .ml8{ margin-left:8px;}
.ml10{ margin-left:10px;} .ml10{ margin-left:10px;}
.ml15{ margin-left:15px;} .ml15{ margin-left:15px;}
.ml20{ margin-left:20px;} .ml20{ margin-left:20px;}
.ml40{ margin-left:40px;} .ml40{ margin-left:40px;}
.ml45{ margin-left:45px;} .ml45{ margin-left:45px;}
.ml55{ margin-left:55px;} .ml55{ margin-left:55px;}
.ml30{ margin-left:30px;} .ml30{ margin-left:30px;}
.ml60{ margin-left:60px;} .ml60{ margin-left:60px;}
.ml80{ margin-left:80px;} .ml80{ margin-left:80px;}
.ml90{ margin-left:90px;} .ml90{ margin-left:90px;}
.ml100{ margin-left:100px;} .ml100{ margin-left:100px;}
.ml110{ margin-left:110px;} .ml110{ margin-left:110px;}
.ml150 { margin-left:150px;} .ml150 { margin-left:150px;}
.mr5{ margin-right:5px;} .mr5{ margin-right:5px;}
.mr45 {margin-right:45px;} .mr45 {margin-right:45px;}
.mr55{ margin-right:55px;} .mr55{ margin-right:55px;}
.mr10{ margin-right:10px;} .mr10{ margin-right:10px;}
.mr15 {margin-right:15px;} .mr15 {margin-right:15px;}
.mr20{ margin-right:20px;} .mr20{ margin-right:20px;}
.mr30{ margin-right:30px;} .mr30{ margin-right:30px;}
.mr40{ margin-right:40px;} .mr40{ margin-right:40px;}
.mw20{ margin: 0 20px;} .mw20{ margin: 0 20px;}
.mt3{ margin-top:3px;} .mt3{ margin-top:3px;}
.mt5{ margin-top:5px;} .mt5{ margin-top:5px;}
.mt8{ margin-top:8px;} .mt8{ margin-top:8px;}
.mt10{ margin-top:10px !important;} .mt10{ margin-top:10px !important;}
.mt15 {margin-top:15px;} .mt15 {margin-top:15px;}
.mb4{ margin-bottom:4px;} .mb4{ margin-bottom:4px;}
.mb5{ margin-bottom:5px;} .mb5{ margin-bottom:5px;}
.mb8 {margin-bottom:8px;} .mb8 {margin-bottom:8px;}
.mb10{ margin-bottom:10px !important;} .mb10{ margin-bottom:10px !important;}
.mb20{ margin-bottom:20px;} .mb20{ margin-bottom:20px;}
.pl15{ padding-left:15px;} .pl15{ padding-left:15px;}
.w20{ width:20px;} .w20{ width:20px;}
.w60{ width:60px;} .w60{ width:60px;}
.w70{ width:70px;} .w70{ width:70px;}
.w90{ width:90px;} .w90{ width:90px;}
.w210{ width:210px;} .w210{ width:210px;}
.w150{ width:150px;} .w150{ width:150px;}
.w280{ width:280px;} .w280{ width:280px;}
.w430{ width:470px;} .w430{ width:470px;}
.w520{ width:520px;} .w520{ width:520px;}
.w543{ width:543px;} .w543{ width:543px;}
.w557{ width:557px;} .w557{ width:557px;}
.w583{ width:583px;} .w683{ width:683px;}
.w350{ width:350px;} .w350{ width:350px;}
.w610{ width:610px;} .w610{ width:610px;}
.w600{ width:600px;} .w600{ width:600px;}
.h22{ height:22px;} .h22{ height:22px;}
.h26{ height:26px;} .h26{ height:26px;}
.h50{ height:50px;} .h50{ height:50px;}
.h70{ height:70px;} .h70{ height:70px;}
.h150{ height:150px;} .h150{ height:150px;}

View File

@ -1267,7 +1267,7 @@ div.disable_link {background-color: #c1c1c1 !important;}
/*导入题库样式*/ /*导入题库样式*/
.popupWrap {border:3px solid #269ac9; padding:15px; background-color:#ffffff; position:relative; z-index:1000;} .popupWrap {border:3px solid #269ac9; padding:15px; background-color:#ffffff; position:relative; z-index:1000;}
.subjectList {width:585px;} .subjectList {width:585px;}
.subjectDetail {width:385px;} .subjectDetail {width:285px;}
a.subjectChoose {padding:8px 20px; background-color:#f1f1f1; color:#888888;} a.subjectChoose {padding:8px 20px; background-color:#f1f1f1; color:#888888;}
a.chooseActive {background-color:#269ac9; color:#ffffff;} a.chooseActive {background-color:#269ac9; color:#ffffff;}
.subjectBanner {width:585px; height:40px; background-color:#f1f1f1; border-top:1px solid #eaeaea; color:#7a7a7a; font-size:14px;} .subjectBanner {width:585px; height:40px; background-color:#f1f1f1; border-top:1px solid #eaeaea; color:#7a7a7a; font-size:14px;}
@ -1278,7 +1278,7 @@ a.chooseActive {background-color:#269ac9; color:#ffffff;}
.subjectRow {width:585px; height:40px; color:#7a7a7a; font-size:12px;} .subjectRow {width:585px; height:40px; color:#7a7a7a; font-size:12px;}
.subjectRow li {height:40px; line-height:40px; vertical-align:middle;} .subjectRow li {height:40px; line-height:40px; vertical-align:middle;}
.subjectSearch {border:1px solid #dddddd; height:32px; width:250px;} .subjectSearch {border:1px solid #dddddd; height:32px; width:250px;}
.subjectInfo {width:385px; background-color:#f1f1f1; border:1px solid #dddddd; height:32px; line-height:32px; vertical-align:middle; text-align:center; color:#7a7a7a;} .subjectInfo {width:285px; background-color:#f1f1f1; border:1px solid #dddddd; height:32px; line-height:32px; vertical-align:middle; text-align:center; color:#7a7a7a;}
.subjectWrap {border:1px solid #dddddd; border-top:none; padding:10px; width:365px; height:460px; overflow-y:auto;} .subjectWrap {border:1px solid #dddddd; border-top:none; padding:10px; width:365px; height:460px; overflow-y:auto;}
.subjectIntro {color:#585858; line-height:18px; font-size:12px;} .subjectIntro {color:#585858; line-height:18px; font-size:12px;}
.subjectContent {color:#888888; line-height:18px; font-size:12px;} .subjectContent {color:#888888; line-height:18px; font-size:12px;}

View File

@ -135,7 +135,7 @@ a.linkGrey6:hover {color:#ffffff !important;}
.w520{ width:520px;} .w520{ width:520px;}
.w543{ width:543px;} .w543{ width:543px;}
.w557{ width:557px;} .w557{ width:557px;}
.w583{ width:583px;} .w683{ width:683px;}
.w350{ width:350px;} .w350{ width:350px;}
.w610{ width:610px;} .w610{ width:610px;}
.w600{ width:600px;} .w600{ width:600px;}
@ -1440,50 +1440,50 @@ span.at a{color:#269ac9;text-decoration: none;}
/*导入题库样式*/ /*导入题库样式*/
.popup-wrapper {border:3px solid #269ac9; padding:15px; background-color:#ffffff; position:relative; z-index:1000;} .popup-wrapper {border:3px solid #269ac9; padding:15px; background-color:#ffffff; position:relative; z-index:1000;}
.subject-list {width:585px;} .subject-list {width:685px;}
.subject-detail {width:385px;} .subject-detail {width:285px;}
a.subject-choose {padding:8px 20px; background-color:#f1f1f1; color:#888888;} a.subject-choose {padding:8px 20px; background-color:#f1f1f1; color:#888888;}
a.choose-active {background-color:#269ac9; color:#ffffff;} a.choose-active {background-color:#269ac9; color:#ffffff;}
.subject-pop-banner {width:585px; height:40px; background-color:#f1f1f1; border-top:1px solid #eaeaea; color:#7a7a7a; font-size:14px;} .subject-pop-banner {width:685px; height:40px; background-color:#f1f1f1; border-top:1px solid #eaeaea; color:#7a7a7a; font-size:14px;}
.subject-pop-banner li {height:40px; line-height:40px; vertical-align:middle;} .subject-pop-banner li {height:40px; line-height:40px; vertical-align:middle;}
.subject-pop-name {width:200px; padding-left:10px; padding-right:10px;} .subject-pop-name {width:260px; padding-left:10px; padding-right:10px;}
.subject-pop-publisher {width:80px; text-align:center;} .subject-pop-publisher {width:80px; text-align:center;}
.subject-pop-date {width:75px; text-align:center;} .subject-pop-date {width:75px; text-align:center;}
.subject-pop-row {width:585px; height:30px; color:#7a7a7a; font-size:12px;} .subject-pop-row {width:685px; height:30px; color:#7a7a7a; font-size:12px;}
.subject-pop-row li {height:30px; line-height:30px; vertical-align:middle;} .subject-pop-row li {height:30px; line-height:30px; vertical-align:middle;}
.subject-pop-search {border:1px solid #dddddd; height:32px; width:250px;} .subject-pop-search {border:1px solid #dddddd; height:32px; width:250px;}
.subject-pop-info {width:385px; background-color:#f1f1f1; border:1px solid #dddddd; height:32px; line-height:32px; vertical-align:middle; text-align:center; color:#7a7a7a;} .subject-pop-info {width:285px; background-color:#f1f1f1; border:1px solid #dddddd; height:32px; line-height:32px; vertical-align:middle; text-align:center; color:#7a7a7a;}
.subject-pop-wrap {border:1px solid #dddddd; border-top:none; padding:10px; width:365px; height:475px; overflow-y:auto;} .subject-pop-wrap {border:1px solid #dddddd; border-top:none; padding:10px; width:265px; height:475px; overflow-y:auto;}
.subject-pop-intro {color:#585858; line-height:18px; font-size:12px;} .subject-pop-intro {color:#585858; line-height:18px; font-size:12px;}
.subject-pop-content {color:#888888; line-height:18px; font-size:12px;} .subject-pop-content {color:#888888; line-height:18px; font-size:12px;}
.popup-close {background:url(../images/resource_icon_list.png) 0px -40px no-repeat; width:20px; height:20px; display:inline-block; position: absolute; z-index: 1000; right:10px; top:5px;} .popup-close {background:url(../images/resource_icon_list.png) 0px -40px no-repeat; width:20px; height:20px; display:inline-block; position: absolute; z-index: 1000; right:10px; top:5px;}
.subject-pop-type {width:50px; text-align:center;} .subject-pop-type {width:50px; text-align:center;}
.subject-pop-count {width:60px; text-align:center;} .subject-pop-count {width:60px; text-align:center;}
.subject-pop-from {width:100px; text-align:center;} .subject-pop-from {width:140px; text-align:center;}
.subjectContent p,.subjectContent div,.subjectContent em, .subjectContent span{text-align: justify; text-justify:inter-ideograph; word-break: normal !important; word-wrap: break-word !important; line-height: 18px !important; color:#888888 !important; font-size:12px !important;} .subjectContent p,.subjectContent div,.subjectContent em, .subjectContent span{text-align: justify; text-justify:inter-ideograph; word-break: normal !important; word-wrap: break-word !important; line-height: 18px !important; color:#888888 !important; font-size:12px !important;}
.whiteSettingIcon {background:url(../images/hwork_icon.png) -5px -302px no-repeat; width:20px; height:20px;} .whiteSettingIcon {background:url(../images/hwork_icon.png) -5px -302px no-repeat; width:20px; height:20px;}
.whiteSettingIcon:hover {background:url(../images/homepage_icon.png) -93px -44px no-repeat;} .whiteSettingIcon:hover {background:url(../images/homepage_icon.png) -93px -44px no-repeat;}
/*20160301新题库样式*/ /*20160301新题库样式*/
.subject-list-banner {width:585px; height:34px; background-color:#f1f1f1; border-top:1px solid #eaeaea; color:#7a7a7a; font-size:14px;} .subject-list-banner {width:685px; height:40px; background-color:#f1f1f1; border-top:1px solid #eaeaea; color:#7a7a7a; font-size:14px;}
.subject-list-banner li {height:34px; line-height:34px; vertical-align:middle;} .subject-list-banner li {height:40px; line-height:40px; vertical-align:middle;}
.subject-list-name {width:200px; padding-left:10px; padding-right:10px;} .subject-list-name {width:260px; padding-left:10px; padding-right:10px;}
.subject-list-publisher {width:80px; text-align:center;} .subject-list-publisher {width:80px; text-align:center;}
.subject-list-date {width:70px; text-align:center;} .subject-list-date {width:70px; text-align:center;}
.subject-list-row {width:585px; height:30px; color:#7a7a7a; font-size:12px;} .subject-list-row {width:685px; height:40px; color:#7a7a7a; font-size:12px;}
.subject-list-row li {height:30px; line-height:30px; vertical-align:middle;} .subject-list-row li {height:40px; line-height:40px; vertical-align:middle;}
.subject-list-search {border:1px solid #dddddd; height:32px; width:250px;} .subject-list-search {border:1px solid #dddddd; height:32px; width:250px;}
.subject-list-info {width:385px; background-color:#f1f1f1; border:1px solid #dddddd; height:32px; line-height:32px; vertical-align:middle; text-align:center; color:#7a7a7a;} .subject-list-info {width:385px; background-color:#f1f1f1; border:1px solid #dddddd; height:32px; line-height:32px; vertical-align:middle; text-align:center; color:#7a7a7a;}
.subject-list-wrap {border:1px solid #dddddd; border-top:none; padding:10px; width:365px; height:460px; overflow-y:auto;} .subject-list-wrap {border:1px solid #dddddd; border-top:none; padding:10px; width:365px; height:460px; overflow-y:auto;}
.subject-content-wrapper {border:1px solid #dddddd; border-top:none; padding:10px; width:365px; height:430px; overflow-y:auto;} .subject-content-wrapper {border:1px solid #dddddd; border-top:none; padding:10px; width:265px; height:430px; overflow-y:auto;}
.subject-list-type {width:50px; text-align:center;} .subject-list-type {width:50px; text-align:center;}
.subject-list-count {width:60px; text-align:center;} .subject-list-count {width:60px; text-align:center;}
.subject-list-from {width:105px; text-align:center;} .subject-list-from {width:145px; text-align:center;}
/*视频播放默认图标*/ /*视频播放默认图标*/
.mediaIco{margin: 30px 0 30px 20px;} .mediaIco{margin: 30px 0 30px 20px;}
a.st_up{ display: block; width:8px; float:left; height:13px; background:url(../images/pic_up.png) 0 0 no-repeat; margin-top:5px; margin-left:3px;} a.st_up{ display: block; width:8px; float:left; height:13px; background:url(../images/pic_up.png) 0 0 no-repeat; margin-top:5px; margin-left:3px;}
a.st_down{ display: block; width:8px; float:left; height:13px; background:url(../images/pic_up.png) 0 -22px no-repeat; margin-top:5px; margin-left:3px;} a.st_down{ display: block; width:8px; float:left; height:13px; background:url(../images/pic_up.png) 0 -22px no-repeat; margin-top:5px; margin-left:3px;}
a.st_img { display:block;width:32px; height:32px; border:1px solid #CCC; padding:1px;} a.st_img { display:block;width:32px; height:32px; border:1px solid #CCC; padding:1px;}
a:hover.st_img { border:1px solid #1c9ec7; } a:hover.st_img { border:1px solid #1c9ec7; }

View File

@ -121,7 +121,7 @@ a.link_file_a2{ background:url(../images/pic_file.png) 0 -15px no-repeat; paddin
/*导入题库样式*/ /*导入题库样式*/
.popupWrap {border:3px solid #269ac9; padding:15px; background-color:#ffffff; position:relative; z-index:1000;} .popupWrap {border:3px solid #269ac9; padding:15px; background-color:#ffffff; position:relative; z-index:1000;}
.subjectList {width:585px;} .subjectList {width:585px;}
.subjectDetail {width:385px;} .subjectDetail {width:285px;}
a.subjectChoose {padding:8px 20px; background-color:#f1f1f1; color:#888888;} a.subjectChoose {padding:8px 20px; background-color:#f1f1f1; color:#888888;}
a.chooseActive {background-color:#269ac9; color:#ffffff;} a.chooseActive {background-color:#269ac9; color:#ffffff;}
.subjectBanner {width:585px; height:40px; background-color:#f1f1f1; border-top:1px solid #eaeaea; color:#7a7a7a; font-size:14px;} .subjectBanner {width:585px; height:40px; background-color:#f1f1f1; border-top:1px solid #eaeaea; color:#7a7a7a; font-size:14px;}
@ -132,7 +132,7 @@ a.chooseActive {background-color:#269ac9; color:#ffffff;}
.subjectRow {width:585px; height:40px; color:#7a7a7a; font-size:12px;} .subjectRow {width:585px; height:40px; color:#7a7a7a; font-size:12px;}
.subjectRow li {height:40px; line-height:40px; vertical-align:middle;} .subjectRow li {height:40px; line-height:40px; vertical-align:middle;}
.subjectSearch {border:1px solid #dddddd; height:32px; width:250px;} .subjectSearch {border:1px solid #dddddd; height:32px; width:250px;}
.subjectInfo {width:385px; background-color:#f1f1f1; border:1px solid #dddddd; height:32px; line-height:32px; vertical-align:middle; text-align:center; color:#7a7a7a;} .subjectInfo {width:285px; background-color:#f1f1f1; border:1px solid #dddddd; height:32px; line-height:32px; vertical-align:middle; text-align:center; color:#7a7a7a;}
.subjectWrap {border:1px solid #dddddd; border-top:none; padding:10px; width:365px; height:460px; overflow-y:auto;} .subjectWrap {border:1px solid #dddddd; border-top:none; padding:10px; width:365px; height:460px; overflow-y:auto;}
.subjectIntro {color:#585858; line-height:18px; font-size:12px;} .subjectIntro {color:#585858; line-height:18px; font-size:12px;}
.subjectContent {color:#888888; line-height:18px; font-size:12px;} .subjectContent {color:#888888; line-height:18px; font-size:12px;}

View File

@ -1182,7 +1182,7 @@ div.disable_link {background-color: #c1c1c1 !important;}
/*导入题库样式*/ /*导入题库样式*/
.popupWrap {border:3px solid #269ac9; padding:15px; background-color:#ffffff; position:relative; z-index:1000;} .popupWrap {border:3px solid #269ac9; padding:15px; background-color:#ffffff; position:relative; z-index:1000;}
.subjectList {width:585px;} .subjectList {width:585px;}
.subjectDetail {width:385px;} .subjectDetail {width:285px;}
a.subjectChoose {padding:8px 20px; background-color:#f1f1f1; color:#888888;} a.subjectChoose {padding:8px 20px; background-color:#f1f1f1; color:#888888;}
a.chooseActive {background-color:#269ac9; color:#ffffff;} a.chooseActive {background-color:#269ac9; color:#ffffff;}
.subjectBanner {width:585px; height:40px; background-color:#f1f1f1; border-top:1px solid #eaeaea; color:#7a7a7a; font-size:14px;} .subjectBanner {width:585px; height:40px; background-color:#f1f1f1; border-top:1px solid #eaeaea; color:#7a7a7a; font-size:14px;}
@ -1193,7 +1193,7 @@ a.chooseActive {background-color:#269ac9; color:#ffffff;}
.subjectRow {width:585px; height:40px; color:#7a7a7a; font-size:12px;} .subjectRow {width:585px; height:40px; color:#7a7a7a; font-size:12px;}
.subjectRow li {height:40px; line-height:40px; vertical-align:middle;} .subjectRow li {height:40px; line-height:40px; vertical-align:middle;}
.subjectSearch {border:1px solid #dddddd; height:32px; width:250px;} .subjectSearch {border:1px solid #dddddd; height:32px; width:250px;}
.subjectInfo {width:385px; background-color:#f1f1f1; border:1px solid #dddddd; height:32px; line-height:32px; vertical-align:middle; text-align:center; color:#7a7a7a;} .subjectInfo {width:285px; background-color:#f1f1f1; border:1px solid #dddddd; height:32px; line-height:32px; vertical-align:middle; text-align:center; color:#7a7a7a;}
.subjectWrap {border:1px solid #dddddd; border-top:none; padding:10px; width:365px; height:460px; overflow-y:auto;} .subjectWrap {border:1px solid #dddddd; border-top:none; padding:10px; width:365px; height:460px; overflow-y:auto;}
.subjectIntro {color:#585858; line-height:18px; font-size:12px;} .subjectIntro {color:#585858; line-height:18px; font-size:12px;}
.subjectContent {color:#888888; line-height:18px; font-size:12px;} .subjectContent {color:#888888; line-height:18px; font-size:12px;}

View File

@ -165,7 +165,7 @@ h4{ font-size:14px; color:#3b3b3b;}
.w543{ width:543px;} .w543{ width:543px;}
.w557{ width:557px;} .w557{ width:557px;}
.w576{ width:576px;} .w576{ width:576px;}
.w583{ width:583px;} .w683{ width:683px;}
.w350{ width:350px;} .w350{ width:350px;}
.w610{ width:610px;} .w610{ width:610px;}
.w600{ width:600px !important;} .w600{ width:600px !important;}
@ -1034,26 +1034,26 @@ a:hover.userCancel{border:1px solid #888888; }
/*导入题库样式*/ /*导入题库样式*/
.popup-wrapper {border:3px solid #269ac9; padding:15px; background-color:#ffffff; position:relative; z-index:1000;} .popup-wrapper {border:3px solid #269ac9; padding:15px; background-color:#ffffff; position:relative; z-index:1000;}
.subject-list {width:585px;} .subject-list {width:685px;}
.subject-detail {width:385px;} .subject-detail {width:285px;}
a.subject-choose {padding:8px 20px; background-color:#f1f1f1; color:#888888;} a.subject-choose {padding:8px 20px; background-color:#f1f1f1; color:#888888;}
a.choose-active {background-color:#269ac9; color:#ffffff;} a.choose-active {background-color:#269ac9; color:#ffffff;}
.subject-pop-banner {width:585px; height:40px; background-color:#f1f1f1; border-top:1px solid #eaeaea; color:#7a7a7a; font-size:14px;} .subject-pop-banner {width:685px; height:40px; background-color:#f1f1f1; border-top:1px solid #eaeaea; color:#7a7a7a; font-size:14px;}
.subject-pop-banner li {height:40px; line-height:40px; vertical-align:middle;} .subject-pop-banner li {height:40px; line-height:40px; vertical-align:middle;}
.subject-pop-name {width:200px; padding-left:10px; padding-right:10px;} .subject-pop-name {width:260px; padding-left:10px; padding-right:10px;}
.subject-pop-publisher {width:80px; text-align:center;} .subject-pop-publisher {width:80px; text-align:center;}
.subject-pop-date {width:75px; text-align:center;} .subject-pop-date {width:75px; text-align:center;}
.subject-pop-row {width:585px; height:30px; color:#7a7a7a; font-size:12px;} .subject-pop-row {width:685px; height:30px; color:#7a7a7a; font-size:12px;}
.subject-pop-row li {height:30px; line-height:30px; vertical-align:middle;} .subject-pop-row li {height:30px; line-height:30px; vertical-align:middle;}
.subject-pop-search {border:1px solid #dddddd; height:32px; width:250px;} .subject-pop-search {border:1px solid #dddddd; height:32px; width:250px;}
.subject-pop-info {width:385px; background-color:#f1f1f1; border:1px solid #dddddd; height:32px; line-height:32px; vertical-align:middle; text-align:center; color:#7a7a7a;} .subject-pop-info {width:285px; background-color:#f1f1f1; border:1px solid #dddddd; height:32px; line-height:32px; vertical-align:middle; text-align:center; color:#7a7a7a;}
.subject-pop-wrap {border:1px solid #dddddd; border-top:none; padding:10px; width:365px; height:475px; overflow-y:auto;} .subject-pop-wrap {border:1px solid #dddddd; border-top:none; padding:10px; width:265px; height:475px; overflow-y:auto;}
.subject-pop-intro {color:#585858; line-height:18px; font-size:12px;} .subject-pop-intro {color:#585858; line-height:18px; font-size:12px;}
.subject-pop-content {color:#888888; line-height:18px; font-size:12px;} .subject-pop-content {color:#888888; line-height:18px; font-size:12px;}
.popup-close {background:url(../images/resource_icon_list.png) 0px -40px no-repeat; width:20px; height:20px; display:inline-block; position: absolute; z-index: 1000; right:10px; top:5px;} .popup-close {background:url(../images/resource_icon_list.png) 0px -40px no-repeat; width:20px; height:20px; display:inline-block; position: absolute; z-index: 1000; right:10px; top:5px;}
.subject-pop-type {width:50px; text-align:center;} .subject-pop-type {width:50px; text-align:center;}
.subject-pop-count {width:60px; text-align:center;} .subject-pop-count {width:60px; text-align:center;}
.subject-pop-from {width:100px; text-align:center;} .subject-pop-from {width:140px; text-align:center;}
.subjectContent p,.subjectContent div,.subjectContent em, .subjectContent span{text-align: justify; text-justify:inter-ideograph; word-break: normal !important; word-wrap: break-word !important; line-height: 18px !important; color:#888888 !important; font-size:12px !important;} .subjectContent p,.subjectContent div,.subjectContent em, .subjectContent span{text-align: justify; text-justify:inter-ideograph; word-break: normal !important; word-wrap: break-word !important; line-height: 18px !important; color:#888888 !important; font-size:12px !important;}
.whiteSettingIcon {background:url(../images/hwork_icon.png) -5px -302px no-repeat; width:20px; height:20px;} .whiteSettingIcon {background:url(../images/hwork_icon.png) -5px -302px no-repeat; width:20px; height:20px;}
@ -1086,7 +1086,7 @@ a.resource-tab-active {color:#fff; background-color:#269ac9; border-bottom:1px s
/*导入资源样式*/ /*导入资源样式*/
.popupWrap {border:3px solid #269ac9; padding:15px; background-color:#ffffff; position:relative; z-index:1000;} .popupWrap {border:3px solid #269ac9; padding:15px; background-color:#ffffff; position:relative; z-index:1000;}
.resoure-list {width:705px;} .resoure-list {width:705px;}
.subjectDetail {width:385px;} .subjectDetail {width:285px;}
.resource-pop-banner {width:705px; height:40px; background-color:#f1f1f1; border-top:1px solid #eaeaea; color:#7a7a7a; font-size:14px;} .resource-pop-banner {width:705px; height:40px; background-color:#f1f1f1; border-top:1px solid #eaeaea; color:#7a7a7a; font-size:14px;}
.resource-pop-banner li {height:40px; line-height:40px; vertical-align:middle;} .resource-pop-banner li {height:40px; line-height:40px; vertical-align:middle;}
.resource-pop-name {width:270px; padding-left:10px; padding-right:10px;} .resource-pop-name {width:270px; padding-left:10px; padding-right:10px;}
@ -1095,7 +1095,7 @@ a.resource-tab-active {color:#fff; background-color:#269ac9; border-bottom:1px s
.resource-pop-row {width:705px; height:40px; color:#7a7a7a; font-size:12px;} .resource-pop-row {width:705px; height:40px; color:#7a7a7a; font-size:12px;}
.resource-pop-row li {height:40px; line-height:40px; vertical-align:middle;} .resource-pop-row li {height:40px; line-height:40px; vertical-align:middle;}
.subjectSearch {border:1px solid #dddddd; height:32px; width:250px;} .subjectSearch {border:1px solid #dddddd; height:32px; width:250px;}
.subjectInfo {width:385px; background-color:#f1f1f1; border:1px solid #dddddd; height:32px; line-height:32px; vertical-align:middle; text-align:center; color:#7a7a7a;} .subjectInfo {width:285px; background-color:#f1f1f1; border:1px solid #dddddd; height:32px; line-height:32px; vertical-align:middle; text-align:center; color:#7a7a7a;}
.subjectWrap {border:1px solid #dddddd; border-top:none; padding:10px; width:365px; height:460px; overflow-y:auto;} .subjectWrap {border:1px solid #dddddd; border-top:none; padding:10px; width:365px; height:460px; overflow-y:auto;}
.subjectIntro {color:#585858; line-height:18px; font-size:12px;} .subjectIntro {color:#585858; line-height:18px; font-size:12px;}
.subjectContent {color:#888888; line-height:18px; font-size:12px;} .subjectContent {color:#888888; line-height:18px; font-size:12px;}
@ -1136,4 +1136,4 @@ a.program-btn{background: url(../images/homepage_icon.png) -86px -393px no-repea
.mediaIco{margin: 30px 0 30px 20px;width: 200px;} .mediaIco{margin: 30px 0 30px 20px;width: 200px;}
/*排序样式*/ /*排序样式*/
a.st_up{ display: block; width:8px; float:left; height:13px; background:url(../images/pic_up.png) 0 0 no-repeat; margin-top:5px; margin-left:3px;} a.st_up{ display: block; width:8px; float:left; height:13px; background:url(../images/pic_up.png) 0 0 no-repeat; margin-top:5px; margin-left:3px;}
a.st_down{ display: block; width:8px; float:left; height:13px; background:url(../images/pic_up.png) 0 -22px no-repeat; margin-top:5px; margin-left:3px;} a.st_down{ display: block; width:8px; float:left; height:13px; background:url(../images/pic_up.png) 0 -22px no-repeat; margin-top:5px; margin-left:3px;}

File diff suppressed because it is too large Load Diff