Merge branch 'develop' into rep_quality
This commit is contained in:
commit
7cfdacd172
|
@ -599,8 +599,19 @@ class AdminController < ApplicationController
|
|||
|
||||
#学校列表
|
||||
def schools
|
||||
|
||||
@order = ""
|
||||
@sort = ""
|
||||
@schools = School.find_by_sql("SELECT * FROM schools ORDER BY created_at DESC")
|
||||
if params[:sort] && (params[:order] == 'num')
|
||||
@order = params[:order]
|
||||
@sort = params[:sort]
|
||||
@schools.each do |school|
|
||||
count = UserExtensions.where("school_id = #{school.id} or occupation = '#{school.name}'").count
|
||||
school[:infocount] = count.to_i
|
||||
end
|
||||
@sort == 'asc' ? (@schools = @schools.sort{|x,y| x[:infocount] <=> y[:infocount] }) : (@schools = @schools.sort{|x,y| y[:infocount] <=> x[:infocount]})
|
||||
end
|
||||
|
||||
@school_count = @schools.count
|
||||
|
||||
@school_pages = Paginator.new @school_count, 30, params['page'] || 1
|
||||
|
|
|
@ -40,7 +40,7 @@ class AvatarController < ApplicationController
|
|||
@urlfile='/' << File.join("images","avatars",avatar_directory(@source_type),avatar_filename(@source_id,@image_file))
|
||||
|
||||
# 用户头像上传时进行特别处理
|
||||
if @is_direct == '1' && (@source_type == 'User' || @source_type == 'Course' || @source_type == 'Project')
|
||||
if @is_direct == '1' && (@source_type == 'User' || @source_type == 'Course' || @source_type == 'Project' || @source_type == 'Organization')
|
||||
diskfile += "temp"
|
||||
@urlfile += "temp"
|
||||
end
|
||||
|
|
|
@ -331,7 +331,7 @@ class CoursesController < ApplicationController
|
|||
@all_members = searchTeacherAndAssistant(@course)
|
||||
@members = @all_members
|
||||
when '2'
|
||||
if @course.open_student == 1 || User.current.member_of_course?(@course)
|
||||
if @course.open_student == 1 || User.current.member_of_course?(@course) || User.current.admin?
|
||||
@subPage_title = l :label_student_list
|
||||
page = params[:page].nil? ? 0 : (params['page'].to_i - 1)
|
||||
@all_members = student_homework_score(0,page, 10,@score_sort_by,@sort_type)
|
||||
|
|
|
@ -196,8 +196,9 @@ class IssuesController < ApplicationController
|
|||
priority_id = params[:issue][:priority_id]
|
||||
|
||||
ps = ProjectsService.new
|
||||
ps.send_wechat_project_issue_notice senduser,@issue.project,issue_id,issue_title,priority_id
|
||||
|
||||
if senduser.id != User.current.id
|
||||
ps.send_wechat_project_issue_notice senduser,@issue.project,issue_id,issue_title,priority_id
|
||||
end
|
||||
call_hook(:controller_issues_new_after_save, { :params => params, :issue => @issue})
|
||||
respond_to do |format|
|
||||
format.html {
|
||||
|
|
|
@ -96,6 +96,9 @@ class MyController < ApplicationController
|
|||
elsif params[:project]
|
||||
@project = Project.find params[:project]
|
||||
diskfile = disk_filename('Project', @project.id)
|
||||
elsif params[:organization]
|
||||
@organization = Organization.find params[:organization]
|
||||
diskfile = disk_filename('Organization', @organization.id)
|
||||
else
|
||||
@user = User.current
|
||||
diskfile = disk_filename('User', @user.id)
|
||||
|
@ -116,6 +119,9 @@ class MyController < ApplicationController
|
|||
when 'Project'
|
||||
@project = Project.find params[:source_id]
|
||||
diskfile = disk_filename('Project', @project.id)
|
||||
when 'Organization'
|
||||
@organization = Organization.find params[:source_id]
|
||||
diskfile = disk_filename('Organization', @organization.id)
|
||||
end
|
||||
end
|
||||
diskfile1 = diskfile + 'temp'
|
||||
|
|
|
@ -410,11 +410,11 @@ class StudentWorkController < ApplicationController
|
|||
#开放作品 || 老师 || 超级管理员 || 禁用匿评&&作业截止&&已提交作品 显示所有列表
|
||||
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
|
||||
@stundet_works = search_homework_member @homework.student_works.no_copy.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.no_copy.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.no_copy.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
|
||||
elsif User.current.member_of_course?(@course)
|
||||
|
@ -476,11 +476,11 @@ class StudentWorkController < ApplicationController
|
|||
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.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
|
||||
@stundet_works = search_homework_member @homework.student_works.no_copy.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.no_copy.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.no_copy.select("student_works.*,student_works.work_score as score").order("#{@order} #{@b_sort}"),@name
|
||||
end
|
||||
@show_all = true
|
||||
elsif User.current.member_of_course?(@course)
|
||||
|
@ -613,33 +613,21 @@ class StudentWorkController < ApplicationController
|
|||
student_work.work_status = 1
|
||||
end
|
||||
if student_work.save
|
||||
if @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1
|
||||
@student_work_project.student_work_id = student_work.id
|
||||
@student_work_project.save
|
||||
members = params[:group_member_ids].split(',')
|
||||
for i in 1 .. members.count-1
|
||||
stu_project = StudentWorkProject.new
|
||||
stu_project.homework_common_id = @homework.id
|
||||
stu_project.student_work_id = student_work.id
|
||||
stu_project.project_id = @student_work_project.project_id
|
||||
stu_project.user_id = members[i].to_i
|
||||
stu_project.is_leader = 0
|
||||
if @homework.homework_type == 3
|
||||
if @homework.homework_detail_group.base_on_project == 1
|
||||
@student_work_project.student_work_id = student_work.id
|
||||
@student_work_project.save
|
||||
elsif @homework.homework_detail_group.base_on_project == 0
|
||||
stu_project = StudentWorkProject.new(:homework_common_id => @homework.id, :student_work_id => student_work.id, :project_id => student_work.project_id, :user_id => student_work.user_id, :is_leader => 1)
|
||||
stu_project.save
|
||||
end
|
||||
elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 0
|
||||
members = params[:group_member_ids].split(',')
|
||||
for i in 0 .. members.count-1
|
||||
stu_project = StudentWorkProject.new
|
||||
stu_project.homework_common_id = @homework.id
|
||||
stu_project.student_work_id = student_work.id
|
||||
stu_project.project_id = -1
|
||||
stu_project.user_id = members[i].to_i
|
||||
if i == 0
|
||||
stu_project.is_leader = 1
|
||||
else
|
||||
stu_project.is_leader = 0
|
||||
for i in 1 .. members.count-1
|
||||
stu_work = StudentWork.new(:name => student_work.name, :description => student_work.description,:user_id =>members[i].to_i, :homework_common_id => @homework.id,:project_id => student_work.project_id, :late_penalty => student_work.late_penalty,:work_status => 3, :commit_time => student_work.commit_time)
|
||||
if stu_work.save
|
||||
stu_project = StudentWorkProject.new(:homework_common_id => @homework.id, :student_work_id => student_work.id, :project_id => stu_work.project_id == 0 ? -1 : stu_work.project_id, :user_id => members[i].to_i, :is_leader => 0)
|
||||
stu_project.save
|
||||
end
|
||||
stu_project.save
|
||||
end
|
||||
end
|
||||
@homework.update_column(:updated_at, Time.now)
|
||||
|
@ -687,20 +675,17 @@ class StudentWorkController < ApplicationController
|
|||
if @homework.homework_type == 3
|
||||
@student_work_project = @homework.student_work_projects.where("user_id=?",User.current.id).first
|
||||
student_work_projects = @homework.student_work_projects.where("student_work_id=? and is_leader =?",@work.id,0)
|
||||
user_ids = student_work_projects.empty? ? "(-1)" : "(" + student_work_projects.map{|stu|stu.user_id}.join(",") + ")"
|
||||
student_works = @homework.student_works.where("user_id in #{user_ids}")
|
||||
student_works.delete_all
|
||||
student_work_projects.delete_all
|
||||
members = params[:group_member_ids].split(',')
|
||||
for i in 1 .. members.count-1
|
||||
stu_project = StudentWorkProject.new
|
||||
stu_project.homework_common_id = @homework.id
|
||||
stu_project.student_work_id = @work.id
|
||||
if @homework.homework_detail_group.base_on_project == 1
|
||||
stu_project.project_id = @student_work_project.project_id
|
||||
else @homework.homework_detail_group.base_on_project == 0
|
||||
stu_project.project_id = -1
|
||||
stu_work = StudentWork.new(:name => @work.name, :description => @work.description,:user_id=> members[i].to_i, :homework_common_id => @homework.id, :project_id => @work.project_id, :late_penalty => @work.late_penalty,:work_status => 3, :commit_time => @work.commit_time)
|
||||
if stu_work.save
|
||||
stu_project = StudentWorkProject.new(:homework_common_id => @homework.id, :student_work_id => @work.id, :project_id => stu_work.project_id == 0 ? -1 : stu_work.project_id, :user_id => members[i].to_i, :is_leader => 0)
|
||||
stu_project.save
|
||||
end
|
||||
stu_project.user_id = members[i].to_i
|
||||
stu_project.is_leader = 0
|
||||
stu_project.save
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -735,26 +720,25 @@ class StudentWorkController < ApplicationController
|
|||
|
||||
def destroy
|
||||
if @homework.homework_type == 3
|
||||
if @work.destroy
|
||||
if @homework.homework_detail_group.base_on_project == 1
|
||||
pros = @work.student_work_projects.where("is_leader = 0")
|
||||
pros.each do |pro|
|
||||
pro.destroy
|
||||
end
|
||||
project = @work.student_work_projects.where("is_leader = 1").first
|
||||
project.update_attributes(:student_work_id => nil)
|
||||
elsif @homework.homework_detail_group.base_on_project == 0
|
||||
@work.student_work_projects.each do |pro2|
|
||||
pro2.destroy
|
||||
end
|
||||
end
|
||||
pros = @work.student_work_projects.where("is_leader = 0")
|
||||
user_ids = pros.empty? ? "(-1)" : "(" + pros.map{|stu|stu.user_id}.join(",") + ")"
|
||||
student_works = @homework.student_works.where("user_id in #{user_ids}")
|
||||
student_works.delete_all
|
||||
pros.delete_all
|
||||
|
||||
project = @work.student_work_projects.where("is_leader = 1").first
|
||||
if @homework.homework_detail_group.base_on_project == 1
|
||||
project.update_attributes(:student_work_id => nil)
|
||||
else
|
||||
project.destroy
|
||||
end
|
||||
@work.destroy
|
||||
else
|
||||
@work.attachments.destroy_all
|
||||
@work.student_works_scores.destroy_all
|
||||
@work.course_messages.destroy_all
|
||||
@work.student_work_tests.destroy_all
|
||||
@work.update_attributes(:work_status => 0, :name => "#{@homework.name}的作品提交", :description => nil, :late_penalty => 0, :commit_time => nil,:final_score => nil,:teacher_score => nil,:student_score => nil,:teaching_asistant_score => nil,:system_score => 0,:work_score => nil)
|
||||
@work.update_attributes(:work_status => 0, :name => "#{@homework.name}的作品提交", :description => nil, :late_penalty => 0, :commit_time => nil,:final_score => nil,:teacher_score => nil,:student_score => nil,:teaching_asistant_score => nil,:system_score => 0,:work_score => nil, :project_id => 0)
|
||||
@work.update_column("work_score",nil)
|
||||
end
|
||||
respond_to do |format|
|
||||
|
@ -786,22 +770,21 @@ class StudentWorkController < ApplicationController
|
|||
|
||||
def retry_work
|
||||
if @homework.homework_type == 3
|
||||
if @work.destroy
|
||||
if @homework.homework_detail_group.base_on_project == 1
|
||||
pros = @work.student_work_projects.where("is_leader = 0")
|
||||
pros.each do |pro|
|
||||
pro.destroy
|
||||
end
|
||||
project = @work.student_work_projects.where("is_leader = 1").first
|
||||
project.update_attributes(:student_work_id => nil)
|
||||
elsif @homework.homework_detail_group.base_on_project == 0
|
||||
@work.student_work_projects.each do |pro2|
|
||||
pro2.destroy
|
||||
end
|
||||
end
|
||||
pros = @work.student_work_projects.where("is_leader = 0")
|
||||
user_ids = pros.empty? ? "(-1)" : "(" + pros.map{|stu|stu.user_id}.join(",") + ")"
|
||||
student_works = @homework.student_works.where("user_id in #{user_ids}")
|
||||
student_works.delete_all
|
||||
pros.delete_all
|
||||
|
||||
project = @work.student_work_projects.where("is_leader = 1").first
|
||||
if @homework.homework_detail_group.base_on_project == 1
|
||||
project.update_attributes(:student_work_id => nil)
|
||||
else
|
||||
project.destroy
|
||||
end
|
||||
elsif @homework.homework_type == 1
|
||||
@work.update_attributes(:work_status => 0, :name => "#{@homework.name}的作品提交", :description => nil, :late_penalty => 0, :commit_time => nil)
|
||||
@work.destroy
|
||||
else
|
||||
@work.update_attributes(:work_status => 0, :name => "#{@homework.name}的作品提交", :description => nil, :late_penalty => 0, :commit_time => nil, :project_id => 0)
|
||||
@work.attachments.destroy_all
|
||||
@work.course_messages.destroy_all
|
||||
end
|
||||
|
@ -1096,9 +1079,13 @@ class StudentWorkController < ApplicationController
|
|||
|
||||
#创建作业的关联项目
|
||||
def student_work_project
|
||||
@work = @homework.student_works.where("user_id = #{User.current.id} and work_status = 0").first
|
||||
if @work
|
||||
@work.update_column('project_id', params[:projectName].to_i)
|
||||
end
|
||||
@project = StudentWorkProject.new
|
||||
@project.homework_common_id = @homework.id
|
||||
@project.project_id = (Project.find params[:projectName].to_i).id
|
||||
@project.project_id = params[:projectName].to_i
|
||||
@project.user_id = User.current.id
|
||||
@project.is_leader = 1
|
||||
if @project.save
|
||||
|
@ -1139,7 +1126,7 @@ class StudentWorkController < ApplicationController
|
|||
end
|
||||
all_students = User.where("id in #{all_student_ids}")
|
||||
student_work_id = @homework.student_work_projects.where("user_id=? and student_work_id is not null",User.current.id).first.nil? ? -1 : @homework.student_work_projects.where("user_id=?",User.current.id).first.student_work_id
|
||||
@commit_student_ids = @homework.student_work_projects.where("student_work_id != #{student_work_id}").map{|student| student.user_id}
|
||||
@commit_student_ids = @homework.student_works.where("id != #{student_work_id}").map{|student| student.user_id}
|
||||
@users = searchstudent_by_name all_students,name
|
||||
respond_to do |format|
|
||||
format.js
|
||||
|
@ -1147,6 +1134,10 @@ class StudentWorkController < ApplicationController
|
|||
end
|
||||
|
||||
def cancel_relate_project
|
||||
@work = @homework.student_works.where("user_id = #{User.current.id} and work_status = 0").first
|
||||
if @work
|
||||
@work.update_column('project_id', 0)
|
||||
end
|
||||
relate_pro = StudentWorkProject.where("user_id = #{User.current.id} and homework_common_id = #{@homework.id}").first
|
||||
if relate_pro.destroy
|
||||
@user_activity_id = params[:user_activity_id].to_i
|
||||
|
@ -1402,7 +1393,7 @@ class StudentWorkController < ApplicationController
|
|||
end
|
||||
|
||||
def find_or_save_student_work(is_test)
|
||||
student_work = StudentWork.where(homework_common_id: @homework.id, user_id: User.current.id).first
|
||||
student_work = StudentWork.where(homework_common_id: @homework.id, user_id: User.current.id, is_test: is_test).first
|
||||
if student_work.nil?
|
||||
@homework.student_works.build(
|
||||
name: params[:title],
|
||||
|
@ -1413,7 +1404,7 @@ class StudentWorkController < ApplicationController
|
|||
unless @homework.save
|
||||
logger.debug @homework.errors.full_messages
|
||||
else
|
||||
student_work = StudentWork.where(homework_common_id: @homework.id, user_id: User.current.id).first
|
||||
student_work = StudentWork.where(homework_common_id: @homework.id, user_id: User.current.id, is_test: is_test).first
|
||||
end
|
||||
end
|
||||
student_work
|
||||
|
@ -1586,6 +1577,10 @@ class StudentWorkController < ApplicationController
|
|||
end
|
||||
end
|
||||
end
|
||||
if homework.homework_type == 3
|
||||
student_works = group_student_works student_work, homework
|
||||
student_works.update_all(:final_score => student_work.final_score,:teacher_score => student_work.teacher_score,:student_score => student_work.student_score,:teaching_asistant_score => student_work.teaching_asistant_score,:work_score => student_work.work_score)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -983,7 +983,7 @@ class UsersController < ApplicationController
|
|||
@user = User.current
|
||||
@homework = HomeworkCommon.find(params[:homework_id])
|
||||
@is_test = params[:is_test] == 'true'
|
||||
@student_work = StudentWork.where(homework_common_id: @homework.id, user_id: User.current.id).first
|
||||
@student_work = StudentWork.where(homework_common_id: @homework.id, user_id: User.current.id, is_test: @is_test).first
|
||||
if @student_work.nil?
|
||||
@student_work = StudentWork.new
|
||||
end
|
||||
|
@ -1660,55 +1660,117 @@ class UsersController < ApplicationController
|
|||
course_types = "('Message','News','HomeworkCommon','Poll','Course','JournalsForMessage')"
|
||||
project_types = "('Message','Issue','Project')"
|
||||
principal_types = "JournalsForMessage"
|
||||
container_type = ''
|
||||
act_type = ''
|
||||
if params[:type].present?
|
||||
case params[:type]
|
||||
when "course_homework"
|
||||
@user_activities = UserActivity.where("container_type = 'Course' and container_id in #{user_course_ids} and act_type = 'HomeworkCommon'").order('updated_at desc').limit(10).offset(@page * 10)
|
||||
container_type = 'Course'
|
||||
act_type = 'HomeworkCommon'
|
||||
when "course_news"
|
||||
@user_activities = UserActivity.where("container_type = 'Course' and container_id in #{user_course_ids} and act_type = 'News'").order('updated_at desc').limit(10).offset(@page * 10)
|
||||
container_type = 'Course'
|
||||
act_type = 'News'
|
||||
when "course_message"
|
||||
@user_activities = UserActivity.where("container_type = 'Course' and container_id in #{user_course_ids} and act_type = 'Message'").order('updated_at desc').limit(10).offset(@page * 10)
|
||||
container_type = 'Course'
|
||||
act_type = 'Message'
|
||||
when "course_poll"
|
||||
@user_activities = UserActivity.where("container_type = 'Course' and container_id in #{user_course_ids} and act_type = 'Poll'").order('updated_at desc').limit(10).offset(@page * 10)
|
||||
container_type = 'Course'
|
||||
act_type = 'Poll'
|
||||
when "course_journals"
|
||||
@user_activities = UserActivity.where("container_type = 'Course' and container_id in #{user_course_ids} and act_type = 'JournalsForMessage'").order('updated_at desc').limit(10).offset(@page * 10)
|
||||
container_type = 'Course'
|
||||
act_type = 'JournalsForMessage'
|
||||
when "project_issue"
|
||||
@user_activities = UserActivity.where("container_type = 'Project' and container_id in #{user_project_ids} and act_type = 'Issue'").order('updated_at desc').limit(10).offset(@page * 10)
|
||||
container_type = 'Project'
|
||||
act_type = 'Issue'
|
||||
when "project_message"
|
||||
@user_activities = UserActivity.where("container_type = 'Project' and container_id in #{user_project_ids} and act_type = 'Message'").order('updated_at desc').limit(10).offset(@page * 10)
|
||||
container_type = 'Course'
|
||||
act_type = 'Message'
|
||||
when "user_journals"
|
||||
@user_activities = UserActivity.where("container_type = 'Principal' and act_type= 'JournalsForMessage' and container_id = #{@user.id}").order('updated_at desc').limit(10).offset(@page * 10)
|
||||
container_type = 'Principal'
|
||||
act_type = 'JournalsForMessage'
|
||||
when "current_user"
|
||||
@user_activities = UserActivity.where("user_id = #{@user.id} and ((container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types}) or (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types}))").order('updated_at desc').limit(10).offset(@page * 10)
|
||||
else
|
||||
if @user == User.current
|
||||
blog_ids = "("+@user.blog.id.to_s+","+((User.watched_by(@user.id).count == 0 )? '0' :User.watched_by(@user.id).map{|u| u.blog.id}.join(','))+")"
|
||||
else
|
||||
blog_ids = "("+@user.blog.id.to_s+")"
|
||||
end
|
||||
@user_activities = UserActivity.where("(container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types})" +
|
||||
"or (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types}) "+
|
||||
"or (container_type = 'Principal' and act_type= '#{principal_types}' and container_id = #{@user.id}) " +
|
||||
"or (container_type = 'Blog' and act_type= 'BlogComment' and container_id in #{blog_ids})").order('updated_at desc').limit(10).offset(@page * 10)
|
||||
container_type = 'Principal'
|
||||
act_type = 'Principal'
|
||||
end
|
||||
end
|
||||
if container_type != '' && act_type != ''
|
||||
if container_type == 'Course'
|
||||
sql = "container_type = '#{container_type}' and container_id in #{user_course_ids} and act_type = '#{act_type}'"
|
||||
elsif container_type == 'Project'
|
||||
sql = "container_type = '#{container_type}' and container_id in #{user_project_ids} and act_type = '#{act_type}'"
|
||||
elsif container_type == 'Principal' && act_type == 'JournalsForMessage'
|
||||
sql = "container_type = '#{container_type}' and act_type= '#{act_type}' and container_id = #{@user.id}"
|
||||
elsif container_type == 'Principal' && act_type == 'Principal'
|
||||
sql = "user_id = #{@user.id} and ((container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types}) or (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types}))"
|
||||
end
|
||||
if User.current != @user
|
||||
sql += " and user_id = #{@user.id}"
|
||||
end
|
||||
else
|
||||
# @user_activities = UserActivity.where("(container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types}) or (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types})or (container_type = 'Principal' and act_type= '#{principal_types}' and container_id = #{@user.id})").order('updated_at desc').limit(10).offset(@page * 10)
|
||||
# blog_ids = "("+@user.blog.id.to_s+","+((User.watched_by(@user.id).count == 0 )? '0' :User.watched_by(@user.id).map{|u| u.blog.id}.join(','))+")"
|
||||
# 减少数据库交互
|
||||
if @user == User.current
|
||||
watched_user_ids = User.watched_by(@user.id).count == 0 ? " " : ("," + User.watched_by(@user.id).map{|u| u.id.to_s }.join(','))
|
||||
user_ids = "(" + @user.id.to_s + watched_user_ids + ")"
|
||||
if User.current != @user
|
||||
blog_ids = "("+@user.blog.id.to_s+")"
|
||||
sql = "user_id = #{@user.id} and((container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types})" +
|
||||
"or (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types}) "+
|
||||
"or (container_type = 'Principal' and act_type= '#{principal_types}' and container_id = #{@user.id}) " +
|
||||
"or (container_type = 'Blog' and act_type= 'BlogComment' and container_id in #{blog_ids}))"
|
||||
else
|
||||
user_ids = "(" + @user.id.to_s + ")"
|
||||
blog_ids = "("+@user.blog.id.to_s+","+((User.watched_by(@user.id).count == 0 )? '0' :User.watched_by(@user.id).map{|u| u.blog.id}.join(','))+")"
|
||||
sql = "(container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types})" +
|
||||
"or (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types}) "+
|
||||
"or (container_type = 'Principal' and act_type= '#{principal_types}' and container_id = #{@user.id}) " +
|
||||
"or (container_type = 'Blog' and act_type= 'BlogComment' and container_id in #{blog_ids})"
|
||||
end
|
||||
watched_user_blog_ids = Blog.select("id").where("author_id in #{user_ids}")
|
||||
blog_ids = watched_user_blog_ids.empty? ? "(-1)" : "(" + watched_user_blog_ids.map { |blog| blog.id}.join(",") + ")"
|
||||
|
||||
@user_activities = UserActivity.where("(container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types})" +
|
||||
"or (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types}) "+
|
||||
"or (container_type = 'Principal' and act_type= '#{principal_types}' and container_id = #{@user.id}) " +
|
||||
"or (container_type = 'Blog' and act_type= 'BlogComment' and container_id in #{blog_ids})").order('updated_at desc').limit(10).offset(@page * 10)
|
||||
end
|
||||
@user_activities = UserActivity.where("#{sql}").order('updated_at desc').limit(10).offset(@page * 10)
|
||||
# if params[:type].present?
|
||||
# case params[:type]
|
||||
# when "course_homework"
|
||||
# @user_activities = UserActivity.where("container_type = 'Course' and container_id in #{user_course_ids} and act_type = 'HomeworkCommon'").order('updated_at desc').limit(10).offset(@page * 10)
|
||||
# when "course_news"
|
||||
# @user_activities = UserActivity.where("container_type = 'Course' and container_id in #{user_course_ids} and act_type = 'News'").order('updated_at desc').limit(10).offset(@page * 10)
|
||||
# when "course_message"
|
||||
# @user_activities = UserActivity.where("container_type = 'Course' and container_id in #{user_course_ids} and act_type = 'Message'").order('updated_at desc').limit(10).offset(@page * 10)
|
||||
# when "course_poll"
|
||||
# @user_activities = UserActivity.where("container_type = 'Course' and container_id in #{user_course_ids} and act_type = 'Poll'").order('updated_at desc').limit(10).offset(@page * 10)
|
||||
# when "course_journals"
|
||||
# @user_activities = UserActivity.where("container_type = 'Course' and container_id in #{user_course_ids} and act_type = 'JournalsForMessage'").order('updated_at desc').limit(10).offset(@page * 10)
|
||||
# when "project_issue"
|
||||
# @user_activities = UserActivity.where("container_type = 'Project' and container_id in #{user_project_ids} and act_type = 'Issue'").order('updated_at desc').limit(10).offset(@page * 10)
|
||||
# when "project_message"
|
||||
# @user_activities = UserActivity.where("container_type = 'Project' and container_id in #{user_project_ids} and act_type = 'Message'").order('updated_at desc').limit(10).offset(@page * 10)
|
||||
# when "user_journals"
|
||||
# @user_activities = UserActivity.where("container_type = 'Principal' and act_type= 'JournalsForMessage' and container_id = #{@user.id}").order('updated_at desc').limit(10).offset(@page * 10)
|
||||
# when "current_user"
|
||||
# @user_activities = UserActivity.where("user_id = #{@user.id} and ((container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types}) or (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types}))").order('updated_at desc').limit(10).offset(@page * 10)
|
||||
# else
|
||||
# if @user == User.current
|
||||
# blog_ids = "("+@user.blog.id.to_s+","+((User.watched_by(@user.id).count == 0 )? '0' :User.watched_by(@user.id).map{|u| u.blog.id}.join(','))+")"
|
||||
# else
|
||||
# blog_ids = "("+@user.blog.id.to_s+")"
|
||||
# end
|
||||
# @user_activities = UserActivity.where("(container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types})" +
|
||||
# "or (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types}) "+
|
||||
# "or (container_type = 'Principal' and act_type= '#{principal_types}' and container_id = #{@user.id}) " +
|
||||
# "or (container_type = 'Blog' and act_type= 'BlogComment' and container_id in #{blog_ids})").order('updated_at desc').limit(10).offset(@page * 10)
|
||||
# end
|
||||
# else
|
||||
# # @user_activities = UserActivity.where("(container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types}) or (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types})or (container_type = 'Principal' and act_type= '#{principal_types}' and container_id = #{@user.id})").order('updated_at desc').limit(10).offset(@page * 10)
|
||||
# # blog_ids = "("+@user.blog.id.to_s+","+((User.watched_by(@user.id).count == 0 )? '0' :User.watched_by(@user.id).map{|u| u.blog.id}.join(','))+")"
|
||||
# # 减少数据库交互
|
||||
# if @user == User.current
|
||||
# watched_user_ids = User.watched_by(@user.id).count == 0 ? " " : ("," + User.watched_by(@user.id).map{|u| u.id.to_s }.join(','))
|
||||
# user_ids = "(" + @user.id.to_s + watched_user_ids + ")"
|
||||
# else
|
||||
# user_ids = "(" + @user.id.to_s + ")"
|
||||
# end
|
||||
# watched_user_blog_ids = Blog.select("id").where("author_id in #{user_ids}")
|
||||
# blog_ids = watched_user_blog_ids.empty? ? "(-1)" : "(" + watched_user_blog_ids.map { |blog| blog.id}.join(",") + ")"
|
||||
#
|
||||
# @user_activities = UserActivity.where("(container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types})" +
|
||||
# "or (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types}) "+
|
||||
# "or (container_type = 'Principal' and act_type= '#{principal_types}' and container_id = #{@user.id}) " +
|
||||
# "or (container_type = 'Blog' and act_type= 'BlogComment' and container_id in #{blog_ids})").order('updated_at desc').limit(10).offset(@page * 10)
|
||||
# end
|
||||
# @user_activities = paginateHelper @user_activities,500
|
||||
@type = params[:type]
|
||||
respond_to do |format|
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
module SchoolHelper
|
||||
def schoolMember_num school
|
||||
count = student_num(school) + teacher_num(school)
|
||||
count = UserExtensions.where("school_id = #{school.id} or occupation = '#{school.name}'").count
|
||||
count.to_s
|
||||
end
|
||||
|
||||
|
|
|
@ -22,8 +22,12 @@ module StudentWorkHelper
|
|||
end
|
||||
|
||||
#获取指定用户对某一作业的评分结果
|
||||
def student_work_score work,user
|
||||
StudentWorksScore.where(:user_id => user.id,:student_work_id => work.id).last
|
||||
def student_work_score work,user,reviewer_role=0
|
||||
if reviewer_role != 0
|
||||
StudentWorksScore.where(:user_id => user.id,:student_work_id => work.id,:reviewer_role => reviewer_role).last
|
||||
else
|
||||
StudentWorksScore.where(:user_id => user.id,:student_work_id => work.id).last
|
||||
end
|
||||
end
|
||||
|
||||
#获取指定评分的角色
|
||||
|
@ -154,4 +158,11 @@ module StudentWorkHelper
|
|||
end
|
||||
return status
|
||||
end
|
||||
|
||||
def group_student_works student_work, homework
|
||||
pros = student_work.student_work_projects.where("is_leader = 0")
|
||||
user_ids = pros.empty? ? "(-1)" : "(" + pros.map{|stu|stu.user_id}.join(",") + ")"
|
||||
student_works = homework.student_works.where("user_id in #{user_ids}")
|
||||
return student_works
|
||||
end
|
||||
end
|
|
@ -184,8 +184,10 @@ class AtMessage < ActiveRecord::Base
|
|||
when 'JournalsForMessage'
|
||||
if at_message.jour_type == 'Principal'
|
||||
{controller: :users, action: :user_messages, id: at_message.at_user}
|
||||
else
|
||||
elsif at_message.jour_type == 'HomeworkCommon'
|
||||
{controller: :homework_common, action: :index, course: at_message.jour.course_id}
|
||||
elsif at_message.jour_type == 'Course'
|
||||
{controller: :courses, action: :feedback, id: at_message.jour_id}
|
||||
end
|
||||
|
||||
else
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#学生提交作品表
|
||||
#学生提交作品表 #work_status :0 未提交 1 已提交 2 迟交 3 分组作品复制的组员作品
|
||||
class StudentWork < ActiveRecord::Base
|
||||
attr_accessible :name, :description, :homework_common_id, :user_id, :final_score, :teacher_score, :student_score, :teaching_asistant_score, :system_score, :work_score, :project_id, :is_test, :simi_id, :simi_value, :work_status, :commit_time
|
||||
|
||||
|
@ -13,7 +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")}
|
||||
scope :has_committed, lambda{where("work_status != 0 and work_status != 3")}
|
||||
scope :no_copy, lambda{where("work_status != 3")}
|
||||
|
||||
before_destroy :delete_praise
|
||||
before_save :set_program_score, :set_src
|
||||
|
@ -31,7 +32,7 @@ class StudentWork < ActiveRecord::Base
|
|||
|
||||
private
|
||||
def set_program_score
|
||||
if homework_common.is_program_homework? #编程作业,学生提交作品后计算系统得分
|
||||
if self.homework_common.is_program_homework? #编程作业,学生提交作品后计算系统得分
|
||||
#根据最后一次测试计算得分
|
||||
unless last_test
|
||||
self.system_score = 0
|
||||
|
@ -169,6 +170,12 @@ class StudentWork < ActiveRecord::Base
|
|||
end
|
||||
end
|
||||
end
|
||||
if homework.homework_type == 3
|
||||
pros = student_work.student_work_projects.where("is_leader = 0")
|
||||
user_ids = pros.empty? ? "(-1)" : "(" + pros.map{|stu|stu.user_id}.join(",") + ")"
|
||||
student_works = homework.student_works.where("user_id in #{user_ids}")
|
||||
student_works.update_all(:final_score => student_work.final_score,:teacher_score => student_work.teacher_score,:student_score => student_work.student_score,:teaching_asistant_score => student_work.teaching_asistant_score,:work_score => student_work.work_score)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -62,9 +62,9 @@
|
|||
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" title='<%=strip_html(journal.notes) %>'>
|
||||
<%case journal.jour_type %>
|
||||
<% when 'Principal' %>
|
||||
<%= link_to(strip_html(journal.notes), feedback_path(journal.jour_id)) %>
|
||||
<%= link_to(journal.m_parent_id.nil? ? strip_html(journal.notes) : 'RE: ' + strip_html(journal.notes), feedback_path(journal.jour_id)) %>
|
||||
<% when 'Course' %>
|
||||
<%= link_to(strip_html(journal.notes), course_feedback_path(journal.jour_id)) %>
|
||||
<%= link_to(journal.m_parent_id.nil? ? strip_html(journal.notes) : 'RE: ' + strip_html(journal.notes), course_feedback_path(journal.jour_id)) %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td class="center">
|
||||
|
|
|
@ -20,8 +20,8 @@
|
|||
<th style="width: 100px;">
|
||||
学校名称
|
||||
</th>
|
||||
<th style="width: 35px;">
|
||||
用户数
|
||||
<th style="width: 35px;" class = "<%= @order == 'num' ? (@sort == 'desc' ? 'st_up' : (@sort == 'asc' ? 'st_down' : '')) : '' %>">
|
||||
<%= link_to '用户数', admin_schools_path(:sort=> @sort == "desc" ? 'asc' : 'desc', :order => 'num') %>
|
||||
</th>
|
||||
<th style="width: 90px;">
|
||||
创建时间
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<% if @is_direct == '1' && (@source_type=='User'|| @source_type == 'Course' || @source_type == 'Project') %>
|
||||
<% if @is_direct == '1' && (@source_type=='User'|| @source_type == 'Course' || @source_type == 'Project' || @source_type == 'Organization') %>
|
||||
var imgSpan = $("img[nhname='avatar_image']");
|
||||
imgSpan.attr({"src":'<%= "#{@urlfile.to_s}?#{Time.now.to_i}" %>'});
|
||||
<% else %>
|
||||
|
|
|
@ -134,7 +134,7 @@
|
|||
<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="homepagePostReplyDes" onmouseover="$('#delete_reply_<%=comment.id%>').show();" onmouseout="$('#delete_reply_<%=comment.id%>').hide();">
|
||||
<%= render :partial => 'users/message_contents', :locals => {:comment => comment}%>
|
||||
|
||||
<% if !comment.content_detail.blank? %>
|
||||
|
@ -161,7 +161,8 @@
|
|||
l(:button_delete),
|
||||
{:controller => 'blog_comments', :action => 'destroy', :id => comment.id},
|
||||
:method => :delete,
|
||||
:class => 'fr mr20',
|
||||
:id => "delete_reply_#{comment.id}",
|
||||
:class => 'fr mr20 undis',
|
||||
:data => {:confirm => l(:text_are_you_sure)},
|
||||
:title => l(:button_delete)
|
||||
) %>
|
||||
|
|
|
@ -11,27 +11,27 @@
|
|||
$("#relateProject,.relatePInfo").mouseout(function(){
|
||||
$(".relatePInfo").css("display","none");
|
||||
})
|
||||
$(".homepagePostPortrait").mouseover(function(){
|
||||
onImage = true;
|
||||
$(this).children(".userCard").css("display","block");
|
||||
})
|
||||
$(".homepagePostPortrait").mouseout(function(){
|
||||
var cur = $(this);
|
||||
onImage = false;
|
||||
setTimeout(function(){
|
||||
if (onUserCard == false && onImage == false){
|
||||
$(cur).children(".userCard").css("display", "none");
|
||||
}
|
||||
}, 500);
|
||||
})
|
||||
$(".userCard").mouseover(function(){
|
||||
onUserCard = true;
|
||||
$(this).css("display","block");
|
||||
})
|
||||
$(".userCard").mouseout(function(){
|
||||
onUserCard = false;
|
||||
$(this).css("display","none");
|
||||
})
|
||||
// $(".homepagePostPortrait").mouseover(function(){
|
||||
// onImage = true;
|
||||
// $(this).children(".userCard").css("display","block");
|
||||
// })
|
||||
// $(".homepagePostPortrait").mouseout(function(){
|
||||
// var cur = $(this);
|
||||
// onImage = false;
|
||||
// setTimeout(function(){
|
||||
// if (onUserCard == false && onImage == false){
|
||||
// $(cur).children(".userCard").css("display", "none");
|
||||
// }
|
||||
// }, 500);
|
||||
// })
|
||||
// $(".userCard").mouseover(function(){
|
||||
// onUserCard = true;
|
||||
// $(this).css("display","block");
|
||||
// })
|
||||
// $(".userCard").mouseout(function(){
|
||||
// onUserCard = false;
|
||||
// $(this).css("display","none");
|
||||
// });
|
||||
$(".coursesLineGrey").mouseover(function(){
|
||||
$(this).css("color","#ffffff");
|
||||
})
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<div class="ping_dispic">
|
||||
<%= link_to image_tag(url_to_avatar(journal.user),:width => '46',:height => '46'), user_path(journal.user) %>
|
||||
</div>
|
||||
<div class="ping_discon upload_img" style="width: 610px;">
|
||||
<div class="ping_discon upload_img" style="width: 610px;" onmouseover="$('#delete_reply_<%=journal.id %>').show();" onmouseout="$('#delete_reply_<%=journal.id %>').hide();">
|
||||
<div class="ping_distop f14">
|
||||
<!-- <a style=" font-weight:bold; color:#15bccf; margin-right:30px; background:none;" target="_blank" href="#">gugu01</a> -->
|
||||
<span>
|
||||
|
@ -28,17 +28,17 @@
|
|||
<span id="reply_praise_count_<%=journal.id %>">
|
||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>journal, :user_activity_id=>journal.id,:type=>"reply"}%>
|
||||
</span>
|
||||
<% if journal.user == User.current|| User.current.admin? || (@course && User.current.allowed_to?(:as_teacher,@course)) %>
|
||||
<%= link_to(l(:label_bid_respond_delete),
|
||||
{:controller => 'words', :action => 'destroy', :object_id => journal, :user_id => @user},
|
||||
:remote => true, :confirm => l(:text_are_you_sure), :method => 'delete',
|
||||
:class => "delete", :title => l(:button_delete)) %>
|
||||
<% end %>
|
||||
<% if reply_allow %>
|
||||
<%#= link_to l(:label_bid_respond_quote),'',
|
||||
{:focus => 'project_respond',:nhname=>"reply_btn", :onclick => "toggleAndSettingWordsVal($('##{ids}'), $('##{ids} textarea')); $('##{ids} textarea') ;return false;"} %>
|
||||
<%= link_to l(:label_bid_respond_quote),'javascript:;',{:nhname=>"reply_btn"} %>
|
||||
<% end %>
|
||||
<% if journal.user == User.current|| User.current.admin? || (@course && User.current.allowed_to?(:as_teacher,@course)) %>
|
||||
<%= link_to(l(:label_bid_respond_delete),
|
||||
{:controller => 'words', :action => 'destroy', :object_id => journal, :user_id => @user},
|
||||
:remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :id => "delete_reply_#{journal.id}",
|
||||
:class => "delete undis", :title => l(:button_delete)) %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<% ids = 'project_respond_form_'+ journal.id.to_s%>
|
||||
|
|
|
@ -218,8 +218,12 @@
|
|||
<% end %>
|
||||
</div>
|
||||
<div class="ur_buttons">
|
||||
<%= link_to "保存",commit_exercise_exercise_path(exercise,:save => 1),:id=>"exercise_submit_btn", :method => :post,:class => "ur_button_submit",:format => 'js',:remote=>true %>
|
||||
<%= link_to "提交",commit_exercise_exercise_path(exercise), :data => {:confirm => "您确定要提交吗?"},:id=>"exercise_submit_btn", :method => :post,:class => "ur_button_submit",:style => "margin-left:20px;",:format => 'js',:remote=>true %>
|
||||
<% if exercise.time == -1 %>
|
||||
<%= link_to "保存",commit_exercise_exercise_path(exercise,:save => 1),:id=>"exercise_submit_btn", :method => :post,:class => "ur_button_submit",:format => 'js',:remote=>true %>
|
||||
<%= link_to "提交",commit_exercise_exercise_path(exercise), :data => {:confirm => "您确定要提交吗?"},:id=>"exercise_submit_btn", :method => :post,:class => "ur_button_submit",:style => "margin-left:20px;",:format => 'js',:remote=>true %>
|
||||
<% else %>
|
||||
<%= link_to "提交",commit_exercise_exercise_path(exercise), :data => {:confirm => "您确定要提交吗?"},:id=>"exercise_submit_btn", :method => :post,:class => "ur_button_submit",:style => "margin-left:84px;",:format => 'js',:remote=>true %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<!--contentbox end-->
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
<%=exercise.user.show_name %>
|
||||
</td>
|
||||
<td class="hworkStID student_work_<%= exercise.id%> pl15 pr10 float-none" title="学号" id="student_id_<%= exercise.id%>" style="cursor:pointer;">
|
||||
<span class="hidden fl" style="width:80px;"><%= exercise.user.user_extensions.nil? ? "--" : exercise.user.user_extensions.student_id%></span>
|
||||
<span class="hidden fl" style="width:55px;"><%= exercise.user.user_extensions.nil? ? "--" : exercise.user.user_extensions.student_id%></span>
|
||||
</td>
|
||||
<td class="hworkStID student_work_<%= exercise.id%> float-none" title="班级" id="student_class_<%= exercise.id%>" style="cursor:pointer;">
|
||||
--
|
||||
|
|
|
@ -124,12 +124,14 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<div class="resource_tip_box fontGrey2">
|
||||
<em></em>
|
||||
<span></span>
|
||||
<p class="mb5">私有资源:<br/>仅对本班级成员可见</p>
|
||||
<p>公共资源:<br/>对所有用户可见</p>
|
||||
</div>
|
||||
<% if !User.current.member_of_course?(@course) && show_attachment_tip(@course.id, "Course") %>
|
||||
<div class="resource_tip_box fontGrey2">
|
||||
<em></em>
|
||||
<span></span>
|
||||
<p class="mb5">私有资源:<br/>仅对本班级成员可见</p>
|
||||
<p>公共资源:<br/>对所有用户可见</p>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<div id="course_list">
|
||||
<%= render :partial => 'course_list',:locals => {course: @course,all_attachments: @all_attachments,sort:@sort,order:@order,curse_attachments:@obj_attachments} %>
|
||||
|
|
|
@ -1,15 +1,18 @@
|
|||
共有 <span id="attachment_count"><%= @tip_all_attachments %></span> 个资源
|
||||
<span id="attachment_count_public" class="fontGrey2 ml10" style="font-weight: normal;">公共资源:<%= @tip_all_public_attachments %>个</span>
|
||||
<% if @project %>
|
||||
<% if !User.current.member_of?(@project) && params[:tag_name] %>
|
||||
<span id="attachment_count_private" class="fontGrey2 ml10" style="font-weight: normal;">私有资源:0个</span>
|
||||
<% else %>
|
||||
<span id="attachment_count_private" class="fontGrey2 ml10" style="font-weight: normal;">私有资源:<%= @tip_all_private_attachments %>个</span>
|
||||
<% end %>
|
||||
<% elsif @course %>
|
||||
<% if !User.current.member_of_course?(@course) && params[:tag_name] %>
|
||||
<span id="attachment_count_private" class="fontGrey2 ml10" style="font-weight: normal;">私有资源:0个</span>
|
||||
<% else %>
|
||||
<span id="attachment_count_private" class="fontGrey2 ml10" style="font-weight: normal;">私有资源:<%= @tip_all_private_attachments %>个</span>
|
||||
<% if @tip_all_private_attachments != 0 %>
|
||||
<span id="attachment_count_public" class="fontGrey2 ml10" style="font-weight: normal;">公共资源:<%= @tip_all_public_attachments %>个</span>
|
||||
<% if @project %>
|
||||
<% if !User.current.member_of?(@project) && params[:tag_name] %>
|
||||
<span id="attachment_count_private" class="fontGrey2 ml10" style="font-weight: normal;">私有资源:0个</span>
|
||||
<% else %>
|
||||
<span id="attachment_count_private" class="fontGrey2 ml10" style="font-weight: normal;">私有资源:<%= @tip_all_private_attachments %>个</span>
|
||||
<% end %>
|
||||
<% elsif @course %>
|
||||
<% if !User.current.member_of_course?(@course) && params[:tag_name] %>
|
||||
<span id="attachment_count_private" class="fontGrey2 ml10" style="font-weight: normal;">私有资源:0个</span>
|
||||
<% else %>
|
||||
<span id="attachment_count_private" class="fontGrey2 ml10" style="font-weight: normal;">私有资源:<%= @tip_all_private_attachments %>个</span>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<% end %>
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<div class="homepagePostReplyPortrait" >
|
||||
<%= link_to image_tag(url_to_avatar(comment.user), :width => "33", :height => "33"), user_path(comment.user_id), :alt => "用户头像" %>
|
||||
</div>
|
||||
<div class="homepagePostReplyDes">
|
||||
<div class="homepagePostReplyDes" onmouseover="$('#delete_reply_<%=comment.id %>').show();" onmouseout="$('#delete_reply_<%=comment.id %>').hide();">
|
||||
<%= render :partial => 'users/news_contents', :locals => {:comment => comment}%>
|
||||
|
||||
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= comment.id %>">
|
||||
|
@ -40,7 +40,8 @@
|
|||
l(:button_delete),
|
||||
{:controller => 'issues',:action => 'delete_journal', :id => issue.id,:journal_id=>comment.id},
|
||||
:method => :get,
|
||||
:class => 'fr mr20',
|
||||
:id => "delete_reply_#{comment.id}",
|
||||
:class => 'fr mr20 undis',
|
||||
:data => {:confirm => l(:text_are_you_sure)},
|
||||
:title => l(:button_delete)
|
||||
) if comment.user_id == User.current.id %>
|
||||
|
|
|
@ -6,7 +6,7 @@ $("#issue_detail").show();
|
|||
$("#issue_edit").hide();
|
||||
$("#reply_div_<%= @issue.id %>").html("<%= escape_javascript(render :partial => 'issues/issue_replies', :locals => {:issue => @issue,:replies_all_i=>0}) %>");
|
||||
sd_create_editor_from_data(<%= @issue.id%>, null, "100%","<%=@issue.class.name%>");
|
||||
$(".homepagePostReplyBannerCount").html('回复(<%= @issue.journals.count %>)')
|
||||
$(".homepagePostReplyBannerCount").html('<%= escape_javascript(render :partial => 'issues/issue_reply_banner') %>');
|
||||
//edit里的编辑器貌似显示不出来,所以手动js生成。
|
||||
issue_desc_editor = KindEditor.create('#issue_description',
|
||||
{"width":"85%",
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
<div class="cl"></div>
|
||||
<div class="sy_class_logo fl">
|
||||
<div class="pr" style="width: 96px; height:96px;">
|
||||
<% if User.current.logged? && (User.current == @course.teacher || User.current.admin?)%>
|
||||
<% if is_teacher%>
|
||||
<%=link_to image_tag(url_to_avatar(@course),width:"96", height: "96", :id=>'nh_source_tx'), my_clear_user_avatar_temp_path(:course => @course.id), :remote => true%>
|
||||
<div class="homepageEditProfile undis">
|
||||
<%=link_to '', my_clear_user_avatar_temp_path(:course => @course.id), :class => 'homepageEditProfileIcon', :title => '点击编辑头像', :remote => true %>
|
||||
|
|
|
@ -14,8 +14,11 @@
|
|||
<li class="navHomepageMenu fl">
|
||||
<%= link_to "题库", user_homeworks_user_path(User.current), :class => "c_white f16 db p10"%>
|
||||
</li>
|
||||
<li class="navHomepageMenu fl mr30">
|
||||
<%= link_to "帮助中心", "https://#{Setting.host_name}/forums/1/memos/1168", :class =>"c_white f16 db p10" %>
|
||||
<!--<li class="navHomepageMenu fl mr30">-->
|
||||
<!--<%#= link_to "帮助中心", "https://#{Setting.host_name}/forums/1/memos/1168", :class =>"c_white f16 db p10" %>-->
|
||||
<!--</li>-->
|
||||
<li class="navHomepageMenu fl mr40">
|
||||
<a href="<%= forums_path(:reorder_complex=>'desc')%>" target="_blank" class="c_white f16 db p10" > 贴吧交流</a>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
|
|
|
@ -128,7 +128,7 @@
|
|||
<li><a href="<%=issue_path(:id => ma.forge_message.id) %>" target="_blank" title="<%=ma.forge_message.author.show_name %> <%= ma.forge_message.tracker_id == 5 ? "发布的周报:":"指派给你的问题:"%><%= ma.forge_message.subject%> 截止时间快到了!"><span class="shadowbox_news_user"><%=ma.forge_message.author.show_name %> </span><%= ma.forge_message.tracker_id == 5 ? "发布的周报:":"指派给你的问题:"%><%= ma.forge_message.subject%> 截止时间快到了!</a></li>
|
||||
<% elsif ma.forge_message_type == "Issue" && ma.status != 1 %>
|
||||
<li><a href="<%=issue_path(:id => ma.forge_message.id) %>" target="_blank" title="<%=ma.forge_message.author.show_name %> <%= ma.forge_message.tracker_id == 5 ? "发布了周报:":"指派了问题给你:"%><%= ma.forge_message.subject%>"><span class="shadowbox_news_user"><%=ma.forge_message.author.show_name %> </span><%= ma.forge_message.tracker_id == 5 ? "发布了周报:":"指派了问题给你:"%><%= ma.forge_message.subject%></a></li>
|
||||
<% elsif ma.forge_message_type == "Journal" %>
|
||||
<% elsif ma.forge_message_type == "Journal" && ma.forge_message %>
|
||||
<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="<%=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>
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
<p style="position:relative; display:inline;"><% if syllabus.eng_name && !syllabus.eng_name.empty? %>
|
||||
<span><%=syllabus.eng_name %></span>
|
||||
<% else%>
|
||||
<span style="color: #888">课程英文名称</span>
|
||||
<span style="color: #888"></span>
|
||||
<% end %>
|
||||
<% if User.current == syllabus.user || User.current.admin? %>
|
||||
<%= link_to image_tag("../images/signature_edit.png",width:"12px", height: "12px"), "javascript:void(0);",:id => "syllabus_edit_ng_name_png", :style => "width:15px; position:absolute; right: -20px; top: 5px;", :class => "none", :onclick => "show_edit_eng_name('#{syllabus.eng_name}');"%>
|
||||
<%= link_to image_tag("../images/signature_edit.png",width:"12px", height: "12px"), "javascript:void(0);",:id => "syllabus_edit_ng_name_png", :style => "width:15px; position:absolute; right: -20px; top: 5px;", :class => "none", :onclick => "show_edit_eng_name('#{syllabus.eng_name}');", :title => '编辑课程英文名称'%>
|
||||
<% end %>
|
||||
</p>
|
|
@ -1,5 +1,6 @@
|
|||
<h2 style="position:relative; display:inline;">课程名称:<%=syllabus.title %>
|
||||
<h2 style="position:relative; display:inline;">
|
||||
<%=syllabus.title %>
|
||||
<% if User.current == syllabus.user || User.current.admin? %>
|
||||
<%= link_to image_tag("../images/signature_edit.png",width:"12px", height: "12px"), "javascript:void(0);",:id => "syllabus_edit_title_png", :class => "none", :style => "width:15px; position:absolute; right: -20px; top: 15px;", :onclick => "show_edit_title('#{syllabus.title}');"%>
|
||||
<%= link_to image_tag("../images/signature_edit.png",width:"12px", height: "12px"), "javascript:void(0);",:id => "syllabus_edit_title_png", :class => "none", :style => "width:15px; position:absolute; right: -20px; top: 15px;", :onclick => "show_edit_title('#{syllabus.title}');", :title => '编辑课程名称'%>
|
||||
<% end %>
|
||||
</h2>
|
||||
|
|
|
@ -4,8 +4,11 @@
|
|||
</div>
|
||||
<div class="fl">
|
||||
<ul>
|
||||
<!--<li class="navHomepageMenu fl mr40">-->
|
||||
<!--<%#= link_to "帮助中心", "https://#{Setting.host_name}/forums/1/memos/1168", :class =>"c_white f16 db p10" %>-->
|
||||
<!--</li>-->
|
||||
<li class="navHomepageMenu fl mr40">
|
||||
<%= link_to "帮助中心", "https://#{Setting.host_name}/forums/1/memos/1168", :class =>"c_white f16 db p10" %>
|
||||
<a href="<%= forums_path(:reorder_complex=>'desc')%>" target="_blank" class="c_white f16 db p10" > 贴吧交流</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
<%= javascript_heads %>
|
||||
<%= heads_for_theme %>
|
||||
<%= stylesheet_link_tag 'prettify','jquery/jquery-ui-1.9.2','css/common','css/structure','css/public','repository','css/courses','css/org','css/project', 'css/popup' %>
|
||||
<%= javascript_include_tag 'cookie','project', 'organization','header','prettify','select_list_move','org'%>
|
||||
<%= javascript_include_tag 'cookie','project',"avatars", 'organization','header','prettify','select_list_move','org'%>
|
||||
<%= javascript_include_tag 'attachments' %>
|
||||
<%= call_hook :view_layouts_base_html_head %>
|
||||
<!-- page specific tags -->
|
||||
|
@ -77,17 +77,15 @@
|
|||
<!--<div class="pr_info_logo fl mr10 mb5">-->
|
||||
<!--<%#= image_tag(url_to_avatar(@organization), :width=>"60", :height=>"60", :alt=>"组织logo") %>-->
|
||||
<!--</div>-->
|
||||
<div class="pr_info_logo fl fl mr10 mb5" id="homepage_portrait_image">
|
||||
<%= image_tag(url_to_avatar(@organization),width:"60", height: "60", :id=>'nh_user_tx') %>
|
||||
<% if User.current.logged?%>
|
||||
<% if User.current.id == @organization.creator_id%>
|
||||
<div id="edit_org_file_btn" class="none">
|
||||
<div class="homepageEditProfile">
|
||||
<a href="<%= clear_org_avatar_temp_organization_path(@organization) %>" data-remote="true" class="homepageEditProfileIcon"></a>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end%>
|
||||
<div class="pr_info_logo fl fl mr10 mb5 pr" id="homepage_portrait_image">
|
||||
<% if User.current.logged? && User.current.admin_of_org?(@organization)%>
|
||||
<%=link_to image_tag(url_to_avatar(@organization),width:"60", height: "60", :id=>'nh_source_tx'), my_clear_user_avatar_temp_path(:organization => @organization.id), :remote => true%>
|
||||
<div class="homepageEditProfile undis">
|
||||
<%=link_to '', my_clear_user_avatar_temp_path(:organization => @organization.id), :remote => true, :class => 'homepageEditProfileIcon', :title => '点击编辑Logo' %>
|
||||
</div>
|
||||
<% else %>
|
||||
<%= image_tag(url_to_avatar(@organization), :width => "60", :height => "60", :alt => "组织logo") %>
|
||||
<% end %>
|
||||
</div>
|
||||
<!--<div class="orgName fl mb5 f14">组织id:<%#= @organization.id %></div>-->
|
||||
<div class="orgName fl mb5 f14" title="<%= @organization.name %>">
|
||||
|
@ -172,6 +170,10 @@
|
|||
<span><%= l(:label_loading) %></span>
|
||||
</div>
|
||||
|
||||
<div id="nh_tx_dialog_html" class="white_content" style="display:none;">
|
||||
<%=render :partial => 'layouts/upload_avatar', :locals => {:source => @organization} %>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
$("#courseMenu").mouseenter(function(){
|
||||
$("#topnav_course_menu").show();
|
||||
|
|
|
@ -34,9 +34,12 @@
|
|||
<%# 弹框 %>
|
||||
<div id="ajax-modal" style="display:none;"></div>
|
||||
<div id="ajax-indicator" style="display:none;"><span><%= l(:label_loading) %></span></div>
|
||||
<div id="nh_tx_dialog_html" class="white_content" style="display:none;">
|
||||
<%=render :partial => 'layouts/upload_avatar', :locals => {:source => @organization} %>
|
||||
</div>
|
||||
<%= call_hook :view_layouts_base_body_bottom %>
|
||||
<%# JS提前加载 %>
|
||||
<%= javascript_include_tag 'cookie','project', 'organization','header','prettify','select_list_move','org'%>
|
||||
<%= javascript_include_tag 'cookie','project',"avatars", 'organization','header','prettify','select_list_move','org'%>
|
||||
<%= javascript_include_tag 'attachments' %>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -41,9 +41,9 @@
|
|||
<div style="width:1000px; margin: 5px auto;">
|
||||
<p class="sy_cgrey">
|
||||
位置:
|
||||
<%= link_to User.current, user_path(User.current.id), :class => 'sy_cgrey', :target => '_blank' %>
|
||||
<%= link_to @syllabus.user.show_name, user_path(@syllabus.user), :class => 'sy_cgrey', :target => '_blank' %>
|
||||
>
|
||||
<%= link_to '课程', user_courselist_user_path(User.current.id), :class => "sy_cgrey", :target => '_blank' %>
|
||||
<%= link_to '课程', user_courselist_user_path(@syllabus.user), :class => "sy_cgrey", :target => '_blank' %>
|
||||
>
|
||||
<%= link_to @syllabus.title, syllabus_path(@syllabus.id), :class => "sy_cgrey" %>
|
||||
</p>
|
||||
|
|
|
@ -33,31 +33,31 @@
|
|||
$(document).ready(function(){
|
||||
$("#relateProject,.relatePInfo").mouseover(function(){
|
||||
$(".relatePInfo").css("display","block");
|
||||
})
|
||||
});
|
||||
$("#relateProject,.relatePInfo").mouseout(function(){
|
||||
$(".relatePInfo").css("display","none");
|
||||
})
|
||||
$(".homepagePostPortrait").mouseover(function(){
|
||||
onImage = true;
|
||||
$(this).children(".userCard").css("display","block");
|
||||
})
|
||||
$(".homepagePostPortrait").mouseout(function(){
|
||||
var cur = $(this);
|
||||
onImage = false;
|
||||
setTimeout(function(){
|
||||
if (onUserCard == false && onImage == false) {
|
||||
$(cur).children(".userCard").css("display","none");
|
||||
}
|
||||
},500);
|
||||
})
|
||||
$(".userCard").mouseover(function(){
|
||||
onUserCard = true;
|
||||
$(this).css("display","block");
|
||||
})
|
||||
$(".userCard").mouseout(function(){
|
||||
onUserCard = false;
|
||||
$(this).css("display","none");
|
||||
})
|
||||
});
|
||||
// $(".homepagePostPortrait").mouseover(function(){
|
||||
// onImage = true;
|
||||
// $(this).children(".userCard").css("display","block");
|
||||
// });
|
||||
// $(".homepagePostPortrait").mouseout(function(){
|
||||
// var cur = $(this);
|
||||
// onImage = false;
|
||||
// setTimeout(function(){
|
||||
// if (onUserCard == false && onImage == false) {
|
||||
// $(cur).children(".userCard").css("display","none");
|
||||
// }
|
||||
// },500);
|
||||
// });
|
||||
// $(".userCard").mouseover(function(){
|
||||
// onUserCard = true;
|
||||
// $(this).css("display","block");
|
||||
// });
|
||||
// $(".userCard").mouseout(function(){
|
||||
// onUserCard = false;
|
||||
// $(this).css("display","none");
|
||||
// });
|
||||
$(".coursesLineGrey").mouseover(function(){
|
||||
$(this).css("color","#ffffff");
|
||||
})
|
||||
|
|
|
@ -33,34 +33,34 @@
|
|||
$(document).ready(function(){
|
||||
$("#relateProject,.relatePInfo").mouseover(function(){
|
||||
$(".relatePInfo").css("display","block");
|
||||
})
|
||||
});
|
||||
$("#relateProject,.relatePInfo").mouseout(function(){
|
||||
$(".relatePInfo").css("display","none");
|
||||
})
|
||||
$(".homepagePostPortrait").mouseover(function(){
|
||||
onImage = true;
|
||||
$(this).children(".userCard").css("display","block");
|
||||
})
|
||||
$(".homepagePostPortrait").mouseout(function(){
|
||||
var cur = $(this);
|
||||
onImage = false;
|
||||
setTimeout(function(){
|
||||
if (onUserCard == false && onImage == false) {
|
||||
$(cur).children(".userCard").css("display","none");
|
||||
}
|
||||
},500);
|
||||
})
|
||||
$(".userCard").mouseover(function(){
|
||||
onUserCard = true;
|
||||
$(this).css("display","block");
|
||||
})
|
||||
$(".userCard").mouseout(function(){
|
||||
onUserCard = false;
|
||||
$(this).css("display","none");
|
||||
})
|
||||
});
|
||||
// $(".homepagePostPortrait").mouseover(function(){
|
||||
// onImage = true;
|
||||
// $(this).children(".userCard").css("display","block");
|
||||
// });
|
||||
// $(".homepagePostPortrait").mouseout(function(){
|
||||
// var cur = $(this);
|
||||
// onImage = false;
|
||||
// setTimeout(function(){
|
||||
// if (onUserCard == false && onImage == false) {
|
||||
// $(cur).children(".userCard").css("display","none");
|
||||
// }
|
||||
// },500);
|
||||
// });
|
||||
// $(".userCard").mouseover(function(){
|
||||
// onUserCard = true;
|
||||
// $(this).css("display","block");
|
||||
// });
|
||||
// $(".userCard").mouseout(function(){
|
||||
// onUserCard = false;
|
||||
// $(this).css("display","none");
|
||||
// });
|
||||
$(".coursesLineGrey").mouseover(function(){
|
||||
$(this).css("color","#ffffff");
|
||||
})
|
||||
});
|
||||
$(".coursesLineGrey").mouseout(function(){
|
||||
$(this).css("color","#808080");
|
||||
});
|
||||
|
|
|
@ -107,7 +107,7 @@
|
|||
<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="homepagePostReplyDes" onmouseover="$('#delete_reply_<%=reply.id %>').show();" onmouseout="$('#delete_reply_<%=reply.id %>').hide();">
|
||||
<%= render :partial => 'users/message_contents', :locals => {:comment => reply}%>
|
||||
|
||||
<div class="homepagePostReplyContent upload_img break_word table_maxWidth" id="reply_message_description_<%= reply.id %>">
|
||||
|
@ -132,7 +132,8 @@
|
|||
l(:button_delete),
|
||||
{:action => 'destroy', :id => reply},
|
||||
:method => :post,
|
||||
:class => 'fr mr20',
|
||||
:id => "delete_reply_#{reply.id}",
|
||||
:class => 'fr mr20 undis',
|
||||
:data => {:confirm => l(:text_are_you_sure)},
|
||||
:title => l(:button_delete)
|
||||
) if reply.course_destroyable_by?(User.current) %>
|
||||
|
|
|
@ -104,18 +104,15 @@
|
|||
<ul>
|
||||
<li class="homepagePostSettingIcon">
|
||||
<ul class="homepagePostSettiongText">
|
||||
|
||||
<li>
|
||||
<%= link_to(l(:button_edit), {:action => 'edit', :id => @topic}, :class => 'postOptionLink') if @message.editable_by?(User.current) %>
|
||||
</li>
|
||||
<% if @topic.author.id == User.current.id %>
|
||||
<li>
|
||||
<%= link_to(l(:button_delete), {:action => 'destroy', :id => @topic},:method => :post,
|
||||
:data => {:confirm => l(:text_are_you_sure)},
|
||||
:class => 'postOptionLink'
|
||||
) if @message.destroyable_by?(User.current) %>
|
||||
</li>
|
||||
<% end %>
|
||||
<li>
|
||||
<%= link_to(l(:button_edit), {:action => 'edit', :id => @topic}, :class => 'postOptionLink') if @message.editable_by?(User.current) %>
|
||||
</li>
|
||||
<li>
|
||||
<%= link_to(l(:button_delete), {:action => 'destroy', :id => @topic},:method => :post,
|
||||
:data => {:confirm => l(:text_are_you_sure)},
|
||||
:class => 'postOptionLink'
|
||||
) if @message.destroyable_by?(User.current) %>
|
||||
</li>
|
||||
<% if hidden_unproject_infos %>
|
||||
<li><%= link_to "发送", "javascript:void(0);", :onclick => "show_send(#{@message.id},#{User.current.id},'message');", :class => 'postOptionLink' %></li>
|
||||
<% else %>
|
||||
|
@ -174,7 +171,7 @@
|
|||
<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="homepagePostReplyDes" onmouseover="$('#delete_reply_<%=reply.id %>').show();" onmouseout="$('#delete_reply_<%=reply.id %>').hide();">
|
||||
<%= render :partial => 'users/message_contents', :locals => {:comment => reply}%>
|
||||
|
||||
<div class="homepagePostReplyContent upload_img break_word table_maxWidth" id="reply_message_description_<%= reply.id %>">
|
||||
|
@ -199,10 +196,11 @@
|
|||
l(:button_delete),
|
||||
{:action => 'destroy', :id => reply},
|
||||
:method => :post,
|
||||
:class => 'fr mr20',
|
||||
:id => "delete_reply_#{reply.id}",
|
||||
:class => 'fr mr20 undis',
|
||||
:data => {:confirm => l(:text_are_you_sure)},
|
||||
:title => l(:button_delete)
|
||||
) if reply.course_destroyable_by?(User.current) %>
|
||||
) if reply.destroyable_by?(User.current) %>
|
||||
</span>
|
||||
|
||||
<div class="cl"></div>
|
||||
|
|
|
@ -10,5 +10,15 @@ if($("#course_avatar_form").length > 0) {
|
|||
$("#nh_source_tx").replaceWith('<%= image_tag(url_to_avatar(@project), :id=>'nh_source_tx',:style=>"width:60px;height:60px;overflow:hidden",:alt=>"项目logo") %>');
|
||||
if($("#project_avatar_form").length > 0) {
|
||||
window.location.href = "<%=settings_project_path(@project) %>";
|
||||
}<% end %>
|
||||
}
|
||||
<% elsif @organization %>
|
||||
<% if @organization.show_mode == 1 %>
|
||||
$("#nh_source_tx").replaceWith('<%= image_tag(url_to_avatar(@organization), :id=>'nh_source_tx',:style=>"width:51px;height:51px;overflow:hidden",:alt=>"组织logo") %>');
|
||||
<% else %>
|
||||
$("#nh_source_tx").replaceWith('<%= image_tag(url_to_avatar(@organization), :id=>'nh_source_tx',:style=>"width:60px;height:60px;overflow:hidden",:alt=>"组织logo") %>');
|
||||
<% end %>
|
||||
if($("#org_avatar_form").length > 0) {
|
||||
window.location.href = "<%=setting_organization_path(@organization) %>";
|
||||
}
|
||||
<% end %>
|
||||
hideModal();
|
|
@ -82,7 +82,7 @@
|
|||
</div>
|
||||
<div class="cl"></div>
|
||||
<div class="homepagePostReply">
|
||||
<%= render :partial => 'news/news_all_replies' %>
|
||||
<%= render :partial => 'news/news_all_replies', :locals => {:object => @course} %>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
<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="homepagePostReplyDes" onmouseover="$('#delete_reply_<%=comment.id %>').show();" onmouseout="$('#delete_reply_<%=comment.id %>').hide();">
|
||||
<%= render :partial => 'users/news_contents', :locals => {:comment => comment}%>
|
||||
|
||||
<% if !comment.content_detail.blank? %>
|
||||
|
@ -47,10 +47,11 @@
|
|||
:action => 'destroy', :id => @news,
|
||||
:comment_id => comment},
|
||||
:method => :delete,
|
||||
:class => 'fr mr20',
|
||||
:id => "delete_reply_#{comment.id}",
|
||||
:class => 'fr mr20 undis',
|
||||
:data => {:confirm => l(:text_are_you_sure)},
|
||||
:title => l(:button_delete)
|
||||
) if @news.author == User.current %>
|
||||
) if User.current.allowed_to?(:manage_news, object) %>
|
||||
</span>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
|
|
@ -86,7 +86,7 @@
|
|||
</div>
|
||||
<div class="cl"></div>
|
||||
<div class="homepagePostReply">
|
||||
<%= render :partial => 'news/news_all_replies' %>
|
||||
<%= render :partial => 'news/news_all_replies', :locals => {:object => @project} %>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
|
|
|
@ -102,7 +102,7 @@
|
|||
<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="homepagePostReplyDes" onmouseover="$('#delete_reply_<%=comment.id%>').show();" onmouseout="$('#delete_reply_<%=comment.id%>').hide();">
|
||||
<%= render :partial => 'users/message_contents', :locals => {:comment => comment}%>
|
||||
|
||||
<% if !comment.content_detail.blank? %>
|
||||
|
@ -129,7 +129,8 @@
|
|||
l(:button_delete),
|
||||
{:controller => 'org_document_comments',:action => 'delete_reply', :id => comment.id},
|
||||
:method => :delete,
|
||||
:class => 'fr mr20',
|
||||
:id => "delete_reply_#{comment.id}",
|
||||
:class => 'fr mr20 undis',
|
||||
:data => {:confirm => l(:text_are_you_sure)},
|
||||
:title => l(:button_delete)) %>
|
||||
<% end %>
|
||||
|
|
|
@ -24,7 +24,8 @@
|
|||
:upload_path => upload_avatar_path(:format => 'js'),
|
||||
:description_placeholder => nil ,# l(:label_optional_description)
|
||||
:source_type => source.class.to_s,
|
||||
:source_id => source.id.to_s
|
||||
:source_id => source.id.to_s,
|
||||
:is_direct => 0
|
||||
} %>
|
||||
<!--</span>-->
|
||||
<% content_for :header_tags do %>
|
||||
|
|
|
@ -1,7 +1,17 @@
|
|||
|
||||
<div class="por_header_top">
|
||||
<div class="por_header_con" >
|
||||
<%= image_tag(url_to_avatar(@organization), width:"51", height: "51", :id => 'nh_user_tx', :class => "por_logo fl mt1", :target => "_blank") %>
|
||||
<div class="por_header_con">
|
||||
<div class="pr fl">
|
||||
<% if User.current.logged? && User.current.admin_of_org?(@organization)%>
|
||||
<%=link_to image_tag(url_to_avatar(@organization),width:"51", height: "51", :id=>'nh_source_tx'), my_clear_user_avatar_temp_path(:organization => @organization.id), :remote => true%>
|
||||
<div class="homepageEditProfile undis">
|
||||
<%=link_to '', my_clear_user_avatar_temp_path(:organization => @organization.id), :remote => true, :class => 'homepageEditProfileIcon', :title => '点击编辑Logo' %>
|
||||
</div>
|
||||
<% else %>
|
||||
<%= image_tag(url_to_avatar(@organization), :width => "51", :height => "51", :alt => "组织logo") %>
|
||||
<% end %>
|
||||
</div>
|
||||
<%#= image_tag(url_to_avatar(@organization), width:"51", height: "51", :id => 'nh_user_tx', :class => "por_logo fl mt1", :target => "_blank") %>
|
||||
<% if User.current.logged? %>
|
||||
<div class="navHomepageProfile" id="navHomepageProfile">
|
||||
<ul>
|
||||
|
|
|
@ -4,45 +4,45 @@
|
|||
$(document).ready(function(){
|
||||
$("#relateProject,.relatePInfo").mouseover(function(){
|
||||
$(".relatePInfo").css("display","block");
|
||||
})
|
||||
});
|
||||
$("#relateProject,.relatePInfo").mouseout(function(){
|
||||
$(".relatePInfo").css("display","none");
|
||||
})
|
||||
$(".homepagePostPortrait").mouseover(function(){
|
||||
onImage = true;
|
||||
$(this).children(".userCard").css("display","block");
|
||||
})
|
||||
$(".homepagePostPortrait").mouseout(function(){
|
||||
var cur = $(this);
|
||||
onImage = false;
|
||||
setTimeout(function(){
|
||||
if (onUserCard == false && onImage == false) {
|
||||
$(cur).children(".userCard").css("display", "none");
|
||||
}
|
||||
}, 500);
|
||||
})
|
||||
$(".userCard").mouseover(function(){
|
||||
onUserCard = true;
|
||||
$(this).css("display","block");
|
||||
})
|
||||
$(".userCard").mouseout(function(){
|
||||
onUserCard = false;
|
||||
$(this).css("display","none");
|
||||
})
|
||||
});
|
||||
// $(".homepagePostPortrait").mouseover(function(){
|
||||
// onImage = true;
|
||||
// $(this).children(".userCard").css("display","block");
|
||||
// });
|
||||
// $(".homepagePostPortrait").mouseout(function(){
|
||||
// var cur = $(this);
|
||||
// onImage = false;
|
||||
// setTimeout(function(){
|
||||
// if (onUserCard == false && onImage == false) {
|
||||
// $(cur).children(".userCard").css("display", "none");
|
||||
// }
|
||||
// }, 500);
|
||||
// });
|
||||
// $(".userCard").mouseover(function(){
|
||||
// onUserCard = true;
|
||||
// $(this).css("display","block");
|
||||
// });
|
||||
// $(".userCard").mouseout(function(){
|
||||
// onUserCard = false;
|
||||
// $(this).css("display","none");
|
||||
// });
|
||||
$(".coursesLineGrey").mouseover(function(){
|
||||
$(this).css("color","#ffffff");
|
||||
})
|
||||
});
|
||||
$(".coursesLineGrey").mouseout(function(){
|
||||
$(this).css("color","#808080");
|
||||
})
|
||||
});
|
||||
$(".homepagePostSetting,.coursesLineGrey").mouseover(function(){
|
||||
$(this).prev().css("color","#ffffff");
|
||||
$(this).css("z-index", "9999");
|
||||
})
|
||||
});
|
||||
$(".homepagePostSetting").mouseout(function(){
|
||||
$(this).prev().css("color","#808080");
|
||||
$(this).css("z-index", "1");
|
||||
})
|
||||
});
|
||||
|
||||
//二级菜单滑动时箭头方向控制
|
||||
$(".homepageLeftMenuMoreIcon").toggle(function(){
|
||||
|
|
|
@ -47,7 +47,9 @@
|
|||
<!--<a href="javascript:void(0);" class="logoEnter fl linkGrey4">上传图片</a>-->
|
||||
<%#= form_for( @organization,{:controller => 'organizations',:action => 'update',:id=>@organization,:html=>{:id=>'update_org_form',:method=>'put'}}) do %>
|
||||
<%= labelled_form_for @organization do |f|%>
|
||||
<%= render :partial=>"new_org_avatar_form",:locals=> {source:@organization} %>
|
||||
<div id="org_avatar_form">
|
||||
<%= render :partial=>"new_org_avatar_form",:locals=> {source:@organization} %>
|
||||
</div>
|
||||
<!--<div class="cl"></div>-->
|
||||
<!--</div>-->
|
||||
<div class="orgRow mb10"><span class="c_red">* </span>组织名称:<input type="text" name="organization[name]" id="organization_name" maxlength="100" onblur="check_uniq(<%=@organization.id %>);" onfocus="$('#check_name_hint').hide()" class="orgNameInput" value="<%= @organization.name%>" />
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<% for journal in journals %>
|
||||
<div class="ping_C" id='word_li_<%= journal.id.to_s %>'>
|
||||
<div class="ping_dispic"><%= link_to image_tag(url_to_avatar(journal.user),:width => '46',:height => '46'), user_path(journal.user) %></div>
|
||||
<div class="ping_discon" style="width: 610px;">
|
||||
<div class="ping_discon" style="width: 610px;" onmouseover="$('#delete_reply_<%=journal.id %>').show();" onmouseout="$('#delete_reply_<%=journal.id %>').hide();">
|
||||
<div class="ping_distop f14">
|
||||
<!-- <a style=" font-weight:bold; color:#15bccf; margin-right:30px; background:none;" target="_blank" href="#">gugu01</a> -->
|
||||
<span><%= link_to journal.user.show_name, user_path(journal.user), :class => 'c_blue fb fl mb10 f14', :target => "_blank" %>
|
||||
|
@ -20,16 +20,16 @@
|
|||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>journal, :user_activity_id=>journal.id,:type=>"reply"}%>
|
||||
</span>
|
||||
<% if journal.user == User.current|| User.current.admin? %>
|
||||
<%= link_to(l(:label_bid_respond_delete),
|
||||
{:controller => 'words', :action => 'destroy', :object_id => journal, :user_id => @user},
|
||||
:remote => true, :confirm => l(:text_are_you_sure), :method => 'delete',
|
||||
:class => "delete", :title => l(:button_delete)) %>
|
||||
<% end %>
|
||||
<% if reply_allow %>
|
||||
<% if reply_allow %>
|
||||
<%#= link_to l(:label_bid_respond_quote),'',
|
||||
{:focus => 'project_respond',:nhname=>"reply_btn", :onclick => "toggleAndSettingWordsVal($('##{ids}'), $('##{ids} textarea')); $('##{ids} textarea') ;return false;"} %>
|
||||
<%= link_to l(:label_bid_respond_quote),'javascript:;', {:nhname=>"reply_btn"} %>
|
||||
|
||||
<% end %>
|
||||
<%= link_to(l(:label_bid_respond_delete),
|
||||
{:controller => 'words', :action => 'destroy', :object_id => journal, :user_id => @user},
|
||||
:remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :id => "delete_reply_#{journal.id}",
|
||||
:class => "delete undis", :title => l(:button_delete)) %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
|
|
@ -5,41 +5,41 @@
|
|||
$(document).ready(function(){
|
||||
$("#relateProject,.relatePInfo").mouseover(function(){
|
||||
$(".relatePInfo").css("display","block");
|
||||
})
|
||||
});
|
||||
$("#relateProject,.relatePInfo").mouseout(function(){
|
||||
$(".relatePInfo").css("display","none");
|
||||
})
|
||||
$(".homepagePostPortrait").mouseover(function(){
|
||||
onImage = true;
|
||||
$(this).children(".userCard").css("display","block");
|
||||
})
|
||||
$(".homepagePostPortrait").mouseout(function(){
|
||||
var cur = $(this);
|
||||
onImage = false;
|
||||
setTimeout(function(){
|
||||
if (onUserCard == false && onImage == false) {
|
||||
$(cur).children(".userCard").css("display", "none");
|
||||
}
|
||||
}, 500);
|
||||
})
|
||||
$(".userCard").mouseover(function(){
|
||||
onUserCard = true;
|
||||
$(this).css("display","block");
|
||||
})
|
||||
$(".userCard").mouseout(function(){
|
||||
onUserCard = false;
|
||||
$(this).css("display","none");
|
||||
})
|
||||
});
|
||||
// $(".homepagePostPortrait").mouseover(function(){
|
||||
// onImage = true;
|
||||
// $(this).children(".userCard").css("display","block");
|
||||
// });
|
||||
// $(".homepagePostPortrait").mouseout(function(){
|
||||
// var cur = $(this);
|
||||
// onImage = false;
|
||||
// setTimeout(function(){
|
||||
// if (onUserCard == false && onImage == false) {
|
||||
// $(cur).children(".userCard").css("display", "none");
|
||||
// }
|
||||
// }, 500);
|
||||
// });
|
||||
// $(".userCard").mouseover(function(){
|
||||
// onUserCard = true;
|
||||
// $(this).css("display","block");
|
||||
// });
|
||||
// $(".userCard").mouseout(function(){
|
||||
// onUserCard = false;
|
||||
// $(this).css("display","none");
|
||||
// });
|
||||
$(".coursesLineGrey").mouseover(function(){
|
||||
$(this).css("color","#ffffff");
|
||||
})
|
||||
});
|
||||
$(".coursesLineGrey").mouseout(function(){
|
||||
$(this).css("color","#808080");
|
||||
})
|
||||
});
|
||||
$(".homepagePostSetting,.coursesLineGrey").mouseover(function(){
|
||||
$(this).prev().css("color","#ffffff");
|
||||
$(this).css("z-index", "9999");
|
||||
})
|
||||
});
|
||||
$(".homepagePostSetting").mouseout(function(){
|
||||
$(this).prev().css("color","#808080");
|
||||
$(this).css("z-index", "1");
|
||||
|
|
|
@ -26,7 +26,11 @@
|
|||
<%= 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? %>
|
||||
<% if student_work.project_id == 0 || student_work.project_id.nil?%>
|
||||
<td class="<%=@homework.anonymous_comment == 1 ? 'hworkPrName2' : 'hworkPrName'%> student_work_<%= student_work.id%>" title="该项目是私有的">
|
||||
--
|
||||
</td>
|
||||
<% elsif 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>
|
||||
|
|
|
@ -26,7 +26,11 @@
|
|||
<%= 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? %>
|
||||
<% if student_work.project_id == 0 || student_work.project_id.nil?%>
|
||||
<td class="hworkPrName float-none mr10 student_work_<%= student_work.id%>" title="项目名称">
|
||||
--
|
||||
</td>
|
||||
<% elsif student_work.project.is_public || User.current.member_of?(student_work.project) || User.current.admin? %>
|
||||
<td class="hworkPrName float-none mr10 student_work_<%= student_work.id%>" title="项目名称">
|
||||
<%= link_to( student_work.project.name, project_path(student_work.project.id))%>
|
||||
</td>
|
||||
|
@ -81,7 +85,7 @@
|
|||
</td>
|
||||
<% end%>
|
||||
|
||||
<% my_score = student_work_score(student_work,User.current) %>
|
||||
<% my_score = student_work_score(student_work,User.current,3) %>
|
||||
<td class="hworkList70 <%= my_score.nil? ? 'c_grey' : score_color(my_score.score)%> mr10 ml10">
|
||||
<%= my_score.nil? ? "--" : format("%.1f",my_score.score)%>
|
||||
</td>
|
||||
|
|
|
@ -46,13 +46,16 @@
|
|||
<% if @homework.homework_detail_group.base_on_project == 1 %>
|
||||
<li>
|
||||
<span class="tit_fb"> 关联项目:</span>
|
||||
<% if work.project.is_public || User.current.member_of?(work.project) || User.current.admin? %>
|
||||
<% if work.project_id == 0 || work.project_id.nil? %>
|
||||
<span>暂无</span>
|
||||
<% elsif work.project.is_public || User.current.member_of?(work.project) || User.current.admin? %>
|
||||
<%= link_to( work.project.name, project_path(work.project.id), :class => "linkBlue" )%>
|
||||
<span class="ml5">(综合评分:<font class="c_red"><%=static_project_score(work.project.project_score).to_i %></font>)</span>
|
||||
<% else %>
|
||||
<span title ="该项目是私有的"><%=work.project.name %></span>
|
||||
<span class="ml5">(综合评分:<font class="c_red"><%=static_project_score(work.project.project_score).to_i %></font>)</span>
|
||||
<% end %>
|
||||
<%#= link_to( work.project.name, project_path(work.project.id), :class => "linkBlue" )%>
|
||||
<span class="ml5">(综合评分:<font class="c_red"><%=static_project_score(work.project.project_score).to_i %></font>)</span>
|
||||
</li>
|
||||
<% end %>
|
||||
<% end%>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<ul class="ping_box_ul <%= is_last ? '' : 'ping_line'%> fl">
|
||||
<% show_real_name = @is_teacher || score.user == User.current || score.user.allowed_to?(:as_teacher,@course) %>
|
||||
<% show_real_name = @is_teacher || score.user == User.current || score.user.allowed_to?(:as_teacher,@course) || score.reviewer_role != 3 %>
|
||||
<%= link_to image_tag(url_to_avatar(show_real_name ? score.user : ""), :width => "34", :height => "34"), show_real_name ? user_path(score.user) : "javascript:void(0)",:class => "ping_pic fl" %>
|
||||
<div class="pingBoxTit">
|
||||
<%= link_to show_real_name ? score.user.show_name : "匿名", show_real_name ? user_path(score.user) : "javascript:void(0)", :title => show_real_name ? score.user.show_name : "匿评用户", :class => "linkBlue fl" %>
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
<span class="<%= course.is_public == 0 ? 'hw_icon_private' : 'hw_icon_open' %> fl mr20 mt3"></span>
|
||||
<div class="cl"></div>
|
||||
<p class="sy_cgrey">
|
||||
<span class=" mr15">主讲老师:<%=link_to course.teacher.show_name, user_path(course.teacher), :class => 'sy_cblue' %></span>
|
||||
<span class=" mr15">创建老师:<%=link_to course.teacher.show_name, user_path(course.teacher), :class => 'sy_cblue' %></span>
|
||||
<% if User.current.admin? || User.current.allowed_to?(:as_teacher,course) %>
|
||||
<% homework_num = course.homework_commons.count %>
|
||||
<% else %>
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
$("#syllabus_eng_name_show").html("<%= escape_javascript render :partial => 'layouts/syllabus_eng_name', :locals => {:syllabus => @syllabus} %>");
|
||||
$("#syllabus_eng_name_show").show();
|
||||
$("#syllabus_edit_ng_name_png").show();
|
||||
$("#syllabus_eng_name_edit").hide();
|
|
@ -10,13 +10,15 @@
|
|||
<span class="c_red" id="new_syllabus_name_notice" style="display: none;">课程名称不能为空且至少有两个字符</span>
|
||||
</li>
|
||||
<div class="cl"></div>
|
||||
<li class="ml125 fontGrey3"><span class="success-icon mr25">正确示例:软件工程</span><span class="error-icon">错误示例:2016软件工程</span></li>
|
||||
<li class="ml125 mt10 mb10 fontGrey2">课程是针对一个具体的学科方向开展的教学内容与进程安排<br/>本质上,一门课程就是一个教学计划</li>
|
||||
<li class="ml45">
|
||||
<label><span class="c_white">*</span> <%= l(:label_tags_course_eng_name)%> :</label>
|
||||
<input type="text" name="eng_name" id="new_syllabus_eng_name" placeholder="例如:Software Engineering" class="name_input" maxlength="100">
|
||||
<!--<span class="c_red" id="new_course_class_period_notice" style="display: none;"></span>-->
|
||||
</li>
|
||||
<div class="cl"></div>
|
||||
<li class=" ml90" >
|
||||
<li class=" ml55" >
|
||||
<a href="javascript:void(0)" class="blue_btn fl c_white" onclick="submit_new_syllabus();" >提交</a>
|
||||
<%= link_to "取消",user_activities_path(User.current.id),:class => "grey_btn fl c_white ml10"%>
|
||||
<div class="cl"></div>
|
||||
|
|
|
@ -215,15 +215,18 @@
|
|||
</script>
|
||||
|
||||
<div class="mr10 mb10 mt10 fl w100 fontGrey2" style="text-align: center;">
|
||||
<% if project.is_public || User.current.member_of?(project) || User.current.admin? %>
|
||||
<%= link_to image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius relatePImage"),project_path(project.id,:host=>Setting.host_name),:id=>"project_img_"+project.id.to_s+"_"+activity.id.to_s,:alt =>"项目头像" %>
|
||||
<% else %>
|
||||
<%= image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius relatePImage",:id=>"project_img_"+project.id.to_s+"_"+activity.id.to_s,:alt =>"项目头像") %>
|
||||
<% end %>
|
||||
<% com_time = project.project_score.commit_time %>
|
||||
<% forge_time=ForgeActivity.where("project_id=?",project.id).last.updated_at if ForgeActivity.where("project_id=?",project.id).last %>
|
||||
<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(forge_time) ? com_time : forge_time %> <%= project.project_score.changeset_num %>提交</p>
|
||||
<% if project.is_public || User.current.member_of?(project) || User.current.admin? %>
|
||||
<%= link_to image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius relatePImage"),project_path(project.id,:host=>Setting.host_name),:id=>"project_img_"+project.id.to_s+"_"+activity.id.to_s,:alt =>"项目头像", :target => '_blank' %>
|
||||
<p class="mh18 hidden"><%=link_to (User.find project.user_id).show_name+"(组长)", project_path(project.id,:host=>Setting.host_name), :target => '_blank', :title => "#{(User.find project.user_id).show_name}(组长)" %></p>
|
||||
<% update_time = time_from_now !com_time.nil? && format_time(com_time) > format_time(forge_time) ? com_time : forge_time %>
|
||||
<p class="mh18 hidden"><%=link_to update_time+" "+project.project_score.changeset_num.to_s+"提交", project_path(project.id,:host=>Setting.host_name), :target => '_blank', :title => "#{update_time} #{project.project_score.changeset_num.to_s}提交" %></p>
|
||||
<% else %>
|
||||
<%= image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius relatePImage",:id=>"project_img_"+project.id.to_s+"_"+activity.id.to_s,:alt =>"项目头像",:title => "私有项目不可访问") %>
|
||||
<p class="mh18 hidden" title="私有项目不可访问"><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 hidden" title="私有项目不可访问"><%=time_from_now !com_time.nil? && format_time(com_time) > format_time(forge_time) ? com_time : forge_time %> <%= project.project_score.changeset_num %>提交</p>
|
||||
<% end %>
|
||||
<div class="relatePInfo" id="relatePInfo_<%=project.id %>_<%=activity.id %>">
|
||||
项目名称:<%=project.name %><br />
|
||||
创建者:<%=(User.find project.user_id).show_name %>(组长)<br />
|
||||
|
@ -295,7 +298,7 @@
|
|||
<% comments = activity.journals_for_messages.reorder("created_on desc").limit(3) %>
|
||||
<% if count > 0 %>
|
||||
<div class="" id="reply_div_<%= user_activity_id %>">
|
||||
<%=render :partial => 'users/news_replies', :locals => {:comments => comments, :type => 'HomeworkCommon', :is_in_course => -1,:course_activity=>course_activity, :is_teacher => is_teacher, :user_activity_id => user_activity_id} %>
|
||||
<%=render :partial => 'users/news_replies', :locals => {:comments => comments, :type => 'HomeworkCommon', :is_in_course => -1,:course_activity=>course_activity, :is_teacher => is_teacher, :user_activity_id => user_activity_id, :activity_id => activity.id} %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<div class="syllabus_class_w ">
|
||||
<a href="<%= allow_visit ? course_path(course.id) : "javascript:void(0)" %>" class="syllabus_class_title fl" target="_blank" title="<%= allow_visit ? "" : "私有班级不可访问" %>"><%= course.name %></a>
|
||||
<span class="<%= course.is_public == 0 ? 'syllabus_class_private' : 'syllabus_class_open' %> fl ml10 mt3 syllabus_class_property"><%= course.is_public == 0 ? '私有' : '公开' %></span>
|
||||
<span class="fr sy_p_grey hidden" style="max-width: 120px;">主讲老师:<%= link_to course.teacher.show_name, user_path(course.teacher) %></span>
|
||||
<span class="fr sy_p_grey hidden" style="max-width: 120px;">创建老师:<%= link_to course.teacher.show_name, user_path(course.teacher) %></span>
|
||||
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<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="homepagePostReplyDes" onmouseover="$('#delete_reply_<%=activity_id %>_<%=comment.id %>').show();" onmouseout="$('#delete_reply_<%=activity_id %>_<%=comment.id %>').hide();">
|
||||
<%= render :partial => 'users/message_contents', :locals => {:comment => comment}%>
|
||||
|
||||
<% if !comment.content_detail.blank? %>
|
||||
|
@ -33,13 +33,14 @@
|
|||
: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) %>
|
||||
<% if comment.course_destroyable_by?(User.current) || comment.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',
|
||||
:id => "delete_reply_#{activity_id}_#{comment.id}",
|
||||
:class => 'fr mr20 undis',
|
||||
:data => {:confirm => l(:text_are_you_sure)},
|
||||
:title => l(:button_delete)
|
||||
) %>
|
||||
|
@ -56,7 +57,7 @@
|
|||
</span>
|
||||
<% if comment.creator_user == User.current || User.current.admin? %>
|
||||
<%= link_to('删除', {:controller => 'words', :action => 'destroy', :object_id => comment, :user_id => comment.user, :user_activity_id => user_activity_id, :activity_id => activity_id},
|
||||
:remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "fr mr20", :title => l(:button_delete)) %>
|
||||
:id => "delete_reply_#{activity_id}_#{comment.id}",:remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "fr mr20 undis", :title => l(:button_delete)) %>
|
||||
<% end %>
|
||||
<% elsif type == 'OrgDocumentComment' %>
|
||||
<span style="position: relative" class="fr mr20">
|
||||
|
@ -74,7 +75,8 @@
|
|||
{:controller => 'org_document_comments',:action => 'destroy', :id => comment.id, :user_activity_id => user_activity_id},
|
||||
:method => :delete,
|
||||
:remote => true,
|
||||
:class => 'fr mr20',
|
||||
:id => "delete_reply_#{activity_id}_#{comment.id}",
|
||||
:class => 'fr mr20 undis',
|
||||
:data => {:confirm => l(:text_are_you_sure)},
|
||||
:title => l(:button_delete)) %>
|
||||
<% end %>
|
||||
|
@ -94,7 +96,8 @@
|
|||
{:controller => 'blog_comments',:action => 'destroy', :id => comment.id, :user_activity_id => user_activity_id, :homepage => homepage, :user_id => user_id},
|
||||
:method => :delete,
|
||||
:remote => true,
|
||||
:class => 'fr mr20',
|
||||
:id => "delete_reply_#{activity_id}_#{comment.id}",
|
||||
:class => 'fr mr20 undis',
|
||||
:data => {:confirm => l(:text_are_you_sure)},
|
||||
:title => l(:button_delete)) %>
|
||||
<% end %>
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<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="homepagePostReplyDes" onmouseover="$('#delete_reply_<%=activity_id %>_<%=comment.id %>').show();" onmouseout="$('#delete_reply_<%=activity_id %>_<%=comment.id %>').hide();">
|
||||
<%= render :partial => 'users/news_contents', :locals => {:comment => comment}%>
|
||||
|
||||
<% if !comment.content_detail.blank? || comment.class == Journal %>
|
||||
|
@ -44,7 +44,7 @@
|
|||
</span>
|
||||
<% if User.current.admin? ||is_teacher || comment.user == User.current%>
|
||||
<%= link_to('删除', {:controller => 'words', :action => 'destroy', :object_id => comment, :user_id => comment.user,:is_in_course => is_in_course, :user_activity_id => user_activity_id, :course_activity => course_activity},
|
||||
:remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "fr mr20", :title => l(:button_delete)) %>
|
||||
:id => "delete_reply_#{activity_id}_#{comment.id}",:remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "fr mr20 undis", :title => l(:button_delete)) %>
|
||||
<% end %>
|
||||
<% elsif type == 'News' %>
|
||||
<span style="position: relative" class="fr mr20">
|
||||
|
@ -56,8 +56,9 @@
|
|||
:title => l(:button_reply)) %>
|
||||
<span id="reply_iconup_<%= comment.id %>" class="reply_iconup02" style="display: none"> ︿</span>
|
||||
</span>
|
||||
<% news = News.find(activity_id) %>
|
||||
<%= link_to('删除', {:controller => 'comments', :action => 'destroy', :id => activity_id, :comment_id => comment, :user_activity_id => user_activity_id},
|
||||
:remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "fr mr20", :title => l(:button_delete)) if News.find(activity_id).author == User.current %>
|
||||
:id => "delete_reply_#{activity_id}_#{comment.id}",:remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "fr mr20 undis", :title => l(:button_delete)) if (User.current.allowed_to?(:manage_news, news.course) || User.current.allowed_to?(:manage_news, news.project)) %>
|
||||
<% elsif type == 'Issue' %>
|
||||
<span style="position: relative" class="fr mr20">
|
||||
<%= link_to(
|
||||
|
@ -74,7 +75,8 @@
|
|||
:method => 'get',
|
||||
:confirm => l(:text_are_you_sure),
|
||||
:remote=>true,
|
||||
:class => 'fr mr20',
|
||||
:id => "delete_reply_#{activity_id}_#{comment.id}",
|
||||
:class => 'fr mr20 undis',
|
||||
:title => l(:button_delete)
|
||||
) if comment.user_id == User.current.id %>
|
||||
<% elsif type == 'Syllabus' %>
|
||||
|
@ -88,8 +90,8 @@
|
|||
<span id="reply_iconup_<%= comment.id %>" class="reply_iconup02" style="display: none"> ︿</span>
|
||||
</span>
|
||||
<% if User.current.admin? || User.current == Syllabus.find(activity_id).user || comment.user == User.current%>
|
||||
<%= link_to('删除', {:controller => 'words', :action => 'destroy', :object_id => comment, :user_id => comment.user},
|
||||
:remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "fr mr20", :title => l(:button_delete)) %>
|
||||
<%= link_to('删除', {:controller => 'words', :action => 'destroy', :object_id => comment, :user_id => comment.user},:id => "delete_reply_#{activity_id}_#{comment.id}",
|
||||
:remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "fr mr20 undis", :title => l(:button_delete)) %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</span>
|
||||
|
|
|
@ -80,7 +80,7 @@
|
|||
<div id="intro_content_hide_<%= user_activity_id %>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
|
||||
<div class="cl"></div>
|
||||
<%# 局部刷新:修改xissue属性 %>
|
||||
<% if User.current.member_of?(activity.project) %>
|
||||
<% if User.current.member_of?(activity.project) && !activity.nil? && !activity.status.nil? %>
|
||||
<% unless params[:action] == "index" %>
|
||||
<div id="div_user_issue_detail_<%=activity.id %>">
|
||||
<%= render :partial => 'users/project_issue_detail', :locals => {:activity => activity} %>
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
: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)) %>
|
||||
<%='创建老师:'+(teacher.try(:realname) != " " ? teacher.lastname + teacher.firstname : teacher.try(:login)) %>
|
||||
</span>
|
||||
</li>
|
||||
<div class="cl"></div>
|
||||
|
|
|
@ -225,15 +225,18 @@
|
|||
</script>
|
||||
|
||||
<div class="mr10 mb10 mt10 fl w100 fontGrey2" style="text-align: center;">
|
||||
<% if project.is_public || User.current.member_of?(project) || User.current.admin? %>
|
||||
<%= link_to image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius relatePImage"),project_path(project.id,:host=>Setting.host_name),:id=>"project_img_"+project.id.to_s+"_"+homework_common.id.to_s,:alt =>"项目头像" %>
|
||||
<% else %>
|
||||
<%= image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius relatePImage",:id=>"project_img_"+project.id.to_s+"_"+homework_common.id.to_s,:alt =>"项目头像") %>
|
||||
<% end %>
|
||||
<% com_time = project.project_score.commit_time %>
|
||||
<% forge_time=ForgeActivity.where("project_id=?",project.id).last.updated_at if ForgeActivity.where("project_id=?",project.id).last %>
|
||||
<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(forge_time) ? com_time : forge_time %> <%= project.project_score.changeset_num %>提交</p>
|
||||
<% if project.is_public || User.current.member_of?(project) || User.current.admin? %>
|
||||
<%= link_to image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius relatePImage"),project_path(project.id,:host=>Setting.host_name),:id=>"project_img_"+project.id.to_s+"_"+homework_common.id.to_s,:alt =>"项目头像", :target => '_blank' %>
|
||||
<p class="mh18 hidden"><%=link_to (User.find project.user_id).show_name+"(组长)", project_path(project.id,:host=>Setting.host_name), :target => '_blank', :title => "#{(User.find project.user_id).show_name}(组长)" %></p>
|
||||
<% update_time = time_from_now !com_time.nil? && format_time(com_time) > format_time(forge_time) ? com_time : forge_time %>
|
||||
<p class="mh18 hidden"><%=link_to update_time+" "+project.project_score.changeset_num.to_s+"提交", project_path(project.id,:host=>Setting.host_name), :target => '_blank', :title => "#{update_time} #{project.project_score.changeset_num.to_s}提交" %></p>
|
||||
<% else %>
|
||||
<%= image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius relatePImage",:id=>"project_img_"+project.id.to_s+"_"+homework_common.id.to_s,:alt =>"项目头像",:title => "私有项目不可访问") %>
|
||||
<p class="mh18 hidden" title="私有项目不可访问"><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 hidden" title="私有项目不可访问"><%=time_from_now !com_time.nil? && format_time(com_time) > format_time(forge_time) ? com_time : forge_time %> <%= project.project_score.changeset_num %>提交</p>
|
||||
<% end %>
|
||||
<div class="relatePInfo" id="relatePInfo_<%=project.id %>_<%=homework_common.id %>">
|
||||
项目名称:<%=project.name %><br />
|
||||
创建者:<%=(User.find project.user_id).show_name %>(组长)<br />
|
||||
|
@ -307,7 +310,7 @@
|
|||
<% comments = homework_common.journals_for_messages.reorder("created_on desc").limit(3) %>
|
||||
<% if count > 0 %>
|
||||
<div class="" id="reply_div_<%= homework_common.id %>">
|
||||
<%=render :partial => 'users/news_replies', :locals => {:comments => comments, :type => 'HomeworkCommon', :is_in_course => is_in_course,:course_activity=>-1, :is_teacher => is_teacher, :user_activity_id => -1} %>
|
||||
<%=render :partial => 'users/news_replies', :locals => {:comments => comments, :type => 'HomeworkCommon', :is_in_course => is_in_course,:course_activity=>-1, :is_teacher => is_teacher, :user_activity_id => -1, :activity_id => homework_common.id} %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
|
|
|
@ -130,7 +130,7 @@
|
|||
</ul>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% if ma.forge_message_type == "Journal" %>
|
||||
<% if ma.forge_message_type == "Journal" && ma.forge_message %>
|
||||
<ul class="homepageNewsList fl">
|
||||
<li class="homepageNewsPortrait fl">
|
||||
<a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.forge_message.user), :width => "30", :height => "30"), user_path(ma.forge_message.user), :target => '_blank' %></a>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<% if params[:type] == 'HomeworkCommon' %>
|
||||
$('#reply_div_<%= params[:div_id].to_i %>').html('<%=escape_javascript(render :partial => 'users/news_replies', :locals => {:comments => @journals, :type => @type, :is_in_course =>@is_in_course,:course_activity=>@course_activity, :is_teacher => @is_teacher, :user_activity_id => @user_activity_id}) %>');
|
||||
$('#reply_div_<%= params[:div_id].to_i %>').html('<%=escape_javascript(render :partial => 'users/news_replies', :locals => {:comments => @journals, :type => @type, :is_in_course =>@is_in_course,:course_activity=>@course_activity, :is_teacher => @is_teacher, :user_activity_id => @user_activity_id, :activity_id => params[:id].to_i}) %>');
|
||||
<% elsif params[:type] == 'JournalsForMessage' %>
|
||||
$('#reply_div_<%= @user_activity_id %>').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}) %>');
|
||||
<% elsif params[:type] == 'Message' %>
|
||||
|
|
|
@ -34,7 +34,9 @@
|
|||
<ul class="homepagePostTypeProject fl">
|
||||
<li class="f14">更多</li>
|
||||
<li class="mt-4"><%= link_to "个人留言", {:controller => "users", :action => "show", :type => "user_journals"}, :class =>"homepagePostTypeMessage postTypeGrey"%>
|
||||
<li class="mt-4"><%= link_to @user == User.current ? "我的动态" : "他的动态", {:controller => "users", :action => "show", :type => "current_user"}, :class =>"homepagePostTypeMine postTypeGrey"%>
|
||||
<% if @user == User.current %>
|
||||
<li class="mt-4"><%= link_to "我的动态", {:controller => "users", :action => "show", :type => "current_user"}, :class =>"homepagePostTypeMine postTypeGrey"%>
|
||||
<% end %>
|
||||
<li class="mt-4"><%= link_to "全部动态", {:controller => "users", :action => "show", :type => nil}, :class =>"homepagePostTypeAll postTypeGrey"%>
|
||||
</ul>
|
||||
</li>
|
||||
|
|
|
@ -39,15 +39,15 @@
|
|||
<span id="reply_praise_count_<%=reply.id %>">
|
||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
|
||||
</span>
|
||||
<% if User.current.admin? || reply.user.id == User.current.id || allow_delete%>
|
||||
<%= link_to(l(:label_newfeedback_delete), {:controller => 'words', :action => 'destroy', :object_id => reply, :user_id => reply.user},
|
||||
:remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "delete", :title => l(:button_delete)) %>
|
||||
<% end %>
|
||||
<% if reply_allow %>
|
||||
<%#= link_to l(:button_reply),'',
|
||||
{:focus => 'project_respond',:nhname=>"reply_btn", :onclick => "toggleAndSettingWordsVal($('##{id}'), $('##{id} textarea'), ''); return false;"} %>
|
||||
<%= link_to l(:button_reply),'javascript:;',{:nhname=>"reply_btn"} %>
|
||||
<% end %> <!-- #{l(:label_reply_plural)} #{m_reply_id.user.name}: -->
|
||||
<% if User.current.admin? || reply.user.id == User.current.id || allow_delete%>
|
||||
<%= link_to(l(:label_newfeedback_delete), {:controller => 'words', :action => 'destroy', :object_id => reply, :user_id => reply.user},
|
||||
:remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "delete", :title => l(:button_delete)) %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<div id='<%=id%>' class="respond-form">
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
class GroupHomeworkCopyWork < ActiveRecord::Migration
|
||||
def up
|
||||
homeworks = HomeworkCommon.where("homework_type = 3")
|
||||
count = homeworks.count / 30 + 2
|
||||
transaction do
|
||||
for i in 1 ... count do i
|
||||
homeworks.page(i).per(30).each do |homework|
|
||||
homework.student_works.each do |stu|
|
||||
stu.student_work_projects.each do |stu_pro|
|
||||
if stu_pro.is_leader == 0
|
||||
new_stu = StudentWork.new(:name => stu.name, :description => stu.description, :homework_common_id =>homework.id, :user_id => stu_pro.user_id, :final_score => stu.final_score, :teacher_score => stu.teacher_score, :student_score => stu.student_score, :teaching_asistant_score => stu.teaching_asistant_score,
|
||||
:project_id => stu.project_id, :late_penalty => stu.late_penalty,:absence_penalty => stu.absence_penalty,:work_score => stu.work_score,:work_status => 3,:commit_time => stu.commit_time)
|
||||
new_stu.save
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
end
|
||||
end
|
|
@ -11,7 +11,7 @@
|
|||
#
|
||||
# It's strongly recommended to check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(:version => 20160830090214) do
|
||||
ActiveRecord::Schema.define(:version => 20160905084821) do
|
||||
|
||||
create_table "activities", :force => true do |t|
|
||||
t.integer "act_id", :null => false
|
||||
|
|
|
@ -1140,7 +1140,7 @@ $.fn.atwho["default"] = {
|
|||
searchKey: "name",
|
||||
suffix: void 0,
|
||||
hideWithoutSuffix: false,
|
||||
startWithSpace: true,
|
||||
startWithSpace: false,
|
||||
highlightFirst: true,
|
||||
limit: 5,
|
||||
maxLen: 20,
|
||||
|
|
|
@ -1,6 +1,14 @@
|
|||
|
||||
<!-- 模板1开始,可以使用script(type设置为text/html)来存放模板片段,并且用id标示 -->
|
||||
<div loading-spinner></div>
|
||||
<div ng-show="showtip">
|
||||
<div class="blue-title">提示</div>
|
||||
<div class="ac-wrap">
|
||||
<ul class="ac-content f13 c-grey3">
|
||||
<li class="mt30 mb15">啊哦,您来晚了,内容已经被删除了</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div ng-if="blog.act_type == 'BlogComment'">
|
||||
<div class="post-container">
|
||||
<div class="post-wrapper" style="margin-top:0;">
|
||||
|
|
|
@ -1,6 +1,14 @@
|
|||
|
||||
<!-- 模板1开始,可以使用script(type设置为text/html)来存放模板片段,并且用id标示 -->
|
||||
<div loading-spinner></div>
|
||||
<div ng-show="showtip">
|
||||
<div class="blue-title">提示</div>
|
||||
<div class="ac-wrap">
|
||||
<ul class="ac-content f13 c-grey3">
|
||||
<li class="mt30 mb15">啊哦,您来晚了,内容已经被删除了</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div ng-if="discussion.act_type == 'Message'">
|
||||
<div class="post-container">
|
||||
<div loading-spinner></div>
|
||||
|
|
|
@ -1,6 +1,14 @@
|
|||
|
||||
<!-- 模板1开始,可以使用script(type设置为text/html)来存放模板片段,并且用id标示 -->
|
||||
<div loading-spinner></div>
|
||||
<div ng-show="showtip">
|
||||
<div class="blue-title">提示</div>
|
||||
<div class="ac-wrap">
|
||||
<ul class="ac-content f13 c-grey3">
|
||||
<li class="mt30 mb15">啊哦,您来晚了,内容已经被删除了</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div ng-if="news.act_type == 'News'">
|
||||
<div class="post-container">
|
||||
<div class="post-wrapper" style="margin-top:0;">
|
||||
|
|
|
@ -1,6 +1,14 @@
|
|||
|
||||
<!-- 模板1开始,可以使用script(type设置为text/html)来存放模板片段,并且用id标示 -->
|
||||
<div loading-spinner></div>
|
||||
<div ng-show="showtip">
|
||||
<div class="blue-title">提示</div>
|
||||
<div class="ac-wrap">
|
||||
<ul class="ac-content f13 c-grey3">
|
||||
<li class="mt30 mb15">啊哦,您来晚了,内容已经被删除了</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div ng-if="homework.act_type == 'HomeworkCommon'">
|
||||
<div class="post-container">
|
||||
<div class="post-wrapper" style="margin-top:0;">
|
||||
|
|
|
@ -1,6 +1,14 @@
|
|||
|
||||
<!-- 模板1开始,可以使用script(type设置为text/html)来存放模板片段,并且用id标示 -->
|
||||
<div loading-spinner></div>
|
||||
<div ng-show="showtip">
|
||||
<div class="blue-title">提示</div>
|
||||
<div class="ac-wrap">
|
||||
<ul class="ac-content f13 c-grey3">
|
||||
<li class="mt30 mb15">啊哦,您来晚了,内容已经被删除了</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div ng-if="issue.act_type == 'Issue'">
|
||||
<div class="post-container">
|
||||
<div class="post-wrapper" style="margin-top:0;">
|
||||
|
|
|
@ -1,5 +1,13 @@
|
|||
<!-- 模板1开始,可以使用script(type设置为text/html)来存放模板片段,并且用id标示 -->
|
||||
<div loading-spinner></div>
|
||||
<div ng-show="showtip">
|
||||
<div class="blue-title">提示</div>
|
||||
<div class="ac-wrap">
|
||||
<ul class="ac-content f13 c-grey3">
|
||||
<li class="mt30 mb15">啊哦,您来晚了,内容已经被删除了</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div ng-if="message.act_type == 'JournalsForMessage'">
|
||||
<div class="post-container">
|
||||
<div class="post-wrapper" style="margin-top:0;">
|
||||
|
|
|
@ -1,6 +1,14 @@
|
|||
|
||||
<!-- 模板1开始,可以使用script(type设置为text/html)来存放模板片段,并且用id标示 -->
|
||||
<div loading-spinner></div>
|
||||
<div ng-show="showtip">
|
||||
<div class="blue-title">提示</div>
|
||||
<div class="ac-wrap">
|
||||
<ul class="ac-content f13 c-grey3">
|
||||
<li class="mt30 mb15">啊哦,您来晚了,内容已经被删除了</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div ng-if="discussion.act_type == 'Message'">
|
||||
<div class="post-container">
|
||||
<div class="post-wrapper" style="margin-top:0;">
|
||||
|
|
|
@ -25,28 +25,28 @@ function description_show_hide(id){
|
|||
|
||||
//名片的显示
|
||||
function user_card_show_hide() {
|
||||
$(".homepagePostPortrait").mouseover(function(){
|
||||
$(".userCard").css("display","none");
|
||||
onImage = true;
|
||||
$(this).children(".userCard").css("display","block");
|
||||
});
|
||||
$(".homepagePostPortrait").mouseout(function(){
|
||||
var cur = $(this);
|
||||
onImage = false;
|
||||
setTimeout(function(){
|
||||
if (onUserCard == false && onImage == false){
|
||||
$(cur).children(".userCard").css("display", "none");
|
||||
}
|
||||
}, 500);
|
||||
});
|
||||
$(".userCard").mouseover(function(){
|
||||
onUserCard = true;
|
||||
$(this).css("display","block");
|
||||
});
|
||||
$(".userCard").mouseout(function(){
|
||||
onUserCard = false;
|
||||
$(this).css("display","none");
|
||||
});
|
||||
// $(".homepagePostPortrait").mouseover(function(){
|
||||
// $(".userCard").css("display","none");
|
||||
// onImage = true;
|
||||
// $(this).children(".userCard").css("display","block");
|
||||
// });
|
||||
// $(".homepagePostPortrait").mouseout(function(){
|
||||
// var cur = $(this);
|
||||
// onImage = false;
|
||||
// setTimeout(function(){
|
||||
// if (onUserCard == false && onImage == false){
|
||||
// $(cur).children(".userCard").css("display", "none");
|
||||
// }
|
||||
// }, 500);
|
||||
// });
|
||||
// $(".userCard").mouseover(function(){
|
||||
// onUserCard = true;
|
||||
// $(this).css("display","block");
|
||||
// });
|
||||
// $(".userCard").mouseout(function(){
|
||||
// onUserCard = false;
|
||||
// $(this).css("display","none");
|
||||
// });
|
||||
}
|
||||
|
||||
function cleanArray (actual){
|
||||
|
|
|
@ -11,6 +11,11 @@ app.controller('BlogController',
|
|||
loadCallback: function(data){
|
||||
console.log(data.data);
|
||||
|
||||
if(data.status == -1){
|
||||
$scope.showtip = true;
|
||||
return;
|
||||
}
|
||||
|
||||
//回复级别 0 一级回复 1 二级回复
|
||||
replytype = data.type;
|
||||
page = data.page;
|
||||
|
|
|
@ -10,6 +10,11 @@ app.controller('CourseNoticeController', ['$scope', '$http', '$routeParams', 'au
|
|||
loadCallback: function(data){
|
||||
console.log(data.data);
|
||||
|
||||
if(data.status == -1){
|
||||
$scope.showtip = true;
|
||||
return;
|
||||
}
|
||||
|
||||
//回复级别 0 一级回复 1 二级回复
|
||||
replytype = data.type;
|
||||
page = data.page;
|
||||
|
|
|
@ -9,6 +9,11 @@ app.controller('DiscussionController', ['$scope', '$http', '$routeParams', 'auth
|
|||
loadCallback: function(data){
|
||||
console.log(data.data);
|
||||
|
||||
if(data.status == -1){
|
||||
$scope.showtip = true;
|
||||
return;
|
||||
}
|
||||
|
||||
//回复级别 0 一级回复 1 二级回复
|
||||
replytype = data.type;
|
||||
page = data.page;
|
||||
|
|
|
@ -9,6 +9,11 @@ app.controller('HomeworkController', ['$scope', '$http', '$routeParams', 'auth',
|
|||
loadCallback: function(data){
|
||||
console.log(data.data);
|
||||
|
||||
if(data.status == -1){
|
||||
$scope.showtip = true;
|
||||
return;
|
||||
}
|
||||
|
||||
//回复级别 0 一级回复 1 二级回复
|
||||
replytype = data.type;
|
||||
page = data.page;
|
||||
|
|
|
@ -9,6 +9,11 @@ app.controller('IssueController', ['$scope', '$http', '$routeParams', 'auth', 'c
|
|||
loadCallback: function(data){
|
||||
console.log(data.data);
|
||||
|
||||
if(data.status == -1){
|
||||
$scope.showtip = true;
|
||||
return;
|
||||
}
|
||||
|
||||
//回复级别 0 一级回复 1 二级回复
|
||||
replytype = data.type;
|
||||
page = data.page;
|
||||
|
|
|
@ -8,6 +8,11 @@ app.controller('JournalsController', ['$scope', '$http', '$routeParams', 'auth',
|
|||
loadCallback: function(data){
|
||||
console.log(data.data);
|
||||
|
||||
if(data.status == -1){
|
||||
$scope.showtip = true;
|
||||
return;
|
||||
}
|
||||
|
||||
//回复级别 0 一级回复 1 二级回复
|
||||
replytype = data.type;
|
||||
page = data.page;
|
||||
|
|
|
@ -9,22 +9,26 @@ app.directive('iphoneRecognize',["$timeout",function(timer){
|
|||
timer(function(){
|
||||
var contentHeight = $(".post-container").height();
|
||||
var toBottom = function(){
|
||||
element.css({"position":"relative","padding":"1px 0"});
|
||||
$(".post-wrapper").css("marginBottom","0");
|
||||
$("#all_homework_reply").css("marginBottom","0");
|
||||
window.scrollTo(0,contentHeight);
|
||||
element.css({"position":"absolute","padding":"1px 0","marginBottom":"-50px"});
|
||||
$(".post-wrapper").css({"marginBottom":"0","position":"relative"});
|
||||
$("#all_homework_reply,#all_blog_reply,#all_course_message_reply,#all_message_reply").css("marginBottom","0");
|
||||
window.scrollTo(0,contentHeight)
|
||||
};
|
||||
if (/ipad|iphone|mac/i.test(navigator.userAgent)){
|
||||
$("#postInput1").bind('focus',function(){
|
||||
toBottom();
|
||||
setTimeout(function(){
|
||||
toBottom();
|
||||
},200);
|
||||
});
|
||||
$("#postInput1,#replyBlock").bind("click",function(){
|
||||
toBottom();
|
||||
setTimeout(function(){
|
||||
toBottom();
|
||||
},200);
|
||||
});
|
||||
$("#postInput1").bind('blur',function(){
|
||||
element.css("position","fixed");
|
||||
$(".post-wrapper").css("marginBottom","10px");
|
||||
$("#all_homework_reply").css("marginBottom","50px");
|
||||
element.css({"position":"fixed","marginBottom":"0"});
|
||||
$(".post-wrapper").css({"marginBottom":"10px","position":""});
|
||||
$("#all_homework_reply,#all_blog_reply,#all_course_message_reply,#all_message_reply").css("marginBottom","52px");
|
||||
});
|
||||
}
|
||||
})
|
||||
|
|
|
@ -226,6 +226,10 @@ app.factory('common', ['$http', 'auth', '$routeParams','rms','config','wx','$loc
|
|||
var loadData = function(id,replytype,page){
|
||||
loadCommonData(id, args.type,replytype,page).then(function successCallback(response) {
|
||||
console.log(response.data);
|
||||
if(response.data.status == -1){
|
||||
args.loadCallback(response.data);
|
||||
return;
|
||||
}
|
||||
//--------------分享内容定制-------------
|
||||
var tmptile = "分享动态";
|
||||
var imgUrl = "";
|
||||
|
|
|
@ -608,3 +608,7 @@ a:hover.sy_btn_blue{ background: #2788d0;}
|
|||
.author_name{color: #3ca5c6 !important;}
|
||||
.ke-container-default{max-width: 100%;}
|
||||
.borderRadius {border-radius:5px;}
|
||||
|
||||
/*状态提示图标*/
|
||||
.success-icon {background:url("/images/icons_ziliao.png") 0 -28px no-repeat; padding-left:25px;}
|
||||
.error-icon {background:url("/images/icons_ziliao.png") 0 -56px no-repeat; padding-left:25px;}
|
|
@ -566,9 +566,9 @@ a:hover.sy_btn_orange{
|
|||
a.sy_class_ltitle{display: block; font-size: 14px; width: 185px; color:#888; }
|
||||
a:hover.sy_class_ltitle{ color:#333;}
|
||||
.sy_cir_grey{
|
||||
font-size:12px;
|
||||
font-size:11px;
|
||||
padding: 0 10px;
|
||||
background: #dbdbdb;
|
||||
background: #eee;
|
||||
-webkit-border-radius: 15px;
|
||||
-moz-border-radius: 15px;
|
||||
border-radius: 15px;
|
||||
|
|
Loading…
Reference in New Issue