Merge branch 'develop' into ouyangxuhua
Conflicts: app/views/users/_user_message_course.html.erb
This commit is contained in:
commit
093c777b23
|
@ -572,6 +572,15 @@ class AttachmentsController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
#找到文件的所有的历史版本及当前版本
|
||||
def attachment_history_download
|
||||
@attachment = Attachment.find(params[:id])
|
||||
@attachment_histories = @attachment.attachment_histories
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
def find_project
|
||||
@attachment = Attachment.find(params[:id])
|
||||
|
|
|
@ -902,10 +902,7 @@ class CoursesController < ApplicationController
|
|||
end
|
||||
|
||||
def feedback
|
||||
@course.journals_for_messages.each do |messages|
|
||||
query = messages.course_messages.where("user_id = ?", User.current.id)
|
||||
query.update_all(:viewed => true);
|
||||
end
|
||||
CourseMessage.where("user_id = ? and course_id = ?", User.current, @course.id).update_all(:viewed => true)
|
||||
|
||||
if (User.current.admin? || @course.is_public == 1 || (@course.is_public == 0 && User.current.member_of_course?(@course)))
|
||||
page = params[:page]
|
||||
|
|
|
@ -1,378 +1,380 @@
|
|||
class HomeworkCommonController < ApplicationController
|
||||
require 'net/http'
|
||||
require 'json'
|
||||
require "base64"
|
||||
layout "base_courses"
|
||||
|
||||
include StudentWorkHelper
|
||||
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 :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]
|
||||
|
||||
def index
|
||||
@new_homework = HomeworkCommon.new
|
||||
@new_homework.homework_detail_manual = HomeworkDetailManual.new
|
||||
@new_homework.course = @course
|
||||
@page = params[:page] ? params[:page].to_i + 1 : 0
|
||||
@is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,@course))
|
||||
if @is_teacher
|
||||
@homeworks = @course.homework_commons.order("updated_at desc").limit(10).offset(@page * 10)
|
||||
else
|
||||
@homeworks = @course.homework_commons.where("publish_time <= '#{Date.today}'").order("updated_at desc").limit(10).offset(@page * 10)
|
||||
end
|
||||
@is_student = User.current.logged? && (User.current.admin? || (User.current.member_of_course?(@course) && !@is_teacher))
|
||||
@is_new = params[:is_new]
|
||||
|
||||
#设置at已读
|
||||
@homeworks.each do |homework|
|
||||
homework.journals_for_messages.each do |j|
|
||||
User.current.at_messages.unviewed('JournalsForMessage', j.id).each {|x| x.viewed!}
|
||||
end
|
||||
end
|
||||
|
||||
respond_to do |format|
|
||||
format.js
|
||||
format.html
|
||||
end
|
||||
end
|
||||
|
||||
#新建作业,在个人作业列表创建作业
|
||||
def new
|
||||
render_404
|
||||
end
|
||||
|
||||
#新建作业,在个人作业列表创建作业
|
||||
def create
|
||||
redirect_to user_homeworks_user_path(User.current.id)
|
||||
end
|
||||
|
||||
def edit
|
||||
@user = User.current
|
||||
@is_in_course = params[:is_in_course].to_i
|
||||
@course_activity = params[:course_activity].to_i
|
||||
respond_to do |format|
|
||||
format.html{render :layout => 'new_base_user'}
|
||||
end
|
||||
end
|
||||
|
||||
def update
|
||||
if params[:homework_common]
|
||||
@homework.name = params[:homework_common][:name]
|
||||
@homework.description = params[:homework_common][:description]
|
||||
if params[:homework_common][:publish_time] == ""
|
||||
@homework.publish_time = Date.today
|
||||
else
|
||||
@homework.publish_time = params[:homework_common][:publish_time]
|
||||
end
|
||||
@homework.end_time = params[:homework_common][:end_time] || Time.now
|
||||
@homework.course_id = params[:course_id]
|
||||
@homework.anonymous_comment = params[:homework_common][:anonymous_comment] ? params[:homework_common][:anonymous_comment] : 0
|
||||
|
||||
homework_detail_manual = @homework.homework_detail_manual || HomeworkDetailManual.new
|
||||
if @homework.publish_time <= Date.today && homework_detail_manual.comment_status == 0
|
||||
homework_detail_manual.comment_status = 1
|
||||
end
|
||||
homework_detail_manual.evaluation_start = params[:evaluation_start].blank? ? @homework.end_time + 7 : params[:evaluation_start]
|
||||
homework_detail_manual.evaluation_end = params[:evaluation_end].blank? ? homework_detail_manual.evaluation_start + 7 : params[:evaluation_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
|
||||
@homework_detail_programing.language = params[:language_type].to_i
|
||||
|
||||
@homework.homework_tests.delete_all
|
||||
inputs = params[:program][:input]
|
||||
if Array === inputs
|
||||
inputs.each_with_index do |val, i|
|
||||
@homework.homework_tests << HomeworkTest.new(
|
||||
input: val,
|
||||
output: params[:program][:output][i]
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
#分组作业
|
||||
if @homework.homework_type == 3
|
||||
@homework.homework_detail_group ||= HomeworkDetailGroup.new
|
||||
@homework_detail_group = @homework.homework_detail_group
|
||||
@homework_detail_group.min_num = params[:min_num].to_i
|
||||
@homework_detail_group.max_num = params[:max_num].to_i
|
||||
@homework_detail_group.base_on_project = params[:base_on_project].to_i
|
||||
end
|
||||
|
||||
if @homework.save
|
||||
@homework_detail_manual.save if @homework_detail_manual
|
||||
@homework_detail_programing.save if @homework_detail_programing
|
||||
@homework_detail_group.save if @homework_detail_group
|
||||
|
||||
if params[:is_in_course] == "1"
|
||||
redirect_to homework_common_index_path(:course => @course.id)
|
||||
elsif params[:is_in_course] == "0"
|
||||
redirect_to user_homeworks_user_path(User.current.id)
|
||||
elsif params[:is_in_course] == "-1" && params[:course_activity] == "0"
|
||||
redirect_to user_path(User.current.id)
|
||||
elsif params[:is_in_course] == "-1" && params[:course_activity] == "1"
|
||||
redirect_to course_path(@course.id)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def destroy
|
||||
if @homework.destroy
|
||||
respond_to do |format|
|
||||
format.html {
|
||||
if params[:is_in_course] == "1"
|
||||
redirect_to homework_common_index_path(:course => @course.id)
|
||||
elsif params[:is_in_course] == "0"
|
||||
redirect_to user_homeworks_user_path(User.current.id)
|
||||
elsif params[:is_in_course] == "-1" && params[:course_activity] == "0"
|
||||
redirect_to user_path(User.current.id)
|
||||
elsif params[:is_in_course] == "-1" && params[:course_activity] == "1"
|
||||
redirect_to course_path(@course.id)
|
||||
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 = 5 and return if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d")
|
||||
if @homework_detail_manual.comment_status == 1
|
||||
student_works = @homework.student_works
|
||||
if student_works && student_works.size >= 2
|
||||
if @homework.homework_type == 3
|
||||
student_work_projects = @homework.student_work_projects.where("student_work_id is not null")
|
||||
student_work_projects.each_with_index do |pro_work, pro_index|
|
||||
n = @homework_detail_manual.evaluation_num
|
||||
n = n < student_works.size ? n : student_works.size - 1
|
||||
work_index = -1
|
||||
student_works.each_with_index do |stu_work, stu_index|
|
||||
if stu_work.id.to_i == pro_work.student_work_id.to_i
|
||||
work_index = stu_index
|
||||
end
|
||||
end
|
||||
assigned_homeworks = get_assigned_homeworks(student_works, n, work_index)
|
||||
assigned_homeworks.each do |h|
|
||||
student_works_evaluation_distributions = StudentWorksEvaluationDistribution.new(user_id: pro_work.user_id, student_work_id: h.id)
|
||||
student_works_evaluation_distributions.save
|
||||
end
|
||||
end
|
||||
else
|
||||
student_works.each_with_index do |work, index|
|
||||
user = work.user
|
||||
n = @homework_detail_manual.evaluation_num
|
||||
n = n < student_works.size ? n : student_works.size - 1
|
||||
assigned_homeworks = get_assigned_homeworks(student_works, n, index)
|
||||
assigned_homeworks.each do |h|
|
||||
student_works_evaluation_distributions = StudentWorksEvaluationDistribution.new(user_id: user.id, student_work_id: h.id)
|
||||
student_works_evaluation_distributions.save
|
||||
end
|
||||
end
|
||||
end
|
||||
@homework_detail_manual.update_column('comment_status', 2)
|
||||
@homework_detail_manual.update_column('evaluation_start', Date.today)
|
||||
@statue = 1
|
||||
# 匿评开启消息邮件通知
|
||||
send_message_anonymous_comment(@homework, m_status = 2)
|
||||
Mailer.send_mail_anonymous_comment_open(@homework).deliver
|
||||
else
|
||||
@statue = 2
|
||||
|
||||
end
|
||||
else
|
||||
@statue = 3
|
||||
end
|
||||
@user_activity_id = params[:user_activity_id].to_i
|
||||
@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)
|
||||
#计算缺评扣分
|
||||
work_ids = "(" + @homework.student_works.map(&:id).join(",") + ")"
|
||||
@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
|
||||
student_work.absence_penalty = absence_penalty_count > 0 ? absence_penalty_count * @homework_detail_manual.absence_penalty : 0
|
||||
student_work.save
|
||||
end
|
||||
# 匿评关闭消息邮件通知
|
||||
send_message_anonymous_comment(@homework, m_status = 3)
|
||||
Mailer.send_mail_anonymous_comment_close(@homework).deliver
|
||||
@user_activity_id = params[:user_activity_id].to_i
|
||||
@is_in_course = params[:is_in_course].to_i
|
||||
@course_activity = params[:course_activity].to_i
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
# 开启/关闭匿评消息通知
|
||||
def send_message_anonymous_comment(homework, m_status )
|
||||
# status 标记匿评状态 1为关闭 0为开启
|
||||
course = homework.course
|
||||
course.members.each do |m|
|
||||
@homework.course_messages << CourseMessage.new(:user_id => m.user_id, :course_id => course.id, :viewed => false, :status => m_status)
|
||||
end
|
||||
end
|
||||
#提示
|
||||
def alert_anonymous_comment
|
||||
@cur_size = 0
|
||||
@totle_size = 0
|
||||
if @homework_detail_manual.comment_status == 1
|
||||
@totle_size = @course.student.count
|
||||
@cur_size = @homework.student_works.size
|
||||
elsif @homework_detail_manual.comment_status == 2
|
||||
@homework.student_works.map { |work| @totle_size += work.student_works_evaluation_distributions.count}
|
||||
@cur_size = 0
|
||||
@homework.student_works.map { |work| @cur_size += work.student_works_scores.where(:reviewer_role => 3).count}
|
||||
end
|
||||
@percent = format("%.2f",(@cur_size.to_f / ( @totle_size == 0 ? 1 : @totle_size)) * 100)
|
||||
@user_activity_id = params[:user_activity_id].to_i
|
||||
@is_in_course = params[:is_in_course].to_i
|
||||
@course_activity = params[:course_activity].to_i
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
def alert_forbidden_anonymous_comment
|
||||
if params[:user_activity_id]
|
||||
@user_activity_id = params[:user_activity_id]
|
||||
else
|
||||
@user_activity_id = -1
|
||||
end
|
||||
@is_in_course = params[:is_in_course] if params[:is_in_course]
|
||||
@course_activity = params[:course_activity] if params[:course_Activity]
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
def open_student_works
|
||||
if @homework.is_open == 0
|
||||
@homework.update_attribute(:is_open, 1)
|
||||
else
|
||||
@homework.update_attribute(:is_open, 0)
|
||||
end
|
||||
@user_activity_id = params[:user_activity_id]
|
||||
@is_in_course = params[:is_in_course] if params[:is_in_course]
|
||||
@course_activity = params[:course_activity] if params[:course_Activity]
|
||||
end
|
||||
|
||||
def alert_open_student_works
|
||||
if params[:user_activity_id]
|
||||
@user_activity_id = params[:user_activity_id]
|
||||
else
|
||||
@user_activity_id = -1
|
||||
end
|
||||
@is_in_course = params[:is_in_course] if params[:is_in_course]
|
||||
@course_activity = params[:course_activity] if params[:course_Activity]
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
def programing_test
|
||||
test = {language:params[:language],src:Base64.encode64(params[:src]),input:[params[:input]],output:[params[:output]]}
|
||||
@index = params[:index]
|
||||
uri = URI('http://192.168.80.21:8080/api/realtime.json')
|
||||
body = test.to_json
|
||||
res = Net::HTTP.new(uri.host, uri.port).start do |client|
|
||||
request = Net::HTTP::Post.new(uri.path)
|
||||
request.body = body
|
||||
request["Content-Type"] = "application/json"
|
||||
client.request(request)
|
||||
end
|
||||
result = JSON.parse(res.body)
|
||||
@err_msg = result["compile_error_msg"]
|
||||
result["results"].each do |re|
|
||||
@result = re["status"]
|
||||
end
|
||||
end
|
||||
|
||||
#启动匿评参数设置
|
||||
def start_evaluation_set
|
||||
if params[:user_activity_id]
|
||||
@user_activity_id = params[:user_activity_id]
|
||||
else
|
||||
@user_activity_id = -1
|
||||
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
|
||||
@homework_detail_manual.evaluation_start = params[:evaluation_start]
|
||||
end
|
||||
|
||||
unless @homework_detail_manual.evaluation_end.to_s == params[:evaluation_end].to_s
|
||||
@homework_detail_manual.evaluation_end = params[:evaluation_end]
|
||||
end
|
||||
|
||||
@homework_detail_manual.evaluation_num = params[:evaluation_num]
|
||||
@homework_detail_manual.save
|
||||
@user_activity_id = params[:user_activity_id].to_i
|
||||
@is_in_course = params[:is_in_course].to_i
|
||||
@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]
|
||||
else
|
||||
@user_activity_id = -1
|
||||
end
|
||||
@is_in_course = params[:is_in_course]
|
||||
@course_activity = params[:course_activity].to_i
|
||||
end
|
||||
|
||||
private
|
||||
#获取课程
|
||||
def find_course
|
||||
@course = Course.find params[:course]
|
||||
rescue
|
||||
render_404
|
||||
end
|
||||
#获取作业
|
||||
def find_homework
|
||||
@homework = HomeworkCommon.find params[:id]
|
||||
@homework_detail_manual = @homework.homework_detail_manual
|
||||
@homework_detail_programing = @homework.homework_detail_programing
|
||||
@homework_detail_group = @homework.homework_detail_group
|
||||
@course = @homework.course
|
||||
rescue
|
||||
render_404
|
||||
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 get_assigned_homeworks(student_works, n, index)
|
||||
student_works += student_works
|
||||
student_works[index + 1 .. index + n]
|
||||
end
|
||||
end
|
||||
class HomeworkCommonController < ApplicationController
|
||||
require 'net/http'
|
||||
require 'json'
|
||||
require "base64"
|
||||
layout "base_courses"
|
||||
|
||||
include StudentWorkHelper
|
||||
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 :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]
|
||||
|
||||
def index
|
||||
@new_homework = HomeworkCommon.new
|
||||
@new_homework.homework_detail_manual = HomeworkDetailManual.new
|
||||
@new_homework.course = @course
|
||||
@page = params[:page] ? params[:page].to_i + 1 : 0
|
||||
@is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,@course))
|
||||
if @is_teacher
|
||||
@homeworks = @course.homework_commons.order("updated_at desc").limit(10).offset(@page * 10)
|
||||
else
|
||||
@homeworks = @course.homework_commons.where("publish_time <= '#{Date.today}'").order("updated_at desc").limit(10).offset(@page * 10)
|
||||
end
|
||||
@is_student = User.current.logged? && (User.current.admin? || (User.current.member_of_course?(@course) && !@is_teacher))
|
||||
@is_new = params[:is_new]
|
||||
|
||||
#设置at已读
|
||||
@homeworks.each do |homework|
|
||||
homework.journals_for_messages.each do |j|
|
||||
User.current.at_messages.unviewed('JournalsForMessage', j.id).each {|x| x.viewed!}
|
||||
end
|
||||
end
|
||||
|
||||
respond_to do |format|
|
||||
format.js
|
||||
format.html
|
||||
end
|
||||
end
|
||||
|
||||
#新建作业,在个人作业列表创建作业
|
||||
def new
|
||||
render_404
|
||||
end
|
||||
|
||||
#新建作业,在个人作业列表创建作业
|
||||
def create
|
||||
redirect_to user_homeworks_user_path(User.current.id)
|
||||
end
|
||||
|
||||
def edit
|
||||
@user = User.current
|
||||
@is_in_course = params[:is_in_course].to_i
|
||||
@course_activity = params[:course_activity].to_i
|
||||
respond_to do |format|
|
||||
format.html{render :layout => 'new_base_user'}
|
||||
end
|
||||
end
|
||||
|
||||
def update
|
||||
if params[:homework_common]
|
||||
@homework.name = params[:homework_common][:name]
|
||||
@homework.description = params[:homework_common][:description]
|
||||
if params[:homework_common][:publish_time] == ""
|
||||
@homework.publish_time = Date.today
|
||||
else
|
||||
@homework.publish_time = params[:homework_common][:publish_time]
|
||||
end
|
||||
@homework.end_time = params[:homework_common][:end_time] || Time.now
|
||||
@homework.course_id = params[:course_id]
|
||||
@homework.anonymous_comment = params[:homework_common][:anonymous_comment] ? params[:homework_common][:anonymous_comment] : 0
|
||||
|
||||
homework_detail_manual = @homework.homework_detail_manual || HomeworkDetailManual.new
|
||||
if @homework.publish_time <= Date.today && homework_detail_manual.comment_status == 0
|
||||
homework_detail_manual.comment_status = 1
|
||||
end
|
||||
eval_start = homework_detail_manual.evaluation_start
|
||||
if eval_start <= @homework.end_time && homework_detail_manual.comment_status <= 1
|
||||
homework_detail_manual.evaluation_start = @homework.end_time + 7
|
||||
homework_detail_manual.evaluation_end = homework_detail_manual.evaluation_start + 7
|
||||
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
|
||||
@homework_detail_programing.language = params[:language_type].to_i
|
||||
|
||||
@homework.homework_tests.delete_all
|
||||
inputs = params[:program][:input]
|
||||
if Array === inputs
|
||||
inputs.each_with_index do |val, i|
|
||||
@homework.homework_tests << HomeworkTest.new(
|
||||
input: val,
|
||||
output: params[:program][:output][i]
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
#分组作业
|
||||
if @homework.homework_type == 3
|
||||
@homework.homework_detail_group ||= HomeworkDetailGroup.new
|
||||
@homework_detail_group = @homework.homework_detail_group
|
||||
@homework_detail_group.min_num = params[:min_num].to_i
|
||||
@homework_detail_group.max_num = params[:max_num].to_i
|
||||
@homework_detail_group.base_on_project = params[:base_on_project].to_i
|
||||
end
|
||||
|
||||
if @homework.save
|
||||
@homework_detail_manual.save if @homework_detail_manual
|
||||
@homework_detail_programing.save if @homework_detail_programing
|
||||
@homework_detail_group.save if @homework_detail_group
|
||||
|
||||
if params[:is_in_course] == "1"
|
||||
redirect_to homework_common_index_path(:course => @course.id)
|
||||
elsif params[:is_in_course] == "0"
|
||||
redirect_to user_homeworks_user_path(User.current.id)
|
||||
elsif params[:is_in_course] == "-1" && params[:course_activity] == "0"
|
||||
redirect_to user_path(User.current.id)
|
||||
elsif params[:is_in_course] == "-1" && params[:course_activity] == "1"
|
||||
redirect_to course_path(@course.id)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def destroy
|
||||
if @homework.destroy
|
||||
respond_to do |format|
|
||||
format.html {
|
||||
if params[:is_in_course] == "1"
|
||||
redirect_to homework_common_index_path(:course => @course.id)
|
||||
elsif params[:is_in_course] == "0"
|
||||
redirect_to user_homeworks_user_path(User.current.id)
|
||||
elsif params[:is_in_course] == "-1" && params[:course_activity] == "0"
|
||||
redirect_to user_path(User.current.id)
|
||||
elsif params[:is_in_course] == "-1" && params[:course_activity] == "1"
|
||||
redirect_to course_path(@course.id)
|
||||
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 = 5 and return if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d")
|
||||
if @homework_detail_manual.comment_status == 1
|
||||
student_works = @homework.student_works
|
||||
if student_works && student_works.size >= 2
|
||||
if @homework.homework_type == 3
|
||||
student_work_projects = @homework.student_work_projects.where("student_work_id is not null")
|
||||
student_work_projects.each_with_index do |pro_work, pro_index|
|
||||
n = @homework_detail_manual.evaluation_num
|
||||
n = n < student_works.size ? n : student_works.size - 1
|
||||
work_index = -1
|
||||
student_works.each_with_index do |stu_work, stu_index|
|
||||
if stu_work.id.to_i == pro_work.student_work_id.to_i
|
||||
work_index = stu_index
|
||||
end
|
||||
end
|
||||
assigned_homeworks = get_assigned_homeworks(student_works, n, work_index)
|
||||
assigned_homeworks.each do |h|
|
||||
student_works_evaluation_distributions = StudentWorksEvaluationDistribution.new(user_id: pro_work.user_id, student_work_id: h.id)
|
||||
student_works_evaluation_distributions.save
|
||||
end
|
||||
end
|
||||
else
|
||||
student_works.each_with_index do |work, index|
|
||||
user = work.user
|
||||
n = @homework_detail_manual.evaluation_num
|
||||
n = n < student_works.size ? n : student_works.size - 1
|
||||
assigned_homeworks = get_assigned_homeworks(student_works, n, index)
|
||||
assigned_homeworks.each do |h|
|
||||
student_works_evaluation_distributions = StudentWorksEvaluationDistribution.new(user_id: user.id, student_work_id: h.id)
|
||||
student_works_evaluation_distributions.save
|
||||
end
|
||||
end
|
||||
end
|
||||
@homework_detail_manual.update_column('comment_status', 2)
|
||||
@homework_detail_manual.update_column('evaluation_start', Date.today)
|
||||
@statue = 1
|
||||
# 匿评开启消息邮件通知
|
||||
send_message_anonymous_comment(@homework, m_status = 2)
|
||||
Mailer.send_mail_anonymous_comment_open(@homework).deliver
|
||||
else
|
||||
@statue = 2
|
||||
|
||||
end
|
||||
else
|
||||
@statue = 3
|
||||
end
|
||||
@user_activity_id = params[:user_activity_id].to_i
|
||||
@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)
|
||||
#计算缺评扣分
|
||||
work_ids = "(" + @homework.student_works.map(&:id).join(",") + ")"
|
||||
@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
|
||||
student_work.absence_penalty = absence_penalty_count > 0 ? absence_penalty_count * @homework_detail_manual.absence_penalty : 0
|
||||
student_work.save
|
||||
end
|
||||
# 匿评关闭消息邮件通知
|
||||
send_message_anonymous_comment(@homework, m_status = 3)
|
||||
Mailer.send_mail_anonymous_comment_close(@homework).deliver
|
||||
@user_activity_id = params[:user_activity_id].to_i
|
||||
@is_in_course = params[:is_in_course].to_i
|
||||
@course_activity = params[:course_activity].to_i
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
# 开启/关闭匿评消息通知
|
||||
def send_message_anonymous_comment(homework, m_status )
|
||||
# status 标记匿评状态 1为关闭 0为开启
|
||||
course = homework.course
|
||||
course.members.each do |m|
|
||||
@homework.course_messages << CourseMessage.new(:user_id => m.user_id, :course_id => course.id, :viewed => false, :status => m_status)
|
||||
end
|
||||
end
|
||||
#提示
|
||||
def alert_anonymous_comment
|
||||
@cur_size = 0
|
||||
@totle_size = 0
|
||||
if @homework_detail_manual.comment_status == 1
|
||||
@totle_size = @course.student.count
|
||||
@cur_size = @homework.student_works.size
|
||||
elsif @homework_detail_manual.comment_status == 2
|
||||
@homework.student_works.map { |work| @totle_size += work.student_works_evaluation_distributions.count}
|
||||
@cur_size = 0
|
||||
@homework.student_works.map { |work| @cur_size += work.student_works_scores.where(:reviewer_role => 3).count}
|
||||
end
|
||||
@percent = format("%.2f",(@cur_size.to_f / ( @totle_size == 0 ? 1 : @totle_size)) * 100)
|
||||
@user_activity_id = params[:user_activity_id].to_i
|
||||
@is_in_course = params[:is_in_course].to_i
|
||||
@course_activity = params[:course_activity].to_i
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
def alert_forbidden_anonymous_comment
|
||||
if params[:user_activity_id]
|
||||
@user_activity_id = params[:user_activity_id]
|
||||
else
|
||||
@user_activity_id = -1
|
||||
end
|
||||
@is_in_course = params[:is_in_course] if params[:is_in_course]
|
||||
@course_activity = params[:course_activity] if params[:course_Activity]
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
def open_student_works
|
||||
if @homework.is_open == 0
|
||||
@homework.update_attribute(:is_open, 1)
|
||||
else
|
||||
@homework.update_attribute(:is_open, 0)
|
||||
end
|
||||
@user_activity_id = params[:user_activity_id]
|
||||
@is_in_course = params[:is_in_course] if params[:is_in_course]
|
||||
@course_activity = params[:course_activity] if params[:course_Activity]
|
||||
end
|
||||
|
||||
def alert_open_student_works
|
||||
if params[:user_activity_id]
|
||||
@user_activity_id = params[:user_activity_id]
|
||||
else
|
||||
@user_activity_id = -1
|
||||
end
|
||||
@is_in_course = params[:is_in_course] if params[:is_in_course]
|
||||
@course_activity = params[:course_activity] if params[:course_Activity]
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
def programing_test
|
||||
test = {language:params[:language],src:Base64.encode64(params[:src]),input:[params[:input]],output:[params[:output]]}
|
||||
@index = params[:index]
|
||||
uri = URI('http://192.168.80.21:8080/api/realtime.json')
|
||||
body = test.to_json
|
||||
res = Net::HTTP.new(uri.host, uri.port).start do |client|
|
||||
request = Net::HTTP::Post.new(uri.path)
|
||||
request.body = body
|
||||
request["Content-Type"] = "application/json"
|
||||
client.request(request)
|
||||
end
|
||||
result = JSON.parse(res.body)
|
||||
@err_msg = result["compile_error_msg"]
|
||||
result["results"].each do |re|
|
||||
@result = re["status"]
|
||||
end
|
||||
end
|
||||
|
||||
#启动匿评参数设置
|
||||
def start_evaluation_set
|
||||
if params[:user_activity_id]
|
||||
@user_activity_id = params[:user_activity_id]
|
||||
else
|
||||
@user_activity_id = -1
|
||||
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
|
||||
@homework_detail_manual.evaluation_start = params[:evaluation_start]
|
||||
end
|
||||
|
||||
unless @homework_detail_manual.evaluation_end.to_s == params[:evaluation_end].to_s
|
||||
@homework_detail_manual.evaluation_end = params[:evaluation_end]
|
||||
end
|
||||
|
||||
@homework_detail_manual.evaluation_num = params[:evaluation_num]
|
||||
@homework_detail_manual.save
|
||||
@user_activity_id = params[:user_activity_id].to_i
|
||||
@is_in_course = params[:is_in_course].to_i
|
||||
@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]
|
||||
else
|
||||
@user_activity_id = -1
|
||||
end
|
||||
@is_in_course = params[:is_in_course]
|
||||
@course_activity = params[:course_activity].to_i
|
||||
end
|
||||
|
||||
private
|
||||
#获取课程
|
||||
def find_course
|
||||
@course = Course.find params[:course]
|
||||
rescue
|
||||
render_404
|
||||
end
|
||||
#获取作业
|
||||
def find_homework
|
||||
@homework = HomeworkCommon.find params[:id]
|
||||
@homework_detail_manual = @homework.homework_detail_manual
|
||||
@homework_detail_programing = @homework.homework_detail_programing
|
||||
@homework_detail_group = @homework.homework_detail_group
|
||||
@course = @homework.course
|
||||
rescue
|
||||
render_404
|
||||
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 get_assigned_homeworks(student_works, n, index)
|
||||
student_works += student_works
|
||||
student_works[index + 1 .. index + n]
|
||||
end
|
||||
end
|
||||
|
|
|
@ -118,6 +118,9 @@ class IssuesController < ApplicationController
|
|||
end
|
||||
|
||||
def show
|
||||
# 打开编辑内容
|
||||
@is_edit = true unless params[:edit].nil?
|
||||
|
||||
# 当前用户查看指派给他的缺陷消息,则设置消息为已读
|
||||
query = ForgeMessage.where("forge_message_type =? and user_id =? and forge_message_id =?", "Issue", User.current, @issue).first
|
||||
query.update_attribute(:viewed, true) unless query.nil?
|
||||
|
@ -387,6 +390,9 @@ class IssuesController < ApplicationController
|
|||
end
|
||||
|
||||
def destroy
|
||||
# 增加删除页面类型,如果是个人主页,则返回该主页,项目动态则返回项目动态页眉
|
||||
page_classify = params[:page_classify] unless params[:page_classify].nil?
|
||||
page_id = params[:page_id] unless params[:page_id].nil?
|
||||
@hours = TimeEntry.sum(:hours, :conditions => ['issue_id IN (?)', @issues]).to_f
|
||||
if @hours > 0
|
||||
case params[:todo]
|
||||
|
@ -415,7 +421,11 @@ class IssuesController < ApplicationController
|
|||
end
|
||||
end
|
||||
respond_to do |format|
|
||||
format.html { redirect_back_or_default _project_issues_path(@project) }
|
||||
if page_classify
|
||||
format.html { redirect_back_or_default _project_issues_path(@project, page_classify, page_id) }
|
||||
else
|
||||
format.html { redirect_back_or_default _project_issues_path(@project) }
|
||||
end
|
||||
format.api { render_api_ok }
|
||||
end
|
||||
end
|
||||
|
|
|
@ -110,8 +110,7 @@ class UsersController < ApplicationController
|
|||
elsif @user != User.current && !User.current.admin?
|
||||
return render_403
|
||||
end
|
||||
# 初始化/更新 点击按钮时间
|
||||
# 24小时内显示系统消息
|
||||
# 初始化/更新 点击按钮时间, 24小时内显示系统消息
|
||||
update_onclick_time
|
||||
# 全部设为已读
|
||||
if params[:viewed] == "all"
|
||||
|
@ -190,17 +189,19 @@ class UsersController < ApplicationController
|
|||
|
||||
# 消息设置为已读
|
||||
def update_message_viewed(user)
|
||||
course_querys = CourseMessage.where("user_id =? and viewed =?", user, 0)
|
||||
forge_querys = ForgeMessage.where("user_id =? and viewed =?", user, 0)
|
||||
user_querys = UserFeedbackMessage.where("user_id =? and viewed =?", user, 0)
|
||||
forum_querys = MemoMessage.where("user_id =? and viewed =?", user, 0)
|
||||
org_querys = OrgMessage.where("user_id=? and viewed=0", user)
|
||||
if User.current.id == @user.id
|
||||
course_querys.update_all(:viewed => true)
|
||||
forge_querys.update_all(:viewed => true)
|
||||
user_querys.update_all(:viewed => true)
|
||||
forum_querys.update_all(:viewed => true)
|
||||
org_querys.update_all(:viewed => true)
|
||||
course_querys = CourseMessage.where("user_id =? and viewed =?", user, 0)
|
||||
forge_querys = ForgeMessage.where("user_id =? and viewed =?", user, 0)
|
||||
user_querys = UserFeedbackMessage.where("user_id =? and viewed =?", user, 0)
|
||||
forum_querys = MemoMessage.where("user_id =? and viewed =?", user, 0)
|
||||
org_querys = OrgMessage.where("user_id=? and viewed=0", user)
|
||||
at_querys = AtMessage.where("user_id=? and viewed=0", user)
|
||||
course_querys.update_all(:viewed => true) unless course_querys.nil?
|
||||
forge_querys.update_all(:viewed => true) unless forge_querys.nil?
|
||||
user_querys.update_all(:viewed => true) unless user_querys.nil?
|
||||
forum_querys.update_all(:viewed => true) unless forum_querys.nil?
|
||||
org_querys.update_all(:viewed => true) unless org_querys.nil?
|
||||
at_querys.update_all(:viewed => true) unless at_querys.nil?
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -387,12 +388,12 @@ class UsersController < ApplicationController
|
|||
@homeworks = HomeworkCommon.where("user_id = #{@user.id} and publish_time <= '#{Date.today}'").order("#{@order} #{@b_sort}")
|
||||
end
|
||||
@type = params[:type]
|
||||
@limit = 15
|
||||
@limit = 25
|
||||
@is_remote = true
|
||||
@hw_count = @homeworks.count
|
||||
@hw_pages = Paginator.new @hw_count, @limit, params['page'] || 1
|
||||
@offset ||= @hw_pages.offset
|
||||
@homeworks = paginateHelper @homeworks,15
|
||||
@homeworks = paginateHelper @homeworks,25
|
||||
respond_to do |format|
|
||||
format.js
|
||||
format.html {render :layout => 'static_base'}
|
||||
|
@ -546,13 +547,13 @@ class UsersController < ApplicationController
|
|||
end
|
||||
@type = params[:type]
|
||||
@property = params[:property]
|
||||
@limit = 15
|
||||
@is_import = params[:is_import]
|
||||
@limit = params[:is_import].to_i == 1 ? 15 : 25
|
||||
@is_remote = true
|
||||
@hw_count = @homeworks.count
|
||||
@hw_pages = Paginator.new @hw_count, @limit, params['page'] || 1
|
||||
@offset ||= @hw_pages.offset
|
||||
@homeworks = paginateHelper @homeworks,15
|
||||
@is_import = params[:is_import]
|
||||
@homeworks = paginateHelper @homeworks,@limit
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
|
@ -572,6 +573,7 @@ class UsersController < ApplicationController
|
|||
@r_sort = @b_sort == "desc" ? "asc" : "desc"
|
||||
@user = User.current
|
||||
search = params[:name].to_s.strip.downcase
|
||||
type_ids = params[:property] ? "(" + params[:property] + ")" : "(1, 2, 3)"
|
||||
if(params[:type].blank? || params[:type] == "1") #全部
|
||||
visible_course = Course.where("is_public = 1 && is_delete = 0")
|
||||
visible_course_ids = visible_course.empty? ? "(-1)" : "(" + visible_course.map{|course| course.id}.join(",") + ")"
|
||||
|
@ -579,24 +581,40 @@ class UsersController < ApplicationController
|
|||
all_user_ids = all_homeworks.map{|hw| hw.user_id}
|
||||
user_str_ids = search_user_by_name all_user_ids, search
|
||||
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" #课程资源
|
||||
@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
|
||||
=begin
|
||||
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"
|
||||
@homeworks = @homeworks.where("homework_type = 2").reorder("#{@order} #{@b_sort}")
|
||||
@homeworks = @homeworks.where("homework_type = 2")
|
||||
elsif params[:property] && params[:property] == "3"
|
||||
@homeworks = @homeworks.where("homework_type = 3").reorder("#{@order} #{@b_sort}")
|
||||
@homeworks = @homeworks.where("homework_type = 3")
|
||||
end
|
||||
=end
|
||||
@type = params[:type]
|
||||
@limit = 15
|
||||
@limit = params[:is_import].to_i == 1 ? 15 : 25
|
||||
@is_remote = true
|
||||
@hw_count = @homeworks.count
|
||||
@hw_pages = Paginator.new @hw_count, @limit, params['page'] || 1
|
||||
@offset ||= @hw_pages.offset
|
||||
@homeworks = paginateHelper @homeworks,15
|
||||
@homeworks = paginateHelper @homeworks,@limit
|
||||
@is_import = params[:is_import]
|
||||
@property = params[:property]
|
||||
@search = search
|
||||
|
@ -823,20 +841,33 @@ class UsersController < ApplicationController
|
|||
user_course_ids = User.current.courses.map { |c| c.id}
|
||||
user_project_ids = User.current.projects.map {|p| p.id}
|
||||
# user_org_ids = User.current.organizations.map {|o| o.id}
|
||||
if(params[:type].blank? || params[:type] == "1") #全部
|
||||
if(params[:type].blank? || params[:type] == "1") # 我的资源
|
||||
# 修正:我的资源库的话,那么应该是我上传的所有资源加上,我加入的课程、项目、组织的所有资源
|
||||
@attachments = get_my_resources(params[:id], user_course_ids, user_project_ids)
|
||||
elsif params[:type] == "2" # 课程资源
|
||||
@attachments = get_course_resources(params[:id], user_course_ids)
|
||||
elsif params[:type] == "3" # 项目资源
|
||||
@attachments = get_project_resources(params[:id], user_project_ids)
|
||||
elsif params[:type] == "4" #附件
|
||||
@attachments = get_attch_resources params[:id]
|
||||
elsif params[:type] == "5" #用户资源
|
||||
@attachments = get_principal_resources params[:id]
|
||||
if params[:status] == "2"
|
||||
@attachments = get_course_resources(params[:id], user_course_ids, @order, @score)
|
||||
elsif params[:status] == "3"
|
||||
@attachments = get_project_resources(params[:id], user_project_ids, @order, @score)
|
||||
elsif params[:status] == "4"
|
||||
@attachments = get_attch_resources(params[:id], @order, @score)
|
||||
elsif params[:status] == "5"
|
||||
@attachments = get_principal_resources(params[:id], @order, @score)
|
||||
else
|
||||
# 公共资源库:所有公开资源或者我上传的私有资源
|
||||
@attachments = get_my_resources(params[:id], user_course_ids, user_project_ids, @order, @score)
|
||||
end
|
||||
elsif params[:type] == "6" # 公共资源
|
||||
# 公共资源库:所有公开资源或者我上传的私有资源
|
||||
@attachments = get_public_resources(user_course_ids, user_project_ids)
|
||||
if params[:status] == "2"
|
||||
@attachments = get_course_resources_public( user_course_ids, @order, @score)
|
||||
elsif params[:status] == "3"
|
||||
@attachments = get_project_resources_public(user_project_ids, @order, @score)
|
||||
elsif params[:status] == "4"
|
||||
@attachments = get_attch_resources_public(@order, @score)
|
||||
elsif params[:status] == "5"
|
||||
@attachments = get_principal_resources_public(@order, @score)
|
||||
else
|
||||
# 公共资源库:所有公开资源或者我上传的私有资源
|
||||
@attachments = get_public_resources(user_course_ids, user_project_ids, params[:order], @score)
|
||||
end
|
||||
end
|
||||
@type = params[:type]
|
||||
@limit = 7
|
||||
|
@ -946,12 +977,7 @@ class UsersController < ApplicationController
|
|||
return
|
||||
end
|
||||
# 自己访问自己的页面才更新消息状态
|
||||
if User.current == @user
|
||||
journals_messages = UserFeedbackMessage.where("user_id =? and journals_for_message_type =? and viewed =?", User.current.id, "JournalsForMessage", 0)
|
||||
journals_messages.each do |journals_message|
|
||||
journals_message.update_attributes(:viewed => true)
|
||||
end
|
||||
end
|
||||
UserFeedbackMessage.where("user_id =? and viewed =? and journals_for_message_type =? ", User.current.id, 0, "JournalsForMessage").update_all(:viewed => true)
|
||||
# end
|
||||
@page = params[:page] ? params[:page].to_i + 1 : 0
|
||||
if params[:type].present?
|
||||
|
@ -1553,43 +1579,39 @@ class UsersController < ApplicationController
|
|||
user_project_ids = User.current.projects.map {|p| p.id}
|
||||
# user_org_ids = User.current.organizations.map {|o| o.id}
|
||||
@user = User.find(params[:id])
|
||||
#@user.save_attachments(params[:attachments],User.current)
|
||||
# Container_type为Principal
|
||||
# 保存文件
|
||||
attach = Attachment.attach_filesex_public(@user, params[:attachments], params[:attachment_type], is_public = true)
|
||||
@order, @b_sort = params[:order] || "created_on", params[:sort] || "asc"
|
||||
@score = @b_sort == "desc" ? "asc" : "desc"
|
||||
user_course_ids = User.current.courses.map { |c| c.id}
|
||||
user_project_ids = User.current.projects.map {|p| p.id}
|
||||
# user_org_ids = User.current.organizations.map {|o| o.id}
|
||||
if(params[:type].blank? || params[:type] == "1") # 我的资源
|
||||
# 修正:我的资源库的话,那么应该是我上传的所有资源加上,我加入的课程、项目、组织的所有资源
|
||||
if params[:status] == 2
|
||||
@attachments = get_course_resources(params[:id], user_course_ids)
|
||||
if params[:status] == "2"
|
||||
@attachments = get_course_resources(params[:id], user_course_ids, @order, @score)
|
||||
elsif params[:status] == "3"
|
||||
@attachments = get_project_resources(params[:id], user_project_ids)
|
||||
@attachments = get_project_resources(params[:id], user_project_ids, @order, @score)
|
||||
elsif params[:status] == "4"
|
||||
@attachments = get_attch_resources params[:id]
|
||||
@attachments = get_attch_resources(params[:id], @order, @score)
|
||||
elsif params[:status] == "5"
|
||||
@attachments = get_principal_resources params[:id]
|
||||
@attachments = get_principal_resources(params[:id], @order, @score)
|
||||
else
|
||||
# 公共资源库:所有公开资源或者我上传的私有资源
|
||||
@attachments = get_my_resources(params[:id], user_course_ids, user_project_ids)
|
||||
@attachments = get_my_resources(params[:id], user_course_ids, user_project_ids, @order, @score)
|
||||
end
|
||||
elsif params[:type] == "2" # 课程资源
|
||||
@attachments = get_course_resources(params[:id], user_course_ids)
|
||||
elsif params[:type] == "3" # 项目资源
|
||||
@attachments = get_project_resources(params[:id], user_project_ids)
|
||||
elsif params[:type] == "4" #附件
|
||||
@attachments = get_attch_resources params[:id]
|
||||
elsif params[:type] == "5" #用户资源
|
||||
@attachments = get_principal_resources params[:id]
|
||||
elsif params[:type] == "6" # 公共资源
|
||||
if params[:status] == "2"
|
||||
@attachments = get_course_resources_public( user_course_ids)
|
||||
@attachments = get_course_resources_public( user_course_ids, @order, @score)
|
||||
elsif params[:status] == "3"
|
||||
@attachments = get_project_resources_public(user_project_ids)
|
||||
@attachments = get_project_resources_public(user_project_ids, @order, @score)
|
||||
elsif params[:status] == "4"
|
||||
@attachments = get_attch_resources_public
|
||||
@attachments = get_attch_resources_public(@order, @score)
|
||||
elsif params[:status] == "5"
|
||||
@attachments = get_principal_resources_public
|
||||
@attachments = get_principal_resources_public(@order, @score)
|
||||
else
|
||||
# 公共资源库:所有公开资源或者我上传的私有资源
|
||||
@attachments = get_public_resources(user_course_ids, user_project_ids)
|
||||
@attachments = get_public_resources(user_course_ids, user_project_ids, params[:order], @score)
|
||||
end
|
||||
end
|
||||
@status = params[:status]
|
||||
|
@ -1609,49 +1631,44 @@ class UsersController < ApplicationController
|
|||
# 删除用户资源,分为批量删除 和 单个删除,只能删除自己上传的资源
|
||||
def user_resource_delete
|
||||
if params[:resource_id].present?
|
||||
Attachment.where("author_id = #{User.current.id}").delete(params[:resource_id])
|
||||
Attachment.where("author_id =? and id =?", User.current.id, params[:resource_id]).first.destroy
|
||||
elsif params[:checkbox1].present?
|
||||
params[:checkbox1].each do |id|
|
||||
Attachment.where("author_id = #{User.current.id}").delete(id)
|
||||
Attachment.where("author_id =? and id =?", User.current.id, id).first.destroy
|
||||
end
|
||||
end
|
||||
@user = User.current
|
||||
@order, @b_sort = params[:order] || "created_on", params[:sort] || "asc"
|
||||
@score = @b_sort == "desc" ? "asc" : "desc"
|
||||
user_course_ids = User.current.courses.map { |c| c.id}
|
||||
user_project_ids = User.current.projects.map {|p| p.id}
|
||||
# user_org_ids = User.current.organizations.map {|o| o.id}
|
||||
if(params[:type].blank? || params[:type] == "1") # 我的资源
|
||||
# 修正:我的资源库的话,那么应该是我上传的所有资源加上,我加入的课程、项目、组织的所有资源
|
||||
if params[:status] == 2
|
||||
@attachments = get_course_resources(params[:id], user_course_ids)
|
||||
if params[:status] == "2"
|
||||
@attachments = get_course_resources(params[:id], user_course_ids, @order, @score)
|
||||
elsif params[:status] == "3"
|
||||
@attachments = get_project_resources(params[:id], user_project_ids)
|
||||
@attachments = get_project_resources(params[:id], user_project_ids, @order, @score)
|
||||
elsif params[:status] == "4"
|
||||
@attachments = get_attch_resources params[:id]
|
||||
@attachments = get_attch_resources(params[:id], @order, @score)
|
||||
elsif params[:status] == "5"
|
||||
@attachments = get_principal_resources params[:id]
|
||||
@attachments = get_principal_resources(params[:id], @order, @score)
|
||||
else
|
||||
# 公共资源库:所有公开资源或者我上传的私有资源
|
||||
@attachments = get_my_resources(params[:id], user_course_ids, user_project_ids)
|
||||
@attachments = get_my_resources(params[:id], user_course_ids, user_project_ids, @order, @score)
|
||||
end
|
||||
elsif params[:type] == "2" # 课程资源
|
||||
@attachments = get_course_resources(params[:id], user_course_ids)
|
||||
elsif params[:type] == "3" # 项目资源
|
||||
@attachments = get_project_resources(params[:id], user_project_ids)
|
||||
elsif params[:type] == "4" #附件
|
||||
@attachments = get_attch_resources params[:id]
|
||||
elsif params[:type] == "5" #用户资源
|
||||
@attachments = get_principal_resources params[:id]
|
||||
elsif params[:type] == "6" # 公共资源
|
||||
if params[:status] == "2"
|
||||
@attachments = get_course_resources_public( user_course_ids)
|
||||
@attachments = get_course_resources_public( user_course_ids, @order, @score)
|
||||
elsif params[:status] == "3"
|
||||
@attachments = get_project_resources_public(user_project_ids)
|
||||
@attachments = get_project_resources_public(user_project_ids, @order, @score)
|
||||
elsif params[:status] == "4"
|
||||
@attachments = get_attch_resources_public
|
||||
@attachments = get_attch_resources_public(@order, @score)
|
||||
elsif params[:status] == "5"
|
||||
@attachments = get_principal_resources_public
|
||||
@attachments = get_principal_resources_public(@order, @score)
|
||||
else
|
||||
# 公共资源库:所有公开资源或者我上传的私有资源
|
||||
@attachments = get_public_resources(user_course_ids, user_project_ids)
|
||||
@attachments = get_public_resources(user_course_ids, user_project_ids, params[:order], @score)
|
||||
end
|
||||
end
|
||||
@status = params[:status]
|
||||
|
@ -1674,10 +1691,10 @@ class UsersController < ApplicationController
|
|||
if !params[:search].nil?
|
||||
search = "%#{params[:search].to_s.strip.downcase}%"
|
||||
@course = @user.courses.where(" #{Course.table_name}.id = #{params[:search].to_i } or #{Course.table_name}.name like :p",:p=>search)
|
||||
.select { |course| @user.allowed_to?(:as_teacher,course)}
|
||||
.select { |course| @user.allowed_to?(:as_teacher,course) and course.is_delete == 0 }
|
||||
else
|
||||
@course = @user.courses
|
||||
.select { |course| @user.allowed_to?(:as_teacher,course)}
|
||||
.select { |course| @user.allowed_to?(:as_teacher,course) and course.is_delete == 0 }
|
||||
end
|
||||
@search = params[:search]
|
||||
#这里仅仅是传递需要发送的资源id
|
||||
|
@ -1695,7 +1712,7 @@ class UsersController < ApplicationController
|
|||
search = "%#{params[:search].to_s.strip.downcase}%"
|
||||
@projects = @user.projects.where(" #{Project.table_name}.id = #{params[:search].to_i } or #{Project.table_name}.name like :p",:p=>search)
|
||||
else
|
||||
@projects = @user.projects
|
||||
@projects = @user.projects.visible
|
||||
end
|
||||
@search = params[:search]
|
||||
#这里仅仅是传递需要发送的资源id
|
||||
|
@ -2339,59 +2356,125 @@ class UsersController < ApplicationController
|
|||
end
|
||||
|
||||
# 获取公共资源
|
||||
def get_public_resources user_course_ids, user_project_ids
|
||||
attachments = Attachment.where("(is_publish = 1 and is_public =1 and container_id is not null and container_type in('Project','OrgSubfield','Principal','Course')) ").order("created_on desc")
|
||||
def get_public_resources user_course_ids, user_project_ids, order, score
|
||||
attachments = Attachment.where("(is_publish = 1 and is_public =1 and container_id is not null and container_type in('Project','OrgSubfield','Principal','Course')) ").order("#{order.nil? ? 'created_on' : order} #{score}")
|
||||
end
|
||||
|
||||
# 获取公共资源搜索
|
||||
def get_public_resources_search user_course_ids, user_project_ids, order, score, search
|
||||
attachments = Attachment.where("is_publish = 1 and is_public = 1 and container_id is not null and container_type in('Project','OrgSubfield','Principal','Course') and (filename like :p)" ,:p => search).order("#{order.nil? ? 'created_on' : order} #{score}")
|
||||
end
|
||||
|
||||
# 获取我的资源
|
||||
def get_my_resources author_id, user_course_ids, user_project_ids
|
||||
def get_my_resources author_id, user_course_ids, user_project_ids, order, score
|
||||
attachments = Attachment.where("(author_id = #{author_id} and is_publish = 1 and container_id is not null and container_type in('Project','OrgSubfield','Principal','Course','Issue','Document','Message','News','StudentWorkScore','HomewCommon')) "+
|
||||
"or (container_type = 'Course' and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')}) and is_publish = 1 and container_id is not null)" +
|
||||
"or (container_type = 'Project' and container_id in (#{user_project_ids.empty? ? '0': user_project_ids.join(',')}) and is_publish = 1 and container_id is not null)" ).order("created_on desc")
|
||||
"or (container_type = 'Project' and container_id in (#{user_project_ids.empty? ? '0': user_project_ids.join(',')}) and is_publish = 1 and container_id is not null)" ).order("#{order.nil? ? 'created_on' : order} #{score}")
|
||||
end
|
||||
|
||||
# 获取我的资源查询结果
|
||||
def get_my_resources_search (author_id, user_course_ids, user_project_ids, order, score, search)
|
||||
@attachments = Attachment.where("((author_id = #{author_id} and is_publish = 1 and container_id is not null and container_type in('Project','OrgSubfield','Principal','Course','Issue','Document','Message','News','StudentWorkScore','HomewCommon')) "+
|
||||
"or (container_type = 'Course' and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')}) and is_publish = 1 and container_id is not null)" +
|
||||
"or (container_type = 'Project' and container_id in (#{user_project_ids.empty? ? '0': user_project_ids.join(',')}) and is_publish = 1 and container_id is not null)) and (filename like :p)" ,:p => search).order("#{order.nil? ? 'created_on' : order} #{score}")
|
||||
end
|
||||
|
||||
# 获取我的课程资源
|
||||
def get_course_resources author_id, user_course_ids
|
||||
attchments = Attachment.where("(author_id = #{author_id} and container_type = 'Course' and is_publish = 1) or (container_type = 'Course' and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')}) and is_publish = 1) ").order("created_on desc")
|
||||
def get_course_resources author_id, user_course_ids, order, score
|
||||
attchments = Attachment.where("(author_id = #{author_id} and is_publish = 1 and container_id is not null and container_type = 'Course')"+
|
||||
"or (container_type = 'Course' and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')})
|
||||
and is_publish = 1 and container_id is not null)" ).order("#{order.nil? ? 'created_on' : order} #{score}")
|
||||
end
|
||||
|
||||
# 获取公共资源课程
|
||||
def get_course_resources_public user_course_ids
|
||||
attchments = Attachment.where("(container_type = 'Course'and container_id is not null and is_publish = 1 and is_public =1)").order("created_on desc")
|
||||
# 获取我的课程资源中搜索结果
|
||||
def get_course_resources_search author_id, user_course_ids, order, score, search
|
||||
attchments = Attachment.where("((author_id = #{author_id} and is_publish = 1 and container_id is not null and container_type = 'Course')"+
|
||||
"or (container_type = 'Course' and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')})
|
||||
and is_publish = 1 and container_id is not null)) and (filename like :p)", :p => search ).order("#{order.nil? ? 'created_on' : order} #{score}")
|
||||
end
|
||||
|
||||
# 获取公共资源中课程资源
|
||||
def get_course_resources_public user_course_ids, order, score
|
||||
attchments = Attachment.where("(container_type = 'Course'and container_id is not null and is_publish = 1 and is_public =1)").order("#{order.nil? ? 'created_on' : order} #{score}")
|
||||
end
|
||||
|
||||
# 获取公共资源中课程资源搜索结果
|
||||
def get_course_resources_public_search user_course_ids, order, score, search
|
||||
attchments = Attachment.where("(container_type = 'Course'and container_id is not null and is_publish = 1 and is_public =1) and (filename like :p)", :p => search ).order("#{order.nil? ? 'created_on' : order} #{score}")
|
||||
end
|
||||
|
||||
# 获取我的项目资源
|
||||
def get_project_resources author_id, user_project_ids
|
||||
attchments = Attachment.where("(author_id = #{author_id} and container_type = 'Project') or (container_type = 'Course' and container_id in (#{user_project_ids.empty? ? '0': user_project_ids.join(',')}) and is_publish = 1) ").order("created_on desc")
|
||||
def get_project_resources author_id, user_project_ids, order, score
|
||||
attchments = Attachment.where("(author_id = #{author_id} and is_publish = 1 and container_id is not null and container_type = 'Project') "+
|
||||
"or (container_type = 'Project' and container_id in (#{user_project_ids.empty? ? '0': user_project_ids.join(',')})
|
||||
and is_publish = 1 and container_id is not null)").order("#{order.nil? ? 'created_on' : order} #{score}")
|
||||
end
|
||||
|
||||
# 获取我的项目资源搜索
|
||||
def get_project_resources_search author_id, user_project_ids, order, score, search
|
||||
attchments = Attachment.where("((author_id = #{author_id} and is_publish = 1 and container_id is not null and container_type = 'Project') "+
|
||||
"or (container_type = 'Project' and container_id in (#{user_project_ids.empty? ? '0': user_project_ids.join(',')})
|
||||
and is_publish = 1 and container_id is not null)) and (filename like :p)", :p => search ).order("#{order.nil? ? 'created_on' : order} #{score}")
|
||||
end
|
||||
|
||||
# 获取公共资源的项目资源
|
||||
def get_project_resources_public user_project_ids
|
||||
attchments = Attachment.where("container_type = 'Project' and container_id is not null and is_public =1").order("created_on desc")
|
||||
def get_project_resources_public user_project_ids, order, score
|
||||
attchments = Attachment.where("container_type = 'Project' and container_id is not null and is_public =1").order("#{order.nil? ? 'created_on' : order} #{score}")
|
||||
end
|
||||
|
||||
# 获取公共资源的项目资源搜索
|
||||
def get_project_resources_public_search user_project_ids, order, score, search
|
||||
attchments = Attachment.where("(container_type = 'Project' and container_id is not null and is_public =1) and (filename like :p)", :p => search ).order("#{order.nil? ? 'created_on' : order} #{score}")
|
||||
end
|
||||
|
||||
# 获取我上传的附件
|
||||
def get_attch_resources author_id
|
||||
attchments = Attachment.where("author_id = #{author_id} and container_type in('Issue','Document','Message','News','StudentWorkScore','HomewCommon','OrgSubfield','Principal')").order("created_on desc")
|
||||
def get_attch_resources author_id, order, score
|
||||
attchments = Attachment.where("(author_id = #{author_id} and is_publish = 1 and container_id is not null and container_type in('Project','OrgSubfield','Principal','Course','Issue',
|
||||
'Document','Message','News','StudentWorkScore','HomewCommon'))").order("#{order.nil? ? 'created_on' : order} #{score}")
|
||||
end
|
||||
|
||||
# 获取我上传的附件搜索结果
|
||||
def get_attch_resources_search author_id, order, score, search
|
||||
attchments = Attachment.where("(author_id = #{author_id} and is_publish = 1 and container_id is not null and container_type in('Project','OrgSubfield','Principal','Course','Issue',
|
||||
'Document','Message','News','StudentWorkScore','HomewCommon')) and (filename like :p)", :p => search ).order("#{order.nil? ? 'created_on' : order} #{score}")
|
||||
end
|
||||
|
||||
# 获取公共资源中我上传的附件
|
||||
def get_attch_resources_public
|
||||
attchments = Attachment.where("container_type in('Issue','Document','Message','News','StudentWorkScore','HomewCommon','OrgSubfield','Principal') and container_id is not null and is_public =1").order("created_on desc")
|
||||
def get_attch_resources_public order, score
|
||||
attchments = Attachment.where("container_type in('Issue','Document','Message','News','StudentWorkScore','HomewCommon','OrgSubfield','Principal')
|
||||
and container_id is not null and is_public =1").order("#{order.nil? ? 'created_on' : order} #{score}")
|
||||
end
|
||||
|
||||
# 获取公共资源中我上传的附件
|
||||
def get_attch_resources_public_search order, score, search
|
||||
attchments = Attachment.where("(container_type in('Issue','Document','Message','News','StudentWorkScore','HomewCommon','OrgSubfield','Principal')
|
||||
and container_id is not null and is_public =1) and (filename like :p)", :p => search).order("#{order.nil? ? 'created_on' : order} #{score}")
|
||||
end
|
||||
|
||||
# 获取我的用户类型资源
|
||||
def get_principal_resources author_id
|
||||
attchments = Attachment.where("author_id = #{author_id} and container_type = 'Principal'").order("created_on desc")
|
||||
def get_principal_resources author_id, order, score
|
||||
attchments = Attachment.where("author_id = #{author_id} and is_publish = 1 and container_id is not null and container_type = 'Principal'").order("#{order.nil? ? 'created_on' : order} #{score}")
|
||||
end
|
||||
|
||||
# 获取我的用户类型资源搜索
|
||||
def get_principal_resources_search author_id, order, score, search
|
||||
attchments = Attachment.where("(author_id = #{author_id} and is_publish = 1 and container_id is not null and container_type = 'Principal') and (filename like :p)", :p => search).order("#{order.nil? ? 'created_on' : order} #{score}")
|
||||
end
|
||||
|
||||
# 获取我的用户类型资源
|
||||
def get_principal_resources_public
|
||||
attchments = Attachment.where("container_type = 'Principal'and container_id is not null and is_public =1").order("created_on desc")
|
||||
def get_principal_resources_public order, score
|
||||
attchments = Attachment.where("container_type = 'Principal'and container_id is not null and is_public =1").order("#{order.nil? ? 'created_on' : order} #{score}")
|
||||
end
|
||||
|
||||
# 获取我的用户类型资源
|
||||
def get_principal_resources_public_search order, score, search
|
||||
attchments = Attachment.where("(container_type = 'Principal'and container_id is not null and is_public =1) and (filename like :p)", :p => search).order("#{order.nil? ? 'created_on' : order} #{score}")
|
||||
end
|
||||
|
||||
# 资源库 分为全部 课程资源 项目资源 附件
|
||||
def user_resource
|
||||
@order, @b_sort = params[:order] || "created_on", params[:sort] || "asc"
|
||||
@score = @b_sort == "desc" ? "asc" : "desc"
|
||||
# 别人的资源库是没有权限去看的
|
||||
if User.current.id.to_i != params[:id].to_i
|
||||
render_403
|
||||
|
@ -2403,37 +2486,29 @@ class UsersController < ApplicationController
|
|||
if(params[:type].blank? || params[:type] == "1") # 我的资源
|
||||
# 修正:我的资源库的话,那么应该是我上传的所有资源加上,我加入的课程、项目、组织的所有资源
|
||||
if params[:status] == "2"
|
||||
@attachments = get_course_resources(params[:id], user_course_ids)
|
||||
@attachments = get_course_resources(params[:id], user_course_ids, @order, @score)
|
||||
elsif params[:status] == "3"
|
||||
@attachments = get_project_resources(params[:id], user_project_ids)
|
||||
@attachments = get_project_resources(params[:id], user_project_ids, @order, @score)
|
||||
elsif params[:status] == "4"
|
||||
@attachments = get_attch_resources params[:id]
|
||||
@attachments = get_attch_resources(params[:id], @order, @score)
|
||||
elsif params[:status] == "5"
|
||||
@attachments = get_principal_resources params[:id]
|
||||
@attachments = get_principal_resources(params[:id], @order, @score)
|
||||
else
|
||||
# 公共资源库:所有公开资源或者我上传的私有资源
|
||||
@attachments = get_my_resources(params[:id], user_course_ids, user_project_ids)
|
||||
@attachments = get_my_resources(params[:id], user_course_ids, user_project_ids, @order, @score)
|
||||
end
|
||||
elsif params[:type] == "2" # 课程资源
|
||||
@attachments = get_course_resources(params[:id], user_course_ids)
|
||||
elsif params[:type] == "3" # 项目资源
|
||||
@attachments = get_project_resources(params[:id], user_project_ids)
|
||||
elsif params[:type] == "4" #附件
|
||||
@attachments = get_attch_resources params[:id]
|
||||
elsif params[:type] == "5" #用户资源
|
||||
@attachments = get_principal_resources params[:id]
|
||||
elsif params[:type] == "6" # 公共资源
|
||||
if params[:status] == "2"
|
||||
@attachments = get_course_resources_public( user_course_ids)
|
||||
@attachments = get_course_resources_public( user_course_ids, @order, @score)
|
||||
elsif params[:status] == "3"
|
||||
@attachments = get_project_resources_public(user_project_ids)
|
||||
@attachments = get_project_resources_public(user_project_ids, @order, @score)
|
||||
elsif params[:status] == "4"
|
||||
@attachments = get_attch_resources_public
|
||||
@attachments = get_attch_resources_public(@order, @score)
|
||||
elsif params[:status] == "5"
|
||||
@attachments = get_principal_resources_public
|
||||
@attachments = get_principal_resources_public(@order, @score)
|
||||
else
|
||||
# 公共资源库:所有公开资源或者我上传的私有资源
|
||||
@attachments = get_public_resources(user_course_ids, user_project_ids)
|
||||
@attachments = get_public_resources(user_course_ids, user_project_ids, params[:order], @score)
|
||||
end
|
||||
end
|
||||
@status = params[:status]
|
||||
|
@ -2458,16 +2533,19 @@ class UsersController < ApplicationController
|
|||
render_403
|
||||
return
|
||||
end
|
||||
@user = User.find(params[:id])
|
||||
@order, @b_sort = params[:order] || "created_on", params[:sort] || "asc"
|
||||
@score = @b_sort == "desc" ? "asc" : "desc"
|
||||
user_course_ids = User.current.courses.map { |c| c.id}
|
||||
user_project_ids = User.current.projects.map {|p| p.id}
|
||||
# user_org_ids = User.current.organizations.map {|o| o.id}
|
||||
user_project_ids = User.current.projects.map {|p| p.id} # user_org_ids = User.current.organizations.map {|o| o.id}
|
||||
if(params[:type].blank? || params[:type] == "1") # 我的资源
|
||||
# 修正:我的资源库的话,那么应该是我上传的所有资源加上,我加入的课程、项目、组织的所有资源
|
||||
@attachments = get_my_resources(params[:id], user_course_ids, user_project_ids)
|
||||
@attachments = get_my_resources(params[:id], user_course_ids, user_project_ids, @order, @score)
|
||||
elsif params[:type] == "6" # 公共资源
|
||||
# 公共资源库:所有公开资源或者我上传的私有资源
|
||||
@attachments = get_public_resources(user_course_ids, user_project_ids)
|
||||
@attachments = get_public_resources(user_course_ids, user_project_ids, params[:order], @score)
|
||||
end
|
||||
@status = params[:status]
|
||||
@type = params[:type]
|
||||
@limit = 10
|
||||
@is_remote = true
|
||||
|
@ -2483,26 +2561,25 @@ class UsersController < ApplicationController
|
|||
end
|
||||
|
||||
def import_resources_search
|
||||
search = "%#{params[:search].strip.downcase}%"
|
||||
@order, @b_sort = params[:order] || "created_on", params[:sort] || "asc"
|
||||
@score = @b_sort == "desc" ? "asc" : "desc"
|
||||
@user = User.current
|
||||
@switch_search = params[:name].nil? ? " " : params[:name]
|
||||
search = "%#{@switch_search.strip.downcase}%"
|
||||
# 别人的资源库是没有权限去看的
|
||||
if User.current.id.to_i != params[:id].to_i
|
||||
render_403
|
||||
return
|
||||
end
|
||||
user_course_ids = User.current.courses.map { |c| c.id}
|
||||
user_project_ids = User.current.projects.map {|p| p.id}
|
||||
# user_org_ids = User.current.organizations.map {|o| o.id}
|
||||
if(params[:type].blank? || params[:type] == "1") # 我的资源
|
||||
# 修正:我的资源库的话,那么应该是我上传的所有资源加上,我加入的课程、项目、组织的所有资源
|
||||
user_course_ids = User.current.courses.map { |c| c.id}
|
||||
user_project_ids = User.current.projects.map {|p| p.id}
|
||||
# user_org_ids = User.current.organizations.map {|o| o.id}
|
||||
@attachments = Attachment.where("((author_id = #{params[:id]} and is_publish = 1 and container_id is not null and container_type in('Project','OrgSubfield','Principal','Course','Issue','Document','Message','News','StudentWorkScore','HomewCommon')) "+
|
||||
"or (container_type = 'Course' and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')}) and is_publish = 1 and container_id is not null)" +
|
||||
"or (container_type = 'Project' and container_id in (#{user_project_ids.empty? ? '0': user_project_ids.join(',')}) and is_publish = 1 and container_id is not null)) and (filename like :p)" ,:p => search).order("created_on desc")
|
||||
@attachments = get_my_resources_search(params[:id], user_course_ids, user_project_ids, @order, @score, search)
|
||||
elsif params[:type] == "6" # 公共资源
|
||||
# 公共资源库:所有公开资源或者我上传的私有资源
|
||||
@attachments = get_public_resources(user_course_ids, user_project_ids)
|
||||
@attachments = get_public_resources_search(user_course_ids, user_project_ids, @order, @score, search)
|
||||
end
|
||||
@type = params[:type]
|
||||
@limit = 10
|
||||
|
@ -2511,10 +2588,10 @@ class UsersController < ApplicationController
|
|||
@atta_pages = Paginator.new @atta_count, @limit, params['page'] || 1
|
||||
@offset ||= @atta_pages.offset
|
||||
#@curse_attachments_all = @all_attachments[@offset, @limit]
|
||||
@attachments = paginateHelper @attachments,10
|
||||
@attachments = paginateHelper @attachments, 10
|
||||
respond_to do |format|
|
||||
format.js
|
||||
format.html {render :layout => 'new_base'}
|
||||
# format.html {render :layout => 'new_base'}
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -2572,55 +2649,41 @@ class UsersController < ApplicationController
|
|||
|
||||
# 根据资源关键字进行搜索
|
||||
def resource_search
|
||||
search = "%#{params[:search].strip.downcase}%"
|
||||
user_course_ids = User.current.courses.map { |c| c.id}
|
||||
@order, @b_sort = params[:order] || "created_on", params[:sort] || "desc"
|
||||
@score = @b_sort == "desc" ? "asc" : "desc"
|
||||
@user = User.current
|
||||
@switch_search = params[:search].nil? ? " " : params[:search]
|
||||
search = "%#{@switch_search.strip.downcase}%"
|
||||
user_course_ids = User.current.courses.map {|c| c.id}
|
||||
user_project_ids = User.current.projects.map {|p| p.id}
|
||||
# user_org_ids = User.current.organizations.map {|o| o.id}
|
||||
if(params[:type].nil? || params[:type].blank? || params[:type] == "1" || params[:type] == 'all') #全部
|
||||
if User.current.id.to_i == params[:id].to_i
|
||||
|
||||
@attachments = Attachment.where("((author_id = #{params[:id]} and is_publish = 1 and container_id is not null and container_type in('Project','OrgSubfield','Principal','Course','Issue','Document','Message','News','StudentWorkScore','HomewCommon')) "+
|
||||
"or (container_type = 'Course' and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')}) and is_publish = 1 and container_id is not null)" +
|
||||
"or (container_type = 'Project' and container_id in (#{user_project_ids.empty? ? '0': user_project_ids.join(',')}) and is_publish = 1 and container_id is not null)) and (filename like :p)" ,:p => search).order("created_on desc")
|
||||
if(params[:type].nil? || params[:type].blank? || params[:type] == "1" || params[:type] == 'all') # 全部
|
||||
if params[:status] == "2"
|
||||
@attachments = get_course_resources_search(params[:id], user_course_ids, @order, @score, search)
|
||||
elsif params[:status] == "3"
|
||||
@attachments = get_project_resources_search(params[:id], user_project_ids, @order, @score, search)
|
||||
elsif params[:status] == "4"
|
||||
@attachments = get_attch_resources_search(params[:id], @order, @score, search)
|
||||
elsif params[:status] == "5"
|
||||
@attachments = get_principal_resources_search(params[:id], @order, @score, search)
|
||||
else
|
||||
user_course_ids = User.find(params[:id]).courses.visible.map { |c| c.id} #如果课程私有资源,那么要看这个资源的课程是不是在 这个user的所有我可见的课程中
|
||||
@attachments = Attachment.where("((author_id = #{params[:id]} and is_public = 1 and container_type in" +
|
||||
" ('Project','Principal','Course','Issue','Document','Message','News','StudentWorkScore','HomewCommon'))"+
|
||||
" or (container_type = 'Course' and is_public = 1 and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')})) )" +
|
||||
" and (filename like :p) ",:p=>search).order("created_on desc")
|
||||
# 公共资源库:所有公开资源或者我上传的私有资源
|
||||
@attachments = get_my_resources_search(params[:id], user_course_ids, user_project_ids, @order, @score, search)
|
||||
end
|
||||
elsif params[:type] == "2" #课程资源
|
||||
if User.current.id.to_i == params[:id].to_i
|
||||
user_course_ids = User.current.courses.map { |c| c.id}
|
||||
@attachments = Attachment.where("(author_id = #{params[:id]} and container_type = 'Course') or (container_type = 'Course' and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')})) and (filename like :p) ",:p=>search).order("created_on desc")
|
||||
elsif params[:type] == "6" # 公共资源
|
||||
if params[:status] == "2"
|
||||
@attachments = get_course_resources_public_search(user_course_ids, @order, @score, search)
|
||||
elsif params[:status] == "3"
|
||||
@attachments = get_project_resources_public_search(user_project_ids, @order, @score, search)
|
||||
elsif params[:status] == "4"
|
||||
@attachments = get_attch_resources_public_search(@order, @score, search)
|
||||
elsif params[:status] == "5"
|
||||
@attachments = get_principal_resources_public_search(@order, @score, search)
|
||||
else
|
||||
user_course_ids = User.find(params[:id]).courses.visible.map { |c| c.id} #如果课程私有资源,那么要看这个资源的课程是不是在 这个user的所有我可见的课程中
|
||||
@attachments = Attachment.where("((author_id = #{params[:id]} and is_public = 1 and container_type = 'Course') "+
|
||||
"or (container_type = 'Course' and is_public = 1 and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')})) )"+
|
||||
" and (filename like :p) ",:p=>search).order("created_on desc")
|
||||
# 公共资源库:所有公开资源或者我上传的私有资源
|
||||
@attachments = get_public_resources_search(user_course_ids, user_project_ids, @order, @score, search)
|
||||
end
|
||||
elsif params[:type] == "3" #项目资源
|
||||
if User.current.id.to_i == params[:id].to_i
|
||||
@attachments = Attachment.where("author_id = #{params[:id]} and container_type = 'Project' and (filename like :p)",:p=>search).order("created_on desc")
|
||||
else
|
||||
@attachments = Attachment.where("author_id = #{params[:id]} and is_public = 1 and container_type = 'Project' and (filename like :p) ",:p=>search).order("created_on desc")
|
||||
end
|
||||
elsif params[:type] == "4" #附件
|
||||
if User.current.id.to_i == params[:id].to_i
|
||||
@attachments = Attachment.where("author_id = #{params[:id]} and container_type in('Project','Issue','Document','Message','News','StudentWorkScore','HomewCommon') and (filename like :p)",:p=>search).order("created_on desc")
|
||||
else
|
||||
@attachments = Attachment.where("author_id = #{params[:id]} and is_public = 1 and container_type in('Issue','Document','Message','News','StudentWorkScore','HomewCommon') and (filename like :p)",:p=>search).order("created_on desc")
|
||||
end
|
||||
elsif params[:type] == "5" #用户资源
|
||||
if User.current.id.to_i == params[:id].to_i
|
||||
@attachments = Attachment.where("author_id = #{params[:id]} and container_type = 'Principal' and (filename like :p)",:p=>search).order("created_on desc")
|
||||
else
|
||||
@attachments = Attachment.where("author_id = #{params[:id]} and is_public = 1 and container_type = 'Principal' and (filename like :p)",:p=>search).order("created_on desc")
|
||||
end
|
||||
elsif params[:type] == "6" #全部资源
|
||||
# 公共资源库:所有公开资源或者我上传的私有资源
|
||||
@attachments = Attachment.where("is_publish = 1 and is_public = 1 and container_id is not null and container_type in('Project','OrgSubfield','Principal','Course') and (filename like :p)" ,:p => search).order("created_on desc")
|
||||
end
|
||||
@status = params[:status]
|
||||
@type = params[:type]
|
||||
@limit = 25
|
||||
@is_remote = true
|
||||
|
|
|
@ -1044,9 +1044,9 @@ module ApplicationHelper
|
|||
elsif @organization
|
||||
title << @organization.name
|
||||
elsif @user
|
||||
title << @user.login
|
||||
title << @user.try(:realname)
|
||||
else
|
||||
title << User.current.login
|
||||
title << User.current.try(:realname)
|
||||
end
|
||||
if first_page.nil? || first_page.web_title.nil?
|
||||
title << Setting.app_title unless Setting.app_title == title.last
|
||||
|
|
|
@ -22,10 +22,18 @@ module RoutesHelper
|
|||
# Returns the path to project issues or to the cross-project
|
||||
# issue list if project is nil
|
||||
def _project_issues_path(project, *args)
|
||||
if project
|
||||
project_issues_path(project, *args)
|
||||
if args[0].to_s.include? '_page'
|
||||
if args[0].to_s == "user_page"
|
||||
user_activities_path(args[1].to_i)
|
||||
else
|
||||
project_path(project)
|
||||
end
|
||||
else
|
||||
issues_path(*args)
|
||||
if project
|
||||
project_issues_path(project, *args)
|
||||
else
|
||||
issues_path(*args)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -62,7 +62,7 @@ module UsersHelper
|
|||
when 'Course'
|
||||
result = current_time_and_term_resource content
|
||||
when 'Project'
|
||||
result = content.name
|
||||
result = content.name + "(" + content.id.to_s + ")"
|
||||
when 'Issue'
|
||||
result = content.subject
|
||||
when 'Message'
|
||||
|
|
|
@ -90,8 +90,8 @@ class Attachment < ActiveRecord::Base
|
|||
@@thumbnails_storage_path = File.join(Rails.root, "tmp", "thumbnails")
|
||||
|
||||
before_save :files_to_final_location
|
||||
after_save :act_as_course_activity
|
||||
after_create :office_conver, :be_user_score,:act_as_forge_activity,:create_attachment_ealasticsearch_index
|
||||
after_save :act_as_course_activity,:act_as_forge_activity
|
||||
after_create :office_conver, :be_user_score,:create_attachment_ealasticsearch_index
|
||||
after_update :office_conver, :be_user_score,:update_attachment_ealasticsearch_index
|
||||
after_destroy :delete_from_disk,:down_user_score,:delete_attachment_ealasticsearch_index, :decrease_attchments_count, :down_course_score
|
||||
|
||||
|
@ -606,7 +606,7 @@ class Attachment < ActiveRecord::Base
|
|||
# Author lizanle
|
||||
# Description 上传该项目的文档资料也要保存一份在公共表中
|
||||
def act_as_forge_activity
|
||||
if self.container_type == 'Project'
|
||||
if self.container_type == 'Project' && self.forge_acts.empty?
|
||||
self.forge_acts << ForgeActivity.new(:user_id => self.author_id,
|
||||
:project_id => self.container_id)
|
||||
end
|
||||
|
|
|
@ -73,7 +73,8 @@ class CourseActivity < ActiveRecord::Base
|
|||
name = lead_message.subject
|
||||
content = lead_message.content
|
||||
# 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
|
||||
end
|
||||
|
|
|
@ -116,7 +116,7 @@ class User < Principal
|
|||
has_one :preference, :dependent => :destroy, :class_name => 'UserPreference'
|
||||
has_one :rss_token, :class_name => 'Token', :conditions => "action='feeds'"
|
||||
has_one :blog, :class_name => 'Blog', :foreign_key => "author_id"
|
||||
has_many :org_document_comments, :dependent =>:destroy
|
||||
has_many :org_document_comments, :dependent =>:destroy, :foreign_key => "creator_id"
|
||||
has_one :api_token, :class_name => 'Token', :conditions => "action='api'"
|
||||
belongs_to :auth_source
|
||||
has_many :org_members
|
||||
|
@ -1067,6 +1067,16 @@ class User < Principal
|
|||
anonymous_user
|
||||
end
|
||||
|
||||
# refactor User model find function,
|
||||
# return anonymous user when can not find user id = user_id
|
||||
def self.find (*args, &block)
|
||||
begin
|
||||
super
|
||||
rescue
|
||||
self.anonymous
|
||||
end
|
||||
# super
|
||||
end
|
||||
# Salts all existing unsalted passwords
|
||||
# It changes password storage scheme from SHA1(password) to SHA1(salt + SHA1(password))
|
||||
# This method is used in the SaltPasswords migration and is to be kept as is
|
||||
|
|
|
@ -0,0 +1,30 @@
|
|||
<script>
|
||||
$(document).ready(function(){
|
||||
$(".popupClose").click(function(){
|
||||
$(".popupWrap").css("display","none");
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<span class="f16 fontBlue fb">选择版本 </span>
|
||||
<p class="c_red">注:该文件有历史版本,请选择您需要的文件,点击文件名下载。</p>
|
||||
<p class="fontGrey3 mb4 fb">版本及序号</p>
|
||||
|
||||
<div style="max-height:165px; overflow-y:auto; background-color: #e3e3e3; line-height:33px;" class="p10">
|
||||
<span class="attachment">
|
||||
<%= link_to truncate(@attachment.filename,length: 35, omission: '...'),
|
||||
download_named_attachment_path(@attachment.id, @attachment.filename),
|
||||
:title => @attachment.filename+"\n"+@attachment.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis; max-width:300px;",:class => "linkBlue f14 fb link_file_a2 fl" %>
|
||||
</span>
|
||||
<span class="fr">版本号:当前</span>
|
||||
<div class="cl"></div>
|
||||
<% @attachment_histories.each do |history| %>
|
||||
<span class="attachment">
|
||||
<%= link_to truncate(history.filename,length: 35, omission: '...'),
|
||||
download_history_attachment_path(history.id, history.filename),
|
||||
:title => history.filename+"\n"+history.description.to_s,
|
||||
:style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis; max-width:300px;",:class => "linkBlue f14 fb link_file_a2 fl" %>
|
||||
</span>
|
||||
<span class="fr">版本号:<%= history.version %></span>
|
||||
<div class="cl"></div>
|
||||
<% end %>
|
||||
</div>
|
|
@ -0,0 +1,7 @@
|
|||
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'attachments/attachment_history_download' )%>');
|
||||
showModal('ajax-modal', '452px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='hideModal();' style='margin-left: 435px;' class='resourceClose'></a>");
|
||||
$('#ajax-modal').parent().css("top","40%").css("left","50%");
|
||||
$('#ajax-modal').parent().addClass("resourceUploadPopup");
|
||||
$('#ajax-modal').css("padding-left","16px").css("padding-bottom","16px");
|
|
@ -43,6 +43,8 @@
|
|||
<%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>user_activity_id, :content=>activity.content} %>
|
||||
|
||||
<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 class="cl"></div>
|
||||
</div>
|
||||
|
|
|
@ -1,7 +1,123 @@
|
|||
<%= content_for(:header_tags) do %>
|
||||
<%= import_ke(enable_at: true, prettify: false) %>
|
||||
<%= import_ke(enable_at: true, prettify: false, init_activity: false) %>
|
||||
<% 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' %>
|
||||
<div class="resources mt10">
|
||||
<div id="new_course_topic">
|
||||
|
@ -25,7 +141,7 @@
|
|||
<%= text_area :quote,:quote,: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_type => OwnerTypeHelper::MESSAGE,
|
||||
:width => '100%',
|
||||
|
@ -37,8 +153,11 @@
|
|||
:maxlength => 5000 },
|
||||
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>
|
||||
<p id="message_content_span"></p>
|
||||
<p id="e_tip" class="c_grey"></p>
|
||||
<p id="e_tips" class="c_grey"></p>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<div class="mt10">
|
||||
|
@ -49,11 +168,11 @@
|
|||
<div class="cl"></div>
|
||||
<div class="mt5">
|
||||
<%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>
|
||||
<a href="javascript:void(0);" class="fr mr10 mt3" onclick="reset_topic();">取消</a>
|
||||
<% 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>
|
||||
<%= link_to "取消",board_message_url(topic.board, topic.root, :r => (topic.parent_id && topic.id)), :class => "fr mr10 mt3"%>
|
||||
<% end %>
|
||||
|
|
|
@ -25,11 +25,13 @@
|
|||
课程问答区
|
||||
</div>
|
||||
</div>
|
||||
<div nhname="topic_form">
|
||||
<% if User.current.logged? %>
|
||||
<%= 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| %>
|
||||
<%= render :partial => 'course_new', :locals => {:f => f, :topic => @message, :edit_mode => false, :course => @board.course} %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
<%= render :partial=> 'course_show_detail',:locals =>{:topics => @topics, :page => 0} %>
|
||||
</div>
|
||||
|
|
|
@ -9,9 +9,17 @@
|
|||
</div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTitle break_word mt-4">
|
||||
<%= link_to file.is_public? ? truncate(file.filename, length: 45) : truncate(file.filename,length: 35, omission: '...'),
|
||||
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 f_l" %>
|
||||
<%# 如果有历史版本则提供历史版本下载 %>
|
||||
<% if file.attachment_histories.count == 0 %>
|
||||
<%= link_to file.is_public? ? truncate(file.filename, length: 45) : truncate(file.filename,length: 35, omission: '...'),
|
||||
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" %>
|
||||
<% else %>
|
||||
<%= link_to truncate(file.filename,length: 35, omission: '...'), attachment_history_download_path(file.id),
|
||||
:title => file.filename+"\n"+file.description.to_s,
|
||||
:class => "linkGrey3 f_14",
|
||||
:style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;", :remote=>true %>
|
||||
<% end %>
|
||||
<%= file_preview_eye(file, class: 'preview') %>
|
||||
<span id="image_private_<%= file.id%>">
|
||||
<% if file.is_public? == false%>
|
||||
|
|
|
@ -8,9 +8,17 @@
|
|||
</div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTitle break_word mt-4">
|
||||
<%= link_to truncate(file.filename,length: 35, omission: '...'),
|
||||
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" %>
|
||||
<%# 如果有历史版本则提供历史版本下载 %>
|
||||
<% if file.attachment_histories.count == 0 %>
|
||||
<%= link_to truncate(file.filename,length: 35, omission: '...'),
|
||||
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" %>
|
||||
<% else %>
|
||||
<%= link_to truncate(file.filename,length: 35, omission: '...'), attachment_history_download_path(file.id),
|
||||
:title => file.filename+"\n"+file.description.to_s,
|
||||
:class => "linkGrey3 f_14",
|
||||
:style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;", :remote=>true %>
|
||||
<% end %>
|
||||
<%= file_preview_eye(file, class: 'preview') %>
|
||||
<span id="image_private_<%= file.id%>">
|
||||
<% if file.is_public? == false%>
|
||||
|
|
|
@ -6,9 +6,17 @@
|
|||
</div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTitle break_word mt-4">
|
||||
<%= link_to truncate(file.filename,length: 35, omission: '...'),
|
||||
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" %>
|
||||
<%# 如果有历史版本则提供历史版本下载 %>
|
||||
<% if file.attachment_histories.count == 0 %>
|
||||
<%= link_to truncate(file.filename,length: 35, omission: '...'),
|
||||
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" %>
|
||||
<% else %>
|
||||
<%= link_to truncate(file.filename,length: 35, omission: '...'), attachment_history_download_path(file.id),
|
||||
:title => file.filename+"\n"+file.description.to_s,
|
||||
:class => "linkGrey3 f_14",
|
||||
:style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;", :remote=>true %>
|
||||
<% end %>
|
||||
<%= file_preview_eye(file, class: 'preview') %>
|
||||
<span id="image_private_<%= file.id%>">
|
||||
<% if file.is_public? == false%>
|
||||
|
@ -38,31 +46,28 @@
|
|||
<%= render :partial => 'tags/tag_add', :locals => {:obj => file, :object_flag => "6",:tag_name => @tag_name} %>
|
||||
</div>
|
||||
<div class="homepagePostSetting">
|
||||
|
||||
<ul>
|
||||
<li class="homepagePostSettingIcon">
|
||||
<% if User.current.logged? %>
|
||||
|
||||
<% if (is_course_teacher(User.current,@course) || file.author_id == User.current.id) && course_contains_attachment?(@course,file) %>
|
||||
<% if (delete_allowed || User.current.id == file.author_id) && file.container_id == @course.id && file.container_type == "Course" %>
|
||||
<ul class="homepagePostSettiongText">
|
||||
|
||||
<li><%= link_to("发 送".html_safe, 'javascript:void(0)',:class => "postOptionLink",:onclick=>"show_send('#{file.id}','#{User.current.id}','file')") %></li>
|
||||
<li><%= link_to '延期发布',file_hidden_course_file_path(@course,file),:class => "postOptionLink",:remote=>true %></li>
|
||||
<li><%= link_to '更新版本',attachments_versions_path(file),:class => "postOptionLink",:remote=>true %></li>
|
||||
<% if @course.is_public? %>
|
||||
<li>
|
||||
<span id="is_public_<%= file.id %>">
|
||||
<%= link_to (file.is_public? ? "设为私有":"设为公开"), update_file_dense_attachments_path(:attachmentid=>file.id,:newtype=>(file.is_public? ? 0:1)),:remote=>true,:class=>"postOptionLink",:method => :post %>
|
||||
</span>
|
||||
<span id="is_public_<%= file.id %>">
|
||||
<%= link_to (file.is_public? ? "设为私有":"设为公开"), update_file_dense_attachments_path(:attachmentid=>file.id,:newtype=>(file.is_public? ? 0:1)),:remote=>true,:class=>"postOptionLink",:method => :post %>
|
||||
</span>
|
||||
</li>
|
||||
<%end%>
|
||||
<li>
|
||||
<%= link_to( '删除资源', attachment_path(file),
|
||||
:data => {:confirm => l(:text_are_you_sure)}, :method => :delete,:class => "postOptionLink") if (delete_allowed || User.current.id == file.author_id) && file.container_id == @course.id && file.container_type == "Course" && file.destroyable %>
|
||||
:data => {:confirm => l(:text_are_you_sure)},
|
||||
:method => :delete,:class => "postOptionLink") if (delete_allowed || User.current.id == file.author_id) && file.container_id == @course.id && file.container_type == "Course" && file.destroyable %>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<% end %>
|
||||
<%else%>
|
||||
<ul class="resourceSendO">
|
||||
|
|
|
@ -9,6 +9,9 @@
|
|||
$(function(){
|
||||
$("#RSide").removeAttr("id");
|
||||
$("#Container").css("width","1000px");
|
||||
if(<%= @is_edit %>) {
|
||||
issueEditShow();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<div class="homepageRight mt0 ml10" >
|
||||
|
|
|
@ -109,7 +109,7 @@
|
|||
|
||||
<div class="navHomepageNews">
|
||||
<%= link_to "", user_message_path(User.current), :class => "homepageNewsIcon", :target =>"_Blank", :title => "您的所有消息" %>
|
||||
<% if User.current.count_new_message >0 %>
|
||||
<% if User.current.count_new_message.to_i >0 %>
|
||||
<div ><%= link_to User.current.count_new_message , user_message_path(User.current), :class => "newsActive", :target =>"_Blank" %></div>
|
||||
<% end %>
|
||||
<%#= link_to User.current.count_new_message, user_message_path(User.current), :class => "homepageNewsIcon" %>
|
||||
|
|
|
@ -319,7 +319,7 @@
|
|||
}
|
||||
|
||||
})
|
||||
|
||||
//资源库上传附件
|
||||
function course_files_upload(){
|
||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'files/upload_course_files',:locals => {:course => @course,:course_attachment_type => 1}) %>');
|
||||
showModal('ajax-modal', '513px');
|
||||
|
|
|
@ -34,11 +34,7 @@
|
|||
<div class="postRightContainer ml10" onmouseover="$('#message_setting_<%= @topic.id%>').show();" onmouseout="$('#message_setting_<%= @topic.id%>').hide();">
|
||||
<div class="postThemeContainer">
|
||||
<div class="postDetailPortrait">
|
||||
<% if @topic.status == 1 %>
|
||||
<%= 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 %>
|
||||
<%= link_to image_tag(url_to_avatar(@topic.author), :width => 50, :height => 50,:alt=>'图像' ), user_path(@topic.author) %>
|
||||
</div>
|
||||
<div class="postThemeWrap">
|
||||
<% if User.current.logged? %>
|
||||
|
@ -74,16 +70,11 @@
|
|||
<a href="javascript:void(0);" class="f14 linkGrey4 fb" style="overflow:hidden;">主题: <%= @topic.subject%></a>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
||||
<div class="postDetailCreater">
|
||||
<% if @topic.status == 1 %>
|
||||
<span class="fontBlue2">确实团队</span>
|
||||
<% if @topic.try(:author).try(:realname) == ' ' %>
|
||||
<%= link_to @topic.try(:author), user_path(@topic.author,:host=>Setting.host_user), :class => "linkBlue2", :target=> "_blank" %>
|
||||
<% else %>
|
||||
<% if @topic.try(:author).try(:realname) == ' ' %>
|
||||
<%= 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 %>
|
||||
<%= link_to @topic.try(:author).try(:realname), user_path(@topic.author,:host=>Setting.host_user), :class => "linkBlue2", :target=> "_blank" %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="postDetailDate mb5"><%= format_time( @topic.created_on)%></div>
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
<% end %>
|
||||
|
||||
<% elsif @message.course %>
|
||||
<div nhname="topic_form">
|
||||
<%= form_for @message, {
|
||||
:as => :message,
|
||||
:url => {:action => 'edit',:is_course=>@is_course,:is_board=>@is_board},
|
||||
|
@ -22,7 +23,7 @@
|
|||
<%= render :partial => 'boards/course_message_edit',
|
||||
:locals => {:f => f, :edit_mode => true, :topic => @message, :course => @message.course} %>
|
||||
<% end %>
|
||||
|
||||
</div>
|
||||
<% elsif @message.board.org_subfield %>
|
||||
<%= form_for @message, {
|
||||
:as => :message,
|
||||
|
|
|
@ -50,6 +50,8 @@
|
|||
</div>
|
||||
<div class="cl"></div>
|
||||
<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="mt10">
|
||||
<div class="fl" id="topic_attachments">
|
||||
|
|
|
@ -39,6 +39,8 @@
|
|||
<div class="cl"></div>
|
||||
|
||||
<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="mt10">
|
||||
|
|
|
@ -46,6 +46,8 @@
|
|||
</div>
|
||||
<div class="cl"></div>
|
||||
<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="mt10">
|
||||
<div class="fl" id="topic_attachments">
|
||||
|
|
|
@ -66,7 +66,7 @@
|
|||
<%= render :partial => 'projects/project_create', :locals => {:activity => activity, :user_activity_id => activity.id} %>
|
||||
<!--缺陷动态-->
|
||||
<% when "Issue" %>
|
||||
<%= render :partial => 'users/project_issue', :locals => {:activity => activity.forge_act, :user_activity_id => activity.id} %>
|
||||
<%= render :partial => 'users/project_issue', :locals => {:activity => activity.forge_act, :user_activity_id => activity.id, :project_id => activity.project_id} %>
|
||||
|
||||
<!--message -->
|
||||
<% when "Message" %>
|
||||
|
@ -78,7 +78,7 @@
|
|||
<% end %>
|
||||
<!--Attachment -->
|
||||
<% when "Attachment" %>
|
||||
<%= render :partial => 'projects/attachment_acts', :locals => {:activity => activity.forge_act, :user_activity_id => activity.id } %>
|
||||
<%= render :partial => 'users/course_attachment', :locals => {:activity => activity.forge_act, :user_activity_id => activity.id } %>
|
||||
<!--<div class="problem_main">-->
|
||||
<!--<a class="problem_pic fl"><%#= image_tag(url_to_avatar(activity.user), :width => "42", :height => "42") %></a>-->
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
<%= call_hook(:view_projects_settings_members_table_header, :project => @project) %>
|
||||
<% members.each do |member| %>
|
||||
<li >
|
||||
<%= link_to_user_header member.principal,false,:class => "w140_h c_setting_blue fl" %>
|
||||
<%= link_to_user_header member.principal, true, :class => "w140_h c_setting_blue fl" %>
|
||||
<span class="w180_h fl">
|
||||
<!--区分中英文角色显示的不同-->
|
||||
<% if User.current.language == "zh" %>
|
||||
|
|
|
@ -4,6 +4,9 @@
|
|||
$("#pro_st_edit_ku").toggle();
|
||||
}
|
||||
</script>
|
||||
<% unless @project.repositories.any? %>
|
||||
<p class="nodata">温馨提示:<%= l(:label_repository_no_data) %></p>
|
||||
<% end %>
|
||||
<%= str = error_messages_for 'repository' %>
|
||||
<% project_path_cut = RepositoriesHelper::PROJECT_PATH_CUT %>
|
||||
<% ip = RepositoriesHelper::REPO_IP_ADDRESS %><!--Added by tanxianbo For formatting project's path-->
|
||||
|
@ -87,8 +90,6 @@
|
|||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<% else %>
|
||||
<p class="nodata">温馨提示:<%= l(:label_repository_no_data) %></p>
|
||||
<% end %>
|
||||
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
<li><%= link_to "问题动态", {:controller => "projects", :action => "show", :type => "issue"}, :class => "homepagePostTypeMessage postTypeGrey" %></li>
|
||||
<!--<li><%#= link_to "作业动态", {:controller => "courses", :action => "show", :type => "homework"}, :class => "homepagePostTypeAssignment postTypeGrey" %></li>-->
|
||||
<li><%= link_to "新闻动态", {:controller => "projects", :action => "show", :type => "news"}, :class => "homepagePostTypeNotice postTypeGrey" %></li>
|
||||
<!--<li><%#= link_to "资源库动态", {:controller => "projects", :action => "show", :type => "attachment"}, :class => "homepagePostTypeResource resourcesGrey" %></li>-->
|
||||
<li><%= link_to "资源库动态", {:controller => "projects", :action => "show", :type => "attachment"}, :class => "homepagePostTypeResource resourcesGrey" %></li>
|
||||
<li><%= link_to "讨论区动态", {:controller => "projects", :action => "show", :type => "message"}, :class => "homepagePostTypeForum postTypeGrey" %></li>
|
||||
<!--<li><%#= link_to "问卷动态", {:controller => "courses", :action => "show", :type => "poll"}, :class => "homepagePostTypeQuiz postTypeGrey" %></li>-->
|
||||
</ul>
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
<li >
|
||||
<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 class="cl"></div>
|
||||
|
|
|
@ -59,8 +59,8 @@
|
|||
|
||||
<li >
|
||||
<span class="tit_fb ">内容:</span>
|
||||
<div class="showHworkP break_word">
|
||||
<%= text_format(work.description) if work.description%>
|
||||
<div class="showHworkP break_word upload_img" id="student_work_img_<%=work.id %>">
|
||||
<%= work.description.html_safe if work.description%>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
|
@ -105,6 +105,9 @@
|
|||
<div class="cl"></div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
showNormalImage('student_work_img_<%=work.id %>');
|
||||
});
|
||||
function show_upload(){
|
||||
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'student_work/upload_attachment' ,:locals => {:work=>work})%>');
|
||||
showModal('ajax-modal', '452px');
|
||||
|
|
|
@ -71,7 +71,7 @@
|
|||
indentUnit: 2,
|
||||
matchBrackets: true,
|
||||
readOnly: true,
|
||||
value: $("#work-src").text()
|
||||
value: $("#work-src_<%= work.id%>").text()
|
||||
});
|
||||
<% 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")}) %>");
|
||||
|
|
|
@ -4,9 +4,11 @@
|
|||
<p class="f14 mt5">
|
||||
<span class="fb">作品名称:</span><%=@student_work.name%>
|
||||
</p>
|
||||
<p class="f14 mt5">
|
||||
<span class="fb">作品描述:</span><%=@student_work.description%>
|
||||
</p>
|
||||
<div class="f14 mt5" style="max-width: 425px; color:#808181">
|
||||
<div class="fb fl dis">作品描述:</div>
|
||||
<div class="upload_img fl" style="max-width: 350px;"><%=@student_work.description.html_safe %></div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<p class="mt5">
|
||||
<span class="fl fb mr30">附</span><span class="fb fl">件:</span>
|
||||
<% if @student_work.attachments.empty? %>
|
||||
|
|
|
@ -4,9 +4,11 @@
|
|||
<p class="f14 mt5">
|
||||
<span class="fb">作品名称:</span><%=@student_work.name%>
|
||||
</p>
|
||||
<p class="f14 mt5">
|
||||
<span class="fb">作品描述:</span><%=@student_work.description%>
|
||||
</p>
|
||||
<div class="f14 mt5" style="max-width: 425px; color:#808181">
|
||||
<div class="fb fl dis">作品描述:</div>
|
||||
<div class="upload_img fl" style="max-width: 350px;"><%=@student_work.description.html_safe %></div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<p class="mt5">
|
||||
<span class="fl fb mr30">附</span><span class="fb fl">件:</span>
|
||||
<% if @student_work.attachments.empty? %>
|
||||
|
|
|
@ -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="NewsBannerName">编辑作品</div>
|
||||
</div>
|
||||
|
@ -25,7 +29,7 @@
|
|||
</div><!----HomeWorkBox end-->
|
||||
<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|%>
|
||||
<div class=" c_red mb10">
|
||||
提示:作品名称和描述中不要出现真实的姓名信息
|
||||
|
@ -46,13 +50,16 @@
|
|||
<p id="student_work_name_span" class="c_red mb10"></p>
|
||||
</div>
|
||||
<div class="mt10">
|
||||
<textarea name="student_work[description]" id="student_work_description" placeholder="请输入作品描述" class="InputBox W700 H150" maxlength="6000" onkeyup="regexStudentWorkDescription();"><%= @work.description%></textarea>
|
||||
<script>
|
||||
<textarea placeholder="请输入作品描述" style="display: none" nhname='student_work_textarea' name="student_work[description]"><%= @work.description%></textarea>
|
||||
<!--<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");
|
||||
autoTextarea(text);// 调用
|
||||
</script>
|
||||
</script>-->
|
||||
<div class="cl"></div>
|
||||
<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 id="homework_attachments">
|
||||
|
@ -66,7 +73,7 @@
|
|||
<% end %>
|
||||
|
||||
<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>
|
||||
<%= link_to "取消", student_work_index_path(:homework => @homework), :class => "fr mr10 mt3"%>
|
||||
</div>
|
||||
|
@ -96,23 +103,130 @@
|
|||
}
|
||||
|
||||
function popupRegex(){
|
||||
if(regexStudentWorkName()&®exStudentWorkDescription())
|
||||
{
|
||||
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 {
|
||||
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>");
|
||||
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>
|
|
@ -172,7 +172,7 @@
|
|||
<div class="mt5">
|
||||
<% if @homework.homework_detail_manual && @homework.homework_detail_manual.comment_status < 2 %>
|
||||
<div class="fontGrey2 db fl">提交截止时间:<%= @homework.end_time %> 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 %> 23:59</div>
|
||||
<% end %>
|
||||
<% if @homework.homework_detail_manual.comment_status == 0 %>
|
||||
|
|
|
@ -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">
|
||||
<%if @homework.homework_detail_manual.comment_status != 1%>
|
||||
$(function(){
|
||||
|
@ -57,26 +62,136 @@
|
|||
}
|
||||
// 作品校验
|
||||
function popupRegex(){
|
||||
if(regexStudentWorkName()&®exStudentWorkDescription())
|
||||
{
|
||||
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 {
|
||||
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>");
|
||||
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>
|
||||
|
||||
<div class="homepageRightBanner mb10">
|
||||
|
@ -110,7 +225,7 @@
|
|||
</div><!----HomeWorkBox end-->
|
||||
<div class="cl"></div>
|
||||
|
||||
<div class="HomeWorkCon mt15">
|
||||
<div class="HomeWorkCon mt15" nhname='student_work_form'>
|
||||
<%= form_for(@student_work,
|
||||
:html => { :multipart => true },
|
||||
:url => {:controller => 'student_work',
|
||||
|
@ -127,18 +242,21 @@
|
|||
<%=hidden_field_tag 'group_member_ids', params[:group_member_ids], :value=>User.current.id %>
|
||||
<% end %>
|
||||
<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>
|
||||
<p id="student_work_name_span" class="c_red mb10"></p>
|
||||
</div>
|
||||
<div class="mt10">
|
||||
<%= f.text_area "description", :class => "InputBox W700 H150", :placeholder => "请输入作品描述", :onkeyup => "regexStudentWorkDescription();"%>
|
||||
<script>
|
||||
<textarea placeholder="请输入作品描述" style="display: none" nhname='student_work_textarea' name="student_work[description]"></textarea>
|
||||
<%#= f.text_area "description", :class => "InputBox W700 H150", :placeholder => "请输入作品描述", :onkeyup => "regexStudentWorkDescription();"%>
|
||||
<!--<script>
|
||||
var text = document.getElementById("student_work_description");
|
||||
autoTextarea(text);// 调用
|
||||
</script>
|
||||
</script>-->
|
||||
<div class="cl"></div>
|
||||
<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 id="homework_attachments">
|
||||
|
@ -167,9 +285,9 @@
|
|||
</div>-->
|
||||
|
||||
<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>
|
||||
<%= 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 class="cl"></div>
|
||||
<% end%>
|
||||
|
|
|
@ -1,36 +1,36 @@
|
|||
if($("#about_hwork_<%= @work.id%>").children().length > 0){
|
||||
$("#about_hwork_<%= @work.id%>").html("");
|
||||
}
|
||||
else{
|
||||
<% 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}) %>");
|
||||
|
||||
var program_name = "text/x-csrc";
|
||||
var language = <%= @homework.language %>;
|
||||
if (language == 1) {
|
||||
program_name = 'text/x-csrc';
|
||||
} else if(language==2){
|
||||
program_name = 'text/x-c++src';
|
||||
}else if(language==3){
|
||||
program_name = 'text/x-cython';
|
||||
} else if(language==4){
|
||||
program_name = 'text/x-java';
|
||||
}
|
||||
|
||||
var editor = CodeMirror(document.getElementById("work-code_<%= @work.id%>"), {
|
||||
mode: {name: program_name,
|
||||
version: 2,
|
||||
singleLineStringErrors: false},
|
||||
lineNumbers: true,
|
||||
indentUnit: 2,
|
||||
matchBrackets: true,
|
||||
readOnly: true,
|
||||
value: $("#work-src").text()
|
||||
}
|
||||
);
|
||||
|
||||
<% else%>
|
||||
$("#about_hwork_<%= @work.id%>").html("<%= escape_javascript(render :partial => 'show',:locals => {:work =>@work,:score =>@score,:student_work_scores => @student_work_scores}) %>");
|
||||
<% end%>
|
||||
$('#score_<%= @work.id%>').peSlider({range: 'min'});
|
||||
if($("#about_hwork_<%= @work.id%>").children().length > 0){
|
||||
$("#about_hwork_<%= @work.id%>").html("");
|
||||
}
|
||||
else{
|
||||
<% 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}) %>");
|
||||
|
||||
var program_name = "text/x-csrc";
|
||||
var language = <%= @homework.language %>;
|
||||
if (language == 1) {
|
||||
program_name = 'text/x-csrc';
|
||||
} else if(language==2){
|
||||
program_name = 'text/x-c++src';
|
||||
}else if(language==3){
|
||||
program_name = 'text/x-cython';
|
||||
} else if(language==4){
|
||||
program_name = 'text/x-java';
|
||||
}
|
||||
|
||||
var editor = CodeMirror(document.getElementById("work-code_<%= @work.id%>"), {
|
||||
mode: {name: program_name,
|
||||
version: 2,
|
||||
singleLineStringErrors: false},
|
||||
lineNumbers: true,
|
||||
indentUnit: 2,
|
||||
matchBrackets: true,
|
||||
readOnly: true,
|
||||
value: $("#work-src_<%= @work.id%>").text()
|
||||
}
|
||||
);
|
||||
|
||||
<% else%>
|
||||
$("#about_hwork_<%= @work.id%>").html("<%= escape_javascript(render :partial => 'show',:locals => {:work =>@work,:score =>@score,:student_work_scores => @student_work_scores}) %>");
|
||||
<% end%>
|
||||
$('#score_<%= @work.id%>').peSlider({range: 'min'});
|
||||
}
|
|
@ -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="homepagePostBrief">
|
||||
<div class="homepagePostPortrait">
|
||||
<% if activity.status == 1 %>
|
||||
<%= image_tag("/images/trustie_logo1.png", width: "50px", height: "50px") %>
|
||||
<% 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 %>
|
||||
<%= 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} %>
|
||||
</div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo break_word mt-4">
|
||||
<% if activity.status == 1 %>
|
||||
<span class="fontBlue2">确实团队</span>
|
||||
<% if activity.try(:author).try(:realname) == ' ' %>
|
||||
<%= link_to activity.try(:author), user_path(activity.author_id,:host=>Setting.host_user), :class => "newsBlue mr15" %>
|
||||
<% else %>
|
||||
<% if activity.try(:author).try(:realname) == ' ' %>
|
||||
<%= 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 %>
|
||||
<%= link_to activity.try(:author).try(:realname), user_path(activity.author_id,:host=>Setting.host_user), :class => "newsBlue mr15" %>
|
||||
<% end %>
|
||||
TO
|
||||
<%= link_to activity.course.name.to_s+" | 课程问答区", course_boards_path(activity.course,:host=> Setting.host_course), :class => "newsBlue ml15 mr5"%>
|
||||
|
|
|
@ -1,7 +1,17 @@
|
|||
<div class="subject-pop-info">题目信息</div>
|
||||
<div class="subject-pop-wrap">
|
||||
<% 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 %>
|
||||
<div class="subject-pop-intro mb15">标题:<%=homework.name %><br />
|
||||
来源:<%=homework.course.name %><br />
|
||||
|
|
|
@ -2,7 +2,18 @@
|
|||
<div class="subjectInfo">题目信息</div>
|
||||
<div class="subject-content-wrapper">
|
||||
<% 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 %>
|
||||
<div class="subjectIntro mb15">标题:<%=homework.name %><br />
|
||||
来源:<%=homework.course.name %><br />
|
||||
|
|
|
@ -1,18 +1,33 @@
|
|||
<ul class="subject-list-banner">
|
||||
<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-type fl">类别</li>
|
||||
<li class="subject-list-publisher fl">贡献者</li>
|
||||
<li class="subject-list-from fl">
|
||||
<%= 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%>
|
||||
<% 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">
|
||||
<%= 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"%>
|
||||
<%= 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%>
|
||||
</li>
|
||||
<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%>
|
||||
<% 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%>
|
||||
</li>
|
||||
</ul>
|
||||
|
|
|
@ -26,11 +26,14 @@
|
|||
<a href="<%= import_resources_user_path(User.current, :type => '6', :subfield_file_id => params[:subfield_file_id]) %>" id="public_resources_choose" class="subject-choose choose-active fl" data-remote="true">公共资源</a>
|
||||
<a href="<%= import_resources_user_path(User.current, :type => '1', :subfield_file_id => params[:subfield_file_id]) %>" id="my_resources_choose" class="subject-choose fl" data-remote="true">我的资源</a>
|
||||
<% end %>
|
||||
<%#= form_tag( url_for(:controller => 'users', :action => 'import_resources_search', :id => User.current.id, :type => 1),
|
||||
:remote => true , :method => 'get', :id => 'resource_search_form') do %>
|
||||
<div id="user_import_resource_search">
|
||||
<%=render :partial=>'users/user_import_resource_search', :locals => {:type => @type, :search => ''} %>
|
||||
</div>
|
||||
<!--<%#= form_tag( url_for(:controller => 'users', :action => 'import_resources_search', :id => User.current.id), :remote => true , :method => 'get', :id => 'resource_search_form') do %>-->
|
||||
<!--<input type="text" name="search" placeholder="输入资源关键词进行搜索" class="subjectSearch fr" />-->
|
||||
<%#= hidden_field_tag(:type,type.nil? ? 1 : type) %>
|
||||
<%# end %>
|
||||
<!--<%#= hidden_field_tag(:type,type.nil? ? 1 : type) %>-->
|
||||
<!--<%#= submit_tag '', :class => 'homepageSearchIcon', :onfocus => 'this.blur();', :style => 'border-style:none' %>-->
|
||||
<!--<%# end %>-->
|
||||
|
||||
<div class="cl"></div>
|
||||
|
||||
|
@ -42,25 +45,10 @@
|
|||
<li class="subjectPublisher fl">上传者</li>
|
||||
<li class="fl subjectDate">上传时间</li>
|
||||
</ul>
|
||||
<%= form_tag( url_for({:controller => 'users', :action => 'import_into_container',
|
||||
:mul_id => params[:project_id].nil? ? (params[:course_id].nil? ? params[:subfield_file_id] : params[:course_id]) : params[:project_id],
|
||||
:mul_type => params[:project_id].nil? ? (params[:course_id].nil? ? "SubfieldFile" : "Course") : "Project"}),
|
||||
:method => 'post', :id => 'resource_import_container_form') do %>
|
||||
<% @attachments.each do |attach| %>
|
||||
<ul class="subjectRow">
|
||||
<li class="subjectName fl hidden">
|
||||
<label>
|
||||
<input name="checkbox1[]" type="checkbox" data-has-history="<%= attach.attachment_histories.count == 0 ? 'N' : 'Y' %>" data-deleteble="<%= User.current.id ==attach.author_id ? 'Y' : 'N' %>" onclick="checkAllBox($(this));" value="<%= attach.id%>" class="mr5" style="vertical-align:middle;" />
|
||||
<span><%= link_to truncate(attach.filename, :length => 30), download_named_attachment_path(attach.id, attach.filename), :title => attach.filename%></span>
|
||||
</label>
|
||||
</li>
|
||||
<li class="subjectType fl"><%= get_resource_type(attach.container_type)%></li>
|
||||
<li class="subjectCount fl hidden"><%= number_to_human_size(attach.filesize) %></li>
|
||||
<li class="subjectPublisher fl"><%=User.find(attach.author_id).realname.blank? ? User.find(attach.author_id).nickname : User.find(attach.author_id).realname %></li>
|
||||
<li class="fl subjectDate"><%= format_date(attach.created_on) %></li>
|
||||
</ul>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<div id="import_resource_info_list">
|
||||
<%= render :partial => 'users/user_import_resource_list',:locals => {:project_id => params[:project_id], :subfield_file_id => params[:subfield_file_id], :course_id => params[:course_id]} %>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="courseSendSubmit mr15"><a href="javascript:void(0);" class="sendSourceText" onclick="$('#resource_import_container_form').submit();hideModal()">选用</a></div>
|
||||
|
|
|
@ -13,6 +13,29 @@
|
|||
<% end %> TO
|
||||
<%= link_to activity.project.name.to_s+" | 项目问题", project_issues_path(activity.project), :class => "newsBlue ml15"%>
|
||||
</div>
|
||||
<div class="homepagePostSetting">
|
||||
<ul>
|
||||
<li class="homepagePostSettingIcon">
|
||||
<ul class="homepagePostSettiongText">
|
||||
<li>
|
||||
<%= link_to l(:button_edit), issue_path(activity.id, :edit => 'true'), :class => 'postOptionLink', :accesskey => accesskey(:edit) if activity.editable? && User.current.allowed_to?(:edit_issues, activity.project) %>
|
||||
</li>
|
||||
<li>
|
||||
<% if !defined?(project_id) && !defined?(user_id) %>
|
||||
<%= link_to l(:button_delete), issue_path(activity.id), :data => {:confirm => issues_destroy_confirmation_message(activity)}, :method => :delete, :class => 'postOptionLink' if User.current.allowed_to?(:delete_issues, activity.project) %>
|
||||
<% elsif defined?(project_id) %>
|
||||
<%= link_to l(:button_delete), issue_path(activity.id, :page_classify => "project_page", :page_id => project_id), :data => {:confirm => issues_destroy_confirmation_message(activity)}, :method => :delete, :class => 'postOptionLink' if User.current.allowed_to?(:delete_issues, activity.project) %>
|
||||
<% elsif defined?(user_id) %>
|
||||
<%= link_to l(:button_delete), issue_path(activity.id, :page_classify => "user_page", :page_id => user_id), :data => {:confirm => issues_destroy_confirmation_message(activity)}, :method => :delete, :class => 'postOptionLink' if User.current.allowed_to?(:delete_issues, activity.project) %>
|
||||
<% end %>
|
||||
</li>
|
||||
<li>
|
||||
<%= link_to l(:button_copy), project_copy_issue_path(activity.project, activity), :class => 'postOptionLink' if User.current.allowed_to?(:add_issues, activity.project) %>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="homepagePostTitle break_word">
|
||||
<% case activity.tracker_id %>
|
||||
<% when 1%>
|
||||
|
@ -51,6 +74,10 @@
|
|||
<div class="cl"></div>
|
||||
</div>
|
||||
<%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>user_activity_id, :content=>activity.description} %>
|
||||
|
||||
<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 class="cl"></div>
|
||||
<%# 局部刷新:修改xissue属性 %>
|
||||
<% if User.current.member_of?(activity.project) %>
|
||||
<% unless params[:action] == "index" %>
|
||||
|
@ -59,10 +86,7 @@
|
|||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<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 class="cl"></div>
|
||||
<div class="cl"></div>
|
||||
<div class="mt10" style="font-weight:normal;">
|
||||
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %>
|
||||
</div>
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
<li class="resource-list-quote fr"><%= attach.quotes.nil? ? 0 : attach.quotes %></li>
|
||||
<li class="resource-list-download fr"><%= attach.downloads %></li>
|
||||
<li style="display: none"><%= attach.author_id %></li>
|
||||
<li class="resource-list-size fr"><%= number_to_human_size(attach.filesize) %></li>
|
||||
<li class="resource-list-size fr"><%= (number_to_human_size(attach.filesize)).gsub("ytes", "") %></li>
|
||||
<li class="resource-list-uploader fr hidden"><%=User.find(attach.author_id).realname.blank? ? User.find(attach.author_id).nickname : User.find(attach.author_id).realname %></li>
|
||||
<li class="resource-list-type fr"><%= get_resource_type(attach.container_type)%></li>
|
||||
<li class="resource-list-from fr hidden" title="<%= get_resource_origin(attach) %>"><%= get_resource_origin(attach) %></li>
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
<a href="javascript:void(0);" class="sendSourceText" onclick="hideModal()">取消</a>
|
||||
</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%>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
@ -89,7 +89,7 @@
|
|||
<% if act %>
|
||||
<% case user_activity.act_type.to_s %>
|
||||
<% when 'Issue' %>
|
||||
<%= render :partial => 'project_issue', :locals => {:activity => act,:user_activity_id =>user_activity.id} %>
|
||||
<%= render :partial => 'project_issue', :locals => {:activity => act,:user_activity_id =>user_activity.id, :user_id => user_id} %>
|
||||
<% when 'Message' %>
|
||||
<%= render :partial => 'project_message', :locals => {:activity => act,:user_activity_id =>user_activity.id,:is_course=>0,:is_board=>0} %>
|
||||
<% when 'ProjectCreateInfo'%>
|
||||
|
|
|
@ -8,15 +8,15 @@
|
|||
<% if ma.at_message_type == "Message" && !ma.at_message.course.nil? %>
|
||||
<%= link_to ma.subject.html_safe, course_boards_path(ma.at_message.course,
|
||||
:parent_id => ma.at_message.parent_id ? ma.at_message.parent_id : ma.at_message.id, :topic_id => ma.at_message.id),
|
||||
:class =>"#{ma.viewed? ? "newsGrey" : "newsBlack"}",
|
||||
:onmouseover =>"message_titile_show($(this),event)",
|
||||
:onmouseout => "message_titile_hide($(this))" %>
|
||||
:class =>"#{ma.viewed? ? "newsGrey" : "newsBlack"}" %>
|
||||
<!--# :onmouseover =>"message_titile_show($(this),event)",-->
|
||||
<!--:onmouseout => "message_titile_hide($(this))" %>-->
|
||||
<% elsif ma.at_message_type == "Message" && !ma.at_message.project.nil? %>
|
||||
<%= link_to ma.subject.html_safe, project_boards_path(ma.at_message.project,
|
||||
:parent_id => ma.at_message.parent_id ? ma.at_message.parent_id : ma.at_message.id, :topic_id => ma.at_message.id),
|
||||
:class =>"#{ma.viewed? ? "newsGrey" : "newsBlack"}",
|
||||
:onmouseover =>"message_titile_show($(this),event)",
|
||||
:onmouseout => "message_titile_hide($(this))" %>
|
||||
:class =>"#{ma.viewed? ? "newsGrey" : "newsBlack"}" %>
|
||||
<!--# :onmouseover =>"message_titile_show($(this),event)",-->
|
||||
<!--:onmouseout => "message_titile_hide($(this))" %>-->
|
||||
<% else %>
|
||||
<%= link_to ma.subject.html_safe, ma.url, :class =>"#{ma.viewed? ? "newsGrey" : "newsBlack"}", :onmouseover =>"message_titile_show($(this),event)", :onmouseout => "message_titile_hide($(this))" %>
|
||||
<% end %>
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
$("#GroupPopupBox a.group_save_btn").click();
|
||||
<% end %>
|
||||
});
|
||||
var homework_description_editor;
|
||||
function checked_val() {
|
||||
if ($("#anonymous_comment").is(":checked")) {
|
||||
$("#anonymous_comment").val(1);
|
||||
|
@ -106,7 +105,7 @@
|
|||
//paramsHeight = params.kindutil.removeUnit(this.height);
|
||||
edit.iframe.height(150);
|
||||
this.resize(null, Math.max((params.kindutil.IE ? body.scrollHeight : body.offsetHeight) , 150));
|
||||
|
||||
elocalStorage(homework_description_editor,'homework_<%=User.current.id %>');
|
||||
}
|
||||
}).loadPlugin('paste');
|
||||
return editor;
|
||||
|
@ -150,7 +149,7 @@
|
|||
<div class="cl"></div>
|
||||
|
||||
<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 %>
|
||||
<input type="hidden" name="quotes" id="ref_homework_id" value=""/>
|
||||
<% end %>
|
||||
|
@ -159,7 +158,7 @@
|
|||
<% end %>
|
||||
<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%>" >
|
||||
<% 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')%>
|
||||
<% end %>
|
||||
</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 => "请选择发布作业的课程"} %>
|
||||
</div>
|
||||
<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 id="homework_attachments">
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
<%= form_tag( url_for({:controller => 'users', :action => 'import_into_container',
|
||||
:mul_id => project_id.nil? ? (course_id.nil? ? subfield_file_id : course_id) : project_id,
|
||||
:mul_type => project_id.nil? ? (course_id.nil? ? "SubfieldFile" : "Course") : "Project"}),
|
||||
:method => 'post', :id => 'resource_import_container_form') do %>
|
||||
<% @attachments.each do |attach| %>
|
||||
<ul class="subjectRow">
|
||||
<li class="subjectName fl hidden">
|
||||
<label>
|
||||
<input name="checkbox1[]" type="checkbox" data-has-history="<%= attach.attachment_histories.count == 0 ? 'N' : 'Y' %>" data-deleteble="<%= User.current.id ==attach.author_id ? 'Y' : 'N' %>" onclick="checkAllBox($(this));" value="<%= attach.id%>" class="mr5" style="vertical-align:middle;" />
|
||||
<span><%= link_to truncate(attach.filename, :length => 30), download_named_attachment_path(attach.id, attach.filename), :title => attach.filename%></span>
|
||||
</label>
|
||||
</li>
|
||||
<li class="subjectType fl"><%= get_resource_type(attach.container_type)%></li>
|
||||
<li class="subjectCount fl hidden"><%= (number_to_human_size(attach.filesize)).gsub("ytes", "") %></li>
|
||||
<li class="subjectPublisher fl"><%=User.find(attach.author_id).realname.blank? ? User.find(attach.author_id).nickname : User.find(attach.author_id).realname %></li>
|
||||
<li class="fl subjectDate"><%= format_date(attach.created_on) %></li>
|
||||
</ul>
|
||||
<% end %>
|
||||
<% end %>
|
|
@ -0,0 +1,29 @@
|
|||
<input type="text" name="search" placeholder="输入资源关键词进行搜索" class="subjectSearch fr" />
|
||||
<script type="text/javascript">
|
||||
var lastSearchCondition = '';
|
||||
var count = 0;
|
||||
function search_hws(e){
|
||||
if($(e.target).val().trim() == lastSearchCondition && lastSearchCondition != '')
|
||||
{
|
||||
return;
|
||||
}
|
||||
lastSearchCondition = $(e.target).val().trim();
|
||||
$.ajax({
|
||||
url: '<%= url_for(:controller => 'users', :action => 'import_resources_search', :id => User.current.id) %>'+'?name='+ e.target.value+'&type=<%=type %>',
|
||||
type:'get'
|
||||
});
|
||||
}
|
||||
|
||||
function throttle(method,context,e){
|
||||
clearTimeout(method.tId);
|
||||
method.tId=setTimeout(function(){
|
||||
method.call(context,e);
|
||||
},500);
|
||||
}
|
||||
|
||||
//查询项目
|
||||
$("input[name='search']").on('input', function (e) {
|
||||
throttle(search_hws,window,e);
|
||||
});
|
||||
|
||||
</script>
|
|
@ -5,9 +5,10 @@
|
|||
<li class="homepageNewsPubType fl"><%=link_to ma.course_message.author, user_path(ma.course_message.author), :class => "newsBlue homepageNewsPublisher" %><span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">发布了通知:</span></li>
|
||||
<li class="homepageNewsContent fl">
|
||||
<%= link_to ma.course_message.title, {:controller => 'news', :action => 'show', :id => ma.course_message.id },
|
||||
:class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
|
||||
:onmouseover =>"message_titile_show($(this),event)",
|
||||
:onmouseout => "message_titile_hide($(this))" %></li>
|
||||
:class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}" %>
|
||||
<!--:onmouseover =>"message_titile_show($(this),event)",-->
|
||||
<!--:onmouseout => "message_titile_hide($(this))" %>-->
|
||||
</li>
|
||||
<div style="display: none" class="message_title_red system_message_style">
|
||||
<p><strong>标题:</strong><%= ma.course_message.title %></p>
|
||||
<% unless ma.course_message.description.nil? %>
|
||||
|
@ -24,9 +25,10 @@
|
|||
<li class="homepageNewsPubType fl"><%=link_to ma.course_message.author, user_path(ma.course_message.author), :class => "newsBlue homepageNewsPublisher" %><span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">评论了通知:</span></li>
|
||||
<li class="homepageNewsContent fl">
|
||||
<%= link_to ma.course_message.commented.title, {:controller => 'news', :action => 'show', :id => ma.course_message.commented.id },
|
||||
:class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
|
||||
:onmouseover =>"message_titile_show($(this),event)",
|
||||
:onmouseout => "message_titile_hide($(this))" %></li>
|
||||
:class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}" %>
|
||||
<!--:onmouseover =>"message_titile_show($(this),event)",-->
|
||||
<!--:onmouseout => "message_titile_hide($(this))" %>-->
|
||||
</li>
|
||||
<div style="display: none" class="message_title_red system_message_style">
|
||||
<p><strong>评论对象:</strong><%= ma.course_message.commented.title %></p>
|
||||
<% unless ma.course_message.comments.nil? %>
|
||||
|
@ -46,14 +48,14 @@
|
|||
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
||||
<% if !User.current.allowed_to?(:as_teacher, ma.course_message.course) && cur_user_works_for_homework(ma.course_message).nil? %>
|
||||
<%= link_to "作业标题:" + ma.course_message.name, new_student_work_path(:homework => ma.course_message.id),
|
||||
:class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
|
||||
:onmouseover =>"message_titile_show($(this),event)",
|
||||
:onmouseout => "message_titile_hide($(this))" %>
|
||||
:class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}" %>
|
||||
<!--:onmouseover =>"message_titile_show($(this),event)",-->
|
||||
<!--:onmouseout => "message_titile_hide($(this))" %>-->
|
||||
<% else %>
|
||||
<%= link_to "作业标题:" + ma.course_message.name, student_work_index_path(:homework => ma.course_message.id),
|
||||
:class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
|
||||
:onmouseover => "message_titile_show($(this),event)",
|
||||
:onmouseout => "message_titile_hide($(this))" %>
|
||||
:class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}" %>
|
||||
<!--:onmouseover => "message_titile_show($(this),event)",-->
|
||||
<!--:onmouseout => "message_titile_hide($(this))" %>-->
|
||||
<% end %>
|
||||
</a></li>
|
||||
<div style="display: none" class="message_title_red system_message_style">
|
||||
|
@ -104,9 +106,9 @@
|
|||
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">发布的作业:</span></li>
|
||||
<li class="homepageHomeworkContent fl">
|
||||
<%= link_to "作业标题:" + ma.course_message.name, student_work_index_path(:homework => ma.course_message.id),
|
||||
:class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
|
||||
:onmouseover => "message_titile_show($(this),event)",
|
||||
:onmouseout => "message_titile_hide($(this))" %>
|
||||
:class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}" %>
|
||||
<!--:onmouseover => "message_titile_show($(this),event)",-->
|
||||
<!--:onmouseout => "message_titile_hide($(this))" %>-->
|
||||
</li>
|
||||
<div style="display: none" class="message_title_red system_message_style">
|
||||
<% if !User.current.allowed_to?(:as_teacher,ma.course_message.course) %>
|
||||
|
@ -173,9 +175,9 @@
|
|||
<%=link_to ma.course_message.user.lastname + ma.course_message.user.firstname + "老师",
|
||||
user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher" %><span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">关闭了作业匿评:</span></li>
|
||||
<li class="homepageNewsContent fl">
|
||||
<%= link_to "作业标题:" + ma.course_message.name, student_work_index_path(:homework => ma.course_message.id), :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
|
||||
:onmouseover =>"message_titile_show($(this),event)",
|
||||
:onmouseout => "message_titile_hide($(this))"%>
|
||||
<%= link_to "作业标题:" + ma.course_message.name, student_work_index_path(:homework => ma.course_message.id), :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}" %>
|
||||
<!--:onmouseover =>"message_titile_show($(this),event)",-->
|
||||
<!--:onmouseout => "message_titile_hide($(this))"%>-->
|
||||
</li>
|
||||
<div style="display: none" class="message_title_red system_message_style">
|
||||
<p>
|
||||
|
@ -208,9 +210,9 @@
|
|||
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">启动作业匿评失败</span>
|
||||
</li>
|
||||
<li class="homepageNewsContent fl">
|
||||
<%= link_to truncate(ma.course_message.name,:length=>25)+'(失败原因:提交作品的人数低于2人)', student_work_index_path(:homework => ma.course_message.id), :class => "#{ma.viewed == 0 ? "c_red" : "newsGrey "}",
|
||||
:onmouseover => "message_titile_show($(this),event)",
|
||||
:onmouseout => "message_titile_hide($(this))" %>
|
||||
<%= link_to truncate(ma.course_message.name,:length=>25)+'(失败原因:提交作品的人数低于2人)', student_work_index_path(:homework => ma.course_message.id), :class => "#{ma.viewed == 0 ? "c_red" : "newsGrey "}" %>
|
||||
<!--:onmouseover => "message_titile_show($(this),event)",-->
|
||||
<!--:onmouseout => "message_titile_hide($(this))" %>-->
|
||||
</li>
|
||||
<div style="display: none" class="message_title_red system_message_style">
|
||||
<p>
|
||||
|
@ -234,9 +236,10 @@
|
|||
<li class="homepageNewsPubType fl"><%=link_to ma.course_message.user, user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher" %><span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">发布了问卷:</span></li>
|
||||
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
||||
<%= link_to format_activity_title(" #{ma.course_message.polls_name.nil? ? "未命名问卷" : ma.course_message.polls_name}"), poll_path(ma.course_message.id),
|
||||
:class=>"#{ma.viewed==0?"newsBlack":"newsGrey"}",
|
||||
:onmouseover =>"message_titile_show($(this),event)",
|
||||
:onmouseout => "message_titile_hide($(this))" %></a></li>
|
||||
:class=>"#{ma.viewed==0?"newsBlack":"newsGrey"}" %>
|
||||
<!--:onmouseover =>"message_titile_show($(this),event)",-->
|
||||
<!--:onmouseout => "message_titile_hide($(this))" %>-->
|
||||
</a></li>
|
||||
<div style="display: none" class="message_title_red system_message_style">
|
||||
<%= ma.course_message.polls_name %>
|
||||
</div>
|
||||
|
@ -252,9 +255,10 @@
|
|||
<% if ma.course_message.parent_id.nil? %>
|
||||
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
||||
<%= link_to ma.course_message.subject, course_boards_path(ma.course_message.course, :parent_id => ma.course_message.parent_id ? ma.course_message.parent_id : ma.course_message.id, :topic_id => ma.course_message.id),
|
||||
:class => "#{ma.viewed==0 ? "newsBlack" : "newsGrey"}",
|
||||
:onmouseover =>"message_titile_show($(this),event)",
|
||||
:onmouseout => "message_titile_hide($(this))" %></a></li>
|
||||
:class => "#{ma.viewed==0 ? "newsBlack" : "newsGrey"}" %>
|
||||
<!--:onmouseover =>"message_titile_show($(this),event)",-->
|
||||
<!--:onmouseout => "message_titile_hide($(this))" %>-->
|
||||
</a></li>
|
||||
<div style="display: none" class="message_title_red system_message_style" >
|
||||
<p><strong>主题:</strong><%= ma.course_message.subject %></p>
|
||||
<% unless ma.course_message.content.nil? %>
|
||||
|
@ -265,9 +269,10 @@
|
|||
<% else %>
|
||||
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
||||
<%= link_to ma.course_message.content.html_safe, course_boards_path(ma.course_message.course, :parent_id => ma.course_message.parent_id ? ma.course_message.parent_id : ma.course_message.id, :topic_id => ma.course_message.id),
|
||||
:class => "#{ma.viewed==0 ? "newsBlack" : "newsGrey"}",
|
||||
:onmouseover =>"message_titile_show($(this),event)",
|
||||
:onmouseout => "message_titile_hide($(this))" %></a></li>
|
||||
:class => "#{ma.viewed==0 ? "newsBlack" : "newsGrey"}" %>
|
||||
<!--:onmouseover =>"message_titile_show($(this),event)",-->
|
||||
<!--:onmouseout => "message_titile_hide($(this))" %>-->
|
||||
</a></li>
|
||||
<div style="display: none" class="message_title_red system_message_style" >
|
||||
<p><strong>主题:</strong><%= ma.course_message.subject %></p>
|
||||
<% unless ma.course_message.content.nil? %>
|
||||
|
@ -303,9 +308,10 @@
|
|||
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
||||
<% unless ma.content.nil? %>
|
||||
<%= link_to ma.content.html_safe, student_work_index_path(:homework => ma.course_message.student_work.homework_common_id),
|
||||
:class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
|
||||
:onmouseover =>"message_titile_show($(this),event)",
|
||||
:onmouseout => "message_titile_hide($(this))" %></a></li>
|
||||
:class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}" %>
|
||||
<!--:onmouseover =>"message_titile_show($(this),event)",-->
|
||||
<!--:onmouseout => "message_titile_hide($(this))" %>-->
|
||||
</a></li>
|
||||
<div style="display: none" class="message_title_red system_message_style" >
|
||||
<p>
|
||||
<%= User.current.show_name %>同学您好!
|
||||
|
@ -341,9 +347,10 @@
|
|||
</li>
|
||||
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
||||
<%= link_to ma.course_message.notes.html_safe, course_feedback_path(:id => ma.course_id),
|
||||
:class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
|
||||
:onmouseover => "message_titile_show($(this),event)",
|
||||
:onmouseout => "message_titile_hide($(this))" %></a>
|
||||
:class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}" %>
|
||||
<!--:onmouseover => "message_titile_show($(this),event)",-->
|
||||
<!--:onmouseout => "message_titile_hide($(this))" %>-->
|
||||
</a>
|
||||
</li>
|
||||
<div style="display: none" class="message_title_red system_message_style">
|
||||
<%= ma.course_message.notes.html_safe %>
|
||||
|
@ -363,9 +370,10 @@
|
|||
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">回复了作品评论:</span>
|
||||
</li>
|
||||
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
||||
<%= link_to ma.course_message.notes, student_work_index_path(:homework => ma.course_message.jour.student_work.homework_common_id), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
|
||||
:onmouseover => "message_titile_show($(this),event)",
|
||||
:onmouseout => "message_titile_hide($(this))" %></a>
|
||||
<%= link_to ma.course_message.notes, student_work_index_path(:homework => ma.course_message.jour.student_work.homework_common_id), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}" %>
|
||||
<!--:onmouseover => "message_titile_show($(this),event)",-->
|
||||
<!--:onmouseout => "message_titile_hide($(this))" %>-->
|
||||
</a>
|
||||
</li>
|
||||
<div style="display: none" class="message_title_red system_message_style">
|
||||
<p>
|
||||
|
@ -393,9 +401,10 @@
|
|||
</li>
|
||||
<li class="homepageHomeworkContent fl"><a href="javascript:void(0);" class="newsGrey">
|
||||
<%= link_to "作业标题:" + ma.course_message.homework_common.name, student_work_index_path(:homework => ma.course_message.homework_common_id),
|
||||
:class => "#{ma.viewed==0 ? "newsBlack" : "newsGrey"}",
|
||||
:onmouseover => "message_titile_show($(this),event)",
|
||||
:onmouseout => "message_titile_hide($(this))" %></a>
|
||||
:class => "#{ma.viewed==0 ? "newsBlack" : "newsGrey"}" %>
|
||||
<!--:onmouseover => "message_titile_show($(this),event)",-->
|
||||
<!--:onmouseout => "message_titile_hide($(this))" %>-->
|
||||
</a>
|
||||
</li>
|
||||
<div style="display: none" class="message_title_red system_message_style">
|
||||
<p>
|
||||
|
@ -427,9 +436,10 @@
|
|||
</li>
|
||||
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
||||
<%= link_to "课程名称:" + ma.course_message.name, course_path(ma.course_message),
|
||||
:class => "#{ma.viewed==0 ? "newsBlack" : "newsGrey"}",
|
||||
:onmouseover => "message_titile_show($(this),event)",
|
||||
:onmouseout => "message_titile_hide($(this))" %></a></li>
|
||||
:class => "#{ma.viewed==0 ? "newsBlack" : "newsGrey"}" %>
|
||||
<!--:onmouseover => "message_titile_show($(this),event)",-->
|
||||
<!--:onmouseout => "message_titile_hide($(this))" %>-->
|
||||
</a></li>
|
||||
<div style="display: none" class="message_title_red system_message_style">
|
||||
<p>
|
||||
<%= User.current.lastname + User.current.firstname %>老师您好!您成功创建了一个课程,详情如下:
|
||||
|
@ -459,9 +469,10 @@
|
|||
</li>
|
||||
<li class="homepageHomeworkContent fl"><a href="javascript:void(0);" class="newsGrey">
|
||||
<%= link_to User.find(ma.course_message_id).name+"申请成为课程\""+"#{Course.find(ma.course_id).name}"+"\"的"+"#{ma.content == '9' ? "教师" : "教辅"}", user_path(User.find(ma.course_message_id), :course_id => ma.course_id),
|
||||
:class => "#{ma.viewed==0 ? "newsBlack" : "newsGrey"}",
|
||||
:onmouseover => "message_titile_show($(this),event)",
|
||||
:onmouseout => "message_titile_hide($(this))" %></a>
|
||||
:class => "#{ma.viewed==0 ? "newsBlack" : "newsGrey"}" %>
|
||||
<!--:onmouseover => "message_titile_show($(this),event)",-->
|
||||
<!--:onmouseout => "message_titile_hide($(this))" %>-->
|
||||
</a>
|
||||
</li>
|
||||
<div style="display: none" class="message_title_red system_message_style">
|
||||
<p>
|
||||
|
@ -502,9 +513,10 @@
|
|||
'您申请成为课程"'+Course.find(ma.course_id).name+'"的'+(ma.content == '9' ? '老师' : '教辅')+'申请已通过'
|
||||
:
|
||||
'您申请成为课程"'+Course.find(ma.course_id).name+'"的'+(ma.content == '9' ? '老师' : '教辅')+'的申请被拒绝', course_path(Course.find(ma.course_id)),
|
||||
:class => "#{ma.viewed==0 ? "newsBlack" : "newsGrey"}",
|
||||
:onmouseover => "message_titile_show($(this),event)",
|
||||
:onmouseout => "message_titile_hide($(this))" %></a>
|
||||
:class => "#{ma.viewed==0 ? "newsBlack" : "newsGrey"}" %>
|
||||
<!--:onmouseover => "message_titile_show($(this),event)",-->
|
||||
<!--:onmouseout => "message_titile_hide($(this))" %>-->
|
||||
</a>
|
||||
</span>
|
||||
</li>
|
||||
<div style="display: none" class="message_title_red system_message_style">
|
||||
|
@ -531,9 +543,10 @@
|
|||
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">将您加入了课程:</span>
|
||||
</li>
|
||||
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
||||
<%= link_to ma.course.name, course_member_path(ma.course), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
|
||||
:onmouseover => "message_titile_show($(this),event)",
|
||||
:onmouseout => "message_titile_hide($(this))" %></a>
|
||||
<%= link_to ma.course.name, course_member_path(ma.course), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}" %>
|
||||
<!--:onmouseover => "message_titile_show($(this),event)",-->
|
||||
<!--:onmouseout => "message_titile_hide($(this))" %>-->
|
||||
</a>
|
||||
</li>
|
||||
<div style="display: none" class="message_title_red system_message_style">
|
||||
<% if ma.course.is_public? || User.current.member_of_course?(ma.course) || User.current.admin? %>
|
||||
|
@ -564,9 +577,10 @@
|
|||
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">您增加了新的课程成员:</span>
|
||||
</li>
|
||||
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
||||
<%= link_to User.find(ma.course_message_id).login+"("+(User.find(ma.course_message_id).realname ? User.find(ma.course_message_id).realname : User.find(ma.course_message_id).login) +")", user_path(ma.course_message_id), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
|
||||
:onmouseover => "message_titile_show($(this),event)",
|
||||
:onmouseout => "message_titile_hide($(this))" %></a>
|
||||
<%= link_to User.find(ma.course_message_id).login+"("+(User.find(ma.course_message_id).realname ? User.find(ma.course_message_id).realname : User.find(ma.course_message_id).login) +")", user_path(ma.course_message_id), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}" %>
|
||||
<!--:onmouseover => "message_titile_show($(this),event)",-->
|
||||
<!--:onmouseout => "message_titile_hide($(this))" %>-->
|
||||
</a>
|
||||
</li>
|
||||
<div style="display: none" class="message_title_red system_message_style">
|
||||
<% if ma.course.is_public? || User.current.member_of_course?(ma.course) || User.current.admin? %>
|
||||
|
@ -597,9 +611,10 @@
|
|||
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">将您移出了课程:</span>
|
||||
</li>
|
||||
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
||||
<%= link_to ma.course.name, member_course_path(ma.course), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
|
||||
:onmouseover => "message_titile_show($(this),event)",
|
||||
:onmouseout => "message_titile_hide($(this))" %></a>
|
||||
<%= link_to ma.course.name, member_course_path(ma.course), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}" %>
|
||||
<!--:onmouseover => "message_titile_show($(this),event)",-->
|
||||
<!--:onmouseout => "message_titile_hide($(this))" %>-->
|
||||
</a>
|
||||
</li>
|
||||
<div style="display: none" class="message_title_red system_message_style">
|
||||
<% if ma.course.is_public? || User.current.member_of?(ma.course) || User.current.admin? %>
|
||||
|
@ -628,9 +643,9 @@
|
|||
<span><%=link_to ma.course_message.user.lastname + ma.course_message.user.firstname + "老师",
|
||||
user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher" %></span><span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">发布了课程测验 :</span></li>
|
||||
<li class="homepageNewsContent fl">
|
||||
<%= link_to "测验题目:" + ma.course_message.exercise_name, exercise_path(:id => ma.course_message.id), :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
|
||||
:onmouseover =>"message_titile_show($(this),event)",
|
||||
:onmouseout => "message_titile_hide($(this))"%>
|
||||
<%= link_to "测验题目:" + ma.course_message.exercise_name, exercise_path(:id => ma.course_message.id), :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}" %>
|
||||
<!--:onmouseover =>"message_titile_show($(this),event)",-->
|
||||
<!--:onmouseout => "message_titile_hide($(this))"%>-->
|
||||
</li>
|
||||
|
||||
<div style="display: none" class="message_title_red system_message_style">
|
||||
|
@ -665,9 +680,9 @@
|
|||
<span> <%=link_to ma.course_message.user.lastname + ma.course_message.user.firstname + "老师",
|
||||
user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher" %></span><span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">发布的测验:</span></li>
|
||||
<li class="homepageHomeworkContent fl">
|
||||
<%= link_to "测验题目:" + ma.course_message.exercise_name, exercise_path(:id => ma.course_message.id), :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
|
||||
:onmouseover =>"message_titile_show($(this),event)",
|
||||
:onmouseout => "message_titile_hide($(this))"%>
|
||||
<%= link_to "测验题目:" + ma.course_message.exercise_name, exercise_path(:id => ma.course_message.id), :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}" %>
|
||||
<!--:onmouseover =>"message_titile_show($(this),event)",-->
|
||||
<!--:onmouseout => "message_titile_hide($(this))"%>-->
|
||||
|
||||
</li>
|
||||
|
||||
|
|
|
@ -10,9 +10,10 @@
|
|||
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">申请加入项目:</span>
|
||||
</li>
|
||||
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
||||
<%= link_to ma.project, settings_project_path(:id => ma.project, :tab => "members"), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
|
||||
:onmouseover => "message_titile_show($(this),event)",
|
||||
:onmouseout => "message_titile_hide($(this))" %></a>
|
||||
<%= link_to ma.project, settings_project_path(:id => ma.project, :tab => "members"), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}" %>
|
||||
<!--:onmouseover => "message_titile_show($(this),event)",-->
|
||||
<!--:onmouseout => "message_titile_hide($(this))" %>-->
|
||||
</a>
|
||||
</li>
|
||||
<div style="display: none" class="message_title_red system_message_style">
|
||||
<%= ma.project %>
|
||||
|
@ -32,9 +33,10 @@
|
|||
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">将您加入了项目:</span>
|
||||
</li>
|
||||
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
||||
<%= link_to ma.project, project_member_path(ma.project), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
|
||||
:onmouseover => "message_titile_show($(this),event)",
|
||||
:onmouseout => "message_titile_hide($(this))" %></a>
|
||||
<%= link_to ma.project, project_member_path(ma.project), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}" %>
|
||||
<!--:onmouseover => "message_titile_show($(this),event)",-->
|
||||
<!--:onmouseout => "message_titile_hide($(this))" %>-->
|
||||
</a>
|
||||
</li>
|
||||
<div style="display: none" class="message_title_red system_message_style">
|
||||
<% if ma.project.is_public? || User.current.member_of?(ma.project) || User.current.admin? %>
|
||||
|
@ -67,9 +69,10 @@
|
|||
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">将您移出了项目:</span>
|
||||
</li>
|
||||
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
||||
<%= link_to ma.project, member_project_path(ma.project), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
|
||||
:onmouseover => "message_titile_show($(this),event)",
|
||||
:onmouseout => "message_titile_hide($(this))" %></a>
|
||||
<%= link_to ma.project, member_project_path(ma.project), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}" %>
|
||||
<!--:onmouseover => "message_titile_show($(this),event)",-->
|
||||
<!--:onmouseout => "message_titile_hide($(this))" %>-->
|
||||
</a>
|
||||
</li>
|
||||
<div style="display: none" class="message_title_red system_message_style">
|
||||
<% if ma.project.is_public? || User.current.member_of?(ma.project) || User.current.admin? %>
|
||||
|
@ -107,9 +110,9 @@
|
|||
<li class="homepageHomeworkContent fl">
|
||||
<% end %>
|
||||
<%= link_to ma.project, project_path(ma.project),
|
||||
:class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
|
||||
:onmouseover => "message_titile_show($(this),event)",
|
||||
:onmouseout => "message_titile_hide($(this))" %>
|
||||
:class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}" %>
|
||||
<!--:onmouseover => "message_titile_show($(this),event)",-->
|
||||
<!--:onmouseout => "message_titile_hide($(this))" %>-->
|
||||
</li>
|
||||
<div style="display: none" class="message_title_red system_message_style">
|
||||
<%= ma.project %>
|
||||
|
@ -136,9 +139,10 @@
|
|||
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>"><%= ma.forge_message.tracker_id == 5 ? "发布的周报:":"指派给你的问题:"%></span>
|
||||
</li>
|
||||
<li class="homepageHomeworkContent fl"><a href="javascript:void(0);" class="newsGrey">
|
||||
<%= link_to ma.forge_message.subject, issue_path(:id => ma.forge_message.id), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
|
||||
:onmouseover => "message_titile_show($(this),event)",
|
||||
:onmouseout => "message_titile_hide($(this))" %></a>
|
||||
<%= link_to ma.forge_message.subject, issue_path(:id => ma.forge_message.id), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}" %>
|
||||
<!--:onmouseover => "message_titile_show($(this),event)",-->
|
||||
<!--:onmouseout => "message_titile_hide($(this))" %>-->
|
||||
</a>
|
||||
</li>
|
||||
<div style="display: none" class="message_title_red system_message_style">
|
||||
<p><strong>主题:</strong><%= ma.forge_message.subject %></p>
|
||||
|
@ -160,9 +164,10 @@
|
|||
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>"><%= ma.forge_message.tracker_id == 5 ? "发布了周报:":"指派了问题给你:"%></span>
|
||||
</li>
|
||||
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
||||
<%= link_to ma.forge_message.subject, issue_path(:id => ma.forge_message.id), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
|
||||
:onmouseover => "message_titile_show($(this),event)",
|
||||
:onmouseout => "message_titile_hide($(this))" %></a>
|
||||
<%= link_to ma.forge_message.subject, issue_path(:id => ma.forge_message.id), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}" %>
|
||||
<!--:onmouseover => "message_titile_show($(this),event)",-->
|
||||
<!--:onmouseout => "message_titile_hide($(this))" %>-->
|
||||
</a>
|
||||
</li>
|
||||
<div style="display: none" class="message_title_red system_message_style">
|
||||
<p><strong>主题:</strong><%= ma.forge_message.subject %></p>
|
||||
|
@ -187,9 +192,10 @@
|
|||
</li>
|
||||
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
||||
<%= link_to ma.forge_message.journalized.subject,
|
||||
issue_path(:id => ma.forge_message.journalized_id), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
|
||||
:onmouseover =>"message_titile_show($(this),event)",
|
||||
:onmouseout => "message_titile_hide($(this))" %></a>
|
||||
issue_path(:id => ma.forge_message.journalized_id), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}" %>
|
||||
<!--:onmouseover =>"message_titile_show($(this),event)",-->
|
||||
<!--:onmouseout => "message_titile_hide($(this))" %>-->
|
||||
</a>
|
||||
</li>
|
||||
<div style="display: none" class="message_title_red system_message_style" >
|
||||
<p><strong>问题标题:</strong><%= ma.forge_message.journalized.subject %></p>
|
||||
|
@ -208,9 +214,10 @@
|
|||
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
||||
<%= link_to ma.forge_message.subject, project_boards_path(ma.forge_message.project,
|
||||
:parent_id => ma.forge_message.parent_id ? ma.forge_message.parent_id : ma.forge_message.id,
|
||||
:topic_id => ma.forge_message.id), :class => "#{ma.viewed==0 ? "newsBlack" : "newsGrey"}",
|
||||
:onmouseover => "message_titile_show($(this),event)",
|
||||
:onmouseout => "message_titile_hide($(this))" %></a></li>
|
||||
:topic_id => ma.forge_message.id), :class => "#{ma.viewed==0 ? "newsBlack" : "newsGrey"}" %>
|
||||
<!--:onmouseover => "message_titile_show($(this),event)",-->
|
||||
<!--:onmouseout => "message_titile_hide($(this))" %>-->
|
||||
</a></li>
|
||||
<div style="display: none" class="message_title_red system_message_style">
|
||||
<p><strong>主题:</strong><%= ma.forge_message.subject %></p>
|
||||
<% unless ma.forge_message.content.nil? %>
|
||||
|
@ -222,9 +229,10 @@
|
|||
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
||||
<%= link_to ma.forge_message.subject, project_boards_path(ma.forge_message.project,
|
||||
:parent_id => ma.forge_message.parent_id ? ma.forge_message.parent_id : ma.forge_message.id,
|
||||
:topic_id => ma.forge_message.id), :class => "#{ma.viewed==0 ? "newsBlack" : "newsGrey"}",
|
||||
:onmouseover => "message_titile_show($(this),event)",
|
||||
:onmouseout => "message_titile_hide($(this))" %></a></li>
|
||||
:topic_id => ma.forge_message.id), :class => "#{ma.viewed==0 ? "newsBlack" : "newsGrey"}" %>
|
||||
<!--:onmouseover => "message_titile_show($(this),event)",-->
|
||||
<!--:onmouseout => "message_titile_hide($(this))" %>-->
|
||||
</a></li>
|
||||
<div style="display: none" class="message_title_red system_message_style">
|
||||
<p><strong>帖子主题:</strong><%= ma.forge_message.subject %></p>
|
||||
<% unless ma.forge_message.content.nil? %>
|
||||
|
@ -247,9 +255,10 @@
|
|||
</li>
|
||||
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
||||
<%= link_to ("#{ma.forge_message.title.html_safe}"), {:controller => 'news', :action => 'show', :id => ma.forge_message.id},
|
||||
:class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
|
||||
:onmouseover => "message_titile_show($(this),event)",
|
||||
:onmouseout => "message_titile_hide($(this))" %></a>
|
||||
:class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}" %>
|
||||
<!--:onmouseover => "message_titile_show($(this),event)",-->
|
||||
<!--:onmouseout => "message_titile_hide($(this))" %>-->
|
||||
</a>
|
||||
</li>
|
||||
<div style="display: none" class="message_title_red system_message_style">
|
||||
<p><strong>标题:</strong><%= ma.forge_message.title %></p>
|
||||
|
@ -268,9 +277,9 @@
|
|||
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">评论了新闻:</span></li>
|
||||
<li class="homepageNewsContent fl">
|
||||
<%= link_to "#{ma.forge_message.commented.title}",
|
||||
{:controller => 'news', :action => 'show', :id => ma.forge_message.commented.id },:class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
|
||||
:onmouseover => "message_titile_show($(this),event)",
|
||||
:onmouseout => "message_titile_hide($(this))" %>
|
||||
{:controller => 'news', :action => 'show', :id => ma.forge_message.commented.id },:class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}" %>
|
||||
<!--:onmouseover => "message_titile_show($(this),event)",-->
|
||||
<!--:onmouseout => "message_titile_hide($(this))" %>-->
|
||||
</li>
|
||||
<div style="display: none" class="message_title_red system_message_style">
|
||||
<p><strong>新闻标题:</strong><%= ma.forge_message.commented.title %></p>
|
||||
|
|
|
@ -10,9 +10,10 @@
|
|||
</li>
|
||||
<% if ma.memo.parent_id.nil? %>
|
||||
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
||||
<%= link_to ma.memo.subject, forum_memo_path(ma.memo.forum_id, ma.memo.parent_id ? ma.memo.parent_id: ma.memo.id), :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
|
||||
:onmouseover =>"message_titile_show($(this),event)",
|
||||
:onmouseout => "message_titile_hide($(this))" %></a>
|
||||
<%= link_to ma.memo.subject, forum_memo_path(ma.memo.forum_id, ma.memo.parent_id ? ma.memo.parent_id: ma.memo.id), :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}" %>
|
||||
<!--:onmouseover =>"message_titile_show($(this),event)",-->
|
||||
<!--:onmouseout => "message_titile_hide($(this))" %>-->
|
||||
</a>
|
||||
</li>
|
||||
<div style="display: none" class="message_title_red system_message_style">
|
||||
<p><strong>标题:</strong><%= ma.memo.subject %></p>
|
||||
|
@ -23,9 +24,10 @@
|
|||
</div>
|
||||
<% else %>
|
||||
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
||||
<%= link_to ma.memo.content.html_safe, forum_memo_path(ma.memo.forum_id, ma.memo.parent_id ? ma.memo.parent_id: ma.memo.id), :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
|
||||
:onmouseover =>"message_titile_show($(this),event)",
|
||||
:onmouseout => "message_titile_hide($(this))" %></a>
|
||||
<%= link_to ma.memo.content.html_safe, forum_memo_path(ma.memo.forum_id, ma.memo.parent_id ? ma.memo.parent_id: ma.memo.id), :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}" %>
|
||||
<!--:onmouseover =>"message_titile_show($(this),event)",-->
|
||||
<!--:onmouseout => "message_titile_hide($(this))" %>-->
|
||||
</a>
|
||||
</li>
|
||||
<div style="display: none" class="message_title_red system_message_style">
|
||||
<p><strong>标题:</strong><%= ma.memo.subject %></p>
|
||||
|
|
|
@ -11,10 +11,9 @@
|
|||
<li class="homepageSystenMessageContent fl">
|
||||
|
||||
<%= link_to ma.subject.blank? ? (ma.content.nil? ? ma.description.html_safe : ma.content.html_safe) : ma.subject, user_system_messages_path(User.current),
|
||||
:id => "content_link_#{ma.id}",
|
||||
:onmouseover =>"message_titile_show($(this),event);",
|
||||
:onmouseout => "message_titile_hide($(this));"
|
||||
%>
|
||||
:id => "content_link_#{ma.id}" %>
|
||||
<!--:onmouseover =>"message_titile_show($(this),event);",-->
|
||||
<!--:onmouseout => "message_titile_hide($(this));"-->
|
||||
</li>
|
||||
<div style="display:none;" class="message_title_red system_message_style">
|
||||
<% unless ma.subject.blank? %>
|
||||
|
|
|
@ -1,30 +1,30 @@
|
|||
<% if ma.class == UserFeedbackMessage %>
|
||||
<% if ma.journals_for_message_type == "JournalsForMessage" %>
|
||||
<ul class="homepageNewsList fl">
|
||||
<li class="homepageNewsPortrait fl">
|
||||
<a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.journals_for_message.user), :width => "30", :height => "30"), user_path(ma.journals_for_message.user) %></a>
|
||||
</li>
|
||||
<li class="homepageNewsPubType fl">
|
||||
<%=link_to ma.journals_for_message.user, user_path(ma.journals_for_message.user), :class => "newsBlue homepageNewsPublisher" %>
|
||||
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>"><%= ma.journals_for_message.reply_id == 0 ? "给你留言了:" : "回复了你的留言:" %></span>
|
||||
</li>
|
||||
<li class="homepageNewsContent fl">
|
||||
<%= link_to ma.journals_for_message.notes.gsub("<p>","").gsub("</p>","").gsub("<br />","").html_safe, feedback_path(ma.journals_for_message.jour_id), :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
|
||||
:onmouseover =>"message_titile_show($(this),event)",
|
||||
:onmouseout => "message_titile_hide($(this))" %>
|
||||
</li>
|
||||
<div style="display: none" class="message_title_red system_message_style" >
|
||||
<% if ma.journals_for_message.reply_id == 0 %>
|
||||
<%= ma.journals_for_message.notes.html_safe %>
|
||||
<% else %>
|
||||
<div class="fl"><strong>您的留言:</strong></div>
|
||||
<div class="ml60"><%= JournalsForMessage.find(ma.journals_for_message.m_reply_id).notes.html_safe %></div>
|
||||
<div class="fl"><strong>回复内容:</strong></div>
|
||||
<div class="ml60"><%= ma.journals_for_message.notes.html_safe %></div>
|
||||
<% end %>
|
||||
</div>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ma.journals_for_message.created_on).html_safe %> </li>
|
||||
|
||||
</ul>
|
||||
<% end %>
|
||||
<% if ma.class == UserFeedbackMessage %>
|
||||
<% if ma.journals_for_message_type == "JournalsForMessage" %>
|
||||
<ul class="homepageNewsList fl">
|
||||
<li class="homepageNewsPortrait fl">
|
||||
<a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.journals_for_message.user), :width => "30", :height => "30"), user_path(ma.journals_for_message.user) %></a>
|
||||
</li>
|
||||
<li class="homepageNewsPubType fl">
|
||||
<%=link_to ma.journals_for_message.user, user_path(ma.journals_for_message.user), :class => "newsBlue homepageNewsPublisher" %>
|
||||
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>"><%= ma.journals_for_message.reply_id == 0 ? "给你留言了:" : "回复了你的留言:" %></span>
|
||||
</li>
|
||||
<li class="homepageNewsContent fl">
|
||||
<%= link_to ma.journals_for_message.notes.gsub("<p>","").gsub("</p>","").gsub("<br />","").html_safe, feedback_path(ma.journals_for_message.jour_id), :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}"%>
|
||||
<!--:onmouseover =>"message_titile_show($(this),event)",-->
|
||||
<!--:onmouseout => "message_titile_hide($(this))" %>-->
|
||||
</li>
|
||||
<div style="display: none" class="message_title_red system_message_style" >
|
||||
<% if ma.journals_for_message.reply_id == 0 %>
|
||||
<%= ma.journals_for_message.notes.html_safe %>
|
||||
<% else %>
|
||||
<div class="fl"><strong>您的留言:</strong></div>
|
||||
<div class="ml60"><%= JournalsForMessage.find(ma.journals_for_message.m_reply_id).notes.html_safe %></div>
|
||||
<div class="fl"><strong>回复内容:</strong></div>
|
||||
<div class="ml60"><%= ma.journals_for_message.notes.html_safe %></div>
|
||||
<% end %>
|
||||
</div>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ma.journals_for_message.created_on).html_safe %> </li>
|
||||
|
||||
</ul>
|
||||
<% end %>
|
||||
<% end %>
|
|
@ -1,21 +1,11 @@
|
|||
<div id="users_setting">
|
||||
<div class="resourcesUploadBox mt10"><a href="javascript:void(0);" onclick="show_upload();" class="uploadBoxIcon">上传资源</a></div>
|
||||
<div id="search_div">
|
||||
<%= render :partial => 'users/resource_search_form',:locals => {:user => @user, :type => @type} %>
|
||||
<%= render :partial => 'users/resource_search_form',:locals => {:user => @user, :type => @type, :order => @order, :sort => @score, :status => @status} %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<ul class="resource-list-tab mt10">
|
||||
<li class="resource-list-checkbox fl"> </li>
|
||||
<li class="resource-list-name fl">资源名称</li>
|
||||
<li class="resource-list-time fr">上传时间</li>
|
||||
<li class="resource-list-quote fr">引用数</li>
|
||||
<li class="resource-list-download fr">下载数</li>
|
||||
<li class="resource-list-size fr">大小</li>
|
||||
<li class="resource-list-uploader fr">上传者</li>
|
||||
<li class="resource-list-type fr">类别</li>
|
||||
<li class="resource-list-from fr">来源</li>
|
||||
</ul>
|
||||
<%= render :partial => 'users/user_resource_tip_list', :locals => { :type => @type, :status => @status} %>
|
||||
<div class="cl"></div>
|
||||
<form id="resources_list_form">
|
||||
<div id="resources_list">
|
||||
|
@ -23,7 +13,6 @@
|
|||
</div>
|
||||
<div class="cl"></div>
|
||||
|
||||
|
||||
<div class="resource-list-option fl">
|
||||
<div class="resource-check-all">
|
||||
<input id="checkboxAll" type="checkbox" value="" onclick="all_select();" class="resourcesCheckbox" />
|
||||
|
|
|
@ -0,0 +1,33 @@
|
|||
<ul class="resource-list-tab mt10" id="resource_tip_list">
|
||||
<li class="resource-list-checkbox fl"> </li>
|
||||
<li class="resource-list-name fl">资源名称</li>
|
||||
<li class="resource-list-time fr">
|
||||
<%= link_to "上传时间", resource_search_user_path(:type => @type, :status => @status, :sort => @score, :order => "created_on", :search => " "), :class => "fl", :remote => true %>
|
||||
<% if @order == "created_on" %>
|
||||
<%= link_to "", user_resource_user_path(:type => @type, :status => @status, :sort => @score, :order => "created_on", :search => " "), :class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt16", :remote => true %>
|
||||
<% end %>
|
||||
</li>
|
||||
<li class="resource-list-quote fr">
|
||||
<%= link_to "引用数", resource_search_user_path(:type => @type, :status => @status, :sort => @score, :order => "quotes"), :class => "fl", :remote => true %>
|
||||
<% if @order == "quotes" %>
|
||||
<%= link_to "", user_resource_user_path(:type => @type, :status => @status, :sort => @score, :order => "quotes"), :class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt16", :remote => true %>
|
||||
<% end %>
|
||||
</li>
|
||||
<li class="resource-list-download fr">
|
||||
<%= link_to "下载数", resource_search_user_path(:type => @type, :status => @status, :sort => @score, :order => "downloads"), :class => "fl", :remote => true %>
|
||||
<% if @order == "downloads" %>
|
||||
<%= link_to "", user_resource_user_path(:type => @type, :status => @status, :sort => @score, :order => "downloads"), :class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt16", :remote => true %>
|
||||
<% end %>
|
||||
</li>
|
||||
<li class="resource-list-size fr">
|
||||
<div style="margin: 0 auto; width: 40px">
|
||||
<%= link_to "大小", resource_search_user_path(:type => @type, :status => @status, :sort => @score, :order => "filesize"), :class => "fl", :remote => true %>
|
||||
<% if @order == "filesize" %>
|
||||
<%= link_to "", user_resource_user_path(:type => @type, :status => @status, :sort => @score, :order => "filesize"), :class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt16", :remote => true %>
|
||||
<% end %>
|
||||
</div>
|
||||
</li>
|
||||
<li class="resource-list-uploader fr">上传者</li>
|
||||
<li class="resource-list-type fr">类别</li>
|
||||
<li class="resource-list-from fr">来源</li>
|
||||
</ul>
|
|
@ -0,0 +1,29 @@
|
|||
<ul class="resourcesSelect">
|
||||
<li class="resourcesSelected"><a href="javascript:void(0);" class="resourcesIcon"></a>
|
||||
<ul class="resourcesType">
|
||||
<li>
|
||||
<a href="<%= resource_search_user_path(:id => @user.id, :type => @type, :status => 1, :search => @switch_search) %>" id="resource_type_all" class="resourcesTypeAll resourcesGrey" data-method="get" data-remote="true">全部 </a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<%= resource_search_user_path(:id => @user.id, :type => @type, :status => 2, :search => @switch_search) %>" id="resource_type_course" class="homepagePostTypeAssignment postTypeGrey'" data-method="get" data-remote="true">课程资源 </a>
|
||||
<%#= link_to '课程资源' ,user_resource_user_path(:id => @user.id, :type => 2), id="resource_type_course", :remote => true, :method => 'get', :class=> 'homepagePostTypeAssignment postTypeGrey' %>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<%= resource_search_user_path(:id => @user.id, :type => @type, :status => 3, :search => @switch_search) %>" id="resource_type_project" class="homepagePostTypeQuiz postTypeGrey" data-method="get" data-remote="true">项目资源 </a>
|
||||
<%#= link_to '项目资源' ,user_resource_user_path(:id => @user.id, :type => 3), id="resource_type_project", :remote => true, :method => 'get', :class => 'homepagePostTypeQuiz postTypeGrey' %>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<%= resource_search_user_path(:id => @user.id, :type => @type, :status => 5, :search => @switch_search) %>" id="resource_type_user" class="resourcesTypeUser resourcesGrey" data-method="get" data-remote="true">用户资源 </a>
|
||||
<%#= link_to '用户资源' ,user_resource_user_path(:id=>@user.id,:type=>5), id="resource_type_user", :remote=>true,:method => 'get', :class=>'resourcesTypeUser resourcesGrey' %>
|
||||
</li>
|
||||
<div id="my_files_resource">
|
||||
<% if @type != "6" %>
|
||||
<li>
|
||||
<a href="<%= resource_search_user_path(:id => @user.id, :type => @type, :status => 4, :search => @switch_search) %>" id="resource_type_file" class="resourcesTypeAtt resourcesGrey" data-method="get" data-remote="true">附件 </a>
|
||||
<%#= link_to '附件' ,user_resource_user_path(:id=>@user.id,:type=>4), id="resource_type_file", :remote=>true,:method => 'get',:class=>'resourcesTypeAtt resourcesGrey' %>
|
||||
</li>
|
||||
<% end %>
|
||||
</div>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
|
@ -1,25 +1,3 @@
|
|||
//$("#resources_list").html('<%#= escape_javascript( render :partial => 'users/import_resource_info' ,:locals=>{ :attachments => @attachments, :type => @type})%>');
|
||||
//$("#pages").html('<%#= pagination_links_full @atta_pages, @atta_count, :per_page_links => false, :remote => @is_remote, :flag => true %>');
|
||||
//$("#res_all_count").html(<%#= @atta_count%>);
|
||||
//$("#res_count").html(0);
|
||||
//$("#checkboxAll").attr('checked',false);
|
||||
|
||||
|
||||
<% if params[:project_id] %>
|
||||
$('#ajax-modal').html('<%= escape_javascript( render :partial => 'users/import_resource_info', :locals => {:user => User.current, :type => 1, :project_id => params[:project_id]} ) %>');
|
||||
<% elsif params[:course_id] %>
|
||||
$('#ajax-modal').html('<%= escape_javascript( render :partial => 'users/import_resource_info', :locals => {:user => User.current, :type => 1, :course_id => params[:course_id]} ) %>');
|
||||
<% elsif params[:subfield_file_id] %>
|
||||
$('#ajax-modal').html('<%= escape_javascript( render :partial => 'users/import_resource_info', :locals => {:user => User.current, :type => 1, :subfield_file_id => params[:subfield_file_id]} ) %>');
|
||||
<% end %>
|
||||
showModal('ajax-modal', '615px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='hideModal()' style='margin-left: 580px;'><img src='/images/bid/close.png' width='26px' height='26px' /></a>");
|
||||
<% if params[:project_id] %>
|
||||
$('#ajax-modal').parent().css("top","10%").css("left","34%").css("border","3px solid #269ac9");
|
||||
<% else %>
|
||||
$('#ajax-modal').parent().css("top","20%").css("left","42%").css("border","3px solid #269ac9");
|
||||
<% end %>
|
||||
$('#ajax-modal').parent().addClass("popbox_polls");
|
||||
|
||||
|
||||
$("#import_resource_info_list").html('<%= escape_javascript( render :partial => 'user_import_resource_list',
|
||||
:locals => {:user => @user, :type => @type, :project_id => params[:project_id], :subfield_file_id => params[:subfield_file_id], :course_id => params[:course_id]} ) %>');
|
||||
$("#pages").html('<%= pagination_links_full @atta_pages, @atta_count, :per_page_links => false, :remote => @is_remote, :flag => true %>');
|
||||
|
|
|
@ -85,7 +85,7 @@
|
|||
<span data-language=<%=@homework.language%> style="display-hidden" id="data-language"></span>
|
||||
</div>
|
||||
<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 class="mt10">
|
||||
<%= f.text_area :description, id: 'program-src', class:"InputBox W700 H150", placeholder:"请贴入你的代码", rows: 10 %>
|
||||
|
|
|
@ -1,5 +1,14 @@
|
|||
$("#resources_list").html('<%= escape_javascript( render :partial => 'resources_list' ,:locals=>{ :attachments => @attachments})%>');
|
||||
$("#resource_tip_list").html('<%= escape_javascript( render :partial => 'users/user_resource_tip_list', :locals => {:user => @user, :type => @type, :status => @status}) %>');
|
||||
$("#pages").html('<%= pagination_links_full @atta_pages, @atta_count, :per_page_links => false, :remote => @is_remote, :flag => true %>');
|
||||
$("#res_all_count").html(<%= @atta_count%>);
|
||||
$("#res_count").html(0);
|
||||
$("#checkboxAll").attr('checked',false);
|
||||
$("#checkboxAll").attr('checked',false);
|
||||
//更新状态
|
||||
$("#public_resource_list").attr('href','<%= user_resource_user_path(@user, :type => '6') %>');
|
||||
$("#my_resource_list").attr('href','<%= user_resource_user_path(@user, :type => '1') %>');
|
||||
$("#resource_type_all").attr('href','<%= resource_search_user_path(@user,:type => @type, :status => 1, :search => @switch_search) %>');
|
||||
$("#resource_type_course").attr('href','<%= resource_search_user_path(@user,:type => @type, :status => 2, :search => @switch_search) %>');
|
||||
$("#resource_type_project").attr('href','<%= resource_search_user_path(@user,:type => @type, :status => 3, :search => @switch_search) %>');
|
||||
$("#resource_type_user").attr('href','<%= resource_search_user_path(@user,:type => @type, :status => 5, :search => @switch_search) %>');
|
||||
$("#resource_type_file").attr('href','<%= resource_search_user_path(@user,:type => @type, :status => 4, :search => @switch_search) %>');
|
|
@ -45,5 +45,4 @@
|
|||
<% homepage = BlogComment.find(@user.blog.homepage_id) %>
|
||||
<%= render :partial => 'blogs/homepage', :locals => {:activity => homepage, :user_activity_id => homepage.id} %>
|
||||
<% end %>
|
||||
|
||||
<%= render :partial => 'users/user_activities', :locals => {:user_activities => @user_activities,:page => 0,:type => @type} %>
|
||||
<%= render :partial => 'users/user_activities', :locals => {:user_activities => @user_activities,:page => 0,:type => @type, :user_id => (@user.type == "AnonymousUser" ? User.current.id : @user.id)} %>
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
|
||||
<div class="homepageContentContainer">
|
||||
<div class="homepageContent">
|
||||
<div class="resource-wrapper mt10">
|
||||
<div class="resource-wrapper">
|
||||
<ul class="resource-banner">
|
||||
<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>
|
||||
|
@ -46,7 +46,7 @@
|
|||
<ul class="resourcesSelect">
|
||||
<li class="resourcesSelected"><a href="javascript:void(0);" class="resourcesIcon"></a>
|
||||
<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 => 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>
|
||||
|
@ -61,7 +61,7 @@
|
|||
<%=render :partial=>'homework_repository_search', :locals=>{:type => @type,:is_import => 0,:property => @property} %>
|
||||
</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=>''} %>
|
||||
</div>
|
||||
<div id="homework_repository_detail">
|
||||
|
@ -69,7 +69,7 @@
|
|||
</div>
|
||||
<div class="cl"></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%>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
@ -1,12 +1,8 @@
|
|||
<%= javascript_include_tag 'bootstrap'%>
|
||||
<%= javascript_include_tag 'bootstrap' %>
|
||||
<%= stylesheet_link_tag 'project' %>
|
||||
<%= stylesheet_link_tag 'leftside' %>
|
||||
<%= javascript_include_tag 'attachments'%>
|
||||
<!--<script type="text/css">-->
|
||||
<!--html,body{ overflow-y:scroll;}-->
|
||||
<!--html,body{ overflow:scroll; min-height:101%;}-->
|
||||
<!--html{ overflow:-moz-scrollbars-vertical;}-->
|
||||
<!--</script>-->
|
||||
<%= javascript_include_tag 'attachments' %>
|
||||
|
||||
<script>
|
||||
function remote_get_resources(user_id,type){
|
||||
|
||||
|
@ -21,14 +17,6 @@
|
|||
$("#resource_search_form").submit();
|
||||
}
|
||||
|
||||
function show_public_resource(){
|
||||
$("#resource_remote").html('<%= escape_javascript( render :partial => 'user_resource_info' ,:locals => { :tpye => 6}) %>');
|
||||
}
|
||||
|
||||
function show_public_resource(){
|
||||
$("#resource_remote").html('<%= escape_javascript( render :partial => 'user_resource_info' ,:locals => { :tpye => 1}) %>');
|
||||
}
|
||||
|
||||
function closeModal()
|
||||
{
|
||||
hideModal($(".uploadBoxContainer"));
|
||||
|
@ -62,38 +50,16 @@
|
|||
<div>
|
||||
<ul class="resource-banner">
|
||||
<li class="fl resource-switch">
|
||||
<a href="<%= user_resource_user_path(@user, :type => '6', :status => @status) %>" class="resource-tab resource-tab-active" id="public_resource_list" data-remote="true">公共资源</a>
|
||||
<a href="<%= user_resource_user_path(@user, :type => '6', :status => 6) %>" class="resource-tab resource-tab-active" id="public_resource_list" data-remote="true">公共资源</a>
|
||||
</li>
|
||||
<li class="fl resource-switch">
|
||||
<a href="<%= user_resource_user_path(@user, :type => '1', :status => @status) %>" class="resource-tab" id="my_resource_list" data-remote="true">我的资源</a>
|
||||
<a href="<%= user_resource_user_path(@user, :type => '1', :status => 6) %>" class="resource-tab" id="my_resource_list" data-remote="true">我的资源</a>
|
||||
</li>
|
||||
<li class="fl w770 border-bottom h34"> </li>
|
||||
<li class="fr resource-banner-li border-bottom h34">
|
||||
<ul class="resourcesSelect">
|
||||
<li class="resourcesSelected"><a href="javascript:void(0);" class="resourcesIcon"></a>
|
||||
<ul class="resourcesType">
|
||||
<li>
|
||||
<a href="<%= user_resource_user_path(:id => @user.id, :type => @type, :status => 1)%>" id="resource_type_all" class="resourcesTypeAll resourcesGrey" data-method="get" data-remote="true">全部 </a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<%= user_resource_user_path(:id => @user.id, :type => @type, :status => 2) %>" id="resource_type_course" class="homepagePostTypeAssignment postTypeGrey'" data-method="get" data-remote="true">课程资源 </a>
|
||||
<%#= link_to '课程资源' ,user_resource_user_path(:id => @user.id, :type => 2), id="resource_type_course", :remote => true, :method => 'get', :class=> 'homepagePostTypeAssignment postTypeGrey' %>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<%= user_resource_user_path(:id => @user.id, :type => @type, :status => 3) %>" id="resource_type_project" class="homepagePostTypeQuiz postTypeGrey" data-method="get" data-remote="true">项目资源 </a>
|
||||
<%#= link_to '项目资源' ,user_resource_user_path(:id => @user.id, :type => 3), id="resource_type_project", :remote => true, :method => 'get', :class => 'homepagePostTypeQuiz postTypeGrey' %>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<%= user_resource_user_path(:id => @user.id, :type => @type, :status => 5) %>" id="resource_type_user" class="resourcesTypeUser resourcesGrey" data-method="get" data-remote="true">用户资源 </a>
|
||||
<%#= link_to '用户资源' ,user_resource_user_path(:id=>@user.id,:type=>5), id="resource_type_user", :remote=>true,:method => 'get', :class=>'resourcesTypeUser resourcesGrey' %>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<%= user_resource_user_path(:id => @user.id, :type => @type, :status => 4) %>" id="resource_type_file" class="resourcesTypeAtt resourcesGrey" data-method="get" data-remote="true">附件 </a>
|
||||
<%#= link_to '附件' ,user_resource_user_path(:id=>@user.id,:type=>4), id="resource_type_file", :remote=>true,:method => 'get',:class=>'resourcesTypeAtt resourcesGrey' %>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<div id="user_resource_type_filter">
|
||||
<%= render :partial => 'user_resource_type_filter' %>
|
||||
</div>
|
||||
</li>
|
||||
<div class="cl"></div>
|
||||
</ul>
|
||||
|
|
|
@ -1,14 +1,15 @@
|
|||
$("#search_div").html('<%= escape_javascript( render :partial => 'resource_search_form', :locals => {:user => @user, :type => @type} ) %>');
|
||||
$("#resource_tip_list").html('<%= escape_javascript( render :partial => 'users/user_resource_tip_list', :locals => {:user => @user, :type => @type, :status => @status}) %>');
|
||||
$("#resources_list").html('<%= escape_javascript( render :partial => 'resources_list' , :locals => { :attachments => @attachments}) %>');
|
||||
$("#user_resource_type_filter").html('<%= escape_javascript( render :partial => 'user_resource_type_filter' , :locals => {:user => @user, :type => @type, :status => @status}) %>');
|
||||
$("#pages").html('<%= pagination_links_full @atta_pages, @atta_count, :per_page_links => false, :remote => @is_remote, :flag => true %>');
|
||||
$("#res_count").html(0);
|
||||
$("#checkboxAll").attr('checked',false);
|
||||
$("#res_all_count").html(<%= @atta_count %>);
|
||||
|
||||
$("#public_resource_list").attr('href','<%= user_resource_user_path(@user, :type => '6', :status => @status) %>');
|
||||
$("#my_resource_list").attr('href','<%= user_resource_user_path(@user, :type => '1', :status => @status) %>');
|
||||
|
||||
$("#resource_type_all").attr('href','<%= user_resource_user_path(@user,:type => @type, :status => 1) %>');
|
||||
$("#public_resource_list").attr('href','<%= user_resource_user_path(@user, :type => '6') %>');
|
||||
$("#my_resource_list").attr('href','<%= user_resource_user_path(@user, :type => '1') %>');
|
||||
$("#resource_type_all").attr('href','<%= user_resource_user_path(@user, :type => @type, :status => 1) %>');
|
||||
$("#resource_type_course").attr('href','<%= user_resource_user_path(@user,:type => @type, :status => 2) %>');
|
||||
$("#resource_type_project").attr('href','<%= user_resource_user_path(@user,:type => @type, :status => 3) %>');
|
||||
$("#resource_type_user").attr('href','<%= user_resource_user_path(@user,:type => @type, :status => 5) %>');
|
||||
|
|
|
@ -1,7 +1,15 @@
|
|||
|
||||
closeModal();
|
||||
$("#resources_list").html('<%= escape_javascript( render :partial => 'resources_list' ,:locals=>{ :attachments => @attachments})%>');
|
||||
//这里不能将翻页的更新
|
||||
$("#res_all_count").html('<%= @atta_count%>');
|
||||
$("#resource_tip_list").html('<%= escape_javascript( render :partial => 'users/user_resource_tip_list', :locals => {:user => @user, :type => @type, :status => @status}) %>');
|
||||
$("#pages").html('<%= pagination_links_full @atta_pages, @atta_count, :per_page_links => false, :remote => @is_remote, :flag => true %>');
|
||||
$("#res_all_count").html(<%= @atta_count%>);
|
||||
$("#res_count").html(0);
|
||||
$("#checkboxAll").attr('checked',false);
|
||||
$("#checkboxAll").attr('checked',false);
|
||||
//更新状态
|
||||
$("#public_resource_list").attr('href','<%= user_resource_user_path(@user, :type => '6') %>');
|
||||
$("#my_resource_list").attr('href','<%= user_resource_user_path(@user, :type => '1') %>');
|
||||
$("#resource_type_all").attr('href','<%= resource_search_user_path(@user,:type => @type, :status => 1, :search => @switch_search) %>');
|
||||
$("#resource_type_course").attr('href','<%= resource_search_user_path(@user,:type => @type, :status => 2, :search => @switch_search) %>');
|
||||
$("#resource_type_project").attr('href','<%= resource_search_user_path(@user,:type => @type, :status => 3, :search => @switch_search) %>');
|
||||
$("#resource_type_user").attr('href','<%= resource_search_user_path(@user,:type => @type, :status => 5, :search => @switch_search) %>');
|
||||
$("#resource_type_file").attr('href','<%= resource_search_user_path(@user,:type => @type, :status => 4, :search => @switch_search) %>');
|
|
@ -1,5 +1,14 @@
|
|||
$("#resources_list").html('<%= escape_javascript( render :partial => 'resources_list' ,:locals=>{ :attachments => @attachments})%>');
|
||||
$("#resource_tip_list").html('<%= escape_javascript( render :partial => 'users/user_resource_tip_list', :locals => {:user => @user, :type => @type, :status => @status}) %>');
|
||||
$("#pages").html('<%= pagination_links_full @atta_pages, @atta_count, :per_page_links => false, :remote => @is_remote, :flag => true %>');
|
||||
$("#res_all_count").html('<%= @atta_count%>')
|
||||
$("#res_all_count").html(<%= @atta_count%>);
|
||||
$("#res_count").html(0);
|
||||
$("#checkboxAll").attr('checked',false);
|
||||
$("#checkboxAll").attr('checked',false);
|
||||
//更新状态
|
||||
$("#public_resource_list").attr('href','<%= user_resource_user_path(@user, :type => '6') %>');
|
||||
$("#my_resource_list").attr('href','<%= user_resource_user_path(@user, :type => '1') %>');
|
||||
$("#resource_type_all").attr('href','<%= resource_search_user_path(@user,:type => @type, :status => 1, :search => @switch_search) %>');
|
||||
$("#resource_type_course").attr('href','<%= resource_search_user_path(@user,:type => @type, :status => 2, :search => @switch_search) %>');
|
||||
$("#resource_type_project").attr('href','<%= resource_search_user_path(@user,:type => @type, :status => 3, :search => @switch_search) %>');
|
||||
$("#resource_type_user").attr('href','<%= resource_search_user_path(@user,:type => @type, :status => 5, :search => @switch_search) %>');
|
||||
$("#resource_type_file").attr('href','<%= resource_search_user_path(@user,:type => @type, :status => 4, :search => @switch_search) %>');
|
|
@ -1,31 +1,31 @@
|
|||
<% unless all_results.nil? || all_results.empty?%>
|
||||
<% all_results.each do |item|%>
|
||||
<% case item.type %>
|
||||
<% when 'user'%>
|
||||
<ul class="searchContent">
|
||||
<li class="fl"></li>
|
||||
<li class="fl searchContentDes">
|
||||
<ul class="fl">
|
||||
<li class="f16 mb5"><a href="<%= user_path(item.id)%>" class="fontGrey3 fl">
|
||||
<%= item.try(:highlight).try(:login) ? item.highlight.login[0].html_safe : item.login %>
|
||||
<%if item.firstname.present? || item.lastname.present?%>
|
||||
(<%= item.try(:highlight).try(:lastname) ? item.highlight.lastname[0].html_safe : item.lastname%>
|
||||
<%= item.try(:highlight).try(:firstname) ? item.highlight.firstname[0].html_safe : item.firstname %>)
|
||||
<% all_results.each do |item|%>
|
||||
<% case item.type %>
|
||||
<% when 'user'%>
|
||||
<ul class="searchContent">
|
||||
<li class="fl"></li>
|
||||
<li class="fl searchContentDes">
|
||||
<ul class="fl">
|
||||
<li class="f16 mb5"><a href="<%= user_path(item.id)%>" class="fontGrey3 fl">
|
||||
<%= item.try(:highlight).try(:login) ? item.highlight.login[0].html_safe : item.login %>
|
||||
<%if item.firstname.present? || item.lastname.present?%>
|
||||
(<%= item.try(:highlight).try(:lastname) ? item.highlight.lastname[0].html_safe : item.lastname%>
|
||||
<%= item.try(:highlight).try(:firstname) ? item.highlight.firstname[0].html_safe : item.firstname %>)
|
||||
<%end %>
|
||||
</a>
|
||||
<div class="mt5 fl"><%= image_tag("search_icon_03.png", :width=>"8", :height=>"16" ,:class=>"fl") %><span class="searchTag"><%= get_user_identity(User.find(item.id).user_extensions.identity) %></span></div>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<li class="fontGrey3 mb5"><%= User.find(item.id).user_extensions && User.find(item.id).user_extensions.brief_introduction.present? ? User.find(item.id).user_extensions.brief_introduction : '这位童鞋很懒,什么也没有留下~'%></li>
|
||||
<li class="f12 fontGrey2">
|
||||
<span class="mr30">加入时间:<%= format_date( User.find(item.id).created_on)%></span><span class="mr30">
|
||||
</a>
|
||||
<div class="mt5 fl"><%= image_tag("search_icon_03.png", :width=>"8", :height=>"16" ,:class=>"fl") %><span class="searchTag"><%= get_user_identity(User.find(item.id).user_extensions.identity) %></span></div>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<li class="fontGrey3 mb5"><%= User.find(item.id).user_extensions && User.find(item.id).user_extensions.brief_introduction.present? ? User.find(item.id).user_extensions.brief_introduction : '这位童鞋很懒,什么也没有留下~'%></li>
|
||||
<li class="f12 fontGrey2">
|
||||
<span class="mr30">加入时间:<%= format_date( User.find(item.id).created_on)%></span><span class="mr30">
|
||||
最后登陆时间:<%= format_date( User.find(item.id).last_login_on)%></span><span class="mr30">
|
||||
<%= User.find(item.id).user_extensions.occupation.present? ? '单位:'+User.find(item.id).user_extensions.occupation : ''%></span></li>
|
||||
</ul>
|
||||
</li>
|
||||
<div class="cl"></div>
|
||||
</ul>
|
||||
</li>
|
||||
<div class="cl"></div>
|
||||
</ul>
|
||||
<% when 'course'%>
|
||||
<% when 'course'%>
|
||||
<ul class="searchContent">
|
||||
<li class="fl">
|
||||
</li>
|
||||
|
@ -46,7 +46,7 @@
|
|||
</li>
|
||||
<div class="cl"></div>
|
||||
</ul>
|
||||
<% when 'attachment'%>
|
||||
<% when 'attachment'%>
|
||||
<ul class="searchContent">
|
||||
<li class="fl">
|
||||
</li>
|
||||
|
@ -65,7 +65,7 @@
|
|||
</li>
|
||||
<div class="cl"></div>
|
||||
</ul>
|
||||
<% when 'project'%>
|
||||
<% when 'project'%>
|
||||
<ul class="searchContent">
|
||||
<li class="fl">
|
||||
</li>
|
||||
|
@ -97,8 +97,8 @@
|
|||
</li>
|
||||
<div class="cl"></div>
|
||||
</ul>
|
||||
<%end %>
|
||||
<% end %>
|
||||
<%end %>
|
||||
<% end %>
|
||||
<div class="pageRoll">
|
||||
<%= paginate all_results,:params => {:controller => 'welcome', :action => 'search',:search_type=>'all'}%>
|
||||
</div>
|
||||
|
|
|
@ -877,6 +877,7 @@ RedmineApp::Application.routes.draw do
|
|||
# additional routes for having the file name at the end of url
|
||||
get 'attachments/:id/:filename', :to => 'attachments#show', :id => /\d+/, :filename => /.*/, :as => 'named_attachment'
|
||||
get 'attachments/attachment_versions/:id',:to=>'attachments#attachment_versions',:as=>'attachments_versions'
|
||||
get 'attachments/attachment_history_download/:id',:to=>'attachments#attachment_history_download',:as=>'attachment_history_download'
|
||||
post 'attachments/upload_attachment_version',:to=>'attachments#upload_attachment_version',:as=>'upload_attachment_version'
|
||||
get 'attachments/download/:id/:filename', :to => 'attachments#download', :id => /\d+/, :filename => /.*/, :as => 'download_named_attachment'
|
||||
get 'attachments/download_history/:id/:filename', :to => 'attachments#download_history', :id => /\d+/, :filename => /.*/, :as => 'download_history_attachment'
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
class AttachmentProjectCountUpdate < ActiveRecord::Migration
|
||||
def up
|
||||
Project.all.each do |project|
|
||||
unless project.attachments.count.to_i == 0
|
||||
attachment_count = Attachment.find_by_sql("SELECT * FROM `attachments` where container_id = #{project.id} and container_type ='Project'").count
|
||||
project_score = ProjectScore.where("project_id=?", project.id).first
|
||||
if project_score.nil?
|
||||
ProjectScore.create(:project_id => project.id, :attach_num => 0)
|
||||
else
|
||||
project_score.attach_num = attachment_count
|
||||
project_score.save
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
end
|
||||
end
|
|
@ -0,0 +1,8 @@
|
|||
class UpdateCourseLead < ActiveRecord::Migration
|
||||
def up
|
||||
Message.where("status =? ", 1).update_all(:author_id => 1)
|
||||
end
|
||||
|
||||
def down
|
||||
end
|
||||
end
|
17
db/schema.rb
17
db/schema.rb
|
@ -11,7 +11,7 @@
|
|||
#
|
||||
# It's strongly recommended to check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(:version => 20160225031230) do
|
||||
ActiveRecord::Schema.define(:version => 20160316055201) do
|
||||
|
||||
create_table "activities", :force => true do |t|
|
||||
t.integer "act_id", :null => false
|
||||
|
@ -432,9 +432,11 @@ ActiveRecord::Schema.define(:version => 20160225031230) do
|
|||
t.integer "resource_num"
|
||||
t.integer "journal_num"
|
||||
t.integer "journal_reply_num"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
t.integer "total_score"
|
||||
t.integer "homework_journal_num", :default => 0
|
||||
t.integer "news_num", :default => 0
|
||||
end
|
||||
|
||||
create_table "course_groups", :force => true do |t|
|
||||
|
@ -506,6 +508,7 @@ ActiveRecord::Schema.define(:version => 20160225031230) do
|
|||
t.integer "is_excellent", :default => 0
|
||||
t.integer "excellent_option", :default => 0
|
||||
t.integer "is_copy", :default => 0
|
||||
t.integer "visits", :default => 0
|
||||
end
|
||||
|
||||
create_table "custom_fields", :force => true do |t|
|
||||
|
@ -1282,6 +1285,7 @@ ActiveRecord::Schema.define(:version => 20160225031230) do
|
|||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
t.boolean "allow_guest_download", :default => true
|
||||
t.integer "visits", :default => 0
|
||||
end
|
||||
|
||||
create_table "phone_app_versions", :force => true do |t|
|
||||
|
@ -1441,6 +1445,7 @@ ActiveRecord::Schema.define(:version => 20160225031230) do
|
|||
t.integer "acts_count", :default => 0
|
||||
t.integer "journals_count", :default => 0
|
||||
t.integer "boards_reply_count", :default => 0
|
||||
t.integer "visits", :default => 0
|
||||
end
|
||||
|
||||
add_index "projects", ["lft"], :name => "index_projects_on_lft"
|
||||
|
@ -1900,6 +1905,7 @@ ActiveRecord::Schema.define(:version => 20160225031230) do
|
|||
t.string "mail_notification", :default => "", :null => false
|
||||
t.string "salt", :limit => 64
|
||||
t.integer "gid"
|
||||
t.integer "visits", :default => 0
|
||||
end
|
||||
|
||||
add_index "users", ["auth_source_id"], :name => "index_users_on_auth_source_id"
|
||||
|
@ -2013,11 +2019,6 @@ ActiveRecord::Schema.define(:version => 20160225031230) do
|
|||
|
||||
add_index "wikis", ["project_id"], :name => "wikis_project_id"
|
||||
|
||||
create_table "wlcs", :force => true do |t|
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
end
|
||||
|
||||
create_table "workflows", :force => true do |t|
|
||||
t.integer "tracker_id", :default => 0, :null => false
|
||||
t.integer "old_status_id", :default => 0, :null => false
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1432,3 +1432,4 @@ function submit_course_feedback() {
|
|||
function show_more_tool(){
|
||||
$('#navContentCourse').css('display', 'block');
|
||||
}
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
var editor2;
|
||||
function init_des_editor(params){
|
||||
// var minHeight; //最小高度
|
||||
var paramsHeight = params.height; //设定的高度
|
||||
|
@ -32,7 +33,7 @@ function init_des_editor(params){
|
|||
paramsHeight = paramsHeight == undefined ? params.kindutil.removeUnit(this.height) : paramsHeight;
|
||||
edit.iframe.height(paramsHeight);
|
||||
this.resize(null, Math.max((params.kindutil.IE ? body.scrollHeight : body.offsetHeight), paramsHeight));
|
||||
|
||||
elocalStorage(editor2,'org_document');
|
||||
}
|
||||
}).loadPlugin('paste');
|
||||
return editor;
|
||||
|
@ -123,6 +124,7 @@ function init_des_data(){
|
|||
params.width = width;
|
||||
if (params.textarea.data('init') == undefined) {
|
||||
params.editor = init_des_editor(params);
|
||||
editor2 = params.editor;
|
||||
init_form(params);
|
||||
params.cancel_btn.click(function () {
|
||||
nh_reset_form(params);
|
||||
|
|
|
@ -1,109 +1,109 @@
|
|||
/* CSS Document */
|
||||
/* 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 body,table,input,textarea,select,button { font-family: "微软雅黑","宋体"; font-size:12px;line-height:1.5;}
|
||||
div,img,tr,td,table{ border:0;}
|
||||
table,tr,td{border:0;cellspacing:0; cellpadding:0;}
|
||||
ol,ul,li{ list-style-type:none}
|
||||
a:link,a:visited{text-decoration:none;}
|
||||
/*a:hover,a:active{color:#000;}*/
|
||||
/*常用*/
|
||||
/*#RSide{ background:#fff;}*/
|
||||
/*上传图片处理*/
|
||||
.navSearchTypeBox{margin-top: 32px;}
|
||||
#navHomepageSearch{margin-top: 11px;background-color: white;}
|
||||
.upload_img img{max-width: 100%;}
|
||||
blockquote img{max-width: 100%;}
|
||||
.hidden{overflow:hidden; white-space: nowrap; text-overflow:ellipsis;}
|
||||
.none{display: none;}
|
||||
.rside_back{ width:670px; margin-left:10px; background:#fff; margin-bottom:10px;}
|
||||
.break_word{ word-break:break-all; word-wrap: break-word;}
|
||||
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:hover{ background:#b5e2fa; color:#000; border:1px solid #3c7fb1;}
|
||||
/*table{ background:#fff;}*/
|
||||
.more{ font-weight:normal; color:#999; font-size:12px;}
|
||||
.no_line{ border-bottom:none;}
|
||||
.line{border-bottom:1px dashed #d4d4d4; padding-bottom:10px; margin-bottom:10px;}
|
||||
.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;}
|
||||
.db {display:block;}
|
||||
/* font & color */
|
||||
.f12{font-size:12px; font-weight:normal;}
|
||||
.f14{font-size:14px;}
|
||||
.f16{font-size:16px;}
|
||||
.f18{font-size:18px;}
|
||||
.fb{font-weight:bold;}
|
||||
|
||||
/* Float & Clear */
|
||||
.cl{ clear:both; overflow:hidden; }
|
||||
.fl{float:left;display:inline;}
|
||||
.fr{float:right;display:inline;}
|
||||
.f_l{ float:left;}
|
||||
.f_r{ float:right;}
|
||||
.clearfix:after{clear:both;content:".";display:block;font-size:0;height:0;line-height:0;visibility:hidden}
|
||||
.clearfix{clear:both;zoom:1}
|
||||
.break_word{ word-break:break-all; word-wrap: break-word;}
|
||||
.white_space{white-space:nowrap;}
|
||||
a.c_white{ color:#fff !important;}
|
||||
input.c_white { color:#fff !important;}
|
||||
|
||||
/* Spacing */
|
||||
.ml2{ margin-left:2px;}
|
||||
.ml3{ margin-left:3px;}
|
||||
.ml4{ margin-left:4px;}
|
||||
.ml5{ margin-left:5px;}
|
||||
.ml8{ margin-left:8px;}
|
||||
.ml10{ margin-left:10px;}
|
||||
.ml15{ margin-left:15px;}
|
||||
.ml20{ margin-left:20px;}
|
||||
.ml40{ margin-left:40px;}
|
||||
.ml45{ margin-left:45px;}
|
||||
.ml55{ margin-left:55px;}
|
||||
.ml30{ margin-left:30px;}
|
||||
.ml60{ margin-left:60px;}
|
||||
.ml80{ margin-left:80px;}
|
||||
.ml90{ margin-left:90px;}
|
||||
.ml100{ margin-left:100px;}
|
||||
.ml110{ margin-left:110px;}
|
||||
.ml150 { margin-left:150px;}
|
||||
.mr5{ margin-right:5px;}
|
||||
.mr45 {margin-right:45px;}
|
||||
.mr55{ margin-right:55px;}
|
||||
.mr10{ margin-right:10px;}
|
||||
.mr15 {margin-right:15px;}
|
||||
.mr20{ margin-right:20px;}
|
||||
.mr30{ margin-right:30px;}
|
||||
.mr40{ margin-right:40px;}
|
||||
.mw20{ margin: 0 20px;}
|
||||
.mt3{ margin-top:3px;}
|
||||
.mt5{ margin-top:5px;}
|
||||
.mt8{ margin-top:8px;}
|
||||
.mt10{ margin-top:10px !important;}
|
||||
.mt15 {margin-top:15px;}
|
||||
.mb4{ margin-bottom:4px;}
|
||||
.mb5{ margin-bottom:5px;}
|
||||
.mb8 {margin-bottom:8px;}
|
||||
.mb10{ margin-bottom:10px !important;}
|
||||
.mb20{ margin-bottom:20px;}
|
||||
.pl15{ padding-left:15px;}
|
||||
.w20{ width:20px;}
|
||||
.w60{ width:60px;}
|
||||
.w70{ width:70px;}
|
||||
.w90{ width:90px;}
|
||||
.w210{ width:210px;}
|
||||
.w150{ width:150px;}
|
||||
.w280{ width:280px;}
|
||||
.w430{ width:470px;}
|
||||
.w520{ width:520px;}
|
||||
.w543{ width:543px;}
|
||||
.w557{ width:557px;}
|
||||
.w583{ width:583px;}
|
||||
.w350{ width:350px;}
|
||||
.w610{ width:610px;}
|
||||
.w600{ width:600px;}
|
||||
.h22{ height:22px;}
|
||||
.h26{ height:26px;}
|
||||
.h50{ height:50px;}
|
||||
.h70{ height:70px;}
|
||||
/* CSS Document */
|
||||
/* 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 body,table,input,textarea,select,button { font-family: "微软雅黑","宋体"; font-size:12px;line-height:1.5;}
|
||||
div,img,tr,td,table{ border:0;}
|
||||
table,tr,td{border:0;cellspacing:0; cellpadding:0;}
|
||||
ol,ul,li{ list-style-type:none}
|
||||
a:link,a:visited{text-decoration:none;}
|
||||
/*a:hover,a:active{color:#000;}*/
|
||||
/*常用*/
|
||||
/*#RSide{ background:#fff;}*/
|
||||
/*上传图片处理*/
|
||||
.navSearchTypeBox{margin-top: 32px;}
|
||||
#navHomepageSearch{margin-top: 11px;background-color: white;}
|
||||
.upload_img img{max-width: 100%;}
|
||||
blockquote img{max-width: 100%;}
|
||||
.hidden{overflow:hidden; white-space: nowrap; text-overflow:ellipsis;}
|
||||
.none{display: none;}
|
||||
.rside_back{ width:670px; margin-left:10px; background:#fff; margin-bottom:10px;}
|
||||
.break_word{ word-break:break-all; word-wrap: break-word;}
|
||||
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:hover{ background:#b5e2fa; color:#000; border:1px solid #3c7fb1;}
|
||||
/*table{ background:#fff;}*/
|
||||
.more{ font-weight:normal; color:#999; font-size:12px;}
|
||||
.no_line{ border-bottom:none;}
|
||||
.line{border-bottom:1px dashed #d4d4d4; padding-bottom:10px; margin-bottom:10px;}
|
||||
.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;}
|
||||
.db {display:block;}
|
||||
/* font & color */
|
||||
.f12{font-size:12px; font-weight:normal;}
|
||||
.f14{font-size:14px;}
|
||||
.f16{font-size:16px;}
|
||||
.f18{font-size:18px;}
|
||||
.fb{font-weight:bold;}
|
||||
|
||||
/* Float & Clear */
|
||||
.cl{ clear:both; overflow:hidden; }
|
||||
.fl{float:left;display:inline;}
|
||||
.fr{float:right;display:inline;}
|
||||
.f_l{ float:left;}
|
||||
.f_r{ float:right;}
|
||||
.clearfix:after{clear:both;content:".";display:block;font-size:0;height:0;line-height:0;visibility:hidden}
|
||||
.clearfix{clear:both;zoom:1}
|
||||
.break_word{ word-break:break-all; word-wrap: break-word;}
|
||||
.white_space{white-space:nowrap;}
|
||||
a.c_white{ color:#fff !important;}
|
||||
input.c_white { color:#fff !important;}
|
||||
|
||||
/* Spacing */
|
||||
.ml2{ margin-left:2px;}
|
||||
.ml3{ margin-left:3px;}
|
||||
.ml4{ margin-left:4px;}
|
||||
.ml5{ margin-left:5px;}
|
||||
.ml8{ margin-left:8px;}
|
||||
.ml10{ margin-left:10px;}
|
||||
.ml15{ margin-left:15px;}
|
||||
.ml20{ margin-left:20px;}
|
||||
.ml40{ margin-left:40px;}
|
||||
.ml45{ margin-left:45px;}
|
||||
.ml55{ margin-left:55px;}
|
||||
.ml30{ margin-left:30px;}
|
||||
.ml60{ margin-left:60px;}
|
||||
.ml80{ margin-left:80px;}
|
||||
.ml90{ margin-left:90px;}
|
||||
.ml100{ margin-left:100px;}
|
||||
.ml110{ margin-left:110px;}
|
||||
.ml150 { margin-left:150px;}
|
||||
.mr5{ margin-right:5px;}
|
||||
.mr45 {margin-right:45px;}
|
||||
.mr55{ margin-right:55px;}
|
||||
.mr10{ margin-right:10px;}
|
||||
.mr15 {margin-right:15px;}
|
||||
.mr20{ margin-right:20px;}
|
||||
.mr30{ margin-right:30px;}
|
||||
.mr40{ margin-right:40px;}
|
||||
.mw20{ margin: 0 20px;}
|
||||
.mt3{ margin-top:3px;}
|
||||
.mt5{ margin-top:5px;}
|
||||
.mt8{ margin-top:8px;}
|
||||
.mt10{ margin-top:10px !important;}
|
||||
.mt15 {margin-top:15px;}
|
||||
.mb4{ margin-bottom:4px;}
|
||||
.mb5{ margin-bottom:5px;}
|
||||
.mb8 {margin-bottom:8px;}
|
||||
.mb10{ margin-bottom:10px !important;}
|
||||
.mb20{ margin-bottom:20px;}
|
||||
.pl15{ padding-left:15px;}
|
||||
.w20{ width:20px;}
|
||||
.w60{ width:60px;}
|
||||
.w70{ width:70px;}
|
||||
.w90{ width:90px;}
|
||||
.w210{ width:210px;}
|
||||
.w150{ width:150px;}
|
||||
.w280{ width:280px;}
|
||||
.w430{ width:470px;}
|
||||
.w520{ width:520px;}
|
||||
.w543{ width:543px;}
|
||||
.w557{ width:557px;}
|
||||
.w683{ width:683px;}
|
||||
.w350{ width:350px;}
|
||||
.w610{ width:610px;}
|
||||
.w600{ width:600px;}
|
||||
.h22{ height:22px;}
|
||||
.h26{ height:26px;}
|
||||
.h50{ height:50px;}
|
||||
.h70{ height:70px;}
|
||||
.h150{ height:150px;}
|
|
@ -1266,7 +1266,7 @@ div.disable_link {background-color: #c1c1c1 !important;}
|
|||
/*导入题库样式*/
|
||||
.popupWrap {border:3px solid #269ac9; padding:15px; background-color:#ffffff; position:relative; z-index:1000;}
|
||||
.subjectList {width:585px;}
|
||||
.subjectDetail {width:385px;}
|
||||
.subjectDetail {width:285px;}
|
||||
a.subjectChoose {padding:8px 20px; background-color:#f1f1f1; color:#888888;}
|
||||
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;}
|
||||
|
@ -1277,7 +1277,7 @@ a.chooseActive {background-color:#269ac9; color:#ffffff;}
|
|||
.subjectRow {width:585px; height:40px; color:#7a7a7a; font-size:12px;}
|
||||
.subjectRow li {height:40px; line-height:40px; vertical-align:middle;}
|
||||
.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;}
|
||||
.subjectIntro {color:#585858; line-height:18px; font-size:12px;}
|
||||
.subjectContent {color:#888888; line-height:18px; font-size:12px;}
|
||||
|
|
|
@ -135,7 +135,7 @@ a.linkGrey6:hover {color:#ffffff !important;}
|
|||
.w520{ width:520px;}
|
||||
.w543{ width:543px;}
|
||||
.w557{ width:557px;}
|
||||
.w583{ width:583px;}
|
||||
.w683{ width:683px;}
|
||||
.w350{ width:350px;}
|
||||
.w610{ width:610px;}
|
||||
.w600{ width:600px;}
|
||||
|
@ -845,7 +845,7 @@ a.sortArrowActiveU {background:url(images/post_image_list.png) -17px -20px no-re
|
|||
.postDetailTitle {width:580px; max-width:580px; margin-bottom:5px;}
|
||||
.postDetailDes {width:580px; max-width:580px; margin-bottom:6px; color:#888888;display:block;overflow:hidden;word-break:keep-all;text-overflow:ellipsis;}
|
||||
.postDetailDes p,div,em{word-break: break-all;word-wrap: break-word;}
|
||||
.homepagePostIntro p,.homepagePostIntro div,.homepagePostIntro em, .homepagePostIntro span{text-align: justify; text-justify:inter-ideograph; word-break: normal !important; word-wrap: break-word !important; line-height: 23px !important;}
|
||||
.homepagePostIntro p,.homepagePostIntro div,.homepagePostIntro em, .homepagePostIntro span{text-align: justify; text-justify:inter-ideograph; word-break: normal !important; word-wrap: break-word !important; line-height: 18px !important;}
|
||||
.postDetailCreater {color:#888888; font-size:12px; float:left; margin-right:25px;}
|
||||
.postDetailDate {color:#888888; font-size:12px; float:left;}
|
||||
.postDetailReply { margin-top:28px; color:#888888; float:right;display: inline}
|
||||
|
@ -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;}
|
||||
.subject-list {width:585px;}
|
||||
.subject-detail {width:385px;}
|
||||
.subject-list {width:685px;}
|
||||
.subject-detail {width:285px;}
|
||||
a.subject-choose {padding:8px 20px; background-color:#f1f1f1; color:#888888;}
|
||||
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-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-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-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-wrap {border:1px solid #dddddd; border-top:none; padding:10px; width:365px; height:475px; overflow-y:auto;}
|
||||
.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:265px; height:475px; overflow-y:auto;}
|
||||
.subject-pop-intro {color:#585858; 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;}
|
||||
.subject-pop-type {width:50px; 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;}
|
||||
|
||||
.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;}
|
||||
|
||||
/*20160301新题库样式*/
|
||||
.subject-list-banner {width:585px; height:34px; 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-name {width:200px; padding-left:10px; padding-right:10px;}
|
||||
.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:40px; line-height:40px; vertical-align:middle;}
|
||||
.subject-list-name {width:260px; padding-left:10px; padding-right:10px;}
|
||||
.subject-list-publisher {width:80px; 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 li {height:30px; line-height:30px; vertical-align:middle;}
|
||||
.subject-list-row {width:685px; height:40px; color:#7a7a7a; font-size:12px;}
|
||||
.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-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-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-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;}
|
||||
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_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; }
|
||||
|
|
|
@ -122,7 +122,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;}
|
||||
.subjectList {width:585px;}
|
||||
.subjectDetail {width:385px;}
|
||||
.subjectDetail {width:285px;}
|
||||
a.subjectChoose {padding:8px 20px; background-color:#f1f1f1; color:#888888;}
|
||||
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;}
|
||||
|
@ -133,7 +133,7 @@ a.chooseActive {background-color:#269ac9; color:#ffffff;}
|
|||
.subjectRow {width:585px; height:40px; color:#7a7a7a; font-size:12px;}
|
||||
.subjectRow li {height:40px; line-height:40px; vertical-align:middle;}
|
||||
.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;}
|
||||
.subjectIntro {color:#585858; line-height:18px; font-size:12px;}
|
||||
.subjectContent {color:#888888; line-height:18px; font-size:12px;}
|
||||
|
|
|
@ -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;}
|
||||
.subjectList {width:585px;}
|
||||
.subjectDetail {width:385px;}
|
||||
.subjectDetail {width:285px;}
|
||||
a.subjectChoose {padding:8px 20px; background-color:#f1f1f1; color:#888888;}
|
||||
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;}
|
||||
|
@ -1193,7 +1193,7 @@ a.chooseActive {background-color:#269ac9; color:#ffffff;}
|
|||
.subjectRow {width:585px; height:40px; color:#7a7a7a; font-size:12px;}
|
||||
.subjectRow li {height:40px; line-height:40px; vertical-align:middle;}
|
||||
.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;}
|
||||
.subjectIntro {color:#585858; line-height:18px; font-size:12px;}
|
||||
.subjectContent {color:#888888; line-height:18px; font-size:12px;}
|
||||
|
|
|
@ -117,6 +117,7 @@ h4{ font-size:14px; color:#3b3b3b;}
|
|||
.mt6{ margin-top:6px;}
|
||||
.mt8{ margin-top:8px;}
|
||||
.mt10{ margin-top:10px !important;}
|
||||
.mt16{ margin-top:16px !important;}
|
||||
.mt20{margin-top: 20px;}
|
||||
.mt30{ margin-top: 30px;}
|
||||
.mt40{ margin-top: 40px;}
|
||||
|
@ -164,7 +165,7 @@ h4{ font-size:14px; color:#3b3b3b;}
|
|||
.w543{ width:543px;}
|
||||
.w557{ width:557px;}
|
||||
.w576{ width:576px;}
|
||||
.w583{ width:583px;}
|
||||
.w683{ width:683px;}
|
||||
.w350{ width:350px;}
|
||||
.w610{ width:610px;}
|
||||
.w600{ width:600px !important;}
|
||||
|
@ -1033,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;}
|
||||
.subject-list {width:585px;}
|
||||
.subject-detail {width:385px;}
|
||||
.subject-list {width:685px;}
|
||||
.subject-detail {width:285px;}
|
||||
a.subject-choose {padding:8px 20px; background-color:#f1f1f1; color:#888888;}
|
||||
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-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-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-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-wrap {border:1px solid #dddddd; border-top:none; padding:10px; width:365px; height:475px; overflow-y:auto;}
|
||||
.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:265px; height:475px; overflow-y:auto;}
|
||||
.subject-pop-intro {color:#585858; 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;}
|
||||
.subject-pop-type {width:50px; 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;}
|
||||
|
||||
.whiteSettingIcon {background:url(../images/hwork_icon.png) -5px -302px no-repeat; width:20px; height:20px;}
|
||||
|
@ -1085,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;}
|
||||
.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 li {height:40px; line-height:40px; vertical-align:middle;}
|
||||
.resource-pop-name {width:270px; padding-left:10px; padding-right:10px;}
|
||||
|
@ -1094,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 li {height:40px; line-height:40px; vertical-align:middle;}
|
||||
.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;}
|
||||
.subjectIntro {color:#585858; line-height:18px; font-size:12px;}
|
||||
.subjectContent {color:#888888; line-height:18px; font-size:12px;}
|
||||
|
@ -1131,6 +1132,8 @@ a.resource-tab-active {color:#fff; background-color:#269ac9; border-bottom:1px s
|
|||
|
||||
a.group-btn{ background: url(../images/course/hwork_icon.png) -2px -58px no-repeat !important; height:20px; display:block; padding-left:23px; color:#888888; -moz-transition :all 0s linear 0s; -webkit-transition :all 0s linear 0s; -o-transition:all 0s linear 0s; transition:all 0s linear 0s;}
|
||||
a.program-btn{background: url(../images/homepage_icon.png) -86px -393px no-repeat; width:30px; height:20px; display:block; padding-left:23px; color:#888888;}
|
||||
|
||||
/*视频播放默认图标*/
|
||||
.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_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
Loading…
Reference in New Issue