Merge branch 'develop' into rep_quality
This commit is contained in:
commit
23ba289adf
|
@ -45,9 +45,62 @@ class AdminController < ApplicationController
|
|||
render :action => "projects", :layout => false if request.xhr?
|
||||
end
|
||||
|
||||
def courses
|
||||
def syllabuses
|
||||
@name = params[:name]
|
||||
@courses = Course.like(@name).order('created_at desc')
|
||||
@syllabuses = Syllabus.like(@name).order('created_at desc')
|
||||
@syllabuses = paginateHelper @syllabuses,30
|
||||
@page = (params['page'] || 1).to_i - 1
|
||||
respond_to do |format|
|
||||
format.html
|
||||
end
|
||||
end
|
||||
|
||||
#为班级选择课程
|
||||
def select_course_syllabus
|
||||
@flag = false
|
||||
if params[:syllabus_id] && params[:course_id]
|
||||
course = Course.where("id = #{params[:course_id].to_i}").first
|
||||
unless course.nil?
|
||||
course.update_attribute('syllabus_id', params[:syllabus_id].to_i)
|
||||
@flag = true
|
||||
end
|
||||
end
|
||||
if @flag
|
||||
render :text=> "succ"
|
||||
else
|
||||
render :text=>'fail'
|
||||
end
|
||||
end
|
||||
|
||||
#新建课程
|
||||
def create_syllabus
|
||||
if params[:course_id]
|
||||
course = Course.where("id = #{params[:course_id]}").first
|
||||
if course
|
||||
@user = course.teacher
|
||||
syllabus = Syllabus.new
|
||||
syllabus.update_attributes(:title => params[:title], :eng_name => params[:eng_name], :user_id => @user.id)
|
||||
syllabus.description = Message.where("id = 19412").first.nil? ? nil : Message.where("id = 19412").first.content
|
||||
if syllabus.save
|
||||
course.update_attribute('syllabus_id', syllabus.id)
|
||||
@flag = params[:flag].to_i
|
||||
@course = course
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def courses
|
||||
@name = params[:name].to_s.strip.downcase
|
||||
if @name && @name != ""
|
||||
@courses = Course.select{ |course| (course.teacher[:lastname].to_s.downcase + course.teacher[:firstname].to_s.downcase).include?(@name) || course.name.include?(@name)}
|
||||
@courses = @courses.sort{|x, y| y.created_at <=> x.created_at}
|
||||
else
|
||||
@courses = Course.order('created_at desc')
|
||||
end
|
||||
@courses = paginateHelper @courses,30
|
||||
@page = (params['page'] || 1).to_i - 1
|
||||
respond_to do |format|
|
||||
|
@ -55,6 +108,33 @@ class AdminController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
#未配置班级列表
|
||||
def non_syllabus_courses
|
||||
@name = params[:name].to_s.strip.downcase
|
||||
if @name && @name != ""
|
||||
@courses = Course.where("syllabus_id is null").select{ |course| (course.teacher[:lastname].to_s.downcase + course.teacher[:firstname].to_s.downcase).include?(@name) || course.name.include?(@name)}
|
||||
@courses = @courses.sort{|x, y| y.created_at <=> x.created_at}
|
||||
else
|
||||
@courses = Course.where("syllabus_id is null").order('created_at desc')
|
||||
end
|
||||
@courses = paginateHelper @courses,30
|
||||
@page = (params['page'] || 1).to_i - 1
|
||||
respond_to do |format|
|
||||
format.html
|
||||
end
|
||||
end
|
||||
|
||||
#修改课程名称
|
||||
def update_course_name
|
||||
@course = Course.where("id = #{params[:course_id].to_i}").first
|
||||
unless @course.nil?
|
||||
@course.update_attribute("name", params[:name])
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
#管理员界面精品课程列表
|
||||
def excellent_courses
|
||||
@courses = Course.where("is_excellent =? or excellent_option =?", 1, 1 )
|
||||
|
@ -72,10 +152,42 @@ class AdminController < ApplicationController
|
|||
courses = Course.find_by_sql("SELECT c.*,count(c.id) FROM courses c,course_activities ca WHERE c.id = ca.course_id AND c.name like '%#{name}%' GROUP BY c.id ORDER BY count(c.id) #{params[:sort]}, c.id desc")
|
||||
@order = params[:order]
|
||||
@sort = params[:sort]
|
||||
|
||||
elsif params[:sort] && (params[:order] == 'time')
|
||||
courses = Course.find_by_sql("SELECT * FROM courses WHERE name like '%#{name}%' ORDER BY time #{params[:sort]},id desc")
|
||||
courses = Course.find_by_sql("SELECT * FROM courses WHERE name like '%#{name}%' ORDER BY time #{params[:sort]}, id desc")
|
||||
@order = params[:order]
|
||||
@sort = params[:sort]
|
||||
|
||||
elsif params[:sort] && (params[:order] == 'post')
|
||||
courses = Course.find_by_sql("SELECT c.*, count(m.id) count FROM boards b, courses c, messages m WHERE m.board_id = b.id AND b.course_id = c.id AND c.name like '%#{name}%' GROUP BY c.id ORDER BY count #{params[:sort]}, c.id desc")
|
||||
@order = params[:order]
|
||||
@sort = params[:sort]
|
||||
|
||||
elsif params[:sort] && (params[:order] == 'res')
|
||||
courses = Course.find_by_sql("SELECT c.*, count(at.container_id) cat FROM attachments at, courses c WHERE at.container_type = 'Course' AND at.container_id = c.id AND c.name like '%#{name}%' GROUP BY c.id ORDER BY cat #{params[:sort]}, id desc")
|
||||
@order = params[:order]
|
||||
@sort = params[:sort]
|
||||
|
||||
elsif params[:sort] && (params[:order] == 'works')
|
||||
courses = Course.find_by_sql("SELECT c.*, count(hc.id) chc FROM courses c, homework_commons hc,student_works sw WHERE c.id = hc.course_id AND sw.homework_common_id = hc.id AND c.name like '%#{name}%' GROUP BY c.id ORDER BY chc #{params[:sort]}, id desc")
|
||||
@order = params[:order]
|
||||
@sort = params[:sort]
|
||||
|
||||
elsif params[:sort] && (params[:order] == 'homework')
|
||||
courses = Course.find_by_sql("SELECT c.*, count(sw.id) csw FROM student_works sw, courses c, homework_commons hc WHERE c.id = hc.course_id AND sw.id = c.id AND c.name like '%#{name}%' GROUP BY c.id ORDER BY csw #{params[:sort]}, id desc")
|
||||
@order = params[:order]
|
||||
@sort = params[:sort]
|
||||
|
||||
elsif params[:sort] && (params[:order] == 'std')
|
||||
courses = Course.find_by_sql("SELECT c.*, count(sfc.id) sfc FROM courses c, students_for_courses sfc WHERE sfc.course_id = c.id AND c.name like '%#{name}%' GROUP BY c.id ORDER BY sfc #{params[:sort]}, id desc")
|
||||
@order = params[:order]
|
||||
@sort = params[:sort]
|
||||
|
||||
elsif params[:sort] && (params[:order] == 'open')
|
||||
courses = Course.find_by_sql("SELECT * FROM courses WHERE name like '%#{name}%' ORDER BY is_public #{params[:sort]},id desc")
|
||||
@order = params[:order]
|
||||
@sort = params[:sort]
|
||||
|
||||
else
|
||||
courses = Course.like(name).order('created_at desc')
|
||||
end
|
||||
|
|
|
@ -612,7 +612,7 @@ class AttachmentsController < ApplicationController
|
|||
@attachment.container.board.course)
|
||||
@course = @attachment.container.board.course
|
||||
else
|
||||
unless @attachment.container_type == 'Bid' || @attachment.container_type == 'Organization' || @attachment.container_type == 'HomeworkAttach' || @attachment.container_type == 'Memo' || @attachment.container_type == 'Softapplication' || @attachment.container_type == 'PhoneAppVersion' || @attachment.container_type == 'StudentWorksScore'|| @attachment.container_type == 'StudentWork'
|
||||
unless @attachment.container_type == 'Syllabus' || @attachment.container_type == 'Bid' || @attachment.container_type == 'Organization' || @attachment.container_type == 'HomeworkAttach' || @attachment.container_type == 'Memo' || @attachment.container_type == 'Softapplication' || @attachment.container_type == 'PhoneAppVersion' || @attachment.container_type == 'StudentWorksScore'|| @attachment.container_type == 'StudentWork'
|
||||
@project = @attachment.project
|
||||
end
|
||||
end
|
||||
|
|
|
@ -116,6 +116,9 @@ class BlogCommentsController < ApplicationController
|
|||
|
||||
#回复
|
||||
def reply
|
||||
if params[:homepage]
|
||||
@in_user_homepage = true
|
||||
end
|
||||
if params[:in_user_center]
|
||||
@in_user_center = true
|
||||
end
|
||||
|
|
|
@ -125,7 +125,9 @@ class BoardsController < ApplicationController
|
|||
if @order.to_i == 2
|
||||
@type = 2
|
||||
@topics.each do |topic|
|
||||
topic[:infocount] = get_praise_num(topic) + (topic.parent ? topic.parent.children.count : topic.children.count)
|
||||
all_comments = []
|
||||
count=get_all_children(all_comments, topic).count
|
||||
topic[:infocount] = get_praise_num(topic) + count
|
||||
if topic[:infocount] < 0
|
||||
topic[:infocount] = 0
|
||||
end
|
||||
|
|
|
@ -511,7 +511,7 @@ class ExerciseController < ApplicationController
|
|||
def commit_exercise
|
||||
# 老师不需要提交
|
||||
if User.current.allowed_to?(:as_teacher,@course)
|
||||
if @exercise.publish_time.nil?
|
||||
if @exercise.publish_time.nil? || @exercise.publish_time <= Time.now
|
||||
@exercise.update_attributes(:show_result => params[:show_result])
|
||||
@exercise.update_attributes(:exercise_status => 2)
|
||||
@exercise.update_attributes(:publish_time => Time.now)
|
||||
|
|
|
@ -27,6 +27,7 @@ class HomeworkCommonController < ApplicationController
|
|||
#@homeworks = @course.homework_commons.where("publish_time <= '#{Date.today}'").order("created_at desc").limit(10).offset(@page * 10)
|
||||
@homework_commons = @course.homework_commons.where("name like '%#{search}%' and publish_time <= '#{Date.today}'").order("created_at desc")
|
||||
end
|
||||
#update_homework_time @homework_commons
|
||||
@is_student = User.current.logged? && (User.current.admin? || (User.current.member_of_course?(@course) && !@is_teacher))
|
||||
@is_new = params[:is_new]
|
||||
|
||||
|
@ -178,7 +179,7 @@ class HomeworkCommonController < ApplicationController
|
|||
@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
|
||||
student_works = @homework.student_works.has_committed
|
||||
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")
|
||||
|
@ -232,8 +233,8 @@ class HomeworkCommonController < ApplicationController
|
|||
@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|
|
||||
work_ids = "(" + @homework.student_works.has_committed.map(&:id).join(",") + ")"
|
||||
@homework.student_works.has_committed.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
|
||||
|
@ -263,11 +264,11 @@ class HomeworkCommonController < ApplicationController
|
|||
@totle_size = 0
|
||||
if @homework_detail_manual.comment_status == 1
|
||||
@totle_size = @course.student.count
|
||||
@cur_size = @homework.student_works.size
|
||||
@cur_size = @homework.student_works.has_committed.size
|
||||
elsif @homework_detail_manual.comment_status == 2
|
||||
@homework.student_works.map { |work| @totle_size += work.student_works_evaluation_distributions.count}
|
||||
@homework.student_works.has_committed.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}
|
||||
@homework.student_works.has_committed.map { |work| @cur_size += work.student_works_scores.select("distinct user_id").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
|
||||
|
@ -409,8 +410,8 @@ class HomeworkCommonController < ApplicationController
|
|||
def update_homework_time homeworks
|
||||
unless homeworks.nil?
|
||||
homeworks.each do |h|
|
||||
if h.homework_type == 3
|
||||
student_works = h.student_work_projects.where("is_leader = 1")
|
||||
if h.homework_type == 3 && h.homework_detail_group.base_on_project == 1
|
||||
student_works = h.student_work_projects.where("is_leader = 1 && project_id != -1")
|
||||
time = h.updated_at
|
||||
unless student_works.nil?
|
||||
student_works.each do |s|
|
||||
|
@ -418,7 +419,7 @@ class HomeworkCommonController < ApplicationController
|
|||
unless project.nil? && project.gpid.nil?
|
||||
project_time=project.updated_on
|
||||
project_time=ForgeActivity.where("project_id=?",project.id).last.updated_at if ForgeActivity.where("project_id=?",project.id).last
|
||||
if format_time(time) < format_time(project_time)
|
||||
if time.strftime('%Y-%m-%d %H:%M:%S') < project_time.strftime('%Y-%m-%d %H:%M:%S')
|
||||
time = project_time
|
||||
end
|
||||
begin
|
||||
|
@ -428,21 +429,30 @@ class HomeworkCommonController < ApplicationController
|
|||
changesets = g.commits(project.gpid, :ref_name => default_branch)
|
||||
changesets_latest_coimmit = changesets[0]
|
||||
unless changesets[0].blank?
|
||||
if format_time(time) < format_time(changesets_latest_coimmit.created_at)
|
||||
if time.strftime('%Y-%m-%d %H:%M:%S') <changesets_latest_coimmit.created_at.strftime('%Y-%m-%d %H:%M:%S')
|
||||
time = changesets_latest_coimmit.created_at
|
||||
end
|
||||
end
|
||||
rescue
|
||||
logger.error("############## ==> update homework project time")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
puts h.updated_at
|
||||
puts time
|
||||
s_time = time
|
||||
if format_time(time) > format_time(h.updated_at)
|
||||
if time.strftime('%Y-%m-%d %H:%M:%S') > h.updated_at.strftime('%Y-%m-%d %H:%M:%S')
|
||||
h.update_column('updated_at', s_time)
|
||||
course_activity = CourseActivity.where("course_act_type=? and course_act_id =?", 'HomeworkCommon', h.id).first
|
||||
if course_activity && (time.strftime('%Y-%m-%d %H:%M:%S') > course_activity.updated_at.strftime('%Y-%m-%d %H:%M:%S'))
|
||||
course_activity.update_column('updated_at', s_time)
|
||||
end
|
||||
user_activity = UserActivity.where("act_type=? and act_id =?", 'HomeworkCommon', h.id).first
|
||||
if user_activity && (time.strftime('%Y-%m-%d %H:%M:%S') > user_activity.updated_at.strftime('%Y-%m-%d %H:%M:%S'))
|
||||
user_activity.update_column('updated_at', s_time)
|
||||
end
|
||||
org_activity = OrgActivity.where("org_act_type=? and org_act_id =?", 'HomeworkCommon', h.id).first
|
||||
if org_activity && (time.strftime('%Y-%m-%d %H:%M:%S') > org_activity.updated_at.strftime('%Y-%m-%d %H:%M:%S'))
|
||||
org_activity.update_column('updated_at', s_time)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -44,7 +44,8 @@ class MessagesController < ApplicationController
|
|||
offset = @topic.children.count(:conditions => ["#{Message.table_name}.id < ?", params[:r].to_i])
|
||||
page = 1 + offset / REPLIES_PER_PAGE
|
||||
end
|
||||
@reply_count = @topic.children.count
|
||||
all_comments = []
|
||||
@reply_count = get_all_children(all_comments, @topic).count
|
||||
@reply = Message.new(:subject => "RE: #{@message.subject}")
|
||||
if @course
|
||||
messages_replies = @topic.children.
|
||||
|
@ -137,26 +138,32 @@ class MessagesController < ApplicationController
|
|||
|
||||
# Reply to a topic
|
||||
def reply
|
||||
if params[:reply][:content] == ""
|
||||
if params[:is_board]
|
||||
if @project
|
||||
(redirect_to project_boards_path(@project), :notice => l(:label_reply_empty);return)
|
||||
elsif @course
|
||||
(redirect_to course_boards_path(@course), :notice => l(:label_reply_empty);return)
|
||||
end
|
||||
else
|
||||
(redirect_to board_message_url(@board, @topic, :r => @reply), :notice => l(:label_reply_empty);return)
|
||||
end
|
||||
if params[:parent_id]
|
||||
parent = Message.find params[:parent_id]
|
||||
@reply = Message.new
|
||||
@reply.author = User.current
|
||||
@reply.board = parent.board
|
||||
@reply.content = params[:content]
|
||||
@reply.subject = "RE: #{parent.subject}"
|
||||
@reply.reply_id = params[:reply_id]
|
||||
# @reply.reply_id = params[:id]
|
||||
parent.children << @reply
|
||||
@topic = params[:activity_id].nil? ? parent : Message.find(params[:activity_id].to_i)
|
||||
@user_activity_id = params[:user_activity_id] if params[:user_activity_id]
|
||||
@is_course = params[:is_course] if params[:is_course]
|
||||
@is_board = params[:is_board] if params[:is_board]
|
||||
else
|
||||
@quote = params[:quote][:quote]
|
||||
@reply = Message.new
|
||||
@reply.author = User.current
|
||||
@reply.board = @board
|
||||
@reply.safe_attributes = params[:reply]
|
||||
@reply.content = @quote + @reply.content
|
||||
@reply.subject = "RE: #{@topic.subject}" unless params[:reply][:subject]
|
||||
@topic.children << @reply
|
||||
# @reply.reply_id = params[:id]
|
||||
end
|
||||
@quote = params[:quote][:quote]
|
||||
@reply = Message.new
|
||||
@reply.author = User.current
|
||||
@reply.board = @board
|
||||
@reply.safe_attributes = params[:reply]
|
||||
@reply.content = @quote + @reply.content
|
||||
@reply.subject = "RE: #{@topic.subject}" unless params[:reply][:subject]
|
||||
# @reply.reply_id = params[:id]
|
||||
@topic.children << @reply
|
||||
|
||||
update_course_activity(@topic.class,@topic.id)
|
||||
update_user_activity(@topic.class,@topic.id)
|
||||
update_forge_activity(@topic.class,@topic.id)
|
||||
|
@ -182,14 +189,10 @@ class MessagesController < ApplicationController
|
|||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
elsif params[:is_board]
|
||||
if @project
|
||||
redirect_to project_boards_path(@project)
|
||||
elsif @course
|
||||
redirect_to course_boards_path(@course)
|
||||
end
|
||||
return
|
||||
else
|
||||
redirect_to board_message_url(@board, @topic, :r => @reply)
|
||||
redirect_to board_message_url(@board, @topic)
|
||||
return
|
||||
end
|
||||
|
||||
end
|
||||
|
@ -251,6 +254,17 @@ class MessagesController < ApplicationController
|
|||
|
||||
# Delete a messages
|
||||
def destroy
|
||||
if params[:user_activity_id]
|
||||
@message.destroy
|
||||
@topic = Message.find(params[:activity_id].to_i)
|
||||
@user_activity_id = params[:user_activity_id]
|
||||
@is_course = params[:is_course]
|
||||
@is_board = params[:is_board]
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
return
|
||||
end
|
||||
if @project
|
||||
(render_403; return false) unless @message.destroyable_by?(User.current)
|
||||
elsif @course
|
||||
|
@ -299,12 +313,12 @@ class MessagesController < ApplicationController
|
|||
end
|
||||
|
||||
def quote
|
||||
@subject = @message.subject
|
||||
@subject = "RE: #{@subject}" unless @subject.starts_with?('RE:')
|
||||
|
||||
@content = "> #{ll(Setting.default_language, :text_user_wrote, @message.author)}\n> "
|
||||
@temp = Message.new
|
||||
@temp.content = "<blockquote>#{ll(Setting.default_language, :text_user_wrote, @message.author.show_name)} <br/>#{@message.content.html_safe}</blockquote>".html_safe
|
||||
# @subject = @message.subject
|
||||
# @subject = "RE: #{@subject}" unless @subject.starts_with?('RE:')
|
||||
#
|
||||
# @content = "> #{ll(Setting.default_language, :text_user_wrote, @message.author)}\n> "
|
||||
# @temp = Message.new
|
||||
# @temp.content = "<blockquote>#{ll(Setting.default_language, :text_user_wrote, @message.author.show_name)} <br/>#{@message.content.html_safe}</blockquote>".html_safe
|
||||
end
|
||||
|
||||
def preview
|
||||
|
|
|
@ -155,47 +155,51 @@ class SchoolController < ApplicationController
|
|||
def apply_add_school
|
||||
|
||||
data = {result:0,name:params[:name],school_id:0}
|
||||
#0 成功 1参数错误 2名称已存在
|
||||
#0 成功 1参数错误 2名称已存在 3.失败
|
||||
data[:result] = 0
|
||||
|
||||
#检验参数
|
||||
if params[:name] == "" || params[:province] == "" || params[:city] == "" || params[:address] == ""
|
||||
data[:result] = 1
|
||||
else
|
||||
school_id = School.find_by_sql("select id from schools where name='#{params[:name]}'").first
|
||||
if school_id
|
||||
school = School.where("name = '#{params[:name]}'").first
|
||||
if school
|
||||
data[:result] = 2
|
||||
else
|
||||
school = School.new
|
||||
school.name = params[:name].strip
|
||||
school.pinyin = Pinyin.t(params[:name].strip, splitter: '')
|
||||
school.save
|
||||
|
||||
#status 0未处理 1通过 2拒绝
|
||||
applyschool = ApplyAddSchools.new
|
||||
applyschool.school_id = school.id
|
||||
|
||||
#用belongs_to 可以一起存数据库
|
||||
applyschool.school = school
|
||||
applyschool.name = school.name
|
||||
applyschool.province = params[:province]
|
||||
applyschool.city = params[:city]
|
||||
applyschool.address = params[:address]
|
||||
applyschool.remarks = params[:remarks]
|
||||
applyschool.save
|
||||
|
||||
data[:school_id] = school.id
|
||||
if applyschool.save
|
||||
data[:school_id] = school.id
|
||||
else
|
||||
data[:result] = 3
|
||||
end
|
||||
end
|
||||
end
|
||||
render :json =>data
|
||||
end
|
||||
|
||||
def search_repeat_schoolname
|
||||
status = 0
|
||||
status = 0 #没有重复的
|
||||
name = params[:name]
|
||||
|
||||
if name
|
||||
school_id = School.find_by_sql("select id from schools where name='#{name}'").first
|
||||
school = School.where("name = '#{name}'").first
|
||||
|
||||
if school_id
|
||||
status = 1
|
||||
if school
|
||||
status = 1 #有重复的
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -390,7 +390,7 @@ class StudentWorkController < ApplicationController
|
|||
student_in_group = '(' + group_students.map{|user| user.id}.join(',') + ')'
|
||||
end
|
||||
#开放作品 || 老师 || 超级管理员 || 禁用匿评&&作业截止&&已提交作品 显示所有列表
|
||||
if (@homework.is_open == 1 && @course.is_public == 1) || (@homework.is_open == 1 && @course.is_public == 0 && User.current.member_of_course?(@course)) || @is_teacher || User.current.admin? || (User.current.member_of_course?(@course) && @homework.anonymous_comment == 1 && Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.now.strftime("%Y-%m-%d") && !@homework.student_works.where(:user_id => User.current.id).empty?)
|
||||
if (@homework.is_open == 1 && @course.is_public == 1) || (@homework.is_open == 1 && @course.is_public == 0 && User.current.member_of_course?(@course)) || @is_teacher || User.current.admin? || (User.current.member_of_course?(@course) && @homework.anonymous_comment == 1 && Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.now.strftime("%Y-%m-%d") && !@homework.student_works.has_committed.where(:user_id => User.current.id).empty?)
|
||||
if @order == 'lastname'
|
||||
@stundet_works = search_homework_member @homework.student_works.select("student_works.*,student_works.work_score as score").joins(:user).where("users.id in #{student_in_group}").order("CONVERT(lastname USING gbk) COLLATE gbk_chinese_ci #{@b_sort}, login #{@b_sort}"),@name
|
||||
elsif @order == 'student_id'
|
||||
|
@ -409,7 +409,7 @@ class StudentWorkController < ApplicationController
|
|||
@stundet_works = @homework.student_works.select("student_works.*,student_works.work_score as score").where(:id => pro.student_work_id)
|
||||
end
|
||||
else
|
||||
@stundet_works = @homework.student_works.select("student_works.*,student_works.work_score as score").where(:user_id => User.current.id)
|
||||
@stundet_works = @homework.student_works.has_committed.select("student_works.*,student_works.work_score as score").where(:user_id => User.current.id)
|
||||
end
|
||||
elsif @homework.homework_detail_manual.comment_status == 2 #学生 && 开启匿评 看到匿评列表
|
||||
if @homework.homework_type == 3
|
||||
|
@ -420,7 +420,7 @@ class StudentWorkController < ApplicationController
|
|||
my_work = @homework.student_works.where(:id => pro.student_work_id)
|
||||
end
|
||||
else
|
||||
my_work = @homework.student_works.where(:user_id => User.current.id)
|
||||
my_work = @homework.student_works.has_committed.where(:user_id => User.current.id)
|
||||
end
|
||||
@stundet_works = my_work + User.current.student_works_evaluation_distributions.map(&:student_work).select { |work| work.homework_common_id == @homework.id}
|
||||
elsif @homework.homework_detail_manual.comment_status == 3 #学生 && 关闭匿评 未提交作品之前列表为空,提交了作品看到所有的
|
||||
|
@ -432,17 +432,17 @@ class StudentWorkController < ApplicationController
|
|||
my_work = @homework.student_works.select("student_works.*,student_works.work_score as score").where(:id => pro.student_work_id)
|
||||
end
|
||||
else
|
||||
my_work = @homework.student_works.select("student_works.*,student_works.work_score as score").where(:user_id => User.current.id)
|
||||
my_work = @homework.student_works.has_committed.select("student_works.*,student_works.work_score as score").where(:user_id => User.current.id)
|
||||
end
|
||||
if my_work.empty?
|
||||
@stundet_works = []
|
||||
else
|
||||
if @order == 'lastname'
|
||||
@stundet_works = search_homework_member @homework.student_works.select("student_works.*,student_works.work_score as score").joins(:user).where("users.id in #{student_in_group}").order("CONVERT(lastname USING gbk) COLLATE gbk_chinese_ci #{@b_sort}, login #{@b_sort}"),@name
|
||||
@stundet_works = search_homework_member @homework.student_works.has_committed.select("student_works.*,student_works.work_score as score").joins(:user).where("users.id in #{student_in_group}").order("CONVERT(lastname USING gbk) COLLATE gbk_chinese_ci #{@b_sort}, login #{@b_sort}"),@name
|
||||
elsif @order == 'student_id'
|
||||
@stundet_works = search_homework_member @homework.student_works.select("student_works.*,student_works.work_score as score").joins(:user).where("users.id in #{student_in_group}").joins("join user_extensions on student_works.user_id = user_extensions.user_id").order("#{@order} #{@b_sort}"),@name
|
||||
@stundet_works = search_homework_member @homework.student_works.has_committed.select("student_works.*,student_works.work_score as score").joins(:user).where("users.id in #{student_in_group}").joins("join user_extensions on student_works.user_id = user_extensions.user_id").order("#{@order} #{@b_sort}"),@name
|
||||
else
|
||||
@stundet_works = search_homework_member @homework.student_works.select("student_works.*,student_works.work_score as score").joins(:user).where("users.id in #{student_in_group}").order("#{@order} #{@b_sort}"),@name
|
||||
@stundet_works = search_homework_member @homework.student_works.has_committed.select("student_works.*,student_works.work_score as score").joins(:user).where("users.id in #{student_in_group}").order("#{@order} #{@b_sort}"),@name
|
||||
end
|
||||
@show_all = true
|
||||
end
|
||||
|
@ -454,9 +454,9 @@ class StudentWorkController < ApplicationController
|
|||
return
|
||||
end
|
||||
|
||||
@student_work_count = (search_homework_member @homework.student_works.select("student_works.*,student_works.work_score as score").joins(:user).where("users.id in #{student_in_group}").order("#{@order} #{@b_sort}"),@name).count
|
||||
@student_work_count = (search_homework_member @homework.student_works.has_committed.select("student_works.*,student_works.work_score as score").joins(:user).where("users.id in #{student_in_group}").order("#{@order} #{@b_sort}"),@name).count
|
||||
else
|
||||
if (@homework.is_open == 1 &&@course.is_public == 1) || (@homework.is_open == 1 && @course.is_public == 0 && User.current.member_of_course?(@course)) || @is_teacher || User.current.admin? || (User.current.member_of_course?(@course) && @homework.anonymous_comment == 1 && Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.now.strftime("%Y-%m-%d") && !@homework.student_works.where(:user_id => User.current.id).empty?)
|
||||
if (@homework.is_open == 1 &&@course.is_public == 1) || (@homework.is_open == 1 && @course.is_public == 0 && User.current.member_of_course?(@course)) || @is_teacher || User.current.admin? || (User.current.member_of_course?(@course) && @homework.anonymous_comment == 1 && Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.now.strftime("%Y-%m-%d") && !@homework.student_works.has_committed.where(:user_id => User.current.id).empty?)
|
||||
if @order == 'lastname'
|
||||
@stundet_works = search_homework_member @homework.student_works.select("student_works.*,student_works.work_score as score").joins(:user).order("CONVERT(lastname USING gbk) COLLATE gbk_chinese_ci #{@b_sort}, login #{@b_sort}"),@name
|
||||
elsif @order == 'student_id'
|
||||
|
@ -475,7 +475,7 @@ class StudentWorkController < ApplicationController
|
|||
@stundet_works = @homework.student_works.select("student_works.*,student_works.work_score as score").where(:id => pro.student_work_id)
|
||||
end
|
||||
else
|
||||
@stundet_works = @homework.student_works.select("student_works.*,student_works.work_score as score").where(:user_id => User.current.id)
|
||||
@stundet_works = @homework.student_works.has_committed.select("student_works.*,student_works.work_score as score").where(:user_id => User.current.id)
|
||||
end
|
||||
elsif @homework.homework_detail_manual.comment_status == 2 #学生 && 开启匿评 看到匿评列表
|
||||
if @homework.homework_type == 3
|
||||
|
@ -486,7 +486,7 @@ class StudentWorkController < ApplicationController
|
|||
my_work = @homework.student_works.where(:id => pro.student_work_id)
|
||||
end
|
||||
else
|
||||
my_work = @homework.student_works.where(:user_id => User.current.id)
|
||||
my_work = @homework.student_works.has_committed.where(:user_id => User.current.id)
|
||||
end
|
||||
@stundet_works = my_work + User.current.student_works_evaluation_distributions.map(&:student_work).select { |work| work.homework_common_id == @homework.id}
|
||||
elsif @homework.homework_detail_manual.comment_status == 3 #学生 && 关闭匿评 未提交作品之前列表为空,提交了作品看到所有的
|
||||
|
@ -498,17 +498,17 @@ class StudentWorkController < ApplicationController
|
|||
my_work = @homework.student_works.select("student_works.*,student_works.work_score as score").where(:id => pro.student_work_id)
|
||||
end
|
||||
else
|
||||
my_work = @homework.student_works.select("student_works.*,student_works.work_score as score").where(:user_id => User.current.id)
|
||||
my_work = @homework.student_works.has_committed.select("student_works.*,student_works.work_score as score").where(:user_id => User.current.id)
|
||||
end
|
||||
if my_work.empty?
|
||||
@stundet_works = []
|
||||
else
|
||||
if @order == 'lastname'
|
||||
@stundet_works = search_homework_member @homework.student_works.select("student_works.*,student_works.work_score as score").joins(:user).order("CONVERT(lastname USING gbk) COLLATE gbk_chinese_ci #{@b_sort}, login #{@b_sort}"),@name
|
||||
@stundet_works = search_homework_member @homework.student_works.has_committed.select("student_works.*,student_works.work_score as score").joins(:user).order("CONVERT(lastname USING gbk) COLLATE gbk_chinese_ci #{@b_sort}, login #{@b_sort}"),@name
|
||||
elsif @order == 'student_id'
|
||||
@stundet_works = search_homework_member @homework.student_works.select("student_works.*,student_works.work_score as score").joins("join user_extensions on student_works.user_id = user_extensions.user_id").order("#{@order} #{@b_sort}"),@name
|
||||
@stundet_works = search_homework_member @homework.student_works.has_committed.select("student_works.*,student_works.work_score as score").joins("join user_extensions on student_works.user_id = user_extensions.user_id").order("#{@order} #{@b_sort}"),@name
|
||||
else
|
||||
@stundet_works = search_homework_member @homework.student_works.select("student_works.*,student_works.work_score as score").order("#{@order} #{@b_sort}"),@name
|
||||
@stundet_works = search_homework_member @homework.student_works.has_committed.select("student_works.*,student_works.work_score as score").order("#{@order} #{@b_sort}"),@name
|
||||
end
|
||||
@show_all = true
|
||||
end
|
||||
|
@ -519,7 +519,7 @@ class StudentWorkController < ApplicationController
|
|||
render_403
|
||||
return
|
||||
end
|
||||
@student_work_count = (search_homework_member @homework.student_works.select("student_works.*,student_works.work_score as score").order("#{@order} #{@b_sort}"),@name).count
|
||||
@student_work_count = (search_homework_member @homework.student_works.has_committed.select("student_works.*,student_works.work_score as score").order("#{@order} #{@b_sort}"),@name).count
|
||||
|
||||
end
|
||||
@score = @b_sort == "desc" ? "asc" : "desc"
|
||||
|
@ -547,10 +547,10 @@ class StudentWorkController < ApplicationController
|
|||
return
|
||||
end
|
||||
@user = User.current
|
||||
@student_work = @homework.student_works.where("user_id = ?",User.current.id).first
|
||||
if @student_work.nil?
|
||||
#@student_work = @homework.student_works.where("user_id = ?",User.current.id).first
|
||||
#if @student_work.nil?
|
||||
@student_work = StudentWork.new
|
||||
end
|
||||
#end
|
||||
respond_to do |format|
|
||||
format.html{ render :layout => "new_base_user"}
|
||||
end
|
||||
|
@ -560,7 +560,7 @@ class StudentWorkController < ApplicationController
|
|||
# 提交作品前先判断是否已经提交
|
||||
@has_commit = false;
|
||||
if hsd_committed_work?(User.current.id, @homework.id)
|
||||
@work = StudentWork.where("user_id =? and homework_common_id =?", User.current.id, @homework.id).first
|
||||
@work = StudentWork.where("user_id =? and homework_common_id =? and work_status != 0", User.current.id, @homework.id).first
|
||||
@has_commit = true;
|
||||
#flash[:notice] = l(:notice_successful_create)
|
||||
#redirect_to edit_student_work_url(params[:student_work])
|
||||
|
@ -572,6 +572,7 @@ class StudentWorkController < ApplicationController
|
|||
if params[:student_work]
|
||||
@submit_result = true
|
||||
student_work = StudentWork.find(params[:student_work_id]) if params[:student_work_id]
|
||||
student_work = StudentWork.where("user_id =? and homework_common_id =? and work_status = 0", User.current.id, @homework.id).first
|
||||
student_work ||= StudentWork.new
|
||||
student_work.name = params[:student_work][:name] == "#{@homework.name}的作品提交(可修改)" ? "#{@homework.name}的作品提交" : params[:student_work][:name]
|
||||
student_work.description = params[:student_work][:description]
|
||||
|
@ -586,8 +587,10 @@ class StudentWorkController < ApplicationController
|
|||
#提交作品时,计算是否迟交
|
||||
if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(Time.now.to_s).strftime("%Y-%m-%d")
|
||||
student_work.late_penalty = @homework.late_penalty
|
||||
student_work.work_status = 2
|
||||
else
|
||||
student_work.late_penalty = 0
|
||||
student_work.work_status = 1
|
||||
end
|
||||
if student_work.save
|
||||
if @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1
|
||||
|
@ -800,6 +803,9 @@ class StudentWorkController < ApplicationController
|
|||
@new_score.comment = params[:new_form][:user_message] if params[:new_form] && params[:new_form][:user_message] && params[:new_form][:user_message] != ""
|
||||
@new_score.user_id = User.current.id
|
||||
@new_score.student_work_id = @work.id
|
||||
if @is_teacher && @work.work_status == 0
|
||||
@work.update_column('work_status', 1)
|
||||
end
|
||||
if User.current.admin?
|
||||
@new_score.reviewer_role = 1
|
||||
else
|
||||
|
@ -1148,7 +1154,7 @@ class StudentWorkController < ApplicationController
|
|||
end
|
||||
|
||||
def hsd_committed_work?(user, homework)
|
||||
sw = StudentWork.where("user_id =? and homework_common_id =?", user, homework).first
|
||||
sw = StudentWork.where("user_id =? and homework_common_id =? and work_status != 0", user, homework).first
|
||||
sw.nil? ? result = false : result = true
|
||||
result
|
||||
end
|
||||
|
@ -1225,7 +1231,7 @@ class StudentWorkController < ApplicationController
|
|||
sheet1[count_row,3] = homework.user.user_extensions.student_id
|
||||
sheet1[count_row,4] = homework.user.mail
|
||||
sheet1[count_row,5] = homework.name
|
||||
sheet1[count_row,6] = strip_html homework.description
|
||||
sheet1[count_row,6] = strip_html homework.description if !homework.description.nil?
|
||||
sheet1[count_row,7] = homework.teacher_score.nil? ? l(:label_without_score) : homework.teacher_score.round(2)
|
||||
sheet1[count_row,8] = homework.teaching_asistant_score.nil? ? l(:label_without_score) : homework.teaching_asistant_score.round(2)
|
||||
if @homework.anonymous_comment ==0
|
||||
|
|
|
@ -6,7 +6,7 @@ class SyllabusesController < ApplicationController
|
|||
include CoursesHelper
|
||||
|
||||
before_filter :is_logged, :only => [:index, :show, :edit, :new, :update, :destroy, :delete_syllabus]
|
||||
before_filter :find_syllabus, :only => [:show, :edit, :update, :destroy, :syllabus_courselist, :edit_syllabus_eng_name, :update_base_info, :delete_syllabus, :delete_des]
|
||||
before_filter :find_syllabus, :only => [:show, :edit, :update, :destroy, :syllabus_courselist, :edit_syllabus_eng_name, :edit_syllabus_title, :update_base_info, :delete_syllabus, :delete_des]
|
||||
def index
|
||||
user = User.current
|
||||
@syllabuses = user.syllabuses
|
||||
|
@ -140,6 +140,16 @@ class SyllabusesController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
#修改课程名称
|
||||
def edit_syllabus_title
|
||||
if @syllabus && params[:title] != ""
|
||||
@syllabus.update_column("title",params[:title])
|
||||
end
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
#修改英文名称
|
||||
def edit_syllabus_eng_name
|
||||
if @syllabus
|
||||
|
|
|
@ -90,6 +90,8 @@ class UsersController < ApplicationController
|
|||
case params[:type]
|
||||
when 'JournalsForMessage'
|
||||
@comment = JournalsForMessage.find params[:comment].to_i
|
||||
when 'Message'
|
||||
@comment = Message.find params[:comment].to_i
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -111,6 +113,13 @@ class UsersController < ApplicationController
|
|||
@user_activity_id = params[:user_activity_id]
|
||||
@activity_id = params[:activity_id]
|
||||
@type = 'JournalsForMessage'
|
||||
when 'Message'
|
||||
@reply = Message.find params[:reply_id]
|
||||
@user_activity_id = params[:user_activity_id]
|
||||
@activity_id = params[:activity_id]
|
||||
@is_course = params[:is_course]
|
||||
@is_board = params[:is_board]
|
||||
@type = 'Message'
|
||||
end
|
||||
respond_to do |format|
|
||||
format.js
|
||||
|
@ -941,8 +950,10 @@ class UsersController < ApplicationController
|
|||
#提交作品时,计算是否迟交
|
||||
if Time.parse(homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(Time.now.to_s).strftime("%Y-%m-%d")
|
||||
student_work.late_penalty = homework.late_penalty
|
||||
student_work.work_status = 2
|
||||
else
|
||||
student_work.late_penalty = 0
|
||||
student_work.work_status = 1
|
||||
end
|
||||
|
||||
student_work.save
|
||||
|
@ -1033,6 +1044,25 @@ class UsersController < ApplicationController
|
|||
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 homework.homework_type != 3
|
||||
unless homework.course.nil?
|
||||
name = homework.name
|
||||
name_str = name + "的作品提交"
|
||||
str = ""
|
||||
homework.course.student.each do |student|
|
||||
if str != ""
|
||||
str += ","
|
||||
end
|
||||
str += "('#{name_str}',#{homework.id},#{student.student_id}, '#{format_time(Time.now)}', '#{format_time(Time.now)}')"
|
||||
end
|
||||
#('#{name}的作品提交',#{homework.id},#{student.student_id}, '#{format_time(Time.now)}', '#{format_time(Time.now)}')
|
||||
sql = "insert into student_works (name, homework_common_id,user_id, created_at, updated_at) values" + str
|
||||
#StudentWork.create(:name => "#{name}的作品提交", :homework_common_id => homework.id, :user_id => student.student_id)
|
||||
ActiveRecord::Base.connection.execute sql
|
||||
end
|
||||
end
|
||||
|
||||
if params[:quotes] && !params[:quotes].blank?
|
||||
quotes_homework = HomeworkCommon.find params[:quotes].to_i
|
||||
quotes_homework.update_column(:quotes, quotes_homework.quotes+1)
|
||||
|
@ -2773,8 +2803,8 @@ class UsersController < ApplicationController
|
|||
|
||||
# 获取我的课程资源
|
||||
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(',')})
|
||||
attchments = Attachment.where("(author_id = #{author_id} and is_publish = 1 and container_id is not null and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')}) 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
|
||||
|
||||
|
@ -3281,7 +3311,12 @@ class UsersController < ApplicationController
|
|||
@journals = obj.children.reorder("created_at desc")
|
||||
when 'Message'
|
||||
obj = Message.where('id = ?', params[:id].to_i).first
|
||||
@journals = obj.children.reorder("created_on desc")
|
||||
@type = 'Message'
|
||||
@is_course = params[:is_course]
|
||||
@is_board = params[:is_board]
|
||||
@user_activity_id = params[:div_id].to_i if params[:div_id]
|
||||
comments = []
|
||||
@journals = get_all_children(comments, obj)
|
||||
when 'News'
|
||||
obj = News.where('id = ?', params[:id].to_i).first
|
||||
@journals = obj.comments.reorder("created_on desc")
|
||||
|
|
|
@ -2631,7 +2631,7 @@ module ApplicationHelper
|
|||
def homework_anonymous_comment (homework, is_in_course, user_activity_id = -1, course_activity = -1)
|
||||
if homework.homework_detail_manual.comment_status == 0 ||Time.parse(homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d")
|
||||
link = link_to "启动匿评","javascript:void(0)", :class => "postOptionLink", :title => "作业截止日期之前不可以启动匿评"
|
||||
elsif homework.student_works.count >= 2 && homework.homework_detail_manual#作业份数大于2
|
||||
elsif homework.student_works.has_committed.count >= 2 && homework.homework_detail_manual#作业份数大于2
|
||||
case homework.homework_detail_manual.comment_status
|
||||
when 1
|
||||
link = link_to '启动匿评', Setting.protocol + "://" + Setting.host_name + "/homework_common/" + homework.id.to_s + "/alert_anonymous_comment?is_in_course=" + is_in_course.to_s + "&user_activity_id=" + user_activity_id.to_s + "&course_activity=" + course_activity.to_s, id: "#{homework.id}_start_anonymous_comment", remote: true, disable_with: '加载中...',:class => 'postOptionLink'
|
||||
|
@ -2681,40 +2681,41 @@ module ApplicationHelper
|
|||
|
||||
#根据传入作业确定显示为编辑作品还是新建作品,或者显示作品数量
|
||||
def user_for_homework_common homework,is_teacher
|
||||
count = homework.student_works.has_committed.count
|
||||
if User.current.member_of_course?(homework.course)
|
||||
if is_teacher #老师显示作品数量
|
||||
link_to "作品(#{homework.student_works.count})", student_work_index_url_in_org(homework.id), :class => "c_blue"
|
||||
link_to "作品(#{count})", student_work_index_url_in_org(homework.id), :class => "c_blue"
|
||||
else #学生显示提交作品、修改作品等按钮
|
||||
work = cur_user_works_for_homework homework
|
||||
project = cur_user_projects_for_homework homework
|
||||
if work.nil? && Time.parse(homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d")
|
||||
if homework.homework_type ==3 && project.nil? && homework.homework_detail_group.base_on_project == 1
|
||||
link_to "提交作品(#{homework.student_works.count})","javascript:void(0)", :class => 'c_grey',:style=>"cursor:not-allowed",:title => '请先关联项目再提交作品'
|
||||
link_to "提交作品(#{count})","javascript:void(0)", :class => 'c_grey',:style=>"cursor:not-allowed",:title => '请先关联项目再提交作品'
|
||||
else
|
||||
link_to "提交作品(#{homework.student_works.count})", new_student_work_url_without_domain(homework.id),:class => 'c_blue'
|
||||
link_to "提交作品(#{count})", new_student_work_url_without_domain(homework.id),:class => 'c_blue'
|
||||
end
|
||||
elsif work.nil? && Time.parse(homework.end_time.to_s).strftime("%Y-%m-%d") < Time.now.strftime("%Y-%m-%d")
|
||||
if homework.homework_type ==3 && project.nil? && homework.homework_detail_group.base_on_project == 1
|
||||
link_to "补交作品(#{homework.student_works.count})","javascript:void(0)", :class => 'c_grey',:style=>"cursor:not-allowed",:title => '请先关联项目再补交作品'
|
||||
link_to "补交作品(#{count})","javascript:void(0)", :class => 'c_grey',:style=>"cursor:not-allowed",:title => '请先关联项目再补交作品'
|
||||
else
|
||||
link_to "补交作品(#{homework.student_works.count})", new_student_work_url_without_domain(homework.id),:class => 'c_red'
|
||||
link_to "补交作品(#{count})", new_student_work_url_without_domain(homework.id),:class => 'c_red'
|
||||
end
|
||||
else
|
||||
if homework.homework_detail_manual && homework.homework_detail_manual.comment_status == 2 #匿评作业,且作业状态不是在开启匿评之前
|
||||
link_to "作品匿评", student_work_index_url_in_org(homework.id), :class => 'c_blue', :title => "开启匿评后不可修改作品"
|
||||
elsif homework.homework_detail_manual && homework.homework_detail_manual.comment_status == 3
|
||||
link_to "查看作品(#{homework.student_works.count})",student_work_index_url_in_org(homework.id), :class => 'c_blue', :title => "匿评已结束"
|
||||
link_to "查看作品(#{count})",student_work_index_url_in_org(homework.id), :class => 'c_blue', :title => "匿评已结束"
|
||||
elsif homework.homework_type == 2 && Time.parse(homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d")#编程作业不能修改作品
|
||||
link_to "修改作品(#{homework.student_works.count})", new_student_work_url_without_domain(homework.id),:class => 'c_blue'
|
||||
link_to "修改作品(#{count})", new_student_work_url_without_domain(homework.id),:class => 'c_blue'
|
||||
elsif Time.parse(homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d") && work.user_id == User.current.id
|
||||
link_to "修改作品(#{homework.student_works.count})", edit_student_work_url_without_domain(work.id),:class => 'c_blue'
|
||||
link_to "修改作品(#{count})", edit_student_work_url_without_domain(work.id),:class => 'c_blue'
|
||||
else
|
||||
link_to "查看作品(#{homework.student_works.count})", student_work_index_url_in_org(homework.id), :class => 'c_blue', :title => "作业截止后不可修改作品"
|
||||
link_to "查看作品(#{count})", student_work_index_url_in_org(homework.id), :class => 'c_blue', :title => "作业截止后不可修改作品"
|
||||
end
|
||||
end
|
||||
end
|
||||
else
|
||||
link_to "作品(#{homework.student_works.count})",student_work_index_url_in_org(homework.id),:class => "c_blue"
|
||||
link_to "作品(#{count})",student_work_index_url_in_org(homework.id),:class => "c_blue"
|
||||
end
|
||||
|
||||
end
|
||||
|
@ -2752,7 +2753,7 @@ module ApplicationHelper
|
|||
|
||||
#获取当前用户在指定作业下提交的作业的集合
|
||||
def cur_user_works_for_homework homework
|
||||
work = homework.student_works.where("user_id = ?",User.current).first
|
||||
work = homework.student_works.where("user_id = ? && work_status != 0",User.current).first
|
||||
if homework.homework_type == 3
|
||||
pro = homework.student_work_projects.where("user_id = #{User.current.id}").first
|
||||
if pro.nil? || pro.student_work_id == "" || pro.student_work_id.nil?
|
||||
|
@ -3138,9 +3139,9 @@ def get_reply_parents_no_root parents_rely, comment
|
|||
parents_rely
|
||||
end
|
||||
|
||||
#获取留言的所有子节点
|
||||
#获取所有子节点
|
||||
def get_all_children result, jour
|
||||
if jour.kind_of? JournalsForMessage
|
||||
if (jour.kind_of? JournalsForMessage) || (jour.kind_of? Message)
|
||||
jour.children.each do |jour_child|
|
||||
result << jour_child
|
||||
get_all_children result, jour_child
|
||||
|
@ -3322,3 +3323,21 @@ def get_group_member_names work
|
|||
end
|
||||
result
|
||||
end
|
||||
|
||||
def course_syllabus_option user = User.current
|
||||
syllabuses = user.syllabuses
|
||||
type = []
|
||||
option1 = []
|
||||
option1 << "请选择课程"
|
||||
option1 << 0
|
||||
type << option1
|
||||
unless syllabuses.empty?
|
||||
syllabuses.each do |syllabus|
|
||||
option = []
|
||||
option << syllabus.title
|
||||
option << syllabus.id
|
||||
type << option
|
||||
end
|
||||
end
|
||||
type
|
||||
end
|
||||
|
|
|
@ -772,12 +772,12 @@ module CoursesHelper
|
|||
url = joined ? join_path(:object_id => course.id) : try_join_path(:object_id => course.id)
|
||||
method = joined ? 'delete' : 'post'
|
||||
if joined
|
||||
link = link_to(text, url, :remote => true, :method => method, :class => "pr_join_a", :id => "#{course.id}", :confirm => l(:text_are_you_sure_out))
|
||||
link = link_to(text, url, :remote => true, :method => method, :class => "Blue-btn", :style => "margin_left: 0px;", :id => "#{course.id}", :confirm => l(:text_are_you_sure_out))
|
||||
else
|
||||
link = link_to(text, url, :remote => true, :method => method, :id => "#{course.id}", :class => "pr_join_a")
|
||||
link = link_to(text, url, :remote => true, :method => method, :id => "#{course.id}", :class => "Blue-btn", :style => "margin_left: 0px;")
|
||||
end
|
||||
else
|
||||
link = "<span class='pr_join_span mr5' >#{l(:label_course_join_student)}</span>"
|
||||
link = "<span class='pr_join_span mr5' >#{l(:label_course_join_student)}</span>"
|
||||
end
|
||||
link.html_safe
|
||||
end
|
||||
|
|
|
@ -52,6 +52,19 @@ module StudentWorkHelper
|
|||
result
|
||||
end
|
||||
|
||||
def get_status status
|
||||
str = ""
|
||||
case status
|
||||
when 0
|
||||
str = "未提交"
|
||||
when 1
|
||||
str = "已提交"
|
||||
when 2
|
||||
str = "迟交"
|
||||
end
|
||||
str
|
||||
end
|
||||
|
||||
#获取赞的总数
|
||||
def praise_homework_count obj_id
|
||||
PraiseTread.where("praise_tread_object_id = #{obj_id} AND praise_tread_object_type = 'StudentWork'").count
|
||||
|
|
|
@ -48,17 +48,17 @@ module SyllabusesHelper
|
|||
option6 = []
|
||||
|
||||
option1 << "请选择"
|
||||
option1 << 1
|
||||
option1 << 0
|
||||
option2 << "公共必修课"
|
||||
option2 << 2
|
||||
option2 << 1
|
||||
option3 << "学科必修课"
|
||||
option3 << 3
|
||||
option3 << 2
|
||||
option4 << "专业选修课"
|
||||
option4 << 4
|
||||
option4 << 3
|
||||
option5 << "实践必修课"
|
||||
option5 << 5
|
||||
option5 << 4
|
||||
option6 << "实践选修课"
|
||||
option6 << 6
|
||||
option6 << 5
|
||||
|
||||
type << option1
|
||||
type << option2
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
class ApplyAddSchools < ActiveRecord::Base
|
||||
attr_accessible :address, :city, :name, :province, :remarks, :school_id, :status
|
||||
belongs_to :school
|
||||
end
|
||||
|
|
|
@ -13,6 +13,8 @@ class StudentWork < ActiveRecord::Base
|
|||
has_many :course_messages, :class_name =>'CourseMessage', :as => :course_message, :dependent => :destroy
|
||||
has_many :attachments, :dependent => :destroy
|
||||
|
||||
scope :has_committed, lambda{where("work_status != 0")}
|
||||
|
||||
before_destroy :delete_praise
|
||||
before_save :set_program_score, :set_src
|
||||
|
||||
|
@ -172,7 +174,7 @@ class StudentWork < ActiveRecord::Base
|
|||
|
||||
# status == 0 : delay
|
||||
def act_as_message
|
||||
if self.created_at > self.homework_common.end_time + 1
|
||||
if self.work_status != 0 && self.created_at > self.homework_common.end_time + 1
|
||||
self.course_messages << CourseMessage.new(:user_id => self.user_id, :course_id => self.homework_common.course_id, :viewed => false, :status => false)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -9,9 +9,18 @@ class Syllabus < ActiveRecord::Base
|
|||
belongs_to :user
|
||||
has_many :courses
|
||||
has_many :journals_for_messages, :as => :jour, :dependent => :destroy
|
||||
attr_accessible :description, :title, :eng_name, :syllabus_type, :credit, :hours, :theory_hours, :practice_hours, :applicable_major, :pre_course
|
||||
attr_accessible :user_id, :description, :title, :eng_name, :syllabus_type, :credit, :hours, :theory_hours, :practice_hours, :applicable_major, :pre_course
|
||||
safe_attributes 'title', 'description', 'eng_name', 'syllabus_type', 'credit', 'hours', 'theory_hours', 'practice_hours', 'credit', 'applicable_major', 'pre_course'
|
||||
|
||||
scope :like, lambda {|arg|
|
||||
if arg.blank?
|
||||
where(nil)
|
||||
else
|
||||
pattern = "%#{arg.to_s.strip.downcase}%"
|
||||
where(" LOWER(title) LIKE :p ", :p => pattern)
|
||||
end
|
||||
}
|
||||
|
||||
def delete_kindeditor_assets
|
||||
delete_kindeditor_assets_from_disk self.id,OwnerTypeHelper::SYLLABUS
|
||||
end
|
||||
|
|
|
@ -324,15 +324,15 @@ class CoursesService
|
|||
define_error [
|
||||
0, '加入成功',
|
||||
1, '密码错误',
|
||||
2, '课程已过期 请联系课程管理员重启课程。',
|
||||
3, '您已经加入了课程',
|
||||
4, '您加入的课程不存在',
|
||||
2, '班级已过期 请联系班级管理员重启班级。',
|
||||
3, '您已经加入了班级',
|
||||
4, '您加入的班级不存在',
|
||||
5, '您还未登录',
|
||||
6, '申请成功,请等待审核完毕',
|
||||
7, '您已经发送过申请了,请耐心等待',
|
||||
8, '您已经是该课程的教师了',
|
||||
9, '您已经是该课程的教辅了',
|
||||
10, '您已经是该课程的管理员了',
|
||||
8, '您已经是该班级的教师了',
|
||||
9, '您已经是该班级的教辅了',
|
||||
10, '您已经是该班级的管理员了',
|
||||
'未知错误,请稍后再试'
|
||||
]
|
||||
end
|
||||
|
|
|
@ -6,6 +6,9 @@
|
|||
<%= link_to(course.name, course_path(course.id)) %>
|
||||
</span>
|
||||
</td>
|
||||
<td align="center">
|
||||
<%= checked_image course.is_public? %>
|
||||
</td>
|
||||
<td align="center">
|
||||
<%= link_to(course.try(:teacher).try(:realname).truncate(6, omission: '...'), user_path(course.teacher)) %>
|
||||
</td>
|
||||
|
@ -22,7 +25,7 @@
|
|||
<%= visable_attachemnts_incourse(course).count%>
|
||||
</td>
|
||||
<td class="center">
|
||||
<%= course.boards.first.topics.count + Message.where("board_id =? and parent_id is not ?", course.boards.first.id, nil).count %>
|
||||
<%= Message.where("board_id =?", course.boards.first.id).count %>
|
||||
</td>
|
||||
<td class="center">
|
||||
<%= course.course_activities.count%>
|
||||
|
|
|
@ -0,0 +1,30 @@
|
|||
<td style="text-align: center;">
|
||||
<%= course.id %>
|
||||
</td>
|
||||
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="name" title='<%=course.name%>'>
|
||||
<span>
|
||||
<%= link_to(course.name, course_path(course.id)) %>
|
||||
</span>
|
||||
</td>
|
||||
<td align="center">
|
||||
<%= link_to(course.try(:teacher).try(:realname).truncate(6, omission: '...'), user_path(course.teacher)) %>
|
||||
</td>
|
||||
<td align="center">
|
||||
<%= course.class_period %>
|
||||
</td>
|
||||
<td class="center">
|
||||
<%= checked_image course.is_public? %>
|
||||
</td>
|
||||
<td class="center">
|
||||
<%= format_date(course.created_at) %>
|
||||
</td>
|
||||
<td class="center">
|
||||
<%= course.updated_at.strftime('%Y-%m-%d %H:%M:%S') %>
|
||||
</td>
|
||||
<td class="center">
|
||||
<%= select_tag :syllabus_id,options_for_select(course_syllabus_option(course.teacher),course.syllabus_id), {:id=>"new_syllabus_id_#{course.id}", :class=>"course_syllabus_input", :onchange=>"select_syllabus(#{course.id});"}%>
|
||||
</td>
|
||||
<td class="center">
|
||||
<a href="javascript:void(0)" onclick="alert_new_syllabus(<%=course.id %>, 0)">新建课程</a>
|
||||
<%#= link_to "新建课程", admin_create_syllabus_path%>
|
||||
</td>
|
|
@ -0,0 +1,7 @@
|
|||
<div class="tabs">
|
||||
<ul>
|
||||
<li><%= link_to '课程列表', {:action => 'syllabuses'}, class: "#{current_page?(all_syllabuses_path)? 'selected' : nil }" %></li>
|
||||
<li><%= link_to '全部班级列表', {:action => 'courses'}, class: "#{current_page?(all_courses_path)? 'selected' : nil }" %></li>
|
||||
<li><%= link_to '未配置班级列表', {:action => 'non_syllabus_courses'}, class: "#{current_page?(non_syllabus_courses_path)? 'selected' : nil }" %></li>
|
||||
</ul>
|
||||
</div>
|
|
@ -5,15 +5,20 @@
|
|||
<h3>
|
||||
<%=l(:label_course_all)%>
|
||||
</h3>
|
||||
<%= render 'tab_syllabuses_courses' %>
|
||||
|
||||
<h3>
|
||||
班级列表
|
||||
</h3>
|
||||
|
||||
<%= form_tag({}, :method => :get) do %>
|
||||
<fieldset>
|
||||
<label for='name'>
|
||||
课程:
|
||||
班级:
|
||||
</label>
|
||||
<%= text_field_tag 'name', params[:name], :size => 30, :placeholder => '课程名称' %>
|
||||
<%= text_field_tag 'name', params[:name], :size => 30, :placeholder => '班级、老师名称' %>
|
||||
<%= submit_tag l(:button_apply), :class => "small", :name => nil %>
|
||||
<%= link_to l(:button_clear), {:controller => 'admin', :action => 'courses'},:remote => true, :class => 'icon icon-reload' %>
|
||||
<%= link_to l(:button_clear), {:controller => 'admin', :action => 'courses'}, :class => 'icon icon-reload' %>
|
||||
</fieldset>
|
||||
<% end %>
|
||||
|
||||
|
@ -25,46 +30,36 @@
|
|||
<th style="width: 30px;">
|
||||
序号
|
||||
</th>
|
||||
<th style="width: 120px;">
|
||||
课程
|
||||
<th style="width: 85px;">
|
||||
班级
|
||||
</th>
|
||||
<th style="width: 50px;">
|
||||
<th style="width: 35px;">
|
||||
主讲老师
|
||||
</th>
|
||||
<th style="width: 30px;">
|
||||
<th style="width: 20px;">
|
||||
学时
|
||||
</th>
|
||||
<th style="width: 20px;">
|
||||
<th style="width: 15px;">
|
||||
<%=l(:field_is_public)%>
|
||||
</th>
|
||||
<th style="width: 70px;">
|
||||
<th style="width: 45px;">
|
||||
<%=l(:field_created_on)%>
|
||||
</th>
|
||||
<th style="width: 45px;">
|
||||
动态时间
|
||||
</th>
|
||||
<th style="width:75px">
|
||||
课程
|
||||
</th>
|
||||
<th style="width:35px">
|
||||
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @courses.each do |course| %>
|
||||
<tr class="<%= cycle("odd", "even") %>">
|
||||
<td style="text-align: center;">
|
||||
<%= course.id %>
|
||||
</td>
|
||||
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="name" title='<%=course.name%>'>
|
||||
<span>
|
||||
<%= link_to(course.name, course_path(course.id)) %>
|
||||
</span>
|
||||
</td>
|
||||
<td align="center">
|
||||
<%= link_to(course.try(:teacher).try(:realname).truncate(6, omission: '...'), user_path(course.teacher)) %>
|
||||
</td>
|
||||
<td align="center">
|
||||
<%= course.class_period %>
|
||||
</td>
|
||||
<td class="center">
|
||||
<%= checked_image course.is_public? %>
|
||||
</td>
|
||||
<td class="center">
|
||||
<%= format_date(course.created_at) %>
|
||||
</td>
|
||||
<tr class="<%= cycle("odd", "even") %>" id="course_<%=course.id %>">
|
||||
<%=render :partial => 'courselist_detail_tr', :locals => {:course => course} %>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
|
@ -75,4 +70,19 @@
|
|||
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false %>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
function select_syllabus(id){
|
||||
val = $("#new_syllabus_id_"+id).children('option:selected').val();
|
||||
if(val != "0") {
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "/admin/select_course_syllabus",
|
||||
data: {syllabus_id: val,
|
||||
course_id: id},
|
||||
success: function (data) {
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<% html_title(l(:label_course_all)) -%>
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
hideModal();
|
||||
<%courses = Course.where("tea_id = #{@user.id}") %>
|
||||
<% unless courses.empty? %>
|
||||
<% courses.each do |course|%>
|
||||
$("#course_<%=course.id %>").html("<%=escape_javascript(render :partial => 'courselist_detail_tr', :locals => {:course => course}) %>");
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% if @flag == 1 %>
|
||||
$("#course_<%=@course.id %>").html("");
|
||||
<% end %>
|
|
@ -27,32 +27,35 @@
|
|||
<th style="width: 25px;">
|
||||
序号
|
||||
</th>
|
||||
<th style="width: 120px;">
|
||||
<th style="width: 105px;">
|
||||
课程名
|
||||
</th>
|
||||
<th style="width: 50px;">
|
||||
<th style="width: 35px;" class = "<%= @order == 'open' ? (@sort == 'desc' ? 'st_up' : (@sort == 'asc' ? 'st_down' : '')) : '' %>">
|
||||
<%= link_to '公开', excellent_all_courses_path(:sort=> @sort == "desc" ? 'asc' : 'desc', :order => 'open') %>
|
||||
</th>
|
||||
<th style="width: 35px;">
|
||||
主讲老师
|
||||
</th>
|
||||
<th style="width: 30px;">
|
||||
学生数
|
||||
<th style="width: 30px;" class = "<%= @order == 'std' ? (@sort == 'desc' ? 'st_up' : (@sort == 'asc' ? 'st_down' : '')) : '' %>">
|
||||
<%= link_to '学生数', excellent_all_courses_path(:sort=> @sort == "desc" ? 'asc' : 'desc', :order => 'std') %>
|
||||
</th>
|
||||
<th style="width: 25px;">
|
||||
作业数
|
||||
<th style="width: 30px;" class = "<%= @order == 'homework' ? (@sort == 'desc' ? 'st_up' : (@sort == 'asc' ? 'st_down' : '')) : '' %>">
|
||||
<%= link_to '作业数', excellent_all_courses_path(:sort=> @sort == "desc" ? 'asc' : 'desc', :order => 'homework') %>
|
||||
</th>
|
||||
<th style="width: 25px;">
|
||||
作品数
|
||||
<th style="width: 30px;" class = "<%= @order == 'works' ? (@sort == 'desc' ? 'st_up' : (@sort == 'asc' ? 'st_down' : '')) : '' %>">
|
||||
<%= link_to '作品数', excellent_all_courses_path(:sort=> @sort == "desc" ? 'asc' : 'desc', :order => 'works') %>
|
||||
</th>
|
||||
<th style="width: 25px;">
|
||||
资源数
|
||||
<th style="width: 30px;" class = "<%= @order == 'res' ? (@sort == 'desc' ? 'st_up' : (@sort == 'asc' ? 'st_down' : '')) : '' %>">
|
||||
<%= link_to '资源数', excellent_all_courses_path(:sort=> @sort == "desc" ? 'asc' : 'desc', :order => 'res') %>
|
||||
</th>
|
||||
<th style="width: 30px;">
|
||||
帖子数
|
||||
<th style="width: 30px;" class = "<%= @order == 'post' ? (@sort == 'desc' ? 'st_up' : (@sort == 'asc' ? 'st_down' : '')) : '' %>">
|
||||
<%= link_to '帖子数', excellent_all_courses_path(:sort=> @sort == "desc" ? 'asc' : 'desc', :order => 'post') %>
|
||||
</th>
|
||||
<th style="width: 30px;" class = "<%= @order == 'act' ? (@sort == 'desc' ? 'st_up' : (@sort == 'asc' ? 'st_down' : '')) : '' %>">
|
||||
<%=link_to '动态数', excellent_all_courses_path(:sort=> @sort == "desc" ? 'asc' : 'desc', :order => 'act') %>
|
||||
<th style="width: 40px;" class = "<%= @order == 'act' ? (@sort == 'desc' ? 'st_up' : (@sort == 'asc' ? 'st_down' : '')) : '' %>">
|
||||
<%= link_to '动态数', excellent_all_courses_path(:sort=> @sort == "desc" ? 'asc' : 'desc', :order => 'act') %>
|
||||
</th>
|
||||
<th style="width: 40px;" class = "<%= @order == 'time' ? (@sort == 'desc' ? 'st_up' : (@sort == 'asc' ? 'st_down' : '')) : '' %>">
|
||||
<%=link_to '开课学期', excellent_all_courses_path(:sort=> @sort == "desc" ? 'asc' : 'desc', :order => 'time') %>
|
||||
<%= link_to '开课学期', excellent_all_courses_path(:sort=> @sort == "desc" ? 'asc' : 'desc', :order => 'time') %>
|
||||
</th>
|
||||
<th style="width: 40px;">
|
||||
</tr>
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
序号
|
||||
</th>
|
||||
<th style="width: 120px;">
|
||||
课程名
|
||||
班级名
|
||||
</th>
|
||||
<th style="width: 50px;">
|
||||
主讲老师
|
||||
|
|
|
@ -0,0 +1,164 @@
|
|||
<div class="contextual">
|
||||
<%= link_to l(:label_course_new), {:controller => 'courses', :action => 'new'}, :class => 'icon icon-add' %>
|
||||
</div>
|
||||
|
||||
<h3>
|
||||
未配置班级列表
|
||||
</h3>
|
||||
<%= render 'tab_syllabuses_courses' %>
|
||||
|
||||
<h3>
|
||||
未配置班级列表
|
||||
</h3>
|
||||
|
||||
<%= form_tag({}, :method => :get) do %>
|
||||
<fieldset>
|
||||
<label for='name'>
|
||||
班级:
|
||||
</label>
|
||||
<%= text_field_tag 'name', params[:name], :size => 30, :placeholder => '班级、老师名称' %>
|
||||
<%= submit_tag l(:button_apply), :class => "small", :name => nil %>
|
||||
<%= link_to l(:button_clear), {:controller => 'admin', :action => 'non_syllabus_courses'}, :class => 'icon icon-reload' %>
|
||||
</fieldset>
|
||||
<% end %>
|
||||
|
||||
|
||||
<div class="autoscroll">
|
||||
<table class="list" style="width: 100%;table-layout: fixed">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 30px;">
|
||||
序号
|
||||
</th>
|
||||
<th style="width: 85px;">
|
||||
班级
|
||||
</th>
|
||||
<th style="width: 35px;">
|
||||
主讲老师
|
||||
</th>
|
||||
<th style="width: 20px;">
|
||||
学时
|
||||
</th>
|
||||
<th style="width: 15px;">
|
||||
<%=l(:field_is_public)%>
|
||||
</th>
|
||||
<th style="width: 45px;">
|
||||
<%=l(:field_created_on)%>
|
||||
</th>
|
||||
<th style="width: 45px;">
|
||||
动态时间
|
||||
</th>
|
||||
<th style="width:75px">
|
||||
课程
|
||||
</th>
|
||||
<th style="width:35px">
|
||||
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @courses.each do |course| %>
|
||||
<tr class="<%= cycle("odd", "even") %>" id="course_<%=course.id %>">
|
||||
<td style="text-align: center;">
|
||||
<%= course.id %>
|
||||
</td>
|
||||
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="name" title='<%=course.name%>'>
|
||||
<span>
|
||||
<a title="<%=course.name %>" id="rename_course_name_<%=course.id %>" ondblclick="rename_course_name($(this),'<%=course.name %>','<%=course.id %>');"><%= course.name%></a>
|
||||
</span>
|
||||
</td>
|
||||
<td align="center">
|
||||
<%= link_to(course.try(:teacher).try(:realname).truncate(6, omission: '...'), user_path(course.teacher)) %>
|
||||
</td>
|
||||
<td align="center">
|
||||
<%= course.class_period %>
|
||||
</td>
|
||||
<td class="center">
|
||||
<%= checked_image course.is_public? %>
|
||||
</td>
|
||||
<td class="center">
|
||||
<%= format_date(course.created_at) %>
|
||||
</td>
|
||||
<td class="center">
|
||||
<%= course.updated_at.strftime('%Y-%m-%d %H:%M:%S') %>
|
||||
</td>
|
||||
<td class="center">
|
||||
<%= select_tag :syllabus_id,options_for_select(course_syllabus_option(course.teacher),course.syllabus_id), {:id=>"new_syllabus_id_#{course.id}", :class=>"course_syllabus_input", :onchange=>"select_syllabus(#{course.id});"}%>
|
||||
</td>
|
||||
<td class="center">
|
||||
<a href="javascript:void(0)" onclick="alert_new_syllabus(<%=course.id %>, 1)">新建课程</a>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="pagination">
|
||||
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false %>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var tagNameHtml; //当前双击的链接的父节点的html
|
||||
var parentCssBorder; //当前双击的链接的父节点
|
||||
var ele; //当前双击的链接
|
||||
var tagId; //班级的id
|
||||
var tagName; //班级名称
|
||||
|
||||
function rename_course_name(domEle,name,id){
|
||||
isdb = true; //这是双击
|
||||
//clearTimeout(clickFunction);
|
||||
if (domEle.children().get(0) != undefined) { //已经是编辑框的情况下不要动
|
||||
return;
|
||||
}
|
||||
tagNameHtml = domEle.parent().html();
|
||||
parentCssBorder = domEle.parent().css("border");
|
||||
ele = domEle;
|
||||
tagId = id;
|
||||
tagName = name;
|
||||
domEle.html('<input name="" id="renameCourseName" maxlength="120" minlength="1" style="width:125px;" value="' + name + '"/>');
|
||||
domEle.parent().css("border", "1px solid #ffffff");
|
||||
$("#renameCourseName").focus();
|
||||
}
|
||||
|
||||
$(function(){
|
||||
$("#renameCourseName").live("blur",function(){
|
||||
updateCourseName();
|
||||
}).live("keypress",function(e){
|
||||
if (e.keyCode == '13') {
|
||||
updateCourseName();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
//执行修改courseName方法
|
||||
function updateCourseName(){
|
||||
if(isdb){
|
||||
isdb = false;
|
||||
if($("#renameCourseName").val() == tagName){ //如果值一样,则恢复原来的状态
|
||||
ele.parent().css("border","");
|
||||
ele.parent().html(tagNameHtml);
|
||||
}
|
||||
else{
|
||||
$.post(
|
||||
'<%= admin_update_course_name_path %>',
|
||||
{"course_id": tagId, "name": $("#renameCourseName").val().trim()}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
function select_syllabus(id){
|
||||
val = $("#new_syllabus_id_"+id).children('option:selected').val();
|
||||
if(val != "0") {
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "/admin/select_course_syllabus",
|
||||
data: {syllabus_id: val,
|
||||
course_id: id},
|
||||
success: function (data) {
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<% html_title(l(:label_course_all)) -%>
|
|
@ -0,0 +1,142 @@
|
|||
<h3>
|
||||
课程列表
|
||||
</h3>
|
||||
<%= render 'tab_syllabuses_courses' %>
|
||||
|
||||
<h3>
|
||||
课程列表
|
||||
</h3>
|
||||
|
||||
<%= form_tag({}, :method => :get) do %>
|
||||
<fieldset>
|
||||
<label for='name'>
|
||||
课程:
|
||||
</label>
|
||||
<%= text_field_tag 'name', params[:name], :size => 30, :placeholder => '课程名称' %>
|
||||
<%= submit_tag l(:button_apply), :class => "small", :name => nil %>
|
||||
<%= link_to l(:button_clear), {:controller => 'admin', :action => 'syllabuses'}, :class => 'icon icon-reload' %>
|
||||
</fieldset>
|
||||
<% end %>
|
||||
|
||||
|
||||
<div class="autoscroll">
|
||||
<table class="list" style="width: 100%;table-layout: fixed">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 30px;">
|
||||
序号
|
||||
</th>
|
||||
<th style="width: 85px;">
|
||||
课程名称
|
||||
</th>
|
||||
<th style="width: 85px;">
|
||||
班级名称
|
||||
</th>
|
||||
<th style="width: 35px;">
|
||||
创建老师
|
||||
</th>
|
||||
<th style="width: 60px;">
|
||||
<%=l(:field_created_on)%>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @syllabuses.each do |syllabus| %>
|
||||
<tr class="odd">
|
||||
<td style="text-align: center;">
|
||||
<%= syllabus.id %>
|
||||
</td>
|
||||
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="name" title='<%=syllabus.title%>'>
|
||||
<span>
|
||||
<%= link_to(syllabus.title, syllabus_path(syllabus.id)) %>
|
||||
</span>
|
||||
</td>
|
||||
<td class="center">
|
||||
</td>
|
||||
<td align="center">
|
||||
<%= link_to(syllabus.try(:user).try(:realname).truncate(6, omission: '...'), user_path(syllabus.user)) %>
|
||||
</td>
|
||||
<td class="center">
|
||||
<%= format_date(syllabus.created_at) %>
|
||||
</td>
|
||||
</tr>
|
||||
<% courses = syllabus.courses %>
|
||||
<% courses.each do |course| %>
|
||||
<tr class="even">
|
||||
<td style="text-align: center;">
|
||||
<%= course.id %>
|
||||
</td>
|
||||
<td class="center">
|
||||
</td>
|
||||
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="name" title='<%=course.name%>'>
|
||||
<span>
|
||||
<a title="<%=course.name %>" id="rename_course_name_<%=course.id %>" ondblclick="rename_course_name($(this),'<%=course.name %>','<%=course.id %>');"><%= course.name%></a>
|
||||
</span>
|
||||
</td>
|
||||
<td align="center">
|
||||
<%= link_to(course.try(:teacher).try(:realname).truncate(6, omission: '...'), user_path(course.teacher)) %>
|
||||
</td>
|
||||
<td class="center">
|
||||
<%= format_date(course.created_at) %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="pagination">
|
||||
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false %>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var tagNameHtml; //当前双击的链接的父节点的html
|
||||
var parentCssBorder; //当前双击的链接的父节点
|
||||
var ele; //当前双击的链接
|
||||
var tagId; //班级的id
|
||||
var tagName; //班级名称
|
||||
|
||||
function rename_course_name(domEle,name,id){
|
||||
isdb = true; //这是双击
|
||||
//clearTimeout(clickFunction);
|
||||
if (domEle.children().get(0) != undefined) { //已经是编辑框的情况下不要动
|
||||
return;
|
||||
}
|
||||
tagNameHtml = domEle.parent().html();
|
||||
parentCssBorder = domEle.parent().css("border");
|
||||
ele = domEle;
|
||||
tagId = id;
|
||||
tagName = name;
|
||||
domEle.html('<input name="" id="renameCourseName" maxlength="120" minlength="1" style="width:125px;" value="' + name + '"/>');
|
||||
domEle.parent().css("border", "1px solid #ffffff");
|
||||
$("#renameCourseName").focus();
|
||||
}
|
||||
|
||||
$(function(){
|
||||
$("#renameCourseName").live("blur",function(){
|
||||
updateCourseName();
|
||||
}).live("keypress",function(e){
|
||||
if (e.keyCode == '13') {
|
||||
updateCourseName();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
//执行修改TAGName方法
|
||||
function updateCourseName(){
|
||||
if(isdb){
|
||||
isdb = false;
|
||||
if($("#renameCourseName").val() == tagName){ //如果值一样,则恢复原来的状态
|
||||
ele.parent().css("border","");
|
||||
ele.parent().html(tagNameHtml);
|
||||
}
|
||||
else{
|
||||
$.post(
|
||||
'<%= admin_update_course_name_path %>',
|
||||
{"course_id": tagId, "name": $("#renameCourseName").val().trim()}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
|
@ -0,0 +1 @@
|
|||
$("#rename_course_name_<%=@course.id %>").html("<%=@course.name %>");
|
|
@ -2,31 +2,31 @@
|
|||
<% if defined?(container) && container && container.saved_attachments %>
|
||||
<% if isReply %>
|
||||
<% container.saved_attachments.each_with_index do |attachment, i| %>
|
||||
<span id="attachments_p<%= i %>" class="sub_btn">
|
||||
<p id="attachments_<%= i+1 %>" class="sub_btn">
|
||||
|
||||
<%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'upload_filename readonly', :readonly=>'readonly')%>
|
||||
<%#= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 255, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") %>
|
||||
<!--<span class="ispublic-label"><%#= l(:field_is_public)%>:</span>-->
|
||||
<%#= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public,attachment.is_public == 1 ? true : false, :class => 'is_public_checkbox')%>
|
||||
|
||||
<%= link_to(' '.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') %>
|
||||
<%= link_to(' '.html_safe, attachment_path(attachment, :attachment_id => "#{i+1}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload', :containerid => "2") %>
|
||||
<%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %>
|
||||
</span>
|
||||
</p>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<% container.attachments.each_with_index do |attachment, i| %>
|
||||
<span id="attachments_p<%= i %>" class="attachment">
|
||||
<p id="attachments_<%= i+1 %>" class="attachment">
|
||||
|
||||
<%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'upload_filename readonly', :readonly=>'readonly')%>
|
||||
<%#= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 255, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") %>
|
||||
<!--<span class="ispublic-label"><%#= l(:field_is_public)%>:</span>-->
|
||||
<%#= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public,attachment.is_public == 1 ? true : false, :class => 'is_public_checkbox')%>
|
||||
|
||||
<%= link_to(' '.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') %>
|
||||
<%= link_to(' '.html_safe, attachment_path(attachment, :attachment_id => "#{i+1}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload', :containerid => "2") %>
|
||||
<%#= render :partial => 'tags/tag', :locals => {:obj => attachment, :object_flag => "6"} %>
|
||||
|
||||
<%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %>
|
||||
</span>
|
||||
</p>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
<% if @in_user_center%>
|
||||
<% if @in_user_homepage %>
|
||||
<% homepage = BlogComment.find(@user.blog.homepage_id) %>
|
||||
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'blogs/homepage', :locals => {:activity => homepage, :user_activity_id => homepage.id}) %>");
|
||||
<% elsif @in_user_center%>
|
||||
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/user_blog', :locals => {:activity => @article,:user_activity_id =>@user_activity_id}) %>");
|
||||
// init_activity_KindEditor_data(<%#= @user_activity_id%>,"","87%", 'UserActivity');
|
||||
<% else%>
|
||||
|
|
|
@ -48,4 +48,53 @@
|
|||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% count=activity.children.count %>
|
||||
<div class="homepagePostReply">
|
||||
<%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id} %>
|
||||
|
||||
<% comments = activity.children.reorder("created_on desc").limit(3) %>
|
||||
<% if count > 0 %>
|
||||
<div class="" id="reply_div_<%= user_activity_id %>">
|
||||
<%= render :partial => 'users/all_replies', :locals => {:comments => comments}%>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% if activity.locked == false && User.current.logged?%>
|
||||
<div class="homepagePostReplyContainer borderBottomNone minHeight48">
|
||||
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= user_activity_id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(activity.author_id), :alt => "用户头像" %></div>
|
||||
<div class="homepagePostReplyInputContainer mb10">
|
||||
<% if User.current.logged? %>
|
||||
<div nhname='new_message_<%= user_activity_id%>' style="display:none;">
|
||||
<%= form_for('new_form',:url => {:controller => 'blog_comments', :action => 'reply', :user_id=>activity.author_id,:blog_id=>activity.blog_id,:id=>activity.id,:homepage=>1},:method => "post", :remote => true) do |f|%>
|
||||
<input type="hidden" name="quote[quote]" value="">
|
||||
<input type="hidden" name="in_user_center" value="true">
|
||||
<input type="hidden" name="blog_comment[sticky]" value="0">
|
||||
<input type="hidden" name="blog_comment[locked]" value="0">
|
||||
<input type="hidden" name="blog_comment[title]" value="RE:<%= activity.title%>">
|
||||
<input type="hidden" name="user_activity_id" value="<%=user_activity_id%>">
|
||||
<div nhname='toolbar_container_<%= user_activity_id%>'></div>
|
||||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="blog_comment[content]"></textarea>
|
||||
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
|
||||
<div class="cl"></div>
|
||||
<p nhname='contentmsg_<%= user_activity_id%>'></p>
|
||||
<% end%>
|
||||
</div>
|
||||
<% else %>
|
||||
<%= render :partial => "users/show_unlogged" %>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
function expand_reply_input(id) {
|
||||
$(id).toggle();
|
||||
}
|
||||
|
||||
$(function() {
|
||||
sd_create_editor_from_data(<%= user_activity_id %>, null, "100%", "<%= activity.class.to_s %>");
|
||||
});
|
||||
</script>
|
|
@ -10,12 +10,12 @@ window.location.href= "<%= Setting.protocol%>://"+"<%= Setting.host_name%>"+"/co
|
|||
<% elsif @state == 1 %>
|
||||
alert("密码错误");
|
||||
<% elsif @state == 2 %>
|
||||
alert("课程已过期\n请联系课程管理员重启课程。(在配置课程处)");
|
||||
alert("班级已过期\n请联系班级管理员重启班级。(在配置班级处)");
|
||||
<% elsif @state == 3 %>
|
||||
alert("您已经加入了课程");
|
||||
alert("您已经加入了班级");
|
||||
window.location.href= "<%= Setting.protocol%>://"+"<%= Setting.host_name%>"+"/courses/" + "<%= @course.id%>"
|
||||
<% elsif @state == 4 %>
|
||||
alert("您加入的课程不存在");
|
||||
alert("您加入的班级不存在");
|
||||
<% elsif @state == 5 %>
|
||||
alert("您还未登录");
|
||||
<% elsif @state == 6 %>
|
||||
|
@ -25,15 +25,15 @@ hidden_join_course_form();
|
|||
alert("您已经发送过申请了,请耐心等待");
|
||||
hidden_join_course_form();
|
||||
<% elsif @state == 8%>
|
||||
alert("您已经是该课程的教师了");
|
||||
alert("您已经是该班级的教师了");
|
||||
hidden_join_course_form();
|
||||
window.location.href= "<%= Setting.protocol%>://"+"<%= Setting.host_name%>"+"/courses/" + "<%= @course.id%>"
|
||||
<% elsif @state == 9%>
|
||||
alert("您已经是该课程的教辅了");
|
||||
alert("您已经是该班级的教辅了");
|
||||
hidden_join_course_form();
|
||||
window.location.href= "<%= Setting.protocol%>://"+"<%= Setting.host_name%>"+"/courses/" + "<%= @course.id%>"
|
||||
<% elsif @state == 10%>
|
||||
alert("您已经是该课程的管理员了");
|
||||
alert("您已经是该班级的管理员了");
|
||||
hidden_join_course_form();
|
||||
window.location.href= "<%= Setting.protocol%>://"+"<%= Setting.host_name%>"+"/courses/" + "<%= @course.id%>"
|
||||
<% else %>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<li class="ml45 mb10">
|
||||
<label><span class="c_red">*</span> <%= l(:label_tags_syllabus_name)%> :</label>
|
||||
<% if @syllabus.nil? %>
|
||||
<%= select_tag :syllabus_id,options_for_select(syllabus_option,@course.syllabus_id), {:id=>"new_syllabus_id", :class=>"syllabus_input"} %>
|
||||
<%= select_tag :syllabus_id,options_for_select(course_syllabus_option,@course.syllabus_id), {:id=>"new_syllabus_id", :class=>"syllabus_input"} %>
|
||||
<% else %>
|
||||
<span><%=@syllabus.title %></span>
|
||||
<input style="display: none;" name="syllabus_id" value="<%=@syllabus.id %>" />
|
||||
|
|
|
@ -9,9 +9,9 @@
|
|||
}
|
||||
<% else %>
|
||||
<% if @course.is_public? %>
|
||||
$("#show_course_<%= @course.id %>").attr("title","公开课程:<%= @course.name %>(<%= @course.time.to_s+ @course.term %>)");
|
||||
$("#show_course_<%= @course.id %>").attr("title","公开班级:<%= @course.name %>(<%= @course.time.to_s+ @course.term %>)");
|
||||
<% else %>
|
||||
$("#show_course_<%= @course.id %>").attr("title","私有课程:<%= @course.name %>(<%= @course.time.to_s+ @course.term %>)");
|
||||
$("#show_course_<%= @course.id %>").attr("title","私有班级:<%= @course.name %>(<%= @course.time.to_s+ @course.term %>)");
|
||||
<% end %>
|
||||
$("#set_course_public_<%= @course.id %>").replaceWith('<%= escape_javascript(link_to @course.is_public == 0 ? "设为公开" : "设为私有", {:controller => "courses", :action => "private_or_public", :id => @course,:user_page => true},
|
||||
:id => "set_course_public_#{@course.id.to_s}",:remote=>true,:confirm=>"您确定要设置为"+(@course.is_public == 0 ? "公开" : "私有")+"吗") %>');
|
||||
|
|
|
@ -31,14 +31,13 @@
|
|||
</li>
|
||||
<li class="ml45 mb10">
|
||||
<label><span class="c_red">*</span> <%= l(:label_tags_syllabus_name)%> :</label>
|
||||
<%= select_tag :syllabus_id,options_for_select(syllabus_option,@course.syllabus_id), {:id=>"edit_syllabus_id", :class=>"syllabus_input", :style=>'width:280px'} %>
|
||||
<%= select_tag :syllabus_id,options_for_select(course_syllabus_option,@course.syllabus_id), {:id=>"edit_syllabus_id", :class=>"syllabus_input", :style=>'width:280px'} %>
|
||||
<span class="c_red" id="edit_syllabus_notice" style="display: none;">如果列表中没有对应的课程,请您先<%=link_to '创建课程', new_syllabus_path(),:target => '_blank', :class => 'ml5 green_btn_share c_white'%></span>
|
||||
</li>
|
||||
<li class="ml45">
|
||||
<label><span class="c_red">*</span> <%= l(:label_tags_course_name)%> :</label>
|
||||
<input type="text" name="course[name]" id="edit_course_name" class="courses_input" maxlength="100" onkeyup="regex_course_name('edit');" value="<%= @course.name%>">
|
||||
<input type="text" name="course[name]" id="edit_course_name" autocomplete="off" class="courses_input" maxlength="100" onkeyup="regex_course_name('edit');" value="<%= @course.name%>">
|
||||
<span class="c_red" id="edit_course_name_notice" style="display: none;">班级名称不能为空</span>
|
||||
<input type="password" style="top: -100000px;position: fixed;">
|
||||
</li>
|
||||
<div class="cl"></div>
|
||||
<li class="ml45">
|
||||
|
|
|
@ -145,11 +145,11 @@
|
|||
alert("测验标题不能为空");
|
||||
} else if($.trim($("#exercise_end_time").val()) =="") {
|
||||
alert("截止时间不能为空");
|
||||
} else if((Date.parse($("#exercise_end_time").val())+(24*60*60-1)*1000) < Date.now()) {
|
||||
} else if((Date.parse($("#exercise_end_time").val())+(24*60*60-1)*1000) <= Date.now()) {
|
||||
alert("截止时间不能小于当前时间");
|
||||
} else if($.trim($("#exercise_time").val()) !="" && !/^[1-9][0-9]*$/.test($.trim($("#exercise_time").val()))) {
|
||||
alert("测验时长必须为非零开头的数字");
|
||||
} else if($.trim($("#exercise_publish_time").val()) !="" && Date.parse($("#exercise_publish_time").val()) < Date.now()) {
|
||||
} else if($.trim($("#exercise_publish_time").val()) !="" && ((Date.parse($("#exercise_publish_time").val())+(24*60*60-1)*1000) < Date.now())) {
|
||||
alert("发布时间不能小于当前时间");
|
||||
} else if($.trim($("#exercise_publish_time").val()) !="" && Date.parse($("#exercise_end_time").val()) < Date.parse($("#exercise_publish_time").val())) {
|
||||
alert("截止时间不能小于发布时间");
|
||||
|
|
|
@ -86,6 +86,14 @@
|
|||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<% unless User.current.logged? %>
|
||||
<div class="syllabusbox_tishi mt10">
|
||||
<p style="text-align: center;">您尚未登录,<a href='<%= signin_url_without_domain %>' class='syllabusbox_a_blue' target='_Blank' >登录</a>
|
||||
后可浏览更多信息
|
||||
</p>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="resources mt10" style="padding-bottom:5px;">
|
||||
<div class="reTop mb5">
|
||||
<%= form_tag( search_course_files_path(@course), method: 'get',:class => "re_search",:remote=>true) do %>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<!--<div class="resourcePopupClose"> <a href="javascript:void(0);" class="resourceClose"></a></div>-->
|
||||
<%= form_tag(republish_file_course_file_path(@course,@file), :multipart => true,:remote => !ie8?,:name=>"upload_form") do %>
|
||||
<div class="mb10">
|
||||
<label class="fl c_dark f14" style="margin-top: 4px;">延迟发布:</label>
|
||||
<label class="fl c_dark f14" style="margin-top: 4px;">延期发布:</label>
|
||||
<div class="calendar_div fl">
|
||||
<input type="text" name="publish_time" id="attachment_publish_time" placeholder="发布日期" class="InputBox fl W120 calendar_input" readonly="readonly" value="<%=@file.publish_time %>">
|
||||
<%#= calendar_for('attachment_publish_time')%>
|
||||
|
@ -11,7 +11,7 @@
|
|||
<span class="fl c_red" style="margin-top: 4px;" id="publish_time_notice"></span>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<!--<div class="mt15"> <span class="f14 fontGrey3 mr10">延迟发布:</span>
|
||||
<!--<div class="mt15"> <span class="f14 fontGrey3 mr10">延期发布:</span>
|
||||
<input type="text" name="" placeholder="请输入0-50数值" class="markInput" />
|
||||
</div>-->
|
||||
<div>
|
||||
|
|
|
@ -57,6 +57,14 @@
|
|||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<% unless User.current.logged? %>
|
||||
<div class="syllabusbox_tishi mt10">
|
||||
<p style="text-align: center;">您尚未登录,<a href='<%= signin_url_without_domain %>' class='syllabusbox_a_blue' target='_Blank' >登录</a>
|
||||
后可浏览更多信息
|
||||
</p>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="resources mt10" style="padding-bottom:5px;">
|
||||
<div class="reTop mb5">
|
||||
<%= form_tag( search_project_project_files_path(@project), method: 'get',:class => "re_search",:remote=>true) do %>
|
||||
|
|
|
@ -8,11 +8,11 @@
|
|||
<div class="homepagePostTitle break_word">
|
||||
<%# 如果有历史版本则提供历史版本下载 %>
|
||||
<% if file.attachment_histories.count == 0 %>
|
||||
<%= link_to truncate(file.filename,length: 35, omission: '...'),
|
||||
<%= link_to truncate(file.filename,length: 40, 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),
|
||||
<%= link_to truncate(file.filename,length: 40, 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 %>
|
||||
|
|
|
@ -35,6 +35,14 @@
|
|||
</ul>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<% unless User.current.logged? %>
|
||||
<div class="syllabusbox_tishi mt10">
|
||||
<p style="text-align: center;">您尚未登录,<a href='<%= signin_url_without_domain %>' class='syllabusbox_a_blue' target='_Blank' >登录</a>
|
||||
后可浏览更多信息
|
||||
</p>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="resources mt10" style="padding-bottom:5px;">
|
||||
<div class="reTop mb5">
|
||||
<%= form_tag( search_files_in_subfield_org_subfield_files_path(@org_subfield), method: 'get',:class => "re_search",:remote=>true) do %>
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
|
||||
<% if User.current.allowed_to?(:as_teacher,course) %>
|
||||
<div class="mb5">
|
||||
<label class="fl c_dark f14" style="margin-top: 4px;">延迟发布:</label>
|
||||
<label class="fl c_dark f14" style="margin-top: 4px;">延期发布:</label>
|
||||
<div class="calendar_div fl">
|
||||
<input type="text" name="publish_time" id="attachment_publish_time" placeholder="发布日期(可选)" class="InputBox fl W120 calendar_input" readonly="readonly">
|
||||
<%#= calendar_for('attachment_publish_time')%>
|
||||
|
|
|
@ -8,31 +8,29 @@
|
|||
<% end %>
|
||||
<%= image_tag(url_to_avatar(@course), :width => "60", :height => "60") %>
|
||||
</div>
|
||||
<div class="pr_info_id fl f14">
|
||||
<div class="pr_info_id fl f14 pr_info_name" style="margin-top: 0px;">
|
||||
<!--<span class="pr_info_name hidden">-->
|
||||
<% if @course.syllabus%>
|
||||
<a class="pr_info_name fb c_dark fl hidden" title="<%=@course.syllabus.title %>" style="max-width: 120px;" href="<%= Setting.protocol%>://<%= Setting.host_name%>/syllabuses/<%= @course.syllabus_id%>" target="_blank">
|
||||
<%=@course.syllabus.title %>
|
||||
<a class="c_dark" title="<%=@course.syllabus.title %>" href="<%= Setting.protocol%>://<%= Setting.host_name%>/syllabuses/<%= @course.syllabus_id%>" target="_blank">
|
||||
<%= @course.syllabus.title + " •" %>
|
||||
</a>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
|
||||
<span class="hidden fl" style="max-width: 80px;" title="<%= @course.name %><%=@course.is_public == 0 ? '(私有)' : '(公开)' %>"><%= @course.name %></span><span class="fl"><%=@course.is_public == 0 ? '(私有)' : '(公开)' %></span>
|
||||
</br>
|
||||
<div class="cl"></div>
|
||||
<%= @course.name %><%=@course.is_public == 0 ? '(私有)' : '(公开)' %>
|
||||
<% if is_excellent_course(@course) %>
|
||||
<img src="/images/course/medal.png" alt="精品课程" style="vertical-align:bottom;" class="ml5" />
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="pr_info_id fl f14" style="margin-top: 0px;">
|
||||
<% unless is_teacher %>
|
||||
<div id="join_in_course_header"><%= join_in_course_header(@course, User.current) %></div>
|
||||
<img src="/images/course/medal.png" alt="精品课程" style="vertical-align:bottom;" />
|
||||
<% end %>
|
||||
<!--</span>-->
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
||||
<div>
|
||||
<span class="f14">邀请码:</span>
|
||||
<span class="f14 fontBlue2"><%=@course.generate_invite_code %></span>
|
||||
<span class="f14 fl">邀请码:</span>
|
||||
<span class="f14 fontBlue2 fl"><%=@course.generate_invite_code %></span>
|
||||
<% unless is_teacher %>
|
||||
<div id="join_in_course_header" class="fl ml30"><%= join_in_course_header(@course, User.current) %></div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="cl"></div>
|
||||
<div class="pr_info_foot ">
|
||||
<%= l(:label_account_identity_teacher)%>(<%= course_teacher_link teacher_num %>)
|
||||
|
@ -46,6 +44,9 @@
|
|||
<ul>
|
||||
<li class="homepagePostSettingIcon">
|
||||
<ul class="homepagePostSettiongText boxShadow">
|
||||
<% if @course.syllabus %>
|
||||
<li><%= link_to "查看课程", syllabus_path(@course.syllabus), :class => "postOptionLink", :target => "_blank" %></li>
|
||||
<% end %>
|
||||
<li><%= link_to "班级配置", {:controller => 'courses', :action => 'settings', :id => @course}, :class => "postOptionLink" %></li>
|
||||
<li><%= link_to @course.is_public == 0 ? "设为公开" : "设为私有", {:controller => 'courses', :action => 'private_or_public', :id => @course},:remote=>true,:confirm=>"您确定要设置为"+(@course.is_public == 0 ? "公开" : "私有")+"吗", :class => "postOptionLink" %></li>
|
||||
<li><%= link_to "复制学期", copy_course_course_path(@course.id),:remote=>true, :class => "postOptionLink" %></li>
|
||||
|
|
|
@ -51,7 +51,7 @@
|
|||
<li><a href="<%= poll_path(ma.course_message.id) %>" target="_blank" title="<%=ma.course_message.user.show_name %> 发布了问卷:<%= ma.course_message.polls_name.nil? ? "未命名问卷" : ma.course_message.polls_name %>"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %> </span>发布了问卷:<%= ma.course_message.polls_name.nil? ? "未命名问卷" : ma.course_message.polls_name%></a></li>
|
||||
<% elsif ma.course_message_type == "Message" %>
|
||||
<% content = ma.course_message.parent_id.nil? ? ma.course_message.subject : ma.course_message.content.html_safe %>
|
||||
<% href = 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) %>
|
||||
<% href = board_message_path(ma.course_message.board_id, ma.course_message.parent_id ? ma.course_message.parent_id : ma.course_message.id) %>
|
||||
<li><a href="<%= href %>" target="_blank" title="<%=ma.course_message.author.show_name %> <%= ma.course_message.parent_id.nil? ? "发布了班级帖子:" : "评论了班级帖子:" %><%= content%>"><span class="shadowbox_news_user"><%=ma.course_message.author.show_name %> </span><%= ma.course_message.parent_id.nil? ? "发布了班级帖子:" : "评论了班级帖子:" %><%= content%></a></li>
|
||||
<% elsif ma.course_message_type == "StudentWorksScore" %>
|
||||
<li><a href="<%= student_work_index_path(:homework => ma.course_message.student_work.homework_common_id) %>" target="_blank" title="<%=ma.course_message.reviewer_role == 3 ? '匿名用户' : ma.course_message.user.show_name+"老师" %> <%= ma.status == 0 ? "评阅了您的作品:" : "重新评阅了您的作品:" %><%= ma.content.html_safe if !ma.content.nil?%>"><span class="shadowbox_news_user"><%=ma.course_message.reviewer_role == 3 ? '匿名用户' : ma.course_message.user.show_name+"老师" %> </span><%= ma.status == 0 ? "评阅了您的作品:" : "重新评阅了您的作品:" %><%= ma.content.html_safe if !ma.content.nil?%></a></li>
|
||||
|
@ -104,7 +104,7 @@
|
|||
<% elsif ma.forge_message_type == "Journal" %>
|
||||
<li><a href="<%=issue_path(:id => ma.forge_message.journalized_id) %>" target="_blank" title="<%=ma.forge_message.user.show_name %> 更新了问题状态:<%= ma.forge_message.journalized.subject%>"><span class="shadowbox_news_user"><%=ma.forge_message.user.show_name %> </span>更新了问题状态:<%= ma.forge_message.journalized.subject%></a></li>
|
||||
<% elsif ma.forge_message_type == "Message" %>
|
||||
<li><a href="<%=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) %>" target="_blank" title="<%=ma.forge_message.author.show_name %> <%= ma.forge_message.parent_id.nil? ? "发布了项目帖子:" : "评论了项目帖子:" %><%= ma.forge_message.subject%>"><span class="shadowbox_news_user"><%=ma.forge_message.author.show_name %> </span><%= ma.forge_message.parent_id.nil? ? "发布了项目帖子:" : "评论了项目帖子:" %><%= ma.forge_message.subject%></a></li>
|
||||
<li><a href="<%=board_message_path(ma.forge_message.board_id, ma.forge_message.parent_id ? ma.forge_message.parent_id : ma.forge_message.id) %>" target="_blank" title="<%=ma.forge_message.author.show_name %> <%= ma.forge_message.parent_id.nil? ? "发布了项目帖子:" : "评论了项目帖子:" %><%= ma.forge_message.subject%>"><span class="shadowbox_news_user"><%=ma.forge_message.author.show_name %> </span><%= ma.forge_message.parent_id.nil? ? "发布了项目帖子:" : "评论了项目帖子:" %><%= ma.forge_message.subject%></a></li>
|
||||
<% elsif ma.forge_message_type == "News" %>
|
||||
<li><a href="<%=news_path(ma.forge_message.id) %>" target="_blank" title="<%=ma.forge_message.author.show_name %> 发布了新闻:<%= ma.forge_message.title.html_safe%>"><span class="shadowbox_news_user"><%=ma.forge_message.author.show_name %> </span>发布了新闻:<%= ma.forge_message.title.html_safe%></a></li>
|
||||
<% elsif ma.forge_message_type == "Comment" %>
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
<ul class="syllabus_leftinfo" id="all_syllabus_attr">
|
||||
<li class="fl"><label >创建教师:</label><span><%=syllabus.user.show_name %></span></li>
|
||||
<% if User.current.logged? && (User.current == syllabus.user || User.current.admin?) %>
|
||||
<%= link_to image_tag("../images/signature_edit.png",width:"12px", height: "12px"), "javascript:void(0);", :class => 'fr', :onclick => "show_edit_base_info();"%>
|
||||
<%= link_to image_tag("../images/signature_edit.png",width:"12px", height: "12px"), "javascript:void(0);", :id => 'syllabus_attr_edit', :class => 'undis fr', :onclick => "show_edit_base_info();"%>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
<li><label >创建教师:</label><span><%=syllabus.user.show_name %></span></li>
|
||||
<% unless syllabus.syllabus_type.nil? || syllabus.syllabus_type == 0 %>
|
||||
<% unless syllabus.syllabus_type.nil? || syllabus.syllabus_type == 0 || syllabus.syllabus_type == '' %>
|
||||
<li><label>课程性质:</label><%=syllabus.syllabus_type_str %></li>
|
||||
<% end %>
|
||||
<% unless syllabus.credit.nil? || syllabus.credit == '' %>
|
||||
|
@ -26,7 +26,7 @@
|
|||
<li><label>先修课程:</label><%=syllabus.pre_course %></li>
|
||||
<% end %>
|
||||
|
||||
<% if syllabus.syllabus_type.nil? || syllabus.syllabus_type == '' %>
|
||||
<% if syllabus.syllabus_type.nil? || syllabus.syllabus_type == 0 || syllabus.syllabus_type == '' %>
|
||||
<li class="none none_attr"><label>课程性质:</label><span class="fontGrey3">空</span></li>
|
||||
<% end %>
|
||||
<% if syllabus.credit.nil? || syllabus.credit == '' %>
|
||||
|
@ -48,7 +48,7 @@
|
|||
<li class="none none_attr"><label>先修课程:</label><span class="fontGrey3">空</span></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<% if User.current.logged? && (User.current == syllabus.user || User.current.admin?)&&(syllabus.syllabus_type.nil? || syllabus.syllabus_type == ''||syllabus.credit.nil? || syllabus.credit == ''||syllabus.hours.nil? || syllabus.hours == ''||syllabus.theory_hours.nil? || syllabus.theory_hours == ''||syllabus.practice_hours.nil? || syllabus.practice_hours == ''||syllabus.applicable_major.nil? || syllabus.applicable_major == ''||syllabus.pre_course.nil? || syllabus.pre_course == '')%>
|
||||
<% if User.current.logged? && (User.current == syllabus.user || User.current.admin?)&&(syllabus.syllabus_type.nil? || syllabus.syllabus_type == 0 || syllabus.syllabus_type == ''||syllabus.credit.nil? || syllabus.credit == ''||syllabus.hours.nil? || syllabus.hours == ''||syllabus.theory_hours.nil? || syllabus.theory_hours == ''||syllabus.practice_hours.nil? || syllabus.practice_hours == ''||syllabus.applicable_major.nil? || syllabus.applicable_major == ''||syllabus.pre_course.nil? || syllabus.pre_course == '')%>
|
||||
<span class="homepageLeftMenuMore"><a href="javascript:void(0);" data-init="0" onclick="toggle_all_syllabus_attr();" class="homepageLeftMenuMoreIcon" id="show_all_syllabus_attr"></a></span>
|
||||
<% end %>
|
||||
<script>
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
<ul class="syllabus_leftinfo" id="all_syllabus_attr">
|
||||
<%= form_for('syllabus',:url => update_base_info_syllabus_path(syllabus.id),:remote => true) do |f|%>
|
||||
<li class="fl"><label >创建教师:</label><span><%=syllabus.user.show_name %></span></li>
|
||||
<a href="javascript:void(0);" onclick="update_syllabus_info();" id="submit_edit_info" class="fr">保存</a>
|
||||
<!--<a href="javascript:void(0);" onclick="reset_syllabus_info();" id="submit_reset_info" class="fr mr10">取消</a>-->
|
||||
<div class="cl"></div>
|
||||
<li><label >创建教师:</label><span><%=syllabus.user.show_name %></span></li>
|
||||
<li><label>课程性质:</label>
|
||||
<%= select_tag :syllabus_type,options_for_select(syllabus_type,syllabus.syllabus_type), {:id=>"syllabus_type_input", :class=>"syllabus_select"} %>
|
||||
<div class="cl"></div>
|
||||
|
|
|
@ -4,5 +4,5 @@
|
|||
<span class="fontGrey">课程英文名称</span>
|
||||
<% end %>
|
||||
<% if User.current == syllabus.user %>
|
||||
<%= link_to image_tag("../images/signature_edit.png",width:"12px", height: "12px"), "javascript:void(0);", :onclick => "show_edit_eng_name();"%>
|
||||
<%= link_to image_tag("../images/signature_edit.png",width:"12px", height: "12px"), "javascript:void(0);",:id => "syllabus_edit_ng_name_png", :class => "none", :onclick => "show_edit_eng_name();"%>
|
||||
<% end %>
|
|
@ -1,22 +1,25 @@
|
|||
<% teachers_num = teacher_count @syllabus%>
|
||||
<% students_num = student_count @syllabus%>
|
||||
<% files_num = file_count @syllabus%>
|
||||
<div class="pr_info_logo fl mb5">
|
||||
<%# teachers_num = teacher_count @syllabus%>
|
||||
<%# students_num = student_count @syllabus%>
|
||||
<%# files_num = file_count @syllabus%>
|
||||
<div class="pr_info_logo fl mb5 mr10">
|
||||
<%= image_tag("../images/syllabus.jpg",width:"60px", height: "60px") %>
|
||||
</div>
|
||||
<div class="fl ml15">
|
||||
<p class="homepageSyllabusName mb5" title="<%=@syllabus.title %>"><%=@syllabus.title %></p>
|
||||
<div class="cl"></div>
|
||||
<div class="fl">
|
||||
<div id="syllabus_title_show" class="homepageSyllabusName mb5">
|
||||
<%= render :partial => 'layouts/syllabus_title', :locals => {:syllabus => @syllabus}%>
|
||||
</div>
|
||||
<textarea class="syllabusTitleTextarea none" placeholder="请编辑课程名称" id="syllabus_title_edit" onblur="edit_syllabus_title('<%= edit_syllabus_title_syllabus_path(@syllabus.id)%>');"><%= @syllabus.title %></textarea>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<div>
|
||||
<div class="mb5" id="syllabus_eng_name_show">
|
||||
<div class="mb5" id="syllabus_eng_name_show" style="word-break:normal;word-wrap:normal;">
|
||||
<%= render :partial => 'layouts/syllabus_eng_name', :locals => {:syllabus => @syllabus}%>
|
||||
</div>
|
||||
<textarea class="homepageSignatureTextarea none" placeholder="请编辑英文名称" id="syllabus_eng_name_edit" onblur="edit_syllabus_eng_name('<%= edit_syllabus_eng_name_syllabus_path(@syllabus.id)%>');"><%= @syllabus.eng_name %></textarea>
|
||||
</div>
|
||||
<!--
|
||||
<div class="pr_info_foot ">
|
||||
教师(<a class="info_foot_num c_blue" href="javascript:void(0);" target="_blank" style="cursor: default" title="课程下全部班级的教师数"><%=teachers_num %></a>)<span>|</span>
|
||||
学生(<a class="info_foot_num c_blue" href="javascript:void(0);" target="_blank" style="cursor: default" title="课程下全部班级的学生数"><%=students_num %></a>)<span>|</span>
|
||||
资源(<a class="info_foot_num c_blue" href="javascript:void(0);" target="_blank" style="cursor: default" title="课程下全部班级的资源数"><%=files_num %></a>)</div>
|
||||
<div class="cl"></div>
|
||||
教师(<a class="info_foot_num c_blue" href="javascript:void(0);" target="_blank" style="cursor: default" title="课程下全部班级的教师数"><%#=teachers_num %></a>)<span>|</span>
|
||||
学生(<a class="info_foot_num c_blue" href="javascript:void(0);" target="_blank" style="cursor: default" title="课程下全部班级的学生数"><%#=students_num %></a>)<span>|</span>
|
||||
资源(<a class="info_foot_num c_blue" href="javascript:void(0);" target="_blank" style="cursor: default" title="课程下全部班级的资源数"><%#=files_num %></a>)</div>
|
||||
<div class="cl"></div>-->
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
<span style="word-break: normal; word-wrap: break-word;"><%=@syllabus.title %></span>
|
||||
|
||||
<% if User.current == syllabus.user %>
|
||||
<%= link_to image_tag("../images/signature_edit.png",width:"12px", height: "12px"), "javascript:void(0);",:id => "syllabus_edit_title_png", :class => "none", :onclick => "show_edit_title();"%>
|
||||
<% end %>
|
|
@ -19,6 +19,10 @@
|
|||
<%= call_hook :view_layouts_base_html_head %>
|
||||
<!-- page specific tags -->
|
||||
<%= yield :header_tags -%>
|
||||
<!-- MathJax的配置 -->
|
||||
<script type="text/javascript"
|
||||
src="/javascripts/MathJax/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
|
||||
</script>
|
||||
</head>
|
||||
<body class="<%= h body_css_classes %>">
|
||||
<div id="wrapper">
|
||||
|
|
|
@ -42,12 +42,12 @@
|
|||
<div class="homepageContentContainer">
|
||||
<div class="homepageContent">
|
||||
<div class="homepageLeft">
|
||||
<div class="homepagePortraitContainer mt15">
|
||||
<div class="homepagePortraitContainer mt15" onmouseover="$('#syllabus_edit_title_png').show();$('#syllabus_edit_ng_name_png').show();" onmouseout="$('#syllabus_edit_title_png').hide();$('#syllabus_edit_ng_name_png').hide();">
|
||||
<%=render :partial => 'layouts/syllabus_info' %>
|
||||
</div>
|
||||
<% update_visiti_count @syllabus %>
|
||||
|
||||
<div class="homepageLeftMenuContainer" id="syllabus_base_info">
|
||||
<div class="homepageLeftMenuContainer" id="syllabus_base_info" onmouseover="$('#syllabus_attr_edit').show();" onmouseout="$('#syllabus_attr_edit').hide();">
|
||||
<%= render :partial => 'layouts/syllabus_base_info', :locals => {:syllabus => @syllabus} %>
|
||||
</div>
|
||||
|
||||
|
@ -55,7 +55,7 @@
|
|||
<div class="homepageLeftMenuBlock">
|
||||
<%=link_to '班级', {:controller => "syllabuses", :action => "syllabus_courselist", :id => @syllabus.id}, :class => 'homepageMenuText' %>
|
||||
<% if is_current_user%>
|
||||
<% if User.current.user_extensions && User.current.user_extensions.identity == 0 && User.current.allowed_to?(:add_course, nil, :global => true)%>
|
||||
<% if User.current == @syllabus.user && User.current.user_extensions && User.current.user_extensions.identity == 0 && User.current.allowed_to?(:add_course, nil, :global => true)%>
|
||||
<div class="courseMenu" id="courseMenu">
|
||||
<ul>
|
||||
<li class="courseMenuIcon fr" style="margin-right:10px;" id="courseMenuIcon">
|
||||
|
|
|
@ -95,9 +95,10 @@
|
|||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<% unless @replies.empty? %>
|
||||
<% all_comments = []%>
|
||||
<% comments = get_all_children(all_comments, @topic) %>
|
||||
<div class="" id="reply_div_<%= @topic.id %>">
|
||||
<% @replies.each_with_index do |reply,i| %>
|
||||
<% comments.each_with_index do |reply,i| %>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
showNormalImage('reply_message_description_<%= reply.id %>');
|
||||
|
@ -110,32 +111,41 @@
|
|||
</div>
|
||||
<div class="homepagePostReplyDes">
|
||||
<div class="homepagePostReplyPublisher">
|
||||
<%= link_to reply.author.show_name, user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %>
|
||||
<%= link_to reply.creator_user.show_name, user_url_in_org(reply.creator_user.id), :class => "newsBlue mr10 f14" %>
|
||||
<%= time_from_now(reply.created_on) %>
|
||||
</div>
|
||||
<% if !reply.parent.nil? && !reply.parent.parent.nil? %>
|
||||
<%= render :partial => 'users/message_contents', :locals => {:comment => reply}%>
|
||||
<% end %>
|
||||
<div class="homepagePostReplyContent upload_img break_word table_maxWidth" id="reply_message_description_<%= reply.id %>">
|
||||
<%= reply.content.html_safe%>
|
||||
</div>
|
||||
<div style="margin-top: -7px; margin-bottom: 5px">
|
||||
<%= format_time(reply.created_on) %>
|
||||
<div class="fr" id="reply_edit_menu_<%= reply.id%>" style="display: none">
|
||||
<span id="reply_praise_count_<%=reply.id %>">
|
||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
|
||||
</span>
|
||||
<div class="orig_reply mb10 mt-10">
|
||||
<div class="reply">
|
||||
<span class="reply-right">
|
||||
<span id="reply_praise_count_<%= reply.id %>">
|
||||
<%= render :partial => "praise_tread/praise", :locals => {:activity => reply, :user_activity_id => reply.id, :type => "reply"} %>
|
||||
</span>
|
||||
<span style="position: relative" class="fr mr20">
|
||||
<%= link_to(
|
||||
l(:button_reply),
|
||||
{:action => 'quote', :id => reply},
|
||||
:remote => true,
|
||||
:method => 'get',
|
||||
:class => 'fr newsBlue mr10',
|
||||
:title => l(:button_reply)) if !@topic.locked? && authorize_for('messages', 'reply') %>
|
||||
<span id="reply_iconup_<%= reply.id %>" class="reply_iconup02" style="display: none"> ︿</span>
|
||||
</span>
|
||||
<%= link_to(
|
||||
l(:button_delete),
|
||||
{:action => 'destroy', :id => reply},
|
||||
:method => :post,
|
||||
:class => 'fr newsGrey mr10',
|
||||
:class => 'fr mr20',
|
||||
:data => {:confirm => l(:text_are_you_sure)},
|
||||
:title => l(:button_delete)
|
||||
) if reply.course_destroyable_by?(User.current) %>
|
||||
</span>
|
||||
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
<p id="reply_message_<%= reply.id%>"></p>
|
||||
|
@ -145,7 +155,6 @@
|
|||
<% end %>
|
||||
</div>
|
||||
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
<% if !@topic.locked? && authorize_for_course('messages', 'reply') %>
|
||||
<div class="talkWrapMsg" nhname="about_talk_reply">
|
||||
|
|
|
@ -156,61 +156,65 @@
|
|||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<% unless @replies.empty? %>
|
||||
<div class="" id="reply_div_<%= @topic.id %>">
|
||||
<% @replies.each_with_index do |reply,i| %>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
showNormalImage('reply_message_description_<%= reply.id %>');
|
||||
autoUrl('reply_message_description_<%= reply.id %>');
|
||||
});
|
||||
</script>
|
||||
<div class="homepagePostReplyContainer" onmouseover="$('#reply_edit_menu_<%= reply.id%>').show();" onmouseout="$('#reply_edit_menu_<%= reply.id%>').hide();">
|
||||
<div class="homepagePostReplyPortrait">
|
||||
<%= link_to image_tag(url_to_avatar(reply.author), :width => 33,:height => 33), user_path(reply.author) %>
|
||||
</div>
|
||||
<div class="homepagePostReplyDes">
|
||||
<div class="homepagePostReplyPublisher">
|
||||
<% if reply.try(:author).try(:realname) == ' ' %>
|
||||
<%= link_to reply.try(:author), user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %>
|
||||
<% else %>
|
||||
<%= link_to reply.try(:author).try(:realname), user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="homepagePostReplyContent upload_img break_word table_maxWidth" id="reply_message_description_<%= reply.id %>">
|
||||
<%= reply.content.html_safe%>
|
||||
</div>
|
||||
<div style="margin-top: -7px; margin-bottom: 5px">
|
||||
<%= format_time(reply.created_on) %>
|
||||
<div class="fr" id="reply_edit_menu_<%= reply.id%>" style="display: none">
|
||||
<span id="reply_praise_count_<%=reply.id %>">
|
||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
|
||||
</span>
|
||||
<%= link_to(
|
||||
l(:button_reply),
|
||||
{:action => 'quote', :id => reply},
|
||||
:remote => true,
|
||||
:method => 'get',
|
||||
:class => 'fr newsBlue mr10',
|
||||
:title => l(:button_reply)) if !@topic.locked? && authorize_for('messages', 'reply') %>
|
||||
<%= link_to(
|
||||
l(:button_delete),
|
||||
{:action => 'destroy', :id => reply},
|
||||
:method => :post,
|
||||
:class => 'fr newsGrey mr10',
|
||||
:data => {:confirm => l(:text_are_you_sure)},
|
||||
:title => l(:button_delete)
|
||||
) if reply.destroyable_by?(User.current) %>
|
||||
</div>
|
||||
</div>
|
||||
<p id="reply_message_<%= reply.id%>"></p>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<% all_comments = []%>
|
||||
<% comments = get_all_children(all_comments, @topic) %>
|
||||
<div class="" id="reply_div_<%= @topic.id %>">
|
||||
<% comments.each_with_index do |reply,i| %>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
showNormalImage('reply_message_description_<%= reply.id %>');
|
||||
autoUrl('reply_message_description_<%= reply.id %>');
|
||||
});
|
||||
</script>
|
||||
<div class="homepagePostReplyContainer" onmouseover="$('#reply_edit_menu_<%= reply.id%>').show();" onmouseout="$('#reply_edit_menu_<%= reply.id%>').hide();">
|
||||
<div class="homepagePostReplyPortrait">
|
||||
<%= link_to image_tag(url_to_avatar(reply.author), :width => 33,:height => 33), user_path(reply.author) %>
|
||||
</div>
|
||||
<div class="homepagePostReplyDes">
|
||||
<div class="homepagePostReplyPublisher">
|
||||
<%= link_to reply.creator_user.show_name, user_url_in_org(reply.creator_user.id), :class => "newsBlue mr10 f14" %>
|
||||
<%= time_from_now(reply.created_on) %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<% if !reply.parent.nil? && !reply.parent.parent.nil? %>
|
||||
<%= render :partial => 'users/message_contents', :locals => {:comment => reply}%>
|
||||
<% end %>
|
||||
<div class="homepagePostReplyContent upload_img break_word table_maxWidth" id="reply_message_description_<%= reply.id %>">
|
||||
<%= reply.content.html_safe%>
|
||||
</div>
|
||||
<div class="orig_reply mb10 mt-10">
|
||||
<div class="reply">
|
||||
<span class="reply-right">
|
||||
<span id="reply_praise_count_<%= reply.id %>">
|
||||
<%= render :partial => "praise_tread/praise", :locals => {:activity => reply, :user_activity_id => reply.id, :type => "reply"} %>
|
||||
</span>
|
||||
<span style="position: relative" class="fr mr20">
|
||||
<%= link_to(
|
||||
l(:button_reply),
|
||||
{:action => 'quote', :id => reply},
|
||||
:remote => true,
|
||||
:method => 'get',
|
||||
:title => l(:button_reply)) if !@topic.locked? && authorize_for('messages', 'reply') %>
|
||||
<span id="reply_iconup_<%= reply.id %>" class="reply_iconup02" style="display: none"> ︿</span>
|
||||
</span>
|
||||
<%= link_to(
|
||||
l(:button_delete),
|
||||
{:action => 'destroy', :id => reply},
|
||||
:method => :post,
|
||||
:class => 'fr mr20',
|
||||
:data => {:confirm => l(:text_are_you_sure)},
|
||||
:title => l(:button_delete)
|
||||
) if reply.course_destroyable_by?(User.current) %>
|
||||
</span>
|
||||
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
<p id="reply_message_<%= reply.id%>"></p>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<% if !@topic.locked? && authorize_for('messages', 'reply') %>
|
||||
<div class="talkWrapMsg" nhname="about_talk_reply">
|
||||
|
|
|
@ -4,11 +4,12 @@
|
|||
<div class="ReplyToMessageInputContainer mb10">
|
||||
<% if User.current.logged? %>
|
||||
<div nhname='new_message_<%= reply.id%>'>
|
||||
<%= form_for @reply, :as => :reply, :url => {:action => 'reply', :id => @topic}, :html => {:multipart => true, :id => 'new_form'} do |f| %>
|
||||
<input type="hidden" name="quote[quote]" id="quote_quote">
|
||||
<input type="hidden" name="reply[subject]" id="reply_subject">
|
||||
<%= form_for @reply, :as => :reply, :url => {:action => 'reply', :id => @topic}, :method => "post", :id => 'new_form' do |f| %>
|
||||
<%= hidden_field_tag 'parent_id', params[:parent_id], :value => reply.id %>
|
||||
<%= hidden_field_tag 'reply_id', params[:reply_id], :value => reply.author.id %>
|
||||
<%= hidden_field_tag 'activity_id',params[:activity_id],:value =>@topic.id %>
|
||||
<div nhname='toolbar_container_<%= reply.id%>'></div>
|
||||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= reply.id%>' name="reply[content]"></textarea>
|
||||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= reply.id%>' name="content"></textarea>
|
||||
<a id="new_message_submit_btn_<%= reply.id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
|
||||
<div class="cl"></div>
|
||||
<p nhname='contentmsg_<%= reply.id%>'></p>
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
<%if @project%>
|
||||
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/project_message', :locals => {:activity => @topic,:user_activity_id =>@user_activity_id,:is_course=>@is_course,:is_board=>@is_board}) %>");
|
||||
<%elsif @course%>
|
||||
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_message', :locals => {:activity => @topic,:user_activity_id =>@user_activity_id,:is_course=>@is_course,:is_board=>@is_board}) %>");
|
||||
<% elsif @org_subfield %>
|
||||
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'organizations/org_subfield_message', :locals => {:activity => @topic,:user_activity_id =>@user_activity_id}) %>");
|
||||
<%end%>
|
||||
sd_create_editor_from_data(<%= @user_activity_id %>,"","100%", "UserActivity");
|
|
@ -1,16 +1,8 @@
|
|||
/*$('#message_subject').val("<%#= raw escape_javascript(@subject) %>");
|
||||
$('#message_quote').html("<%#= raw escape_javascript(@temp.content.html_safe) %>");
|
||||
//$('#message_content').val("<#%= raw escape_javascript(@content) %>");
|
||||
$('#quote_quote').html("<%#= raw escape_javascript(@temp.content.html_safe) %>");
|
||||
|
||||
showAndScrollTo("reply", "message_content");
|
||||
$('#message_content').scrollTop = $('#message_content').scrollHeight - $('#message_content').clientHeight;
|
||||
$("img").removeAttr("align");*/
|
||||
if($("#reply_message_<%= @message.id%>").length > 0) {
|
||||
$("#reply_message_<%= @message.id%>").replaceWith("<%= escape_javascript(render :partial => 'reply_message', :locals => {:reply => @message,:temp =>@temp,:subject =>@subject}) %>");
|
||||
$("#reply_message_<%= @message.id%>").replaceWith("<%= escape_javascript(render :partial => 'reply_message', :locals => {:reply => @message}) %>");
|
||||
$(function(){
|
||||
$('#reply_subject').val("<%= raw escape_javascript(@subject) %>");
|
||||
$('#quote_quote').val("<%= raw escape_javascript(@temp.content.html_safe) %>");
|
||||
/*$('#reply_subject').val("<%#= raw escape_javascript(@subject) %>");
|
||||
$('#quote_quote').val("<%#= raw escape_javascript(@temp.content.html_safe) %>");*/
|
||||
sd_create_editor_from_data(<%= @message.id%>,null,"100%", "<%=@message.class.to_s%>");
|
||||
});
|
||||
}else if($("#reply_to_message_<%= @message.id%>").length >0) {
|
||||
|
|
|
@ -120,193 +120,6 @@
|
|||
});
|
||||
}
|
||||
|
||||
function showcity(province, cityField) {
|
||||
$("#provincenotice").hide();
|
||||
switch (province) {
|
||||
case "北京" :
|
||||
var cityOptions = new Array(
|
||||
"东城", "西城", "朝阳", "丰台", "石景山", "海淀", "门头沟",
|
||||
"房山", "通州", "顺义", "昌平", "大兴", "平谷", "怀柔", "密云", "延庆");
|
||||
break;
|
||||
case "上海" :
|
||||
var cityOptions = new Array(
|
||||
"崇明", "黄浦", "卢湾", "徐汇", "长宁", "静安", "普陀", "闸北", "虹口", "杨浦", "闵行",
|
||||
"宝山", "嘉定", "浦东", "金山", "松江", "青浦", "南汇", "奉贤");
|
||||
break;
|
||||
case "广东" :
|
||||
var cityOptions = new Array(
|
||||
"广州", "深圳", "珠海", "东莞", "中山", "佛山", "惠州", "河源", "潮州", "江门", "揭阳", "茂名",
|
||||
"梅州", "清远", "汕头", "汕尾", "韶关", "顺德", "阳江", "云浮", "湛江", "肇庆");
|
||||
break;
|
||||
case "江苏" :
|
||||
var cityOptions = new Array(
|
||||
"南京", "常熟", "常州", "海门", "淮安", "江都", "江阴", "昆山", "连云港", "南通",
|
||||
"启东", "沭阳", "宿迁", "苏州", "太仓", "泰州", "同里", "无锡", "徐州", "盐城",
|
||||
"扬州", "宜兴", "仪征", "张家港", "镇江", "周庄");
|
||||
break;
|
||||
case "重庆" :
|
||||
var cityOptions = new Array(
|
||||
"万州", "涪陵", "渝中", "大渡口", "江北", "沙坪坝", "九龙坡", "南岸", "北碚", "万盛",
|
||||
"双挢", "渝北", "巴南", "黔江", "长寿", "綦江", "潼南", "铜梁", "大足", "荣昌", "壁山",
|
||||
"梁平", "城口", "丰都", "垫江", "武隆", "忠县", "开县", "云阳", "奉节", "巫山", "巫溪",
|
||||
"石柱", "秀山", "酉阳", "彭水", "江津", "合川", "永川", "南川");
|
||||
break;
|
||||
case "安徽" :
|
||||
var cityOptions = new Array(
|
||||
"合肥", "安庆", "蚌埠", "亳州", "巢湖", "滁州", "阜阳", "贵池", "淮北", "淮化", "淮南",
|
||||
"黄山", "九华山", "六安", "马鞍山", "宿州", "铜陵", "屯溪", "芜湖", "宣城");
|
||||
break;
|
||||
case "福建" :
|
||||
var cityOptions = new Array(
|
||||
"福州", "厦门", "泉州", "漳州", "龙岩", "南平", "宁德", "莆田", "三明");
|
||||
break;
|
||||
case "甘肃" :
|
||||
var cityOptions = new Array(
|
||||
"兰州", "白银", "定西", "敦煌", "甘南", "金昌", "酒泉", "临夏", "平凉", "天水",
|
||||
"武都", "武威", "西峰", "张掖");
|
||||
break;
|
||||
case "广西" :
|
||||
var cityOptions = new Array(
|
||||
"南宁", "百色", "北海", "桂林", "防城港", "贵港", "河池", "贺州", "柳州", "钦州", "梧州", "玉林");
|
||||
break;
|
||||
case "贵州" :
|
||||
var cityOptions = new Array(
|
||||
"贵阳", "安顺", "毕节", "都匀", "凯里", "六盘水", "铜仁", "兴义", "玉屏", "遵义");
|
||||
break;
|
||||
case "海南" :
|
||||
var cityOptions = new Array(
|
||||
"海口", "儋县", "陵水", "琼海", "三亚", "通什", "万宁");
|
||||
break;
|
||||
case "河北" :
|
||||
var cityOptions = new Array(
|
||||
"石家庄", "保定", "北戴河", "沧州", "承德", "丰润", "邯郸", "衡水", "廊坊", "南戴河", "秦皇岛",
|
||||
"唐山", "新城", "邢台", "张家口");
|
||||
break;
|
||||
case "黑龙江" :
|
||||
var cityOptions = new Array(
|
||||
"哈尔滨", "北安", "大庆", "大兴安岭", "鹤岗", "黑河", "佳木斯", "鸡西", "牡丹江", "齐齐哈尔",
|
||||
"七台河", "双鸭山", "绥化", "伊春");
|
||||
break;
|
||||
case "河南" :
|
||||
var cityOptions = new Array(
|
||||
"郑州", "安阳", "鹤壁", "潢川", "焦作", "济源", "开封", "漯河", "洛阳", "南阳", "平顶山",
|
||||
"濮阳", "三门峡", "商丘", "新乡", "信阳", "许昌", "周口", "驻马店");
|
||||
break;
|
||||
case "香港" :
|
||||
var cityOptions = new Array(
|
||||
"香港", "九龙", "新界");
|
||||
break;
|
||||
case "湖北" :
|
||||
var cityOptions = new Array(
|
||||
"武汉", "恩施", "鄂州", "黄冈", "黄石", "荆门", "荆州", "潜江", "十堰", "随州", "武穴",
|
||||
"仙桃", "咸宁", "襄阳", "襄樊", "孝感", "宜昌");
|
||||
break;
|
||||
case "湖南" :
|
||||
var cityOptions = new Array(
|
||||
"长沙", "常德", "郴州", "衡阳", "怀化", "吉首", "娄底", "邵阳", "湘潭", "益阳", "岳阳",
|
||||
"永州", "张家界", "株洲");
|
||||
break;
|
||||
case "江西" :
|
||||
var cityOptions = new Array(
|
||||
"南昌", "抚州", "赣州", "吉安", "景德镇", "井冈山", "九江", "庐山", "萍乡",
|
||||
"上饶", "新余", "宜春", "鹰潭");
|
||||
break;
|
||||
case "吉林" :
|
||||
var cityOptions = new Array(
|
||||
"长春", "吉林", "白城", "白山", "珲春", "辽源", "梅河", "四平", "松原", "通化", "延吉");
|
||||
break;
|
||||
case "辽宁" :
|
||||
var cityOptions = new Array(
|
||||
"沈阳", "鞍山", "本溪", "朝阳", "大连", "丹东", "抚顺", "阜新", "葫芦岛", "锦州",
|
||||
"辽阳", "盘锦", "铁岭", "营口");
|
||||
break;
|
||||
case "澳门" :
|
||||
var cityOptions = new Array("澳门");
|
||||
break;
|
||||
case "内蒙古" :
|
||||
var cityOptions = new Array(
|
||||
"呼和浩特", "阿拉善盟", "包头", "赤峰", "东胜", "海拉尔", "集宁", "临河", "通辽", "乌海",
|
||||
"乌兰浩特", "锡林浩特");
|
||||
break;
|
||||
case "宁夏" :
|
||||
var cityOptions = new Array(
|
||||
"银川", "固源", "石嘴山", "吴忠");
|
||||
break;
|
||||
case "青海" :
|
||||
var cityOptions = new Array(
|
||||
"西宁", "德令哈", "格尔木", "共和", "海东", "海晏", "玛沁", "同仁", "玉树");
|
||||
break;
|
||||
case "山东" :
|
||||
var cityOptions = new Array(
|
||||
"济南", "滨州", "兖州", "德州", "东营", "菏泽", "济宁", "莱芜", "聊城", "临沂",
|
||||
"蓬莱", "青岛", "曲阜", "日照", "泰安", "潍坊", "威海", "烟台", "枣庄", "淄博");
|
||||
break;
|
||||
case "山西" :
|
||||
var cityOptions = new Array(
|
||||
"太原", "长治", "大同", "候马", "晋城", "离石", "临汾", "宁武", "朔州", "忻州",
|
||||
"阳泉", "榆次", "运城");
|
||||
break;
|
||||
case "陕西" :
|
||||
var cityOptions = new Array(
|
||||
"西安", "安康", "宝鸡", "汉中", "渭南", "商州", "绥德", "铜川", "咸阳", "延安", "榆林");
|
||||
break;
|
||||
case "四川" :
|
||||
var cityOptions = new Array(
|
||||
"成都", "巴中", "达川", "德阳", "都江堰", "峨眉山", "涪陵", "广安", "广元", "九寨沟",
|
||||
"康定", "乐山", "泸州", "马尔康", "绵阳", "眉山", "南充", "内江", "攀枝花", "遂宁",
|
||||
"汶川", "西昌", "雅安", "宜宾", "自贡", "资阳");
|
||||
break;
|
||||
case "台湾" :
|
||||
var cityOptions = new Array(
|
||||
"台北", "基隆", "台南", "台中", "高雄", "屏东", "南投", "云林", "新竹", "彰化", "苗栗",
|
||||
"嘉义", "花莲", "桃园", "宜兰", "台东", "金门", "马祖", "澎湖");
|
||||
break;
|
||||
case "天津" :
|
||||
var cityOptions = new Array(
|
||||
"天津", "和平", "东丽", "河东", "西青", "河西", "津南", "南开", "北辰", "河北", "武清", "红挢",
|
||||
"塘沽", "汉沽", "大港", "宁河", "静海", "宝坻", "蓟县");
|
||||
break;
|
||||
case "新疆" :
|
||||
var cityOptions = new Array(
|
||||
"乌鲁木齐", "阿克苏", "阿勒泰", "阿图什", "博乐", "昌吉", "东山", "哈密", "和田", "喀什",
|
||||
"克拉玛依", "库车", "库尔勒", "奎屯", "石河子", "塔城", "吐鲁番", "伊宁");
|
||||
break;
|
||||
case "西藏" :
|
||||
var cityOptions = new Array(
|
||||
"拉萨", "阿里", "昌都", "林芝", "那曲", "日喀则", "山南");
|
||||
break;
|
||||
case "云南" :
|
||||
var cityOptions = new Array(
|
||||
"昆明", "大理", "保山", "楚雄", "大理", "东川", "个旧", "景洪", "开远", "临沧", "丽江",
|
||||
"六库", "潞西", "曲靖", "思茅", "文山", "西双版纳", "玉溪", "中甸", "昭通");
|
||||
break;
|
||||
case "浙江" :
|
||||
var cityOptions = new Array(
|
||||
"杭州", "安吉", "慈溪", "定海", "奉化", "海盐", "黄岩", "湖州", "嘉兴", "金华", "临安",
|
||||
"临海", "丽水", "宁波", "瓯海", "平湖", "千岛湖", "衢州", "江山", "瑞安", "绍兴", "嵊州",
|
||||
"台州", "温岭", "温州", "余姚", "舟山");
|
||||
break;
|
||||
case "海外" :
|
||||
var cityOptions = new Array(
|
||||
"美国", "日本", "英国", "法国", "德国", "其他");
|
||||
break;
|
||||
default:
|
||||
var cityOptions = new Array("");
|
||||
break;
|
||||
}
|
||||
|
||||
cityField.options.length = 0;
|
||||
for (var i = 0; i < cityOptions.length; i++) {
|
||||
cityField.options[i] = new Option(cityOptions[i], cityOptions[i]);
|
||||
/*
|
||||
if (cityField.options[i].value==city)
|
||||
{
|
||||
//alert("here put City ok!");
|
||||
document.oblogform["city"].selectedIndex = i;
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
function ifNameRepeat(){
|
||||
|
||||
//名称不能为空也不能重复
|
||||
|
|
|
@ -249,191 +249,6 @@
|
|||
<% end %>
|
||||
|
||||
<script type="text/javascript">
|
||||
function showcity(province, cityField) {
|
||||
switch (province) {
|
||||
case "北京" :
|
||||
var cityOptions = new Array(
|
||||
"东城", "西城", "朝阳", "丰台", "石景山", "海淀", "门头沟",
|
||||
"房山", "通州", "顺义", "昌平", "大兴", "平谷", "怀柔", "密云", "延庆");
|
||||
break;
|
||||
case "上海" :
|
||||
var cityOptions = new Array(
|
||||
"崇明", "黄浦", "卢湾", "徐汇", "长宁", "静安", "普陀", "闸北", "虹口", "杨浦", "闵行",
|
||||
"宝山", "嘉定", "浦东", "金山", "松江", "青浦", "南汇", "奉贤");
|
||||
break;
|
||||
case "广东" :
|
||||
var cityOptions = new Array(
|
||||
"广州", "深圳", "珠海", "东莞", "中山", "佛山", "惠州", "河源", "潮州", "江门", "揭阳", "茂名",
|
||||
"梅州", "清远", "汕头", "汕尾", "韶关", "顺德", "阳江", "云浮", "湛江", "肇庆");
|
||||
break;
|
||||
case "江苏" :
|
||||
var cityOptions = new Array(
|
||||
"南京", "常熟", "常州", "海门", "淮安", "江都", "江阴", "昆山", "连云港", "南通",
|
||||
"启东", "沭阳", "宿迁", "苏州", "太仓", "泰州", "同里", "无锡", "徐州", "盐城",
|
||||
"扬州", "宜兴", "仪征", "张家港", "镇江", "周庄");
|
||||
break;
|
||||
case "重庆" :
|
||||
var cityOptions = new Array(
|
||||
"万州", "涪陵", "渝中", "大渡口", "江北", "沙坪坝", "九龙坡", "南岸", "北碚", "万盛",
|
||||
"双挢", "渝北", "巴南", "黔江", "长寿", "綦江", "潼南", "铜梁", "大足", "荣昌", "壁山",
|
||||
"梁平", "城口", "丰都", "垫江", "武隆", "忠县", "开县", "云阳", "奉节", "巫山", "巫溪",
|
||||
"石柱", "秀山", "酉阳", "彭水", "江津", "合川", "永川", "南川");
|
||||
break;
|
||||
case "安徽" :
|
||||
var cityOptions = new Array(
|
||||
"合肥", "安庆", "蚌埠", "亳州", "巢湖", "滁州", "阜阳", "贵池", "淮北", "淮化", "淮南",
|
||||
"黄山", "九华山", "六安", "马鞍山", "宿州", "铜陵", "屯溪", "芜湖", "宣城");
|
||||
break;
|
||||
case "福建" :
|
||||
var cityOptions = new Array(
|
||||
"福州", "厦门", "泉州", "漳州", "龙岩", "南平", "宁德", "莆田", "三明");
|
||||
break;
|
||||
case "甘肃" :
|
||||
var cityOptions = new Array(
|
||||
"兰州", "白银", "定西", "敦煌", "甘南", "金昌", "酒泉", "临夏", "平凉", "天水",
|
||||
"武都", "武威", "西峰", "张掖");
|
||||
break;
|
||||
case "广西" :
|
||||
var cityOptions = new Array(
|
||||
"南宁", "百色", "北海", "桂林", "防城港", "贵港", "河池", "贺州", "柳州", "钦州", "梧州", "玉林");
|
||||
break;
|
||||
case "贵州" :
|
||||
var cityOptions = new Array(
|
||||
"贵阳", "安顺", "毕节", "都匀", "凯里", "六盘水", "铜仁", "兴义", "玉屏", "遵义");
|
||||
break;
|
||||
case "海南" :
|
||||
var cityOptions = new Array(
|
||||
"海口", "儋县", "陵水", "琼海", "三亚", "通什", "万宁");
|
||||
break;
|
||||
case "河北" :
|
||||
var cityOptions = new Array(
|
||||
"石家庄", "保定", "北戴河", "沧州", "承德", "丰润", "邯郸", "衡水", "廊坊", "南戴河", "秦皇岛",
|
||||
"唐山", "新城", "邢台", "张家口");
|
||||
break;
|
||||
case "黑龙江" :
|
||||
var cityOptions = new Array(
|
||||
"哈尔滨", "北安", "大庆", "大兴安岭", "鹤岗", "黑河", "佳木斯", "鸡西", "牡丹江", "齐齐哈尔",
|
||||
"七台河", "双鸭山", "绥化", "伊春");
|
||||
break;
|
||||
case "河南" :
|
||||
var cityOptions = new Array(
|
||||
"郑州", "安阳", "鹤壁", "潢川", "焦作", "济源", "开封", "漯河", "洛阳", "南阳", "平顶山",
|
||||
"濮阳", "三门峡", "商丘", "新乡", "信阳", "许昌", "周口", "驻马店");
|
||||
break;
|
||||
case "香港" :
|
||||
var cityOptions = new Array(
|
||||
"香港", "九龙", "新界");
|
||||
break;
|
||||
case "湖北" :
|
||||
var cityOptions = new Array(
|
||||
"武汉", "恩施", "鄂州", "黄冈", "黄石", "荆门", "荆州", "潜江", "十堰", "随州", "武穴",
|
||||
"仙桃", "咸宁", "襄阳", "襄樊", "孝感", "宜昌");
|
||||
break;
|
||||
case "湖南" :
|
||||
var cityOptions = new Array(
|
||||
"长沙", "常德", "郴州", "衡阳", "怀化", "吉首", "娄底", "邵阳", "湘潭", "益阳", "岳阳",
|
||||
"永州", "张家界", "株洲");
|
||||
break;
|
||||
case "江西" :
|
||||
var cityOptions = new Array(
|
||||
"南昌", "抚州", "赣州", "吉安", "景德镇", "井冈山", "九江", "庐山", "萍乡",
|
||||
"上饶", "新余", "宜春", "鹰潭");
|
||||
break;
|
||||
case "吉林" :
|
||||
var cityOptions = new Array(
|
||||
"长春", "吉林", "白城", "白山", "珲春", "辽源", "梅河", "四平", "松原", "通化", "延吉");
|
||||
break;
|
||||
case "辽宁" :
|
||||
var cityOptions = new Array(
|
||||
"沈阳", "鞍山", "本溪", "朝阳", "大连", "丹东", "抚顺", "阜新", "葫芦岛", "锦州",
|
||||
"辽阳", "盘锦", "铁岭", "营口");
|
||||
break;
|
||||
case "澳门" :
|
||||
var cityOptions = new Array("澳门");
|
||||
break;
|
||||
case "内蒙古" :
|
||||
var cityOptions = new Array(
|
||||
"呼和浩特", "阿拉善盟", "包头", "赤峰", "东胜", "海拉尔", "集宁", "临河", "通辽", "乌海",
|
||||
"乌兰浩特", "锡林浩特");
|
||||
break;
|
||||
case "宁夏" :
|
||||
var cityOptions = new Array(
|
||||
"银川", "固源", "石嘴山", "吴忠");
|
||||
break;
|
||||
case "青海" :
|
||||
var cityOptions = new Array(
|
||||
"西宁", "德令哈", "格尔木", "共和", "海东", "海晏", "玛沁", "同仁", "玉树");
|
||||
break;
|
||||
case "山东" :
|
||||
var cityOptions = new Array(
|
||||
"济南", "滨州", "兖州", "德州", "东营", "菏泽", "济宁", "莱芜", "聊城", "临沂",
|
||||
"蓬莱", "青岛", "曲阜", "日照", "泰安", "潍坊", "威海", "烟台", "枣庄", "淄博");
|
||||
break;
|
||||
case "山西" :
|
||||
var cityOptions = new Array(
|
||||
"太原", "长治", "大同", "候马", "晋城", "离石", "临汾", "宁武", "朔州", "忻州",
|
||||
"阳泉", "榆次", "运城");
|
||||
break;
|
||||
case "陕西" :
|
||||
var cityOptions = new Array(
|
||||
"西安", "安康", "宝鸡", "汉中", "渭南", "商州", "绥德", "铜川", "咸阳", "延安", "榆林");
|
||||
break;
|
||||
case "四川" :
|
||||
var cityOptions = new Array(
|
||||
"成都", "巴中", "达川", "德阳", "都江堰", "峨眉山", "涪陵", "广安", "广元", "九寨沟",
|
||||
"康定", "乐山", "泸州", "马尔康", "绵阳", "眉山", "南充", "内江", "攀枝花", "遂宁",
|
||||
"汶川", "西昌", "雅安", "宜宾", "自贡", "资阳");
|
||||
break;
|
||||
case "台湾" :
|
||||
var cityOptions = new Array(
|
||||
"台北", "基隆", "台南", "台中", "高雄", "屏东", "南投", "云林", "新竹", "彰化", "苗栗",
|
||||
"嘉义", "花莲", "桃园", "宜兰", "台东", "金门", "马祖", "澎湖");
|
||||
break;
|
||||
case "天津" :
|
||||
var cityOptions = new Array(
|
||||
"天津", "和平", "东丽", "河东", "西青", "河西", "津南", "南开", "北辰", "河北", "武清", "红挢",
|
||||
"塘沽", "汉沽", "大港", "宁河", "静海", "宝坻", "蓟县");
|
||||
break;
|
||||
case "新疆" :
|
||||
var cityOptions = new Array(
|
||||
"乌鲁木齐", "阿克苏", "阿勒泰", "阿图什", "博乐", "昌吉", "东山", "哈密", "和田", "喀什",
|
||||
"克拉玛依", "库车", "库尔勒", "奎屯", "石河子", "塔城", "吐鲁番", "伊宁");
|
||||
break;
|
||||
case "西藏" :
|
||||
var cityOptions = new Array(
|
||||
"拉萨", "阿里", "昌都", "林芝", "那曲", "日喀则", "山南");
|
||||
break;
|
||||
case "云南" :
|
||||
var cityOptions = new Array(
|
||||
"昆明", "大理", "保山", "楚雄", "大理", "东川", "个旧", "景洪", "开远", "临沧", "丽江",
|
||||
"六库", "潞西", "曲靖", "思茅", "文山", "西双版纳", "玉溪", "中甸", "昭通");
|
||||
break;
|
||||
case "浙江" :
|
||||
var cityOptions = new Array(
|
||||
"杭州", "安吉", "慈溪", "定海", "奉化", "海盐", "黄岩", "湖州", "嘉兴", "金华", "临安",
|
||||
"临海", "丽水", "宁波", "瓯海", "平湖", "千岛湖", "衢州", "江山", "瑞安", "绍兴", "嵊州",
|
||||
"台州", "温岭", "温州", "余姚", "舟山");
|
||||
break;
|
||||
case "海外" :
|
||||
var cityOptions = new Array(
|
||||
"美国", "日本", "英国", "法国", "德国", "其他");
|
||||
break;
|
||||
default:
|
||||
var cityOptions = new Array("");
|
||||
break;
|
||||
}
|
||||
|
||||
cityField.options.length = 0;
|
||||
for (var i = 0; i < cityOptions.length; i++) {
|
||||
cityField.options[i] = new Option(cityOptions[i], cityOptions[i]);
|
||||
/*
|
||||
if (cityField.options[i].value==city)
|
||||
{
|
||||
//alert("here put City ok!");
|
||||
document.oblogform["city"].selectedIndex = i;
|
||||
}*/
|
||||
}
|
||||
}
|
||||
function showtechnical_title(val){
|
||||
$("*[nhname='tag']").each(function(){
|
||||
$("*[nh_required='1']",$(this)).attr("required",false);
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% if act.org_act_type == 'OrgDocumentComment' %>
|
||||
<% if act.org_act_type == 'OrgDocumentComment' && act.org_act.organization.home_id != act.org_act.id %>
|
||||
<%= render :partial => 'show_org_document', :locals => {:document => act.org_act, :act => act, :flag => 2, :org_subfield_id => params[:org_subfield_id]} %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
|
|
@ -71,7 +71,7 @@
|
|||
<%= user_for_homework_common activity,is_teacher %>
|
||||
</div>
|
||||
<% work = cur_user_works_for_homework activity %>
|
||||
<% if activity.end_time < Date.today && !is_teacher && !work.nil? %>
|
||||
<% if activity.end_time < Date.today && !is_teacher && !work.nil? && work.user == User.current %>
|
||||
<div class="homepagePostSubmit">
|
||||
<%=link_to "追加附件", student_work_index_url_in_org(activity.id, 1), :class => 'c_blue', :title => "可追加作品修订附件" %>
|
||||
</div>
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
<li class=" mb5 ml80">
|
||||
<label >公开 :</label>
|
||||
<input id="project_is_public" name="project[is_public]" type="checkbox" value="1" checked="checked">
|
||||
<span class="c_grey">(打钩为公开,不打钩则不公开,若不公开,仅项目成员可见该项目。)</span>
|
||||
<span class="c_grey">(打钩为公开项目,不打钩为私有项目;私有项目仅项目成员可见。)</span>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<li>
|
||||
|
|
|
@ -1,32 +1,31 @@
|
|||
<table class="hwork-table-wrap" id="homework_table">
|
||||
<tr class="b_grey hworkH30">
|
||||
<th class="hworkList30 hworkH30 pl5 pr5">序号</th>
|
||||
<th class="hworkList40 hworkH30 pl5 pr5">序号</th>
|
||||
<th class="hworkList50"> </th>
|
||||
<% if @homework.homework_type != 3 %>
|
||||
<th class="<%= @homework.homework_type == 2 ? 'hworkList210' : 'hworkList260' %> hide-text" style="text-align:left;">作品名称</th>
|
||||
<th class="hworkList80 hide-text">
|
||||
<th class="<%= @homework.homework_type == 2 ? 'hworkList160' : 'hworkList200' %> hide-text">
|
||||
<span class="HomeworkStuTitle f14 fb">姓名</span>
|
||||
</th>
|
||||
<th class="hworkList80 hide-text">
|
||||
<th class="<%= @homework.homework_type == 2 ? 'hworkList160' : 'hworkList190' %> hide-text">
|
||||
<span class="HomeworkStuTitle f14 fb">学号</span>
|
||||
</th>
|
||||
<% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1 %>
|
||||
<th class="hworkList260" style="text-align:left;">作品名称</th>
|
||||
<th class="hworkList230" style="text-align:left;">组长</th>
|
||||
<th class="hworkList160">
|
||||
<span class="HomeworkStuTitle f14 fb fl">关联项目</span>
|
||||
</th>
|
||||
<% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 0 %>
|
||||
<th class="hworkList420" style="text-align:left;">作品名称</th>
|
||||
<th class="hworkList390" style="text-align:left;">组长</th>
|
||||
<% end %>
|
||||
<th class="hworkList130 pl10">
|
||||
时间
|
||||
状态
|
||||
</th>
|
||||
<% if @homework.homework_type == 2%>
|
||||
<th class="hworkList50">
|
||||
<th class="hworkList70">
|
||||
系统
|
||||
</th>
|
||||
<% end%>
|
||||
<th class="hworkList50 pr10 pl10" style="font-size:12px;">
|
||||
<th class="hworkList70 pr10 pl10" style="font-size:12px;">
|
||||
我的评分
|
||||
</th>
|
||||
</tr>
|
||||
|
|
|
@ -0,0 +1,48 @@
|
|||
<tr class="b_grey hworkH30">
|
||||
<th class="hworkList40 hworkH30 pl5 pr5">序号</th>
|
||||
<th class="hworkList50"> </th>
|
||||
<th class="<%= @homework.anonymous_comment == 1 ? 'hworkList130' : 'hworkList100' %> pl5 pr5 hide-text">
|
||||
<%= link_to "姓名", @show_all ? student_work_index_path(:homework => @homework.id, :order => "lastname", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)", :class => "c_dark f14 fb", :remote => true %>
|
||||
<% if @show_all && @order == "lastname" %>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id, :order => "lastname", :sort => @score, :name => @name, :group => @group), :class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none", :style => "line-height:30px; vertical-align:middle;", :remote => true %>
|
||||
<% end %>
|
||||
</th>
|
||||
<th class="<%= @homework.anonymous_comment == 1 ? 'hworkList130' : 'hworkList90' %> pl5 pr5 hide-text">
|
||||
<%= link_to "学号", @show_all ? student_work_index_path(:homework => @homework.id, :order => "student_id", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)", :class => "c_dark f14 fb", :remote => true %>
|
||||
<% if @show_all && @order == "student_id" %>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id, :order => "student_id", :sort => @score, :name => @name, :group => @group), :class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none", :style => "line-height:30px; vertical-align:middle;", :remote => true %>
|
||||
<% end %>
|
||||
</th>
|
||||
<th class="hworkList130">
|
||||
<%= link_to "时间", @show_all ? student_work_index_path(:homework => @homework.id, :order => "created_at", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)", :class => "c_dark f14 fb", :remote => true %>
|
||||
<% if @show_all && @order == "created_at" %>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id, :order => "created_at", :sort => @score, :name => @name, :group => @group), :class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none", :style => "line-height:30px; vertical-align:middle;", :remote => true %>
|
||||
<% end %>
|
||||
</th>
|
||||
<th class="hworkList70">
|
||||
<%= link_to "教师", @show_all ? student_work_index_path(:homework => @homework.id, :order => "teacher_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)", :class => "c_dark f14 fb", :remote => true %>
|
||||
<% if @show_all && @order == "teacher_score" %>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id, :order => "teacher_score", :sort => @score, :name => @name, :group => @group), :class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none", :style => "line-height:30px; vertical-align:middle;", :remote => true %>
|
||||
<% end %>
|
||||
</th>
|
||||
<th class="hworkList70">
|
||||
<%= link_to "教辅", @show_all ? student_work_index_path(:homework => @homework.id, :order => "teaching_asistant_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)", :class => "c_dark f14 fb", :remote => true %>
|
||||
<% if @show_all && @order == "teaching_asistant_score" %>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id, :order => "teaching_asistant_score", :sort => @score, :name => @name, :group => @group), :class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none", :style => "line-height:30px; vertical-align:middle;", :remote => true %>
|
||||
<% end %>
|
||||
</th>
|
||||
<% if @homework.anonymous_comment == 0 %>
|
||||
<th class="hworkList70">
|
||||
<%= link_to "匿评", @show_all ? student_work_index_path(:homework => @homework.id, :order => "student_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)", :class => "c_dark f14 fb", :remote => true %>
|
||||
<% if @show_all && @order == "student_score" %>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id, :order => "student_score", :sort => @score, :name => @name, :group => @group), :class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none", :style => "line-height:30px; vertical-align:middle;", :remote => true %>
|
||||
<% end %>
|
||||
</th>
|
||||
<% end %>
|
||||
<th class="hworkList70">
|
||||
<%= link_to "成绩", @show_all ? student_work_index_path(:homework => @homework.id, :order => "score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)", :class => "c_dark f14 fb", :remote => true %>
|
||||
<% if @show_all && @order == "score" %>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id, :order => "score", :sort => @score, :name => @name, :group => @group), :class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none", :style => "line-height:30px; vertical-align:middle;", :remote => true %>
|
||||
<% end %>
|
||||
</th>
|
||||
</tr>
|
|
@ -0,0 +1,79 @@
|
|||
<tr class="hworkListRow" id="student_work_<%= student_work.id %>">
|
||||
<td class="none"><a name="<%= student_work.id %>"></a></td>
|
||||
<td class="hworkList40 pl5 pr5" id="work_num_<%= student_work.id %>"><%= index + 1 %></td>
|
||||
<td class="hworkPortrait pr10 float-none">
|
||||
<%= link_to(image_tag(url_to_avatar(student_work.user), :width => "40", :height => "40", :style => "display:block;"), user_activities_path(student_work.user)) %>
|
||||
</td>
|
||||
<td class="<%= @homework.anonymous_comment == 1 ? 'hworkStName130' : 'hworkStName100' %> pr10 float-none student_work_<%= student_work.id %>" title="<%= student_work.user.show_name %>" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor:pointer;">
|
||||
<%= student_work.user.show_name %>
|
||||
</td>
|
||||
<td class="<%= @homework.anonymous_comment == 1 ? 'hworkStName130' : 'hworkStID90' %> pr10 float-none student_work_<%= student_work.id %>" title="<%= student_work.user.user_extensions.nil? ? "--" : student_work.user.user_extensions.student_id %>" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor:pointer;">
|
||||
<%= student_work.user.user_extensions.nil? ? "--" : student_work.user.user_extensions.student_id %>
|
||||
</td>
|
||||
<td class="hworkList130 c_grey student_work_<%= student_work.id %>" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;">
|
||||
<% if student_work.created_at && @homework.end_time %>
|
||||
<%= Time.parse(format_time(student_work.created_at)).strftime("%m-%d %H:%M") %>
|
||||
<% if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(format_time(student_work.created_at)).strftime("%Y-%m-%d") %>
|
||||
<span class="c_red">[迟交]</span>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td class="hworkList70 <%= score_color student_work.teacher_score %>">
|
||||
<%= student_work.teacher_score.nil? ? "--" : format("%.1f", student_work.teacher_score) %>
|
||||
</td>
|
||||
<td class="hworkList70 <%= score_color student_work.teaching_asistant_score %>">
|
||||
<%= student_work.teaching_asistant_score.nil? ? "--" : format("%.1f", student_work.teaching_asistant_score) %>
|
||||
</td>
|
||||
<% if @homework.anonymous_comment == 0 %>
|
||||
<td class="hworkList70 <%= score_color student_work.student_score %> student_score_info">
|
||||
<% if student_work.student_score.nil? %>
|
||||
<span title="该作品未被匿评">未参与</span>
|
||||
<% else %>
|
||||
<%= format("%.1f", student_work.student_score) %>
|
||||
<% end %>
|
||||
<% unless student_work.student_score.nil? %>
|
||||
<span class="linkBlue">
|
||||
(<%= student_work.student_works_scores.where(:reviewer_role => 3).group_by(&:user_id).count %>)
|
||||
</span>
|
||||
|
||||
<div class="infoNi none">
|
||||
现共有
|
||||
<span class="c_red"> <%= student_work.student_works_scores.where(:reviewer_role => 3).group_by(&:user_id).count %> </span>
|
||||
名学生进行了匿评,平均分为
|
||||
<span class="c_red"> <%= format("%.1f", student_work.student_score) %> </span>分。
|
||||
</div>
|
||||
<% end %>
|
||||
</td>
|
||||
<% end %>
|
||||
<!-- 成绩 -->
|
||||
<% if student_work.homework_common && student_work.homework_common.teacher_priority == 1 && student_work.teacher_score %>
|
||||
<% score = student_work.respond_to?("score") ? student_work.score : student_work.teacher_score %>
|
||||
<% else %>
|
||||
<% score = student_work.respond_to?("score") ? student_work.score : (student_work.final_score || 0) - student_work.absence_penalty - student_work.late_penalty %>
|
||||
<% end %>
|
||||
<td class="hworkList70 <%= score_color score %> student_final_scor_info">
|
||||
<%= score.nil? ? "--" : format("%.1f", score<0 ? 0 : score) %>
|
||||
<% unless score.nil? %>
|
||||
<div class="infoNi none width180">
|
||||
作品最终评分为
|
||||
<span class="c_red"> <%= student_work.final_score %> </span>分。
|
||||
迟交扣分
|
||||
<span class="c_red">
|
||||
<%= student_work.homework_common && student_work.homework_common.teacher_priority == 1 && student_work.teacher_score ? 0 : student_work.late_penalty %>
|
||||
</span>分,
|
||||
缺评扣分
|
||||
<span class="c_red">
|
||||
<%= student_work.homework_common && student_work.homework_common.teacher_priority == 1 && student_work.teacher_score ? 0 : student_work.absence_penalty %>
|
||||
</span>分,
|
||||
最终成绩为
|
||||
<span class="c_red"> <%= format("%.1f", score<0 ? 0 : score) %> </span>分。
|
||||
</div>
|
||||
<% end %>
|
||||
</td>
|
||||
<td>
|
||||
<div style="position:relative;">
|
||||
<div class="hworkTip" style="display: none" id="work_click_<%= student_work.id %>">
|
||||
<em></em><span></span><font class="fontGrey2">点击查看详情</font></div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
|
@ -0,0 +1,44 @@
|
|||
<tr class="b_grey hworkH30">
|
||||
<th class="hworkList40 hworkH30 pl5 pr5">序号</th>
|
||||
<th class="hworkList50"> </th>
|
||||
<% if @homework.homework_detail_group.base_on_project == 1 %>
|
||||
<th class="hworkList130 pl5 pr5" style="text-align:left;">组长</th>
|
||||
<th class="<%= @homework.anonymous_comment == 1 ? 'hworkList140' : 'hworkList70' %>">
|
||||
<span class="c_dark f14 fb">关联项目</span>
|
||||
</th>
|
||||
<% elsif @homework.homework_detail_group.base_on_project == 0 %>
|
||||
<th class="<%= @homework.anonymous_comment == 1 ? 'hworkList270' : 'hworkList200' %> pl5 pr5" style="text-align:left;">组长</th>
|
||||
<% end %>
|
||||
<th class="hworkList130">
|
||||
<%= link_to "时间", @show_all ? student_work_index_path(:homework => @homework.id, :order => "created_at", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)", :class => "c_dark f14 fb", :remote => true %>
|
||||
<% if @show_all && @order == "created_at" %>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id, :order => "created_at", :sort => @score, :name => @name, :group => @group), :class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none", :style => "line-height:30px; vertical-align:middle;", :remote => true %>
|
||||
<% end %>
|
||||
</th>
|
||||
<th class="hworkList70">
|
||||
<%= link_to "教师", @show_all ? student_work_index_path(:homework => @homework.id, :order => "teacher_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)", :class => "c_dark f14 fb", :remote => true %>
|
||||
<% if @show_all && @order == "teacher_score" %>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id, :order => "teacher_score", :sort => @score, :name => @name, :group => @group), :class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none", :style => "line-height:30px; vertical-align:middle;", :remote => true %>
|
||||
<% end %>
|
||||
</th>
|
||||
<th class="hworkList70">
|
||||
<%= link_to "教辅", @show_all ? student_work_index_path(:homework => @homework.id, :order => "teaching_asistant_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)", :class => "c_dark f14 fb", :remote => true %>
|
||||
<% if @show_all && @order == "teaching_asistant_score" %>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id, :order => "teaching_asistant_score", :sort => @score, :name => @name, :group => @group), :class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none", :style => "line-height:30px; vertical-align:middle;", :remote => true %>
|
||||
<% end %>
|
||||
</th>
|
||||
<% if @homework.anonymous_comment == 0 %>
|
||||
<th class="hworkList70">
|
||||
<%= link_to "匿评", @show_all ? student_work_index_path(:homework => @homework.id, :order => "student_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)", :class => "c_dark f14 fb", :remote => true %>
|
||||
<% if @show_all && @order == "student_score" %>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id, :order => "student_score", :sort => @score, :name => @name, :group => @group), :class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none", :style => "line-height:30px; vertical-align:middle;", :remote => true %>
|
||||
<% end %>
|
||||
</th>
|
||||
<% end %>
|
||||
<th class="hworkList70">
|
||||
<%= link_to "成绩", @show_all ? student_work_index_path(:homework => @homework.id, :order => "score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)", :class => "c_dark f14 fb", :remote => true %>
|
||||
<% if @show_all && @order == "score" %>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id, :order => "score", :sort => @score, :name => @name, :group => @group), :class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none", :style => "line-height:30px; vertical-align:middle;", :remote => true %>
|
||||
<% end %>
|
||||
</th>
|
||||
</tr>
|
|
@ -0,0 +1,89 @@
|
|||
<tr class="hworkListRow" id="student_work_<%= student_work.id%>">
|
||||
<td class="none"><a name="<%= student_work.id%>"></a></td>
|
||||
<td class="hworkList40 pl5 pr5" id="work_num_<%=student_work.id %>"><%=index + 1 %></td>
|
||||
<td class="hworkPortrait pr10 float-none">
|
||||
<%= link_to(image_tag(url_to_avatar(student_work.user),:width =>"40",:height => "40",:style => "display:block;"),user_activities_path(student_work.user)) %>
|
||||
</td>
|
||||
<% if @homework.homework_detail_group.base_on_project == 1 %>
|
||||
<td class="hworkName float-none pr10 student_work_<%= student_work.id%> width130" style="cursor: pointer;" onclick="show_student_work('<%= student_work_path(student_work)%>');">
|
||||
<div>
|
||||
<%= link_to student_work.user.show_name,"javascript:void(0)" ,:title => student_work.user.show_name, :class => "linkGrey f14 StudentName break_word #{@homework.homework_type == 2 ? '' : 'width165'}"%>
|
||||
</div>
|
||||
</td>
|
||||
<% if student_work.project.is_public || User.current.member_of?(student_work.project) || User.current.admin? %>
|
||||
<td class="<%=@homework.anonymous_comment == 1 ? 'hworkPrName2' : 'hworkPrName'%> student_work_<%= student_work.id%>" title="项目名称">
|
||||
<%= link_to( student_work.project.name, project_path(student_work.project.id))%>
|
||||
</td>
|
||||
<% else %>
|
||||
<td class="<%=@homework.anonymous_comment == 1 ? 'hworkPrName2' : 'hworkPrName'%> student_work_<%= student_work.id%>" title="该项目是私有的">
|
||||
<%= student_work.project.name %>
|
||||
</td>
|
||||
<% end %>
|
||||
<% elsif @homework.homework_detail_group.base_on_project == 0 %>
|
||||
<td class="hworkName float-none pr10 student_work_<%= student_work.id%> <%=@homework.anonymous_comment == 1 ? 'width280' : 'width210' %>" style="cursor: pointer;" onclick="show_student_work('<%= student_work_path(student_work)%>');">
|
||||
<div>
|
||||
<%= link_to student_work.user.show_name,"javascript:void(0)" ,:title => student_work.user.show_name, :class => "linkGrey f14 StudentName break_word #{@homework.homework_type == 2 ? '' : 'width165'}"%>
|
||||
</div>
|
||||
</td>
|
||||
<% end %>
|
||||
<td class="hworkList130 c_grey student_work_<%= student_work.id%>" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;">
|
||||
<% if student_work.created_at && @homework.end_time%>
|
||||
<%= Time.parse(format_time(student_work.created_at)).strftime("%m-%d %H:%M")%>
|
||||
<% if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(format_time(student_work.created_at)).strftime("%Y-%m-%d") %>
|
||||
<span class="c_red">[迟交]</span>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td class="hworkList70 <%= score_color student_work.teacher_score%>">
|
||||
<%= student_work.teacher_score.nil? ? "--" : format("%.1f",student_work.teacher_score)%>
|
||||
</td>
|
||||
<td class="hworkList70 <%= score_color student_work.teaching_asistant_score%>">
|
||||
<%= student_work.teaching_asistant_score.nil? ? "--" : format("%.1f",student_work.teaching_asistant_score)%>
|
||||
</td>
|
||||
<% if @homework.anonymous_comment == 0%>
|
||||
<td class="hworkList70 <%= score_color student_work.student_score%> student_score_info">
|
||||
<% if student_work.student_score.nil? %>
|
||||
<span title="该作品未被匿评">未参与</span>
|
||||
<% else %>
|
||||
<%=format("%.1f",student_work.student_score) %>
|
||||
<% end %>
|
||||
<% unless student_work.student_score.nil?%>
|
||||
<span class="linkBlue">
|
||||
(<%= student_work.student_works_scores.where(:reviewer_role => 3).group_by(&:user_id).count%>)
|
||||
</span>
|
||||
<div class="infoNi none">
|
||||
现共有
|
||||
<span class="c_red"> <%= student_work.student_works_scores.where(:reviewer_role => 3).group_by(&:user_id).count%> </span>
|
||||
名学生进行了匿评,平均分为
|
||||
<span class="c_red"> <%= format("%.1f",student_work.student_score)%> </span>分。
|
||||
</div>
|
||||
<% end%>
|
||||
</td>
|
||||
<% end %>
|
||||
<!-- 成绩 -->
|
||||
<% if student_work.homework_common && student_work.homework_common.teacher_priority == 1 && student_work.teacher_score %>
|
||||
<% score = student_work.respond_to?("score") ? student_work.score : student_work.teacher_score %>
|
||||
<% else %>
|
||||
<% score = student_work.respond_to?("score") ? student_work.score : (student_work.final_score || 0) - student_work.absence_penalty - student_work.late_penalty%>
|
||||
<% end %>
|
||||
<td class="hworkList70 <%= score_color score%> student_final_scor_info">
|
||||
<%= score.nil? ? "--" : format("%.1f",score<0 ? 0 : score)%>
|
||||
<% unless score.nil?%>
|
||||
<div class="infoNi none width180">
|
||||
作品最终评分为
|
||||
<span class="c_red"> <%= student_work.final_score%> </span>分。
|
||||
迟交扣分
|
||||
<span class="c_red">
|
||||
<%= student_work.homework_common && student_work.homework_common.teacher_priority == 1 && student_work.teacher_score ? 0 : student_work.late_penalty %>
|
||||
</span>分,
|
||||
缺评扣分
|
||||
<span class="c_red">
|
||||
<%= student_work.homework_common && student_work.homework_common.teacher_priority == 1 && student_work.teacher_score ? 0 : student_work.absence_penalty%>
|
||||
</span>分,
|
||||
最终成绩为
|
||||
<span class="c_red"> <%= format("%.1f",score<0 ? 0 : score)%> </span>分。
|
||||
</div>
|
||||
<% end%>
|
||||
</td>
|
||||
<td><div style="position:relative;"><div class="hworkTip" style="display: none" id="work_click_<%= student_work.id%>"><em></em><span></span><font class="fontGrey2">点击查看详情</font></div></div></td>
|
||||
</tr>
|
|
@ -0,0 +1,55 @@
|
|||
<tr class="b_grey hworkH30">
|
||||
<th class="hworkList40 hworkH30 pl5 pr5">序号</th>
|
||||
<th class="hworkList50"> </th>
|
||||
<th class="<%= @homework.anonymous_comment == 1 ? 'hworkList110' : 'hworkList60' %> pl5 pr5 hide-text">
|
||||
<%= link_to "姓名", @show_all ? student_work_index_path(:homework => @homework.id, :order => "lastname", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)", :class => "c_dark f14 fb", :remote => true %>
|
||||
<% if @show_all && @order == "lastname" %>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id, :order => "lastname", :sort => @score, :name => @name, :group => @group), :class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none", :style => "line-height:30px; vertical-align:middle;", :remote => true %>
|
||||
<% end %>
|
||||
</th>
|
||||
<th class="<%= @homework.anonymous_comment == 1 ? 'hworkList100' : 'hworkList80' %> pl5 pr5 hide-text">
|
||||
<%= link_to "学号", @show_all ? student_work_index_path(:homework => @homework.id, :order => "student_id", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)", :class => "c_dark f14 fb", :remote => true %>
|
||||
<% if @show_all && @order == "student_id" %>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id, :order => "student_id", :sort => @score, :name => @name, :group => @group), :class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none", :style => "line-height:30px; vertical-align:middle;", :remote => true %>
|
||||
<% end %>
|
||||
</th>
|
||||
|
||||
<th class="hworkList110">
|
||||
<%= link_to "时间", @show_all ? student_work_index_path(:homework => @homework.id, :order => "created_at", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)", :class => "c_dark f14 fb", :remote => true %>
|
||||
<% if @show_all && @order == "created_at" %>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id, :order => "created_at", :sort => @score, :name => @name, :group => @group), :class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none", :style => "line-height:30px; vertical-align:middle;", :remote => true %>
|
||||
<% end %>
|
||||
</th>
|
||||
<th class="hworkList70">
|
||||
<%= link_to "教师", @show_all ? student_work_index_path(:homework => @homework.id, :order => "teacher_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)", :class => "c_dark f14 fb", :remote => true %>
|
||||
<% if @show_all && @order == "teacher_score" %>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id, :order => "teacher_score", :sort => @score, :name => @name, :group => @group), :class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none", :style => "line-height:30px; vertical-align:middle;", :remote => true %>
|
||||
<% end %>
|
||||
</th>
|
||||
<th class="hworkList70">
|
||||
<%= link_to "教辅", @show_all ? student_work_index_path(:homework => @homework.id, :order => "teaching_asistant_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)", :class => "c_dark f14 fb", :remote => true %>
|
||||
<% if @show_all && @order == "teaching_asistant_score" %>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id, :order => "teaching_asistant_score", :sort => @score, :name => @name, :group => @group), :class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none", :style => "line-height:30px; vertical-align:middle;", :remote => true %>
|
||||
<% end %>
|
||||
</th>
|
||||
<th class="hworkList70">
|
||||
<%= link_to "系统", @show_all ? student_work_index_path(:homework => @homework.id, :order => "system_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)", :class => "c_dark f14 fb", :remote => true %>
|
||||
<% if @show_all && @order == "system_score" %>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id, :order => "system_score", :sort => @score, :name => @name, :group => @group), :class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none", :style => "line-height:30px; vertical-align:middle;", :remote => true %>
|
||||
<% end %>
|
||||
</th>
|
||||
<% if @homework.anonymous_comment == 0 %>
|
||||
<th class="hworkList70">
|
||||
<%= link_to "匿评", @show_all ? student_work_index_path(:homework => @homework.id, :order => "student_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)", :class => "c_dark f14 fb", :remote => true %>
|
||||
<% if @show_all && @order == "student_score" %>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id, :order => "student_score", :sort => @score, :name => @name, :group => @group), :class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none", :style => "line-height:30px; vertical-align:middle;", :remote => true %>
|
||||
<% end %>
|
||||
</th>
|
||||
<% end %>
|
||||
<th class="hworkList70">
|
||||
<%= link_to "成绩", @show_all ? student_work_index_path(:homework => @homework.id, :order => "score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)", :class => "c_dark f14 fb", :remote => true %>
|
||||
<% if @show_all && @order == "score" %>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id, :order => "score", :sort => @score, :name => @name, :group => @group), :class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none", :style => "line-height:30px; vertical-align:middle;", :remote => true %>
|
||||
<% end %>
|
||||
</th>
|
||||
</tr>
|
|
@ -0,0 +1,83 @@
|
|||
<tr class="hworkListRow" id="student_work_<%= student_work.id %>">
|
||||
<td class="none"><a name="<%= student_work.id %>"></a></td>
|
||||
<td class="hworkList40 pl5 pr5" id="work_num_<%= student_work.id %>"><%= index + 1 %></td>
|
||||
<td class="hworkPortrait pr10 float-none">
|
||||
<%= link_to(image_tag(url_to_avatar(student_work.user), :width => "40", :height => "40", :style => "display:block;"), user_activities_path(student_work.user)) %>
|
||||
</td>
|
||||
<td class="<%= @homework.anonymous_comment == 1 ? 'hworkStName110' : 'hworkStName' %> pr10 float-none student_work_<%= student_work.id %>" title="<%= student_work.user.show_name %>" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor:pointer;">
|
||||
<%= student_work.user.show_name %>
|
||||
</td>
|
||||
<td class="<%= @homework.anonymous_comment == 1 ? 'hworkStID100' : 'hworkStID' %> pr10 float-none student_work_<%= student_work.id %>" title="<%= student_work.user.user_extensions.nil? ? "--" : student_work.user.user_extensions.student_id %>" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor:pointer;">
|
||||
<%= student_work.user.user_extensions.nil? ? "--" : student_work.user.user_extensions.student_id %>
|
||||
</td>
|
||||
<td class="hworkList110 c_grey student_work_<%= student_work.id %>" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;">
|
||||
<% if student_work.created_at && @homework.end_time %>
|
||||
<%= Time.parse(format_time(student_work.created_at)).strftime("%m-%d %H:%M") %>
|
||||
<% if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(format_time(student_work.created_at)).strftime("%Y-%m-%d") %>
|
||||
<span class="c_red">[迟交]</span>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td class="hworkList70 <%= score_color student_work.teacher_score %>">
|
||||
<%= student_work.teacher_score.nil? ? "--" : format("%.1f", student_work.teacher_score) %>
|
||||
</td>
|
||||
<td class="hworkList70 <%= score_color student_work.teaching_asistant_score %>">
|
||||
<%= student_work.teaching_asistant_score.nil? ? "--" : format("%.1f", student_work.teaching_asistant_score) %>
|
||||
</td>
|
||||
<!-- 系统评分 -->
|
||||
<td class="hworkList70 <%= score_color student_work.system_score %>">
|
||||
<%= student_work.system_score.nil? ? "--" : format("%.1f", student_work.system_score) %>
|
||||
</td>
|
||||
<% if @homework.anonymous_comment == 0 %>
|
||||
<td class="hworkList70 <%= score_color student_work.student_score %> student_score_info">
|
||||
<% if student_work.student_score.nil? %>
|
||||
<span title="该作品未被匿评">未参与</span>
|
||||
<% else %>
|
||||
<%= format("%.1f", student_work.student_score) %>
|
||||
<% end %>
|
||||
<% unless student_work.student_score.nil? %>
|
||||
<span class="linkBlue">
|
||||
(<%= student_work.student_works_scores.where(:reviewer_role => 3).group_by(&:user_id).count %>)
|
||||
</span>
|
||||
|
||||
<div class="infoNi none">
|
||||
现共有
|
||||
<span class="c_red"> <%= student_work.student_works_scores.where(:reviewer_role => 3).group_by(&:user_id).count %> </span>
|
||||
名学生进行了匿评,平均分为
|
||||
<span class="c_red"> <%= format("%.1f", student_work.student_score) %> </span>分。
|
||||
</div>
|
||||
<% end %>
|
||||
</td>
|
||||
<% end %>
|
||||
<!-- 成绩 -->
|
||||
<% if student_work.homework_common && student_work.homework_common.teacher_priority == 1 && student_work.teacher_score %>
|
||||
<% score = student_work.respond_to?("score") ? student_work.score : student_work.teacher_score %>
|
||||
<% else %>
|
||||
<% score = student_work.respond_to?("score") ? student_work.score : (student_work.final_score || 0) - student_work.absence_penalty - student_work.late_penalty %>
|
||||
<% end %>
|
||||
<td class="hworkList70 <%= score_color score %> student_final_scor_info">
|
||||
<%= score.nil? ? "--" : format("%.1f", score<0 ? 0 : score) %>
|
||||
<% unless score.nil? %>
|
||||
<div class="infoNi none width180">
|
||||
作品最终评分为
|
||||
<span class="c_red"> <%= student_work.final_score %> </span>分。
|
||||
迟交扣分
|
||||
<span class="c_red">
|
||||
<%= student_work.homework_common && student_work.homework_common.teacher_priority == 1 && student_work.teacher_score ? 0 : student_work.late_penalty %>
|
||||
</span>分,
|
||||
缺评扣分
|
||||
<span class="c_red">
|
||||
<%= student_work.homework_common && student_work.homework_common.teacher_priority == 1 && student_work.teacher_score ? 0 : student_work.absence_penalty %>
|
||||
</span>分,
|
||||
最终成绩为
|
||||
<span class="c_red"> <%= format("%.1f", score<0 ? 0 : score) %> </span>分。
|
||||
</div>
|
||||
<% end %>
|
||||
</td>
|
||||
<td>
|
||||
<div style="position:relative;">
|
||||
<div class="hworkTip" style="display: none" id="work_click_<%= student_work.id %>">
|
||||
<em></em><span></span><font class="fontGrey2">点击查看详情</font></div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
|
@ -1,77 +1,86 @@
|
|||
<table class="hwork-table-wrap" id="homework_table">
|
||||
<tr class="b_grey hworkH30">
|
||||
<th class="hworkList30 hworkH30 pl5 pr5">序号</th>
|
||||
<th class="hworkList50"> </th>
|
||||
<% if @homework.homework_type != 3 %>
|
||||
<th class="<%= @homework.homework_type == 2 ? 'hworkList80 pl5 pr5 hide-text' : 'hworkList130 pl5 pr5 hide-text'%>" style="text-align:left;">作品名称</th>
|
||||
<th class="<%=@homework.anonymous_comment == 1 ? 'hworkList100' : 'hworkList60'%> pl5 pr5 hide-text">
|
||||
<%= link_to "姓名",@show_all ? student_work_index_path(:homework => @homework.id,:order => "lastname", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb" ,:remote => true%>
|
||||
<% if @show_all && @order == "lastname"%>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "lastname", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none" ,:style => "line-height:30px; vertical-align:middle;",:remote => true%>
|
||||
<% end%>
|
||||
</th>
|
||||
<th class="<%=@homework.anonymous_comment == 1 ? 'hworkList90' : 'hworkList80'%> pl5 pr5 hide-text">
|
||||
<%= link_to "学号",@show_all ? student_work_index_path(:homework => @homework.id,:order => "student_id", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb" ,:remote => true%>
|
||||
<% if @show_all && @order == "student_id"%>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "student_id", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none" ,:style => "line-height:30px; vertical-align:middle;",:remote => true%>
|
||||
<% end%>
|
||||
</th>
|
||||
<% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1 %>
|
||||
<th class="hworkList130 pl5 pr5" style="text-align:left;">作品名称</th>
|
||||
<th class="<%=@homework.anonymous_comment == 1 ? 'hworkList210' : 'hworkList160'%>">
|
||||
<span class="c_dark f14 fb">关联项目</span>
|
||||
<%# if @homework.homework_type == 1 %>
|
||||
<%#= render :partial => 'evaluation_un_common_title' %>
|
||||
<%# elsif @homework.homework_type == 2 %>
|
||||
<%#= render :partial => 'evaluation_un_pro_title' %>
|
||||
<%# elsif @homework.homework_type == 3 %>
|
||||
<%#= render :partial => 'evaluation_un_group_title' %>
|
||||
<%# else %>
|
||||
<tr class="b_grey hworkH30">
|
||||
<th class="hworkList40 hworkH30 pl5 pr5">序号</th>
|
||||
<th class="hworkList50"> </th>
|
||||
<% if @homework.homework_type != 3 %>
|
||||
<th class="<%= @homework.homework_type == 1 ? (@homework.anonymous_comment == 1 ? 'hworkList130' : 'hworkList100') : (@homework.anonymous_comment == 1 ? 'hworkList110' : 'hworkList60') %> pl5 pr5 hide-text">
|
||||
<%= link_to "姓名", @show_all ? student_work_index_path(:homework => @homework.id, :order => "lastname", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)", :class => "c_dark f14 fb", :remote => true %>
|
||||
<% if @show_all && @order == "lastname" %>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id, :order => "lastname", :sort => @score, :name => @name, :group => @group), :class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none", :style => "line-height:30px; vertical-align:middle;", :remote => true %>
|
||||
<% end %>
|
||||
</th>
|
||||
<th class="<%= @homework.homework_type == 1 ? (@homework.anonymous_comment == 1 ? 'hworkList130' : 'hworkList90') : (@homework.anonymous_comment == 1 ? 'hworkList100' : 'hworkList80') %> pl5 pr5 hide-text">
|
||||
<%= link_to "学号", @show_all ? student_work_index_path(:homework => @homework.id, :order => "student_id", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)", :class => "c_dark f14 fb", :remote => true %>
|
||||
<% if @show_all && @order == "student_id" %>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id, :order => "student_id", :sort => @score, :name => @name, :group => @group), :class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none", :style => "line-height:30px; vertical-align:middle;", :remote => true %>
|
||||
<% end %>
|
||||
</th>
|
||||
<% else %>
|
||||
<% if @homework.homework_detail_group.base_on_project == 1 %>
|
||||
<th class="hworkList130 pl5 pr5" style="text-align:left;">组长</th>
|
||||
<th class="<%= @homework.anonymous_comment == 1 ? 'hworkList140' : 'hworkList70' %>">
|
||||
<span class="c_dark f14 fb">关联项目</span>
|
||||
</th>
|
||||
<% elsif @homework.homework_detail_group.base_on_project == 0 %>
|
||||
<th class="<%= @homework.anonymous_comment == 1 ? 'hworkList270' : 'hworkList200' %> pl5 pr5" style="text-align:left;">组长</th>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<th class="<%= @homework.homework_type ==2 ? 'hworkList110' : 'hworkList130' %>">
|
||||
<%= link_to "状态", @show_all ? student_work_index_path(:homework => @homework.id, :order => "work_status", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)", :class => "c_dark f14 fb", :remote => true %>
|
||||
<% if @show_all && @order == "work_status" %>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id, :order => "work_status", :sort => @score, :name => @name, :group => @group), :class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none", :style => "line-height:30px; vertical-align:middle;", :remote => true %>
|
||||
<% end %>
|
||||
</th>
|
||||
<% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 0 %>
|
||||
<th class="<%=@homework.anonymous_comment == 1 ? 'hworkList340' : 'hworkList290' %> pl5 pr5" style="text-align:left;">作品名称</th>
|
||||
<% end %>
|
||||
<th class="hworkList130">
|
||||
<%= link_to "时间",@show_all ? student_work_index_path(:homework => @homework.id,:order => "created_at", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb" ,:remote => true%>
|
||||
<% if @show_all && @order == "created_at"%>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "created_at", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none",:style => "line-height:30px; vertical-align:middle;",:remote => true%>
|
||||
<% end%>
|
||||
</th>
|
||||
<th class="hworkList50">
|
||||
<%= link_to "教师",@show_all ? student_work_index_path(:homework => @homework.id,:order => "teacher_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb" ,:remote => true%>
|
||||
<% if @show_all && @order == "teacher_score"%>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "teacher_score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none" ,:style => "line-height:30px; vertical-align:middle;",:remote => true%>
|
||||
<% end%>
|
||||
</th>
|
||||
<th class="hworkList50">
|
||||
<%= link_to "教辅",@show_all ? student_work_index_path(:homework => @homework.id,:order => "teaching_asistant_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb",:remote => true%>
|
||||
<% if @show_all && @order == "teaching_asistant_score"%>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "teaching_asistant_score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none",:style => "line-height:30px; vertical-align:middle;",:remote => true%>
|
||||
<% end%>
|
||||
</th>
|
||||
<% if @homework.homework_type == 2%>
|
||||
<th class="hworkList50">
|
||||
<%= link_to "系统",@show_all ? student_work_index_path(:homework => @homework.id,:order => "system_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb",:remote => true%>
|
||||
<% if @show_all && @order == "system_score"%>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "system_score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none",:style => "line-height:30px; vertical-align:middle;",:remote => true%>
|
||||
<% end%>
|
||||
<th class="hworkList70">
|
||||
<%= link_to "教师", @show_all ? student_work_index_path(:homework => @homework.id, :order => "teacher_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)", :class => "c_dark f14 fb", :remote => true %>
|
||||
<% if @show_all && @order == "teacher_score" %>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id, :order => "teacher_score", :sort => @score, :name => @name, :group => @group), :class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none", :style => "line-height:30px; vertical-align:middle;", :remote => true %>
|
||||
<% end %>
|
||||
</th>
|
||||
<% end%>
|
||||
<% if @homework.anonymous_comment == 0%>
|
||||
<th class="hworkList50">
|
||||
<%= link_to "匿评",@show_all ? student_work_index_path(:homework => @homework.id,:order => "student_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb",:remote => true%>
|
||||
<% if @show_all && @order == "student_score"%>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "student_score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none",:style => "line-height:30px; vertical-align:middle;",:remote => true%>
|
||||
<% end%>
|
||||
<th class="hworkList70">
|
||||
<%= link_to "教辅", @show_all ? student_work_index_path(:homework => @homework.id, :order => "teaching_asistant_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)", :class => "c_dark f14 fb", :remote => true %>
|
||||
<% if @show_all && @order == "teaching_asistant_score" %>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id, :order => "teaching_asistant_score", :sort => @score, :name => @name, :group => @group), :class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none", :style => "line-height:30px; vertical-align:middle;", :remote => true %>
|
||||
<% end %>
|
||||
</th>
|
||||
<% end %>
|
||||
<th class="hworkList50">
|
||||
<%= link_to "成绩",@show_all ? student_work_index_path(:homework => @homework.id,:order => "score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb",:remote => true%>
|
||||
<% if @show_all && @order == "score"%>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none",:style => "line-height:30px; vertical-align:middle;",:remote => true%>
|
||||
<% end%>
|
||||
</th>
|
||||
</tr>
|
||||
<% @stundet_works.each_with_index do |student_work, i|%>
|
||||
<%= render :partial => "evaluation_un_work", :locals => {:student_work => student_work, :index => i}%>
|
||||
<% if @homework.homework_type == 2 %>
|
||||
<th class="hworkList70">
|
||||
<%= link_to "系统", @show_all ? student_work_index_path(:homework => @homework.id, :order => "system_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)", :class => "c_dark f14 fb", :remote => true %>
|
||||
<% if @show_all && @order == "system_score" %>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id, :order => "system_score", :sort => @score, :name => @name, :group => @group), :class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none", :style => "line-height:30px; vertical-align:middle;", :remote => true %>
|
||||
<% end %>
|
||||
</th>
|
||||
<% end %>
|
||||
<% if @homework.anonymous_comment == 0 %>
|
||||
<th class="hworkList70">
|
||||
<%= link_to "匿评", @show_all ? student_work_index_path(:homework => @homework.id, :order => "student_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)", :class => "c_dark f14 fb", :remote => true %>
|
||||
<% if @show_all && @order == "student_score" %>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id, :order => "student_score", :sort => @score, :name => @name, :group => @group), :class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none", :style => "line-height:30px; vertical-align:middle;", :remote => true %>
|
||||
<% end %>
|
||||
</th>
|
||||
<% end %>
|
||||
<th class="hworkList70">
|
||||
<%= link_to "成绩", @show_all ? student_work_index_path(:homework => @homework.id, :order => "score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)", :class => "c_dark f14 fb", :remote => true %>
|
||||
<% if @show_all && @order == "score" %>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id, :order => "score", :sort => @score, :name => @name, :group => @group), :class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none", :style => "line-height:30px; vertical-align:middle;", :remote => true %>
|
||||
<% end %>
|
||||
</th>
|
||||
</tr>
|
||||
<%# end %>
|
||||
<% @stundet_works.each_with_index do |student_work, i| %>
|
||||
<%= render :partial => "evaluation_un_work", :locals => {:student_work => student_work, :index => i} %>
|
||||
<tr>
|
||||
<td colspan="12">
|
||||
<div id="about_hwork_<%= student_work.id%>">
|
||||
<div id="about_hwork_<%= student_work.id %>">
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<% end%>
|
||||
<% end %>
|
||||
</table>
|
|
@ -1,71 +1,69 @@
|
|||
<!-- 匿评作品列表,显示某一个作品的信息 -->
|
||||
<%# if @homework.homework_type == 1 %>
|
||||
<%#= render :partial => 'evaluation_un_common_work', :locals => {:student_work => student_work, :index => index} %>
|
||||
<%# elsif @homework.homework_type == 2 %>
|
||||
<%#= render :partial => 'evaluation_un_pro_work', :locals => {:student_work => student_work, :index => index} %>
|
||||
<%# elsif @homework.homework_type == 3 %>
|
||||
<%#= render :partial => 'evaluation_un_group_work', :locals => {:student_work => student_work, :index => index} %>
|
||||
<%# else %>
|
||||
<tr class="hworkListRow" id="student_work_<%= student_work.id%>">
|
||||
<td class="none"><a name="<%= student_work.id%>"></a></td>
|
||||
<td class="hworkList30 pl5 pr5" id="work_num_<%=student_work.id %>"><%=index + 1 %></td>
|
||||
<td class="hworkList40 pl5 pr5" id="work_num_<%=student_work.id %>"><%=index + 1 %></td>
|
||||
<td class="hworkPortrait pr10 float-none">
|
||||
<%= link_to(image_tag(url_to_avatar(student_work.user),:width =>"40",:height => "40",:style => "display:block;"),user_activities_path(student_work.user)) %>
|
||||
</td>
|
||||
<% if @homework.homework_type != 3 %>
|
||||
<td class="hworkName float-none pr10 student_work_<%= student_work.id%> <%= @homework.homework_type == 2 ? '' : 'width130'%>" style="cursor: pointer;" onclick="show_student_work('<%= student_work_path(student_work)%>');">
|
||||
<% student_work_name = student_work.name.nil? || student_work.name.empty? ? student_work.user.show_name + '的作品' : student_work.name%>
|
||||
<div>
|
||||
<%= link_to student_work_name,"javascript:void(0)" ,:title => student_work_name, :class => "linkGrey f14 StudentName break_word #{@homework.homework_type == 2 ? '' : 'width165'}"%>
|
||||
</div>
|
||||
</td>
|
||||
<td class="<%=@homework.anonymous_comment == 1 ? 'hworkStName100' : 'hworkStName'%> pr10 float-none student_work_<%= student_work.id%>" title="<%= student_work.user.show_name%>" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor:pointer;">
|
||||
<td class="<%= @homework.homework_type == 1 ? (@homework.anonymous_comment == 1 ? 'hworkStName130' : 'hworkStName100') : (@homework.anonymous_comment == 1 ? 'hworkStName110' : 'hworkStName') %> pr10 float-none student_work_<%= student_work.id%>" title="<%= student_work.user.show_name%>" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor:pointer;">
|
||||
<%= student_work.user.show_name%>
|
||||
</td>
|
||||
<td class="<%=@homework.anonymous_comment == 1 ? 'hworkStID90' : 'hworkStID'%> pr10 float-none student_work_<%= student_work.id%>" title="<%= student_work.user.user_extensions.nil? ? "--" : student_work.user.user_extensions.student_id%>" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor:pointer;">
|
||||
<td class="<%= @homework.homework_type == 1 ? (@homework.anonymous_comment == 1 ? 'hworkStName130' : 'hworkStID90') : (@homework.anonymous_comment == 1 ? 'hworkStID100' : 'hworkStID') %> pr10 float-none student_work_<%= student_work.id%>" title="<%= student_work.user.user_extensions.nil? ? "--" : student_work.user.user_extensions.student_id%>" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor:pointer;">
|
||||
<%= student_work.user.user_extensions.nil? ? "--" : student_work.user.user_extensions.student_id%>
|
||||
</td>
|
||||
<% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1 %>
|
||||
<td class="hworkName float-none pr10 student_work_<%= student_work.id%> width130" style="cursor: pointer;" onclick="show_student_work('<%= student_work_path(student_work)%>');">
|
||||
<% student_work_name = student_work.name.nil? || student_work.name.empty? ? student_work.user.show_name + '的作品' : student_work.name%>
|
||||
<div>
|
||||
<%= link_to student_work_name,"javascript:void(0)" ,:title => student_work_name, :class => "linkGrey f14 StudentName break_word #{@homework.homework_type == 2 ? '' : 'width165'}"%>
|
||||
</div>
|
||||
</td>
|
||||
<% if student_work.project.is_public || User.current.member_of?(student_work.project) || User.current.admin? %>
|
||||
<td class="<%=@homework.anonymous_comment == 1 ? 'hworkPrName2' : 'hworkPrName'%> student_work_<%= student_work.id%>" title="项目名称">
|
||||
<%= link_to( student_work.project.name, project_path(student_work.project.id))%>
|
||||
</td>
|
||||
<% else %>
|
||||
<td class="hworkPrName student_work_<%= student_work.id%>" title="该项目是私有的">
|
||||
<%= student_work.project.name %>
|
||||
</td>
|
||||
<% end %>
|
||||
<% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 0 %>
|
||||
<td class="hworkName float-none pr10 student_work_<%= student_work.id%> <%=@homework.anonymous_comment == 1 ? 'width340' : 'width290' %>" style="cursor: pointer;" onclick="show_student_work('<%= student_work_path(student_work)%>');">
|
||||
<% student_work_name = student_work.name.nil? || student_work.name.empty? ? student_work.user.show_name + '的作品' : student_work.name%>
|
||||
<div>
|
||||
<%= link_to student_work_name,"javascript:void(0)" ,:title => student_work_name, :class => "linkGrey f14 StudentName break_word #{@homework.homework_type == 2 ? '' : 'width165'}"%>
|
||||
</div>
|
||||
</td>
|
||||
<% else %>
|
||||
<% if @homework.homework_detail_group.base_on_project == 1 %>
|
||||
<td class="hworkName float-none pr10 student_work_<%= student_work.id%> width130" style="cursor: pointer;" onclick="show_student_work('<%= student_work_path(student_work)%>');">
|
||||
<div>
|
||||
<%= link_to student_work.user.show_name,"javascript:void(0)" ,:title => student_work.user.show_name, :class => "StudentName break_word"%>
|
||||
</div>
|
||||
</td>
|
||||
<% if student_work.project.is_public || User.current.member_of?(student_work.project) || User.current.admin? %>
|
||||
<td class="<%=@homework.anonymous_comment == 1 ? 'hworkPrName2' : 'hworkPrName'%> student_work_<%= student_work.id%>" title="项目名称">
|
||||
<%= link_to( student_work.project.name, project_path(student_work.project.id))%>
|
||||
</td>
|
||||
<% else %>
|
||||
<td class="<%=@homework.anonymous_comment == 1 ? 'hworkPrName2' : 'hworkPrName'%> student_work_<%= student_work.id%>" title="该项目是私有的">
|
||||
<%= student_work.project.name %>
|
||||
</td>
|
||||
<% end %>
|
||||
<% elsif @homework.homework_detail_group.base_on_project == 0 %>
|
||||
<td class="hworkName float-none pr10 student_work_<%= student_work.id%> <%=@homework.anonymous_comment == 1 ? 'width280' : 'width210' %>" style="cursor: pointer;" onclick="show_student_work('<%= student_work_path(student_work)%>');">
|
||||
<div>
|
||||
<%= link_to student_work.user.show_name,"javascript:void(0)" ,:title => student_work.user.show_name, :class => "StudentName break_word #{@homework.homework_type == 2 ? '' : 'width165'}"%>
|
||||
</div>
|
||||
</td>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<td class="hworkList130 c_grey student_work_<%= student_work.id%>" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;">
|
||||
<% if student_work.created_at && @homework.end_time%>
|
||||
<%= Time.parse(format_time(student_work.created_at)).strftime("%m-%d %H:%M")%>
|
||||
<% if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(format_time(student_work.created_at)).strftime("%Y-%m-%d") %>
|
||||
<span class="c_red">[迟交]</span>
|
||||
<% end %>
|
||||
<td class="<%= @homework.homework_type ==2 ? 'hworkList110' : 'hworkList130' %> c_grey student_work_<%= student_work.id%>" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;">
|
||||
<% if student_work.work_status%>
|
||||
<%=get_status student_work.work_status %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td class="hworkList50 <%= score_color student_work.teacher_score%>">
|
||||
<td class="hworkList70 <%= score_color student_work.teacher_score%>">
|
||||
<%= student_work.teacher_score.nil? ? "--" : format("%.1f",student_work.teacher_score)%>
|
||||
</td>
|
||||
<td class="hworkList50 <%= score_color student_work.teaching_asistant_score%>">
|
||||
<td class="hworkList70 <%= score_color student_work.teaching_asistant_score%>">
|
||||
<%= student_work.teaching_asistant_score.nil? ? "--" : format("%.1f",student_work.teaching_asistant_score)%>
|
||||
</td>
|
||||
|
||||
<% if @homework.homework_type == 2%>
|
||||
<!-- 系统评分 -->
|
||||
<td class="hworkList50 <%= score_color student_work.system_score%>">
|
||||
<td class="hworkList70 <%= score_color student_work.system_score%>">
|
||||
<%= student_work.system_score.nil? ? "--" : format("%.1f",student_work.system_score)%>
|
||||
</td>
|
||||
<% end%>
|
||||
|
||||
<% if @homework.anonymous_comment == 0%>
|
||||
<td class="hworkList50 <%= score_color student_work.student_score%> student_score_info">
|
||||
<td class="hworkList70 <%= score_color student_work.student_score%> student_score_info">
|
||||
<% if student_work.student_score.nil? %>
|
||||
<span title="该作品未被匿评">未参与</span>
|
||||
<% else %>
|
||||
|
@ -90,7 +88,7 @@
|
|||
<% else %>
|
||||
<% score = student_work.respond_to?("score") ? student_work.score : (student_work.final_score || 0) - student_work.absence_penalty - student_work.late_penalty%>
|
||||
<% end %>
|
||||
<td class="hworkList50 <%= score_color score%> student_final_scor_info">
|
||||
<td class="hworkList70 <%= score_color score%> student_final_scor_info">
|
||||
<%= score.nil? ? "--" : format("%.1f",score<0 ? 0 : score)%>
|
||||
<% unless score.nil?%>
|
||||
<div class="infoNi none width180">
|
||||
|
@ -111,6 +109,7 @@
|
|||
</td>
|
||||
<td><div style="position:relative;"><div class="hworkTip" style="display: none" id="work_click_<%= student_work.id%>"><em></em><span></span><font class="fontGrey2">点击查看详情</font></div></div></td>
|
||||
</tr>
|
||||
<%# end %>
|
||||
<script type="text/javascript">
|
||||
$(".student_work_<%= student_work.id%>").mouseenter(function(){
|
||||
if($("#about_hwork_<%= student_work.id%>").html().trim() == "") {
|
||||
|
|
|
@ -9,28 +9,21 @@
|
|||
<% end %>
|
||||
|
||||
<% if is_my_work%>
|
||||
<td class="hworkList30 pl5 pr5" id="work_num_<%=student_work.id %>"><%=index + 1 %></td>
|
||||
<td class="hworkList40 pl5 pr5" id="work_num_<%=student_work.id %>"><%=index + 1 %></td>
|
||||
<td class="hworkPortrait pr10 float-none">
|
||||
<%= image_tag(url_to_avatar(student_work.user),width:"40", height: "40", style: "display:block;") %>
|
||||
</td>
|
||||
<% if @homework.homework_type != 3 %>
|
||||
<td class="hworkName pr10 w250 float-none student_work_<%= student_work.id%>">
|
||||
<div>
|
||||
<% student_work_name = student_work.name.nil? || student_work.name.empty? ? student_work.user.show_name + '的作品' : student_work.name%>
|
||||
<%= link_to student_work_name, student_work_path(student_work),:remote => true,:title => student_work_name, :class => "linkGrey f14 StudentName break_word w250"%>
|
||||
</div>
|
||||
</td>
|
||||
<td class="hworkStName float-none w80 student_work_<%= student_work.id%>" title="<%= student_work.user.show_name%>" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;">
|
||||
<td class="hworkStName float-none <%= @homework.homework_type == 2 ? 'w180' : 'w190' %> student_work_<%= student_work.id%>" title="<%= student_work.user.show_name%>" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;">
|
||||
<%= student_work.user.show_name%>
|
||||
</td>
|
||||
<td class="hworkStID float-none student_work_<%= student_work.id%>" title="<%= student_work.user.user_extensions.nil? ? "--" : student_work.user.user_extensions.student_id%>" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;">
|
||||
<span class="hidden fl" style="width:80px;"><%= student_work.user.user_extensions.nil? ? "--" : student_work.user.user_extensions.student_id%></span>
|
||||
<td class="hworkStID <%= @homework.homework_type == 2 ? 'w180' : 'w190' %> float-none student_work_<%= student_work.id%>" title="<%= student_work.user.user_extensions.nil? ? "--" : student_work.user.user_extensions.student_id%>" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;">
|
||||
<span class="hidden"><%= student_work.user.user_extensions.nil? ? "--" : student_work.user.user_extensions.student_id%></span>
|
||||
</td>
|
||||
<% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1 %>
|
||||
<td class="hworkName pr10 w250 float-none student_work_<%= student_work.id%>">
|
||||
<td class="hworkName pr10 w220 float-none student_work_<%= student_work.id%>" onclick="show_student_work('<%= student_work_path(student_work)%>');">
|
||||
<div>
|
||||
<% student_work_name = student_work.name.nil? || student_work.name.empty? ? student_work.user.show_name + '的作品' : student_work.name%>
|
||||
<%= link_to student_work_name, student_work_path(student_work),:remote => true,:title => student_work_name, :class => "linkGrey f14 StudentName break_word w250"%>
|
||||
<%= link_to student_work.user.show_name,"javascript:void(0)" ,:title => student_work.user.show_name, :class => "linkGrey f14 StudentName break_word"%>
|
||||
</div>
|
||||
</td>
|
||||
<% if student_work.project.is_public || User.current.member_of?(student_work.project) || User.current.admin? %>
|
||||
|
@ -43,53 +36,53 @@
|
|||
</td>
|
||||
<% end %>
|
||||
<% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 0 %>
|
||||
<td class="hworkName pr10 w410 float-none student_work_<%= student_work.id%>">
|
||||
<td class="hworkName pr10 w380 float-none student_work_<%= student_work.id%>" onclick="show_student_work('<%= student_work_path(student_work)%>');">
|
||||
<div>
|
||||
<% student_work_name = student_work.name.nil? || student_work.name.empty? ? student_work.user.show_name + '的作品' : student_work.name%>
|
||||
<%= link_to student_work_name, student_work_path(student_work),:remote => true,:title => student_work_name, :class => "linkGrey f14 StudentName break_word w250"%>
|
||||
<%= link_to student_work.user.show_name,"javascript:void(0)" ,:title => student_work.user.show_name, :class => "linkGrey f14 StudentName break_word"%>
|
||||
</div>
|
||||
</td>
|
||||
<% end %>
|
||||
<% else%>
|
||||
<td class="hworkList30 pl5 pr5" id="work_num_<%=student_work.id %>"><%=index + 1 %></td>
|
||||
<td class="hworkList40 pl5 pr5" id="work_num_<%=student_work.id %>"><%=index + 1 %></td>
|
||||
<td class="hworkPortrait float-none pr10">
|
||||
<%= image_tag(url_to_avatar(""),width:"40", height: "40", style: "display:block;") %>
|
||||
</td>
|
||||
<td class="hworkName float-none pr10 w250 student_work_<%= student_work.id%>">
|
||||
<div>
|
||||
<%= link_to "匿名的作品", student_work_path(student_work),:remote => true,:title => student_work_name, :class => "linkGrey f14 StudentName break_word w250"%>
|
||||
</div>
|
||||
</td>
|
||||
<% if @homework.homework_type != 3 %>
|
||||
<td class="hworkStName float-none w80" title="姓名" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;">
|
||||
<td class="hworkStName float-none <%= @homework.homework_type == 2 ? 'w180' : 'w190' %>" title="姓名" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;">
|
||||
匿名
|
||||
</td>
|
||||
<td class="hworkStID float-none" title="学号">
|
||||
<td class="hworkStID <%= @homework.homework_type == 2 ? 'w180' : 'w190' %> float-none" title="学号">
|
||||
--
|
||||
</td>
|
||||
<% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1 %>
|
||||
<td class="hworkPrName mr10 float-none" title="项目名称" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;">
|
||||
<td class="hworkName pr10 w220 float-none student_work_<%= student_work.id%>">
|
||||
<div style="text-align: left">匿名</div>
|
||||
</td>
|
||||
<td class="hworkPrName float-none mr10 student_work_<%= student_work.id%>" title="">
|
||||
匿名
|
||||
</td>
|
||||
<% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 0 %>
|
||||
<td class="hworkPrName mr10 float-none" title="" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer; text-align: left;">
|
||||
匿名
|
||||
</td>
|
||||
<% end %>
|
||||
<% end%>
|
||||
<td class="hworkList130 pl10 c_grey student_work_<%= student_work.id%>" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;">
|
||||
<%= Time.parse(format_time(student_work.created_at)).strftime("%m-%d %H:%M")%>
|
||||
<% if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(format_time(student_work.created_at)).strftime("%Y-%m-%d") %>
|
||||
<span class="c_red">[迟交]</span>
|
||||
<% if student_work.work_status%>
|
||||
<%=get_status student_work.work_status %>
|
||||
<% end %>
|
||||
</td>
|
||||
|
||||
<!-- 成绩 -->
|
||||
<% if @homework.homework_type == 2%>
|
||||
<!-- 系统评分 -->
|
||||
<td class="hworkList50 <%= score_color student_work.system_score%>">
|
||||
<td class="hworkList70 <%= score_color student_work.system_score%>">
|
||||
<%= student_work.system_score.nil? ? "--" : format("%.1f",student_work.system_score)%>
|
||||
</td>
|
||||
<% end%>
|
||||
|
||||
<% my_score = student_work_score(student_work,User.current) %>
|
||||
<td class="hworkList50 <%= my_score.nil? ? 'c_grey' : score_color(my_score.score)%> mr10 ml10">
|
||||
<td class="hworkList70 <%= my_score.nil? ? 'c_grey' : score_color(my_score.score)%> mr10 ml10">
|
||||
<%= my_score.nil? ? "--" : format("%.1f",my_score.score)%>
|
||||
</td>
|
||||
<td><div style="position:relative;"><div class="hworkTip" style="display: none" id="work_click_<%= student_work.id%>"><em></em><span></span><font class="fontGrey2">点击查看详情</font></div></div></td>
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
|
||||
<li >
|
||||
<span class="tit_fb ">编程代码:</span>
|
||||
<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 class="showHworkP break_word"><pre id="work-src_<%= work.id%>" style="display: none;"><%= work.description ? work.description : "该作品尚未提交相关内容。"%></pre><div class="fontGrey2 font_cus" id="work-code_<%= work.id%>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<%= link_to "", {:controller => 'syllabuses', :action => 'syllabus_courselist', :id =>@syllabus, :type => @type, :sort => @c_sort, :order => 2 }, :class => "#{@c_sort.to_i == 1 ? 'sortupbtn' : 'sortdownbtn'} ", :remote => true %>
|
||||
<% end %>
|
||||
</div>
|
||||
<p class="fr grayTxt">创建老师:<%=@syllabus.user.show_name %><span class="mr10 "></span> 创建时间:<%=format_date @syllabus.created_at %></p>
|
||||
<!-- <p class="fr grayTxt">创建老师:<%#=@syllabus.user.show_name %><span class="mr10 "></span> 创建时间:<%#=format_date @syllabus.created_at %></p> -->
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
||||
|
@ -23,7 +23,7 @@
|
|||
<li>
|
||||
<span class="item_list fl"></span>
|
||||
<%= link_to course.name+"("+current_time_and_term_short(course)+")", course_path(course.id,:host=>Setting.host_course), :class => "list-title fl #{course_endTime_timeout?(course) ? 'c_dark_grey' : ''}",
|
||||
:style => 'color:#000',:id => "show_course_#{course.id}", :target => '_blank', :title => (course.is_public? ? "公开课程:":"私有课程:")+course.name+"("+current_time_and_term(course)+")"%>
|
||||
:style => 'color:#000',:id => "show_course_#{course.id}", :target => '_blank', :title => (course.is_public? ? "公开班级:":"私有班级:")+course.name+"("+current_time_and_term(course)+")"%>
|
||||
<% teacher = User.where("id=?",course.tea_id).first%>
|
||||
<span class="fr grayTxt">
|
||||
<%='主讲老师:'+(teacher.try(:realname) != " " ? teacher.lastname + teacher.firstname : teacher.try(:login)) %>
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
$("#syllabus_title_show").html("<%= escape_javascript render :partial => 'layouts/syllabus_title', :locals => {:syllabus => @syllabus} %>");
|
||||
$("#syllabus_title_show").show();
|
||||
$("#syllabus_title_edit").hide();
|
|
@ -9,16 +9,12 @@
|
|||
<div class="RightBanner" >
|
||||
<p >课程信息</p>
|
||||
</div>
|
||||
<% if @syllabus.des_status == 1 && @syllabus.courses.empty? %>
|
||||
<% if @syllabus.des_status == 1 && @syllabus.courses.where("is_delete = 0").empty? %>
|
||||
<div class="syllabusbox_tishi">
|
||||
<% if User.current == @syllabus.user %>
|
||||
<p >您建立的课程还未创建班级,请
|
||||
<%= link_to "新建班级", new_course_path(:host=> Setting.host_course, :syllabus_id => @syllabus.id), :class => "syllabusbox_a_blue", :target => '_blank'%>
|
||||
</p>
|
||||
<% elsif User.current.user_extensions && User.current.user_extensions.identity == 0 && User.current.allowed_to?(:add_course, nil, :global => true)%>
|
||||
<p >本课程下还未创建班级,请
|
||||
<%= link_to "新建班级", new_course_path(:host=> Setting.host_course, :syllabus_id => @syllabus.id), :class => "syllabusbox_a_blue", :target => '_blank'%>
|
||||
</p>
|
||||
<% else %>
|
||||
<p >本课程下还未创建班级,敬请期待。
|
||||
</p>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<% if users_results.try(:size).to_i > 0 %>
|
||||
<hr />
|
||||
<% users_results.each do |user| %>
|
||||
<p class="font_description2">
|
||||
<p class="font_description2" style="padding: 10px 5px">
|
||||
<strong><%= l(:label_tags_user_name) %><%= link_to ("#{user.name}"),
|
||||
:controller => "users",:action => "show",:id => user.id%></strong>
|
||||
<br />
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
<% content_for :content do %>
|
||||
<div>
|
||||
<h3><strong><%= l(:label_tags_search_result) %></strong></h3>
|
||||
<div align="right">
|
||||
<div class="mb5">
|
||||
<%= l(:label_tags_numbers) %>:
|
||||
<%= l(:label_issue_plural) %>(<%= @issues_tags_num %>) |
|
||||
<%= l(:label_project_plural) %>(<%= @projects_tags_num %>) |
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
<div class="orig_user fl">
|
||||
<%= link_to image_tag(url_to_avatar(comment.user), :width => "33", :height => "33"), user_path(comment.user_id), :alt => "用户头像" %>
|
||||
<%= link_to image_tag(url_to_avatar(comment.creator_user), :width => "33", :height => "33"), user_path(comment.creator_user.id), :alt => "用户头像" %>
|
||||
</div>
|
||||
<div class="orig_right fl">
|
||||
<%= link_to comment.user.show_name, user_path(comment.user_id), :class => "content-username" %>
|
||||
<%= link_to comment.creator_user.show_name, user_path(comment.creator_user.id), :class => "content-username" %>
|
||||
<span class="orig_area"><%= time_from_now(comment.created_on) %></span>
|
||||
<div class="orig_content "><%= comment.notes.html_safe %></div>
|
||||
<div class="orig_content "><%= comment.content_detail.html_safe %></div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
|
@ -46,12 +46,8 @@
|
|||
发帖人: <%=(u.try(:realname) != " " ? u.lastname + u.firstname : u.try(:login)) %>
|
||||
</span>
|
||||
<span class="grayTxt">更新:<%= format_time(activity.children.any? ? activity.children.last[:created_on] : activity[:created_on] ) %></span>
|
||||
<% count=0 %>
|
||||
<% if activity.parent %>
|
||||
<% count=activity.parent.children.count%>
|
||||
<% else %>
|
||||
<% count=activity.children.count%>
|
||||
<% end %>
|
||||
<% all_comments = []%>
|
||||
<% count=get_all_children(all_comments, activity).count %>
|
||||
<p class="list-info fr grayTxt"><span><%= count>0 ? "#{count}" : "0" %></span><span>回复</span><span>|</span><span><%= get_praise_num(activity) > 0 ? "#{get_praise_num(activity)}" : "0" %></span><span>赞</span></p>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
|
|
@ -69,7 +69,7 @@
|
|||
<%= user_for_homework_common activity,is_teacher %>
|
||||
</div>
|
||||
<% work = cur_user_works_for_homework activity %>
|
||||
<% if activity.end_time < Date.today && !is_teacher && !work.nil? %>
|
||||
<% if activity.end_time < Date.today && !is_teacher && !work.nil? && work.user == User.current %>
|
||||
<div class="homepagePostSubmit">
|
||||
<%=link_to "追加附件", student_work_index_url_in_org(activity.id, 1), :class => 'c_blue', :title => "可追加作品修订附件" %>
|
||||
</div>
|
||||
|
@ -134,8 +134,8 @@
|
|||
<% end %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<% if activity.student_works.count != 0 %>
|
||||
<% sw = activity.student_works.reorder("created_at desc").first %>
|
||||
<% if activity.student_works.has_committed.count != 0 %>
|
||||
<% sw = activity.student_works.has_committed.reorder("created_at desc").first %>
|
||||
<div class="mt10 homepagePostDeadline mb10">
|
||||
# <%=time_from_now sw.created_at %><%= link_to sw.user.show_name, user_activities_path(sw.user_id), :class => "newsBlue ml5 mr5"%>提交了作品
|
||||
</div>
|
||||
|
@ -156,9 +156,9 @@
|
|||
<div>
|
||||
<% if activity.homework_type != 2 %>
|
||||
<% ids = student_work_scores.empty? ? "(-1)" : '('+student_work_scores.map{|sw|sw.student_work_id}.join(',')+')' %>
|
||||
<% student_works = activity.student_works.select("student_works.*,student_works.work_score as score").where("student_works.id in #{ids}").order("score desc") %>
|
||||
<% student_works = activity.student_works.has_committed.select("student_works.*,student_works.work_score as score").where("student_works.id in #{ids}").order("score desc") %>
|
||||
<% else %>
|
||||
<% student_works = activity.student_works.select("student_works.*,student_works.work_score as score").order("score desc") %>
|
||||
<% student_works = activity.student_works.has_committed.select("student_works.*,student_works.work_score as score").order("score desc") %>
|
||||
<% end %>
|
||||
<% student_works.includes(:user).each_with_index do |sw, i| %>
|
||||
<div class="fl mr10 w100" style="text-align:center;">
|
||||
|
@ -195,8 +195,13 @@
|
|||
<% sort_projects = project_sort_update projects %>
|
||||
<div class="mt10 relatePWrap" id="relatePWrap_<%=user_activity_id %>">
|
||||
<div class="mr5 fontGrey2">
|
||||
<% first_pro = project_sort_first(projects).first %>
|
||||
# <%=time_from_now first_pro.updated_at %><%= link_to User.find(first_pro.user_id).show_name, user_activities_path(first_pro.user_id), :class => "newsBlue ml5 mr5"%>更新了项目,最近更新:
|
||||
<%# first_pro = sort_projects.first %>
|
||||
<% first_pro = Project.find sort_projects.first.project_id %>
|
||||
<% commit_time = first_pro.project_score.commit_time %>
|
||||
<% one_time = first_pro.updated_on %>
|
||||
<% one_forge_time=ForgeActivity.where("project_id=?",first_pro.id).last.updated_at if ForgeActivity.where("project_id=?",first_pro.id).last %>
|
||||
<% one_time= one_time > one_forge_time ? one_time : one_forge_time %>
|
||||
# <%=time_from_now !commit_time.nil? && format_time(commit_time) > format_time(one_time) ? commit_time : one_time %><%= link_to User.find(first_pro.user_id).show_name, user_activities_path(first_pro.user_id), :class => "newsBlue ml5 mr5"%>更新了项目,最近更新:
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<% sort_projects.each_with_index do |pro, i| %>
|
||||
|
@ -219,7 +224,8 @@
|
|||
<% end %>
|
||||
<% com_time = project.project_score.commit_time %>
|
||||
<% time=project.updated_on %>
|
||||
<% time=ForgeActivity.where("project_id=?",project.id).last.updated_at if ForgeActivity.where("project_id=?",project.id).last %>
|
||||
<% forge_time=ForgeActivity.where("project_id=?",project.id).last.updated_at if ForgeActivity.where("project_id=?",project.id).last %>
|
||||
<% time= time > forge_time ? time : forge_time %>
|
||||
<p class="mh18"><span class="captainName" title="<%=(User.find project.user_id).show_name %>"><%=(User.find project.user_id).show_name %></span><span style="vertical-align: top;">(组长)</span></p>
|
||||
<p class="mh18"><%=time_from_now !com_time.nil? && format_time(com_time) > format_time(time) ? com_time : time %> <%= project.project_score.changeset_num %>提交</p>
|
||||
<div class="relatePInfo" id="relatePInfo_<%=project.id %>_<%=activity.id %>">
|
||||
|
|
|
@ -78,20 +78,18 @@
|
|||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% count=0 %>
|
||||
<% if activity.parent %>
|
||||
<% count=activity.parent.children.count%>
|
||||
<% else %>
|
||||
<% count=activity.children.count%>
|
||||
<% end %>
|
||||
<% all_comments = []%>
|
||||
<% count=get_all_children(all_comments, activity).count %>
|
||||
<%# allow_delete = (activity.user == User.current || User.current.admin? || User.current.allowed_to?(:as_teacher,activity.course)) %>
|
||||
<%# count = fetch_user_leaveWord_reply(activity).count %>
|
||||
<div class="homepagePostReply">
|
||||
<%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id} %>
|
||||
<%= render :partial => 'users/message_reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id,:is_course => is_course,:is_board =>is_board} %>
|
||||
|
||||
<% activity= activity.parent ? activity.parent : activity%>
|
||||
<% comments = activity.children.reorder("created_on desc").limit(3) %>
|
||||
<% if count > 0 %>
|
||||
<% all_comments = []%>
|
||||
<% comments = get_all_children(all_comments, activity)[0..2] %>
|
||||
<% if count > 0 %>
|
||||
<div class="" id="reply_div_<%= user_activity_id %>">
|
||||
<%= render :partial => 'users/all_replies', :locals => {:comments => comments}%>
|
||||
<%= render :partial => 'users/message_replies', :locals => {:comments => comments, :user_activity_id => user_activity_id, :type => 'Message', :activity_id =>activity.id, :is_course => is_course, :is_board =>is_board}%>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
<% parents_rely = [] %>
|
||||
<% parents_rely = get_reply_parents_no_root parents_rely, comment %>
|
||||
<% length = parents_rely.length %>
|
||||
<div id="comment_reply_<%=comment.id %>">
|
||||
<% if length <= 3 %>
|
||||
<%=render :partial => 'users/journal_comment_reply', :locals => {:comment => comment.parent} %>
|
||||
<% else %>
|
||||
<div class="orig_cont clearfix">
|
||||
<div class="orig_cont clearfix">
|
||||
<div>
|
||||
<%=render :partial => 'users/journal_comment_reply', :locals => {:comment => parents_rely[length - 1]} %>
|
||||
</div>
|
||||
<%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[length - 2]} %>
|
||||
</div>
|
||||
<div class="orig_cont_hide clearfix">
|
||||
<span class="orig_icon" >↓ </span>
|
||||
<span class="orig_icon" style="display:none;" > ↑</span>
|
||||
<%= link_to '点击展开隐藏楼层', show_all_replies_users_path(:comment => comment, :type => comment.class),:remote=>true %>
|
||||
</div>
|
||||
<%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[0]} %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
|
@ -0,0 +1,61 @@
|
|||
<ul>
|
||||
<% comments.each do |comment| %>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
showNormalImage('reply_content_<%= comment.id %>');
|
||||
autoUrl('reply_content_<%= comment.id %>');
|
||||
});
|
||||
</script>
|
||||
<li class="homepagePostReplyContainer" nhname="reply_rec">
|
||||
<div class="homepagePostReplyPortrait">
|
||||
<%= link_to image_tag(url_to_avatar(comment.creator_user), :width => 33, :height => 33, :alt => "用户头像"), user_url_in_org(comment.creator_user.id) %>
|
||||
</div>
|
||||
<div class="homepagePostReplyDes">
|
||||
<div class="homepagePostReplyPublisher">
|
||||
<%= link_to comment.creator_user.show_name, user_url_in_org(comment.creator_user.id), :class => "newsBlue mr10 f14" %>
|
||||
<%= time_from_now(comment.created_on) %>
|
||||
</div>
|
||||
<% if !comment.parent.nil? && !comment.parent.parent.nil? %>
|
||||
<%= render :partial => 'users/message_contents', :locals => {:comment => comment}%>
|
||||
<% end %>
|
||||
<% if !comment.content_detail.blank? %>
|
||||
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= comment.id %>">
|
||||
<%= comment.content_detail.html_safe %>
|
||||
</div>
|
||||
<div class="orig_reply mb10 mt-10">
|
||||
<div class="reply">
|
||||
<span class="reply-right">
|
||||
<span id="reply_praise_count_<%=comment.id %>">
|
||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
|
||||
</span>
|
||||
<span style="position: relative" class="fr mr20">
|
||||
<%= link_to(
|
||||
l(:button_reply),
|
||||
{:controller => 'users' ,:action => 'reply_to', :reply_id => comment.id, :type => type, :user_activity_id => user_activity_id, :activity_id => activity_id, :is_course => is_course, :is_board => is_board},
|
||||
:remote => true,
|
||||
:method => 'get',
|
||||
:title => l(:button_reply)) %>
|
||||
<span id="reply_iconup_<%=comment.id %>" class="reply_iconup02" style="display: none"> ︿</span>
|
||||
</span>
|
||||
<% if comment.course_destroyable_by?(User.current) %>
|
||||
<%= link_to(
|
||||
l(:button_delete),
|
||||
delete_board_message_path(comment,:board_id =>comment.board.id, :user_activity_id => user_activity_id, :activity_id => activity_id, :is_course => is_course, :is_board => is_board),
|
||||
:method => :post,
|
||||
:remote => true,
|
||||
:class => 'fr mr20',
|
||||
:data => {:confirm => l(:text_are_you_sure)},
|
||||
:title => l(:button_delete)
|
||||
) %>
|
||||
<% end %>
|
||||
</span>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
<p id="reply_message_<%= comment.id%>"></p>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
|
@ -0,0 +1,18 @@
|
|||
<div class="homepagePostReplyBanner">
|
||||
<div class="homepagePostReplyBannerCount">
|
||||
<span>回复</span>
|
||||
<span class="reply_iconup" > ︿</span>
|
||||
<sapn class="mr15"><%= count>0 ? "(#{count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
||||
<span id="praise_count_<%=user_activity_id %>">
|
||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
|
||||
</span>
|
||||
</div>
|
||||
<div class="homepagePostReplyBannerTime"><%#= format_date(activity.updated_on) %></div>
|
||||
<%if count>3 %>
|
||||
<div class="homepagePostReplyBannerMore">
|
||||
<a id="reply_btn_<%=user_activity_id%>" onclick="expand_message_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>',<%= activity.id %>,'<%=activity.class %>',<%=user_activity_id %>,<%=is_course %>,<%=is_board %>)" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >
|
||||
展开更多
|
||||
</a>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
|
@ -46,12 +46,8 @@
|
|||
发帖人:<%=(u.try(:realname) != " " ? u.lastname + u.firstname : u.try(:login)) %>
|
||||
</span>
|
||||
<span class="grayTxt">更新:<%= format_time(activity.children.any? ? activity.children.last[:created_on] : activity[:created_on] ) %></span>
|
||||
<% count=0 %>
|
||||
<% if activity.parent %>
|
||||
<% count=activity.parent.children.count%>
|
||||
<% else %>
|
||||
<% count=activity.children.count%>
|
||||
<% end %>
|
||||
<% all_comments = []%>
|
||||
<% count=get_all_children(all_comments, activity).count %>
|
||||
<p class="list-info fr grayTxt"><span><%= count>0 ? "#{count}" : "0" %></span><span>回复</span><span>|</span><span><%= get_praise_num(activity) > 0 ? "#{get_praise_num(activity)}" : "0" %></span><span>赞</span></p>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
|
|
@ -77,20 +77,18 @@
|
|||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% count = 0 %>
|
||||
<% if activity.parent %>
|
||||
<% count=activity.parent.children.count%>
|
||||
<% else %>
|
||||
<% count=activity.children.count%>
|
||||
<% end %>
|
||||
<% all_comments = []%>
|
||||
<% count=get_all_children(all_comments, activity).count %>
|
||||
<%# allow_delete = (activity.user == User.current || User.current.admin? || User.current.allowed_to?(:as_teacher,activity.course)) %>
|
||||
<%# count = fetch_user_leaveWord_reply(activity).count %>
|
||||
<div class="homepagePostReply">
|
||||
<%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id} %>
|
||||
<%= render :partial => 'users/message_reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id,:is_course => is_course,:is_board =>is_board} %>
|
||||
|
||||
<% activity= activity.parent_id.nil? ? activity : activity.parent %>
|
||||
<% comments = activity.children.reorder("created_on desc").limit(3) %>
|
||||
<% all_comments = []%>
|
||||
<% comments = get_all_children(all_comments, activity)[0..2] %>
|
||||
<% if count > 0 %>
|
||||
<div class="" id="reply_div_<%= user_activity_id %>">
|
||||
<%= render :partial => 'users/all_replies', :locals => {:comments => comments}%>
|
||||
<%= render :partial => 'users/message_replies', :locals => {:comments => comments, :user_activity_id => user_activity_id, :type => 'Message', :activity_id =>activity.id, :is_course => is_course, :is_board =>is_board}%>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
<p nhname='contentmsg_<%= reply.id%>'></p>
|
||||
<% end%>
|
||||
<% elsif @type == 'JournalsForMessage' %>
|
||||
<%= form_for('new_form',:url => {:controller => 'words', :action => 'create_reply', :id => reply.id}, :method => "post", :remote => true) do |f|%>
|
||||
<%= form_for('new_form',:url => {:controller => 'words', :action => 'create_reply', :id => reply.id}, :method => "post", :remote => true) do |f|%>
|
||||
<%= hidden_field_tag 'reference_id', params[:reference_id], :value => reply.id %>
|
||||
<%= hidden_field_tag 'reference_user_id', params[:reference_user_id], :value => reply.user.id %>
|
||||
<%= hidden_field_tag 'reference_message_id', params[:reference_message_id], :value => reply.id %>
|
||||
|
@ -28,6 +28,22 @@
|
|||
<a id="new_message_submit_btn_<%= reply.id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
|
||||
<div class="cl"></div>
|
||||
<% end%>
|
||||
<% elsif @type == 'Message' %>
|
||||
<%= form_for('new_form',:url => {:controller => 'messages', :action => 'reply', :id => reply.id, :board_id => reply.board.id}, :method => "post", :remote => true) do |f|%>
|
||||
<%= hidden_field_tag 'is_course', params[:is_course], :value => @is_course %>
|
||||
<%= hidden_field_tag 'is_board', params[:is_board], :value => @is_board %>
|
||||
<%= hidden_field_tag 'parent_id', params[:parent_id], :value => reply.id %>
|
||||
<%= hidden_field_tag 'reply_id', params[:reply_id], :value => reply.author.id %>
|
||||
<%= hidden_field_tag 'activity_id',params[:activity_id],:value =>@activity_id %>
|
||||
<%= hidden_field_tag 'user_activity_id',params[:user_activity_id],:value =>@user_activity_id %>
|
||||
<!--<input type="hidden" name="quote[quote]" id="quote_quote">
|
||||
<input type="hidden" name="reply[subject]" id="reply_subject">-->
|
||||
<div nhname='toolbar_container_<%= reply.id%>'></div>
|
||||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= reply.id%>' name="content"></textarea>
|
||||
<a id="new_message_submit_btn_<%= reply.id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
|
||||
<div class="cl"></div>
|
||||
<p nhname='contentmsg_<%= reply.id%>'></p>
|
||||
<% end%>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
|
|
@ -93,7 +93,9 @@
|
|||
<%# cache (act) do %>
|
||||
<% case user_activity.act_type.to_s %>
|
||||
<% when 'BlogComment' %>
|
||||
<%= render :partial => 'user_blog', :locals => {:activity => act,:user_activity_id =>user_activity.id} %>
|
||||
<% if !(act.blog.homepage_id and act.id == act.blog.homepage_id) %>
|
||||
<%= render :partial => 'user_blog', :locals => {:activity => act,:user_activity_id =>user_activity.id} %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<%# end %>
|
||||
<% end %>
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
<li>
|
||||
<span class="item_list fl"></span>
|
||||
<%= link_to course.name+"("+current_time_and_term_short(course)+")", course_path(course.id,:host=>Setting.host_course), :class => "list-title fl #{course_endTime_timeout?(course) ? 'c_dark_grey' : ''}",
|
||||
:style => 'color:#000',:id => "show_course_#{course.id}", :target => '_blank', :title => (course.is_public? ? "公开课程:":"私有课程:")+course.name+"("+current_time_and_term(course)+")"%>
|
||||
:style => 'color:#000',:id => "show_course_#{course.id}", :target => '_blank', :title => (course.is_public? ? "公开班级:":"私有班级:")+course.name+"("+current_time_and_term(course)+")"%>
|
||||
<% teacher = User.where("id=?",course.tea_id).first%>
|
||||
<span class="fr grayTxt">
|
||||
<%='主讲老师:'+(teacher.try(:realname) != " " ? teacher.lastname + teacher.firstname : teacher.try(:login)) %>
|
||||
|
|
|
@ -76,7 +76,7 @@
|
|||
<%= user_for_homework_common homework_common,is_teacher %>
|
||||
</div>
|
||||
<% work = cur_user_works_for_homework homework_common %>
|
||||
<% if !is_teacher && !work.nil? && homework_common.end_time < Date.today %>
|
||||
<% if !is_teacher && !work.nil? && homework_common.end_time < Date.today && work.user == User.current %>
|
||||
<div class="homepagePostSubmit">
|
||||
<%=link_to "追加附件", student_work_index_url_in_org(homework_common.id, 1), :class => 'c_blue', :title => "可追加作品修订附件" %>
|
||||
</div>
|
||||
|
@ -145,8 +145,8 @@
|
|||
<% end %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<% if homework_common.student_works.count != 0 %>
|
||||
<% sw = homework_common.student_works.reorder("created_at desc").first %>
|
||||
<% if homework_common.student_works.has_committed.count != 0 %>
|
||||
<% sw = homework_common.student_works.has_committed.reorder("created_at desc").first %>
|
||||
<div class="mt10 homepagePostDeadline mb10">
|
||||
# <%=time_from_now sw.created_at %><%= link_to sw.user.show_name, user_activities_path(sw.user_id), :class => "newsBlue ml5 mr5"%>提交了作品
|
||||
</div>
|
||||
|
@ -167,9 +167,9 @@
|
|||
<div>
|
||||
<% if homework_common.homework_type != 2 %>
|
||||
<% ids = student_work_scores.empty? ? "(-1)" : '('+student_work_scores.map{|sw|sw.student_work_id}.join(',')+')' %>
|
||||
<% student_works = homework_common.student_works.select("student_works.*,student_works.work_score as score").where("student_works.id in #{ids}").order("score desc") %>
|
||||
<% student_works = homework_common.student_works.has_committed.select("student_works.*,student_works.work_score as score").where("student_works.id in #{ids}").order("score desc") %>
|
||||
<% else %>
|
||||
<% student_works = homework_common.student_works.select("student_works.*,student_works.work_score as score").order("score desc") %>
|
||||
<% student_works = homework_common.student_works.has_committed.select("student_works.*,student_works.work_score as score").order("score desc") %>
|
||||
<% end %>
|
||||
<% student_works.includes(:user).each_with_index do |sw, i| %>
|
||||
<div class="fl mr10 w100" style="text-align:center;">
|
||||
|
@ -206,8 +206,12 @@
|
|||
<% sort_projects = project_sort_update projects %>
|
||||
<div class="mt10 relatePWrap" id="relatePWrap_<%=homework_common.id %>">
|
||||
<div class="mr5 fontGrey2">
|
||||
<% first_pro = project_sort_first(projects).first %>
|
||||
# <%=time_from_now first_pro.updated_at %><%= link_to User.find(first_pro.user_id).show_name, user_activities_path(first_pro.user_id), :class => "newsBlue ml5 mr5"%>更新了项目,最近更新:
|
||||
<% first_pro = Project.find sort_projects.first.project_id %>
|
||||
<% commit_time = first_pro.project_score.commit_time %>
|
||||
<% one_time = first_pro.updated_on %>
|
||||
<% one_forge_time=ForgeActivity.where("project_id=?",first_pro.id).last.updated_at if ForgeActivity.where("project_id=?",first_pro.id).last %>
|
||||
<% one_time= one_time > one_forge_time ? one_time : one_forge_time %>
|
||||
# <%=time_from_now !commit_time.nil? && format_time(commit_time) > format_time(one_time) ? commit_time : one_time %><%= link_to User.find(first_pro.user_id).show_name, user_activities_path(first_pro.user_id), :class => "newsBlue ml5 mr5"%>更新了项目,最近更新:
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<% sort_projects.each_with_index do |pro, i| %>
|
||||
|
@ -230,7 +234,8 @@
|
|||
<% end %>
|
||||
<% com_time = project.project_score.commit_time %>
|
||||
<% time=project.updated_on %>
|
||||
<% time=ForgeActivity.where("project_id=?",project.id).last.updated_at if ForgeActivity.where("project_id=?",project.id).last %>
|
||||
<% forge_time=ForgeActivity.where("project_id=?",project.id).last.updated_at if ForgeActivity.where("project_id=?",project.id).last %>
|
||||
<% time= time > forge_time ? time : forge_time %>
|
||||
<p class="mh18"><span class="captainName" title="<%=(User.find project.user_id).show_name %>"><%=(User.find project.user_id).show_name %></span><span style="vertical-align: top;">(组长)</span></p>
|
||||
<p class="mh18"><%=time_from_now !com_time.nil? && format_time(com_time) > format_time(time) ? com_time : time %> <%= project.project_score.changeset_num %>提交</p>
|
||||
<div class="relatePInfo" id="relatePInfo_<%=project.id %>_<%=homework_common.id %>">
|
||||
|
|
|
@ -295,7 +295,7 @@
|
|||
<%= ma.course_message.parent_id.nil? ? "发布了班级帖子:" : "评论了班级帖子:" %></span></li>
|
||||
<% 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),
|
||||
<%= link_to ma.course_message.subject, board_message_path(ma.course_message.board_id, ma.course_message.id),
|
||||
:class => "#{ma.viewed==0 ? "newsBlack" : "newsGrey"}", :target => '_blank' %>
|
||||
<!--:onmouseover =>"message_titile_show($(this),event)",-->
|
||||
<!--:onmouseout => "message_titile_hide($(this))" %>-->
|
||||
|
@ -309,7 +309,7 @@
|
|||
</div>
|
||||
<% 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),
|
||||
<%= link_to ma.course_message.content.html_safe, board_message_path(ma.course_message.board_id, ma.course_message.parent_id),
|
||||
:class => "#{ma.viewed==0 ? "newsBlack" : "newsGrey"}", :target => '_blank' %>
|
||||
<!--:onmouseover =>"message_titile_show($(this),event)",-->
|
||||
<!--:onmouseout => "message_titile_hide($(this))" %>-->
|
||||
|
|
|
@ -156,9 +156,7 @@
|
|||
<li class="homepageNewsPubType fl"><%=link_to ma.forge_message.author, user_path(ma.forge_message.author), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
|
||||
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>"><%= ma.forge_message.parent_id.nil? ? "发布了项目帖子:" : "评论了项目帖子:" %></span></li>
|
||||
<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"}", :target => '_blank' %>
|
||||
<%= link_to ma.forge_message.subject, board_message_path(ma.forge_message.board_id, ma.forge_message.parent_id ? ma.forge_message.parent_id : ma.forge_message.id), :class => "#{ma.viewed==0 ? "newsBlack" : "newsGrey"}", :target => '_blank' %>
|
||||
<!--:onmouseover => "message_titile_show($(this),event)",-->
|
||||
<!--:onmouseout => "message_titile_hide($(this))" %>-->
|
||||
</a>
|
||||
|
|
|
@ -74,7 +74,7 @@
|
|||
<%=link_to '查看课程', syllabus_path(syllabus.id), :class => 'postOptionLink',:target =>'_blank', :title => '查看课程' %>
|
||||
</li>
|
||||
<% if User.current == syllabus.user %>
|
||||
<li><%=link_to '删除', delete_syllabus_syllabus_path(syllabus), :class => 'postOptionLink', :remote => 'true'%></li>
|
||||
<li><%=link_to '删除课程', delete_syllabus_syllabus_path(syllabus), :class => 'postOptionLink', :remote => 'true'%></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</li>
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
$('#reply_div_<%= params[:div_id].to_i %>').html('<%=escape_javascript(render :partial => 'users/homework_replies', :locals => {:comments => @journals, :is_in_course =>@is_in_course,:course_activity=>@course_activity, :is_teacher => @is_teacher, :user_activity_id => @user_activity_id}) %>');
|
||||
<% elsif params[:type] == 'JournalsForMessage' %>
|
||||
$('#reply_div_<%= @user_activity_id %>').html('<%=escape_javascript(render :partial => 'users/journal_replies', :locals => {:comments => @journals,:user_activity_id => @user_activity_id, :type => @type, :allow_delete => @allow_delete, :activity_id =>params[:id].to_i}) %>');
|
||||
<% elsif params[:type] == 'Message' %>
|
||||
$('#reply_div_<%= params[:div_id].to_i %>').html('<%=escape_javascript(render :partial => 'users/message_replies', :locals => {:comments => @journals,:user_activity_id => @user_activity_id, :type => @type, :activity_id =>params[:id].to_i,:is_course => @is_course, :is_board => @is_board}) %>');
|
||||
<% else %>
|
||||
$('#reply_div_<%= params[:div_id].to_i %>').html('<%=escape_javascript(render :partial => 'users/all_replies', :locals => {:comments => @journals}) %>');
|
||||
<% end %>
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
<% unless @comment.parent.nil? %>
|
||||
<% if params[:type] == 'JournalsForMessage' && (@comment.jour_type == 'Principal' || @comment.jour_type == 'Course') %>
|
||||
$('#comment_reply_<%=@comment.id %>').html("<%= escape_javascript(render :partial => 'users/journal_comment_reply', :locals => {:comment => @comment.parent})%>");
|
||||
<% elsif @comment.class.to_s == 'Message' %>
|
||||
$('#comment_reply_<%=@comment.id %>').html("<%= escape_javascript(render :partial => 'users/journal_comment_reply', :locals => {:comment => @comment.parent})%>");
|
||||
<% else %>
|
||||
$('#comment_reply_<%=@comment.id %>').html("<%= escape_javascript(render :partial => 'users/comment_reply', :locals => {:comment => @comment.parent})%>");
|
||||
<% end %>
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
<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">
|
||||
最后登录时间:<%= 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>
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
</li>
|
||||
<li class="fontGrey3 mb5"><%= User.find(user.id).user_extensions && User.find(user.id).user_extensions.brief_introduction.present? ? User.find(user.id).user_extensions.brief_introduction : '这位童鞋很懒,什么也没有留下~'%></li>
|
||||
<li class="f12 fontGrey2"><span class="mr30">加入时间:<%= format_date( User.find(user.id).created_on)%></span><span class="mr30">
|
||||
最后登陆时间:<%= format_date( User.find(user.id).last_login_on)%></span><span class="mr30">
|
||||
最后登录时间:<%= format_date( User.find(user.id).last_login_on)%></span><span class="mr30">
|
||||
<%= User.find(user.id).user_extensions.occupation.present? ? '单位:'+User.find(user.id).user_extensions.occupation : ''%></span></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
|
|
@ -12,7 +12,7 @@ zh:
|
|||
#
|
||||
label_course_join_student: 加入班级
|
||||
label_course_exit_student: 退出班级
|
||||
label_course_new: 新建课程
|
||||
label_course_new: 新建班级
|
||||
label_course_name: 课程名称
|
||||
|
||||
label_homework: 作业
|
||||
|
|
|
@ -482,9 +482,10 @@ zh:
|
|||
label_show_contest: 显示竞赛
|
||||
#by young
|
||||
label_requirement: 需求
|
||||
label_new_course: 课程列表
|
||||
label_course_all: 课程列表
|
||||
label_excellent_courses_list: 精品课程列表
|
||||
label_new_course: 班级列表
|
||||
label_course_all: 班级列表
|
||||
label_syllabus_all: 课程列表
|
||||
label_excellent_courses_list: 精品班级列表
|
||||
label_course_resource_list: 班级资源列表
|
||||
label_project_resource_list: 項目资源列表
|
||||
label_teacher_all: 所有教师
|
||||
|
@ -1139,7 +1140,7 @@ zh:
|
|||
text_account_destroy_confirmation: |-
|
||||
确定继续处理?
|
||||
您的账号一旦删除,将无法再次激活使用。
|
||||
error_session_expired: 您的会话已过期。请重新登陆。
|
||||
error_session_expired: 您的会话已过期。请重新登录。
|
||||
text_session_expiration_settings: "警告: 更改这些设置将会使包括你在内的当前会话失效。"
|
||||
setting_session_lifetime: 会话最大有效时间
|
||||
setting_session_timeout: 会话闲置超时
|
||||
|
@ -1367,7 +1368,7 @@ zh:
|
|||
label_bid_reason_homework: 请输入作业提交说明!
|
||||
label_create_new_projects: 创建项目
|
||||
label_call_for_bids: 发布需求
|
||||
label_create_course: 创建课程
|
||||
label_create_course: 创建班级
|
||||
|
||||
label_milestone: 里程碑
|
||||
label_features: 特性
|
||||
|
@ -1488,7 +1489,7 @@ zh:
|
|||
|
||||
|
||||
label_user_project: 项目
|
||||
label_user_course: 课程
|
||||
label_user_course: 班级
|
||||
label_user_homework: 作业
|
||||
|
||||
label_bid_if_agreement: 如果喜欢我,请点击我
|
||||
|
@ -1542,7 +1543,7 @@ zh:
|
|||
label_teacher_work_unit: 教师单位
|
||||
label_course_time: 课程年度
|
||||
label_i_new_activity: 有了新活动在
|
||||
label_choose_course: 选择课程
|
||||
label_choose_course: 选择班级
|
||||
button_submit_homework: 提交作业
|
||||
button_submit_bid: 参与竞标
|
||||
label_requirement_from: 需求来源
|
||||
|
@ -1596,9 +1597,9 @@ zh:
|
|||
|
||||
#end
|
||||
|
||||
label_joined_course: 参加的课程
|
||||
label_created_course: 创建的课程
|
||||
label_course: 课程
|
||||
label_joined_course: 参加的班级
|
||||
label_created_course: 创建的班级
|
||||
label_course: 班级
|
||||
|
||||
|
||||
label_public_info: (打钩为公开,不打钩则不公开,若不公开,仅项目成员可见该项目。)
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue