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

This commit is contained in:
huang 2016-08-05 16:42:44 +08:00
commit 3afdeda4d3
66 changed files with 1468 additions and 680 deletions

View File

@ -616,9 +616,14 @@ class AdminController < ApplicationController
# 未审批tab页
# status: 0 未审批; 1 已批阅; 2已更改 3拒绝
def applied_schools
# 更新消息状态
if params[:flag]
applied_message = AppliedMessage.where(:id => params[:applied_message_id]).first
applied_message.update_attribute(:viewed, true)
end
@name = params[:name] || ""
condition = "#{@name.strip}".gsub(" ","")
@apply_status = ApplyAddSchools.where("status = 0 and name like '%#{condition}%'").order('created_at desc')
@apply_count = @apply_status.count
@apply_pages = Paginator.new @apply_count, 30, params['page'] || 1
@ -655,7 +660,7 @@ class AdminController < ApplicationController
applied_school.update_column('status', 1) unless applied_school.nil?
school = applied_school.school
school.update_attribute("province", applied_school.province)
AppliedMessage.create(:user_id => applied_school.user_id, :status => 1, :viewed => true, :applied_id => applied_school.id, :applied_type => "ApplyAddSchools", :name => applied_school.name )
AppliedMessage.create(:user_id => applied_school.user_id, :status => 1, :viewed => 0, :applied_id => applied_school.id, :applied_type => "ApplyAddSchools", :name => applied_school.name )
# School.create(:user_id => applied_school.user_id, :status => 1, :viewed => true, :applied_id => applied_school.id, :applied_type => "ApplyAddSchools", :name => applied_school.name )
respond_to do |format|
format.html{ redirect_to unapplied_schools_url }
@ -663,8 +668,8 @@ class AdminController < ApplicationController
end
# 单位审核:更改
# REDO: 修改该字段
# REDO: 同步修改使用了改名称的用户单位
# 修改该字段
# 同步修改使用了改名称的用户单位
def edit_applied_schools
aas = ApplyAddSchools.find(params[:applied_id])
# aas.update_attribute(:name, params[:name])
@ -672,11 +677,9 @@ class AdminController < ApplicationController
school = School.find params[:school_id]
begin
aas.update_attribute(:status, 2)
AppliedMessage.create(:user_id => aas.user_id, :status => 2, :viewed => true, :applied_id => aas.id, :applied_type => "ApplyAddSchools", :name => school[0].name )
AppliedMessage.create(:user_id => aas.user_id, :status => 2, :viewed => 0, :applied_id => aas.id, :applied_type => "ApplyAddSchools", :name => school[0].name )
users = UserExtensions.where("school_id = #{aas.school_id}")
users.each do |user|
user.update_column("school_id", school[0].id)
end
users.update_all(:school_id => school[0].id)
if aas.school_id != school[0].id.to_i
aas.school.destroy
end
@ -709,28 +712,19 @@ class AdminController < ApplicationController
end
# 单位审核:删除
# REDO: destroy关联删除
# REDO: 删除确认提示,是否删除
# REDO: 给申请人发送消息
def delete_applied_schools
applied_school = ApplyAddSchools.find(params[:id])
applied_school.update_attribute(:status, 3)
# 未审批删除
if params[:tip] == "unapplied"
AppliedMessage.create(:user_id => applied_school.user_id, :status => 3, :viewed => true, :applied_id => applied_school.id, :applied_type => "ApplyAddSchools", :name => applied_school.name )
# 删除学校的用户
users = UserExtensions.where("school_id = #{applied_school.school_id}")
users.each do |user|
user.update_column("school_id", nil)
end
AppliedMessage.create(:user_id => applied_school.user_id, :status => 3, :viewed => 0, :applied_id => applied_school.id, :applied_type => "ApplyAddSchools", :name => applied_school.name )
# 删除学校的用户
users = UserExtensions.where("school_id = #{applied_school.school_id}")
users.update_all(:school_id => nil)
applied_school.school.destroy
redirect_to unapplied_schools_url
# 已审批删除
elsif params[:tip] == "applied"
users = UserExtensions.where("school_id = #{applied_school.school_id}")
users.each do |user|
user.update_column("school_id", nil)
end
applied_school.destroy
redirect_to applied_schools_url
end

View File

@ -108,6 +108,12 @@ class MyController < ApplicationController
# Edit user's account
def account
# 更新消息状态
if params[:flag]
applied_message = AppliedMessage.where(:id => params[:applied_message_id]).first
applied_message.update_attribute(:viewed, true)
end
@user = User.current
lg=@user.login

View File

@ -188,11 +188,12 @@ class SchoolController < ApplicationController
user_extention.school_id = school.id
user_extention.save!
# status=4 向管理员发送信息
# 向管理员发送信息
users = User.where(:admin => 1)
users.each do |user|
AppliedMessage.create(:user_id => user.id, :status => 0, :applied_user_id => User.current.id, :viewed => true, :applied_id => school.id, :applied_type => "ApplyAddSchools", :name => school.name )
AppliedMessage.create(:user_id => user.id, :status => 0, :applied_user_id => User.current.id, :viewed => 0, :applied_id => school.id, :applied_type => "ApplyAddSchools", :name => school.name )
end
else
data[:result] = 3
end

View File

@ -828,7 +828,7 @@ class StudentWorkController < ApplicationController
if User.current.admin?
@new_score.reviewer_role = 1
else
role = User.current.members.where("course_id = ?",@course.id).first.roles.first.name
role = User.current.members.where("course_id = ?",@course.id).first.roles.where("is_current = 1").first.name
@new_score.reviewer_role = get_role_by_name(role)
end
if @score

View File

@ -41,7 +41,8 @@ class UsersController < ApplicationController
:activity_score_index, :influence_score_index, :score_index,:show_new_score, :topic_new_score_index, :project_new_score_index,
:activity_new_score_index, :influence_new_score_index, :score_new_index,:user_projects_index,:user_resource,
:user_courses4show,:user_projects4show,:user_course_activities,:user_project_activities,:user_feedback4show,:user_visitorlist,:user_messages,:edit_brief_introduction,
:user_import_homeworks,:user_search_homeworks,:user_import_resource, :user_system_messages,:choose_user_course,:user_courselist,:user_projectlist,:sort_syllabus_list]
:user_import_homeworks,:user_search_homeworks,:user_import_resource, :user_system_messages,:choose_user_course,:user_courselist,:user_projectlist,:sort_syllabus_list,
:my_homeworks,:manage_or_receive_homeworks,:search_m_r_homeworks]
before_filter :auth_user_extension, only: :show
#before_filter :rest_user_score, only: :show
#before_filter :select_entry, only: :user_projects
@ -592,23 +593,25 @@ class UsersController < ApplicationController
#用户作业列表
def user_homeworks
@order,@b_sort = params[:order] || "created_at",params[:sort] || "desc"
@order,@b_sort = params[:order] || "publish_time",params[:sort] || "desc"
@user = User.current
@r_sort = @b_sort == "desc" ? "asc" : "desc"
if(params[:type].blank? || params[:type] == "1") #我的题库
@homeworks = HomeworkCommon.where("user_id = #{@user.id} and publish_time <= '#{Date.today}'").order("#{@order} #{@b_sort}")
elsif params[:type] == "2" #题库
courses = @user.courses.where("is_delete = 1")
course_ids = courses.empty? ? "(-1)" : "(" + courses.map{|course| course.id}.join(",") + ")"
@homeworks = HomeworkCommon.where("user_id = #{@user.id} and publish_time <= '#{Date.today}' and course_id not in #{course_ids}").order("#{@order} #{@b_sort}")
elsif params[:type] == "2" #公共题库
visible_course = Course.where("is_delete = 0")
visible_course_ids = visible_course.empty? ? "(-1)" : "(" + visible_course.map{|course| course.id}.join(",") + ")"
@homeworks = HomeworkCommon.where("course_id in #{visible_course_ids} and publish_time <= '#{Date.today}'").order("#{@order} #{@b_sort}")
end
@type = params[:type]
@limit = 25
@limit = 10
@is_remote = true
@hw_count = @homeworks.count
@hw_pages = Paginator.new @hw_count, @limit, params['page'] || 1
@offset ||= @hw_pages.offset
@homeworks = paginateHelper @homeworks,25
@homeworks = paginateHelper @homeworks,10
respond_to do |format|
format.js
format.html {render :layout => 'static_base'}
@ -641,15 +644,15 @@ class UsersController < ApplicationController
end
def choose_user_course
homework = HomeworkCommon.find params[:send_id].to_i
if homework.user != User.current && homework.course.is_public == 0 && !User.current.allowed_to?(:as_teacher,homework.course)
ah = ApplyHomework.where("user_id = ? and homework_common_id = ?", User.current.id, params[:send_id].to_i)
if ah.empty?
@status = 2
elsif ah.first.status != 2
@status = ah.first.status
end
end
homework = HomeworkCommon.find params[:homework].to_i
# if homework.user != User.current && homework.course.is_public == 0 && !User.current.allowed_to?(:as_teacher,homework.course)
# ah = ApplyHomework.where("user_id = ? and homework_common_id = ?", User.current.id, params[:send_id].to_i)
# if ah.empty?
# @status = 2
# elsif ah.first.status != 2
# @status = ah.first.status
# end
# end
if !params[:search].nil?
search = "%#{params[:search].to_s.strip.downcase}%"
@course = @user.courses.where("is_delete = 0 and #{Course.table_name}.id != #{homework.course_id} and (#{Course.table_name}.id = #{params[:search].to_i } or #{Course.table_name}.name like :p)",:p=>search).select { |course| @user.allowed_to?(:as_teacher,course)}
@ -658,7 +661,7 @@ class UsersController < ApplicationController
end
@search = params[:search]
#这里仅仅是传递需要发送的资源id
@send_id = params[:send_id]
@send_id = params[:homework]
respond_to do |format|
format.js
end
@ -737,7 +740,7 @@ class UsersController < ApplicationController
#@user_homeworks = HomeworkCommon.where(:user_id => @user.id).order("created_at desc")
courses = @user.courses.where("is_delete = 1")
course_ids = courses.empty? ? "(-1)" : "(" + courses.map{|course| course.id}.join(",") + ")"
@homeworks = HomeworkCommon.where("user_id = #{@user.id} and publish_time <= '#{Date.today}' and course_id not in #{course_ids}").order("#{@order} #{@b_sort}")
@homeworks = HomeworkCommon.where("user_id = #{@user.id} and course_id not in #{course_ids}").order("#{@order} #{@b_sort}")
@type = params[:type]
@limit = 15
@is_remote = true
@ -751,30 +754,26 @@ class UsersController < ApplicationController
end
def user_homework_type
@order,@b_sort = params[:order] || "created_at",params[:sort] || "desc"
@order,@b_sort = params[:order] || "publish_time",params[:sort] || "desc"
@r_sort = @b_sort == "desc" ? "asc" : "desc"
@user = User.current
if(params[:type].blank? || params[:type] == "1") #我的题库
courses = @user.courses.where("is_delete = 1")
course_ids = courses.empty? ? "(-1)" : "(" + courses.map{|course| course.id}.join(",") + ")"
@homeworks = HomeworkCommon.where("user_id = #{@user.id} and publish_time <= '#{Date.today}' and course_id not in #{course_ids}").order("#{@order} #{@b_sort}")
elsif params[:type] == "2" #题库
if params[:is_import].to_i == 1
visible_course = Course.where("is_public = 1 && is_delete = 0")
elsif params[:is_import].to_i == 0
visible_course = Course.where("is_delete = 0")
end
@homeworks = HomeworkCommon.where("user_id = #{@user.id} and course_id not in #{course_ids}").order("#{@order} #{@b_sort}")
elsif params[:type] == "2" #公共题库
visible_course = Course.where("is_public = 1 && is_delete = 0")
visible_course_ids = visible_course.empty? ? "(-1)" : "(" + visible_course.map{|course| course.id}.join(",") + ")"
@homeworks = HomeworkCommon.where("course_id in #{visible_course_ids} and publish_time <= '#{Date.today}'").order("#{@order} #{@b_sort}")
elsif params[:type] == "3" #申请题库
none_visible_course = Course.where("is_delete = 1")
none_visible_course_ids = none_visible_course.empty? ? "(-1)" : "(" + none_visible_course.map{|course| course.id}.join(",") + ")"
#apply_homeworks = ApplyHomework.where("user_id = ?",@user.id).order('created_at desc')
#homework_ids = apply_homeworks.empty? ? "(-1)" : "(" + apply_homeworks.map{|ah| ah.homework_common_id}.join(",") + ")"
#@homeworks = HomeworkCommon.where("id in #{homework_ids} and course_id not in #{none_visible_course_ids}")
sql = "SELECT homework_commons.* FROM homework_commons INNER JOIN apply_homeworks as ah ON homework_commons.id = ah.homework_common_id where ah.user_id = #{@user.id} and homework_commons.course_id not in #{none_visible_course_ids} order by ah.created_at desc"
@homeworks = HomeworkCommon.find_by_sql(sql)
# elsif params[:type] == "3" #申请题库
# none_visible_course = Course.where("is_delete = 1")
# none_visible_course_ids = none_visible_course.empty? ? "(-1)" : "(" + none_visible_course.map{|course| course.id}.join(",") + ")"
# #apply_homeworks = ApplyHomework.where("user_id = ?",@user.id).order('created_at desc')
# #homework_ids = apply_homeworks.empty? ? "(-1)" : "(" + apply_homeworks.map{|ah| ah.homework_common_id}.join(",") + ")"
# #@homeworks = HomeworkCommon.where("id in #{homework_ids} and course_id not in #{none_visible_course_ids}")
#
# sql = "SELECT homework_commons.* FROM homework_commons INNER JOIN apply_homeworks as ah ON homework_commons.id = ah.homework_common_id where ah.user_id = #{@user.id} and homework_commons.course_id not in #{none_visible_course_ids} order by ah.created_at desc"
# @homeworks = HomeworkCommon.find_by_sql(sql)
end
if params[:property]
all_homework_ids = @homeworks.empty? ? "(-1)" : "(" + @homeworks.map{|h| h.id}.join(",") + ")"
@ -792,7 +791,7 @@ class UsersController < ApplicationController
@type = params[:type]
@property = params[:property]
@is_import = params[:is_import]
@limit = params[:is_import].to_i == 1 ? 15 : 25
@limit = params[:is_import].to_i == 1 ? 15 : 10
@is_remote = true
@hw_count = @homeworks.count
@hw_pages = Paginator.new @hw_count, @limit, params['page'] || 1
@ -827,28 +826,24 @@ class UsersController < ApplicationController
#用户主页过滤作业
def user_search_homeworks
@order,@b_sort = params[:order] || "created_at",params[:sort] || "desc"
@order,@b_sort = params[:order] || "publish_time",params[:sort] || "desc"
@r_sort = @b_sort == "desc" ? "asc" : "desc"
@user = User.current
search = params[:name].to_s.strip.downcase
type_ids = params[:property]=="" || params[:property].nil? ? "(1, 2, 3)" : "(" + params[:property] + ")"
type_ids = (params[:property]=="" || params[:property].nil? || params[:property]=="0") ? "(1, 2, 3)" : "(" + params[:property] + ")"
if(params[:type].blank? || params[:type] == "1") #我的题库
courses = @user.courses.where("is_delete = 1")
course_ids = courses.empty? ? "(-1)" : "(" + courses.map{|course| course.id}.join(",") + ")"
if @order == "course_name"
sql = "SELECT homework_commons.* FROM homework_commons INNER JOIN courses ON homework_commons.course_id = courses.id where homework_commons.course_id not in #{course_ids} and homework_commons.user_id = #{@user.id} and homework_type in #{type_ids} and publish_time <= '#{Date.today}' and (homework_commons.name like '%#{search}%') order by CONVERT (courses.name USING gbk) COLLATE gbk_chinese_ci #{@b_sort}"
sql = "SELECT homework_commons.* FROM homework_commons INNER JOIN courses ON homework_commons.course_id = courses.id where homework_commons.course_id not in #{course_ids} and homework_commons.user_id = #{@user.id} and homework_type in #{type_ids} and (homework_commons.name like '%#{search}%') order by CONVERT (courses.name USING gbk) COLLATE gbk_chinese_ci #{@b_sort}"
@homeworks = HomeworkCommon.find_by_sql(sql)
elsif @order == "user_name"
@homeworks = HomeworkCommon.where("user_id = #{@user.id} and course_id not in #{course_ids} and publish_time <= '#{Date.today}' and (name like '%#{search}%') and homework_type in #{type_ids}").joins(:user).order("CONVERT (lastname USING gbk) COLLATE gbk_chinese_ci #{@b_sort}, CONVERT (firstname USING gbk) COLLATE gbk_chinese_ci #{@b_sort},login #{@b_sort}")
@homeworks = HomeworkCommon.where("user_id = #{@user.id} and course_id not in #{course_ids} and (name like '%#{search}%') and homework_type in #{type_ids}").joins(:user).order("CONVERT (lastname USING gbk) COLLATE gbk_chinese_ci #{@b_sort}, CONVERT (firstname USING gbk) COLLATE gbk_chinese_ci #{@b_sort},login #{@b_sort}")
else
@homeworks = HomeworkCommon.where("user_id = #{@user.id} and course_id not in #{course_ids} and publish_time <= '#{Date.today}' and (name like '%#{search}%') and homework_type in #{type_ids}").order("#{@order} #{@b_sort}")
@homeworks = HomeworkCommon.where("user_id = #{@user.id} and course_id not in #{course_ids} and (name like '%#{search}%') and homework_type in #{type_ids}").order("#{@order} #{@b_sort}")
end
elsif params[:type] == "2" #题库
if params[:is_import].to_i == 1
visible_course = Course.where("is_public = 1 && is_delete = 0")
elsif params[:is_import].to_i == 0
visible_course = Course.where("is_delete = 0")
end
visible_course = Course.where("is_public = 1 && is_delete = 0")
visible_course_ids = visible_course.empty? ? "(-1)" : "(" + visible_course.map{|course| course.id}.join(",") + ")"
all_homeworks = HomeworkCommon.where("course_id in #{visible_course_ids} and publish_time <= '#{Date.today}'")
all_user_ids = all_homeworks.map{|hw| hw.user_id}
@ -886,7 +881,7 @@ class UsersController < ApplicationController
end
=end
@type = params[:type]
@limit = params[:is_import].to_i == 1 ? 15 : 25
@limit = params[:is_import].to_i == 1 ? 15 : 10
@is_remote = true
@hw_count = @homeworks.count
@hw_pages = Paginator.new @hw_count, @limit, params['page'] || 1
@ -900,6 +895,19 @@ class UsersController < ApplicationController
end
end
#检查改作业是否可以选用
def check_homework
homework = HomeworkCommon.find_by_id params[:homework]
student_ids = homework.course.student.empty? ? [] : homework.course.student.map{|student| student.student_id}.join(',')
resultObj = {status: 2}
if student_ids.include?(User.current.id.to_s)
resultObj[:status] = 1
else
resultObj[:status] = 0
end
render :json => resultObj
end
#导入作业,确定按钮
def user_select_homework
homework = HomeworkCommon.find_by_id params[:checkMenu]
@ -1444,26 +1452,14 @@ class UsersController < ApplicationController
#显示更多用户课程
def user_courses4show
@page = params[:page].to_i + 1
@type = params[:type]
if @type == 'User'
@courses = @user.courses.visible.where("is_delete =?", 0).select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS a").order("a desc").limit(5).offset(@page * 5)
@all_count = @user.courses.visible.where("is_delete =?", 0).count
elsif @type == 'Syllabus'
@syllabus = Syllabus.where("id = #{params[:syllabus]}").first
if User.current == @syllabus.user || User.current.admin?
all_courses = @syllabus.courses.where("is_delete = 0").select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS a").order("a desc")
else
all_courses = User.current.courses.visible.where("is_delete =? and syllabus_id =?", 0, @syllabus.id).select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS a").order("a desc")
end
@courses = all_courses.limit(5).offset(@page * 5)
@all_count = all_courses.count
end
@courses = @user.courses.visible.where("is_delete =?", 0).select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS a").order("a desc").limit(10).offset(@page * 10)
@all_count = @user.courses.visible.where("is_delete =?", 0).count
end
#显示更多用户项目
def user_projects4show
@page = params[:page].to_i + 1
@projects = @user.projects.visible.select("projects.*,(SELECT MAX(updated_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS a").order("a desc").limit(5).offset(@page * 5)
@projects = @user.projects.visible.select("projects.*,(SELECT MAX(updated_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS a").order("a desc").limit(10).offset(@page * 10)
end
def user_course_activities
@ -1529,6 +1525,107 @@ class UsersController < ApplicationController
render :action=>'user_course_activities',:layout=>nil
end
#首页-》我的作业
def my_homeworks
tea_courses = @user.courses.visible.not_deleted.select{|course| @user.has_teacher_role(course)}
tea_course_ids = tea_courses.empty? ? "(-1)" : "(" + tea_courses.map{|course| course.id}.join(',') + ")"
@manage_homeworks = HomeworkCommon.where("course_id in #{tea_course_ids}").order("created_at desc").limit(5)
stu_courses = @user.courses.visible.not_deleted.select{|course| @user.has_student_role(course)}
stu_course_ids = stu_courses.empty? ? "(-1)" : "(" + stu_courses.map{|course| course.id}.join(',') + ")"
@receive_homeworks = HomeworkCommon.where("course_id in #{stu_course_ids} and publish_time <= '#{Date.today}'").order("created_at desc").limit(5)
if (@manage_homeworks.empty? && @receive_homeworks.empty?) || (@receive_homeworks.empty?) || (!@manage_homeworks.empty? && !@receive_homeworks.empty? && @manage_homeworks.first.publish_time > @receive_homeworks.first.publish_time)
@manage_pre = true
else
@manage_pre = false
end
respond_to do |format|
format.js
format.html {render :layout => 'static_base'}
end
end
#我管理/收到的作业
def manage_or_receive_homeworks
@order,@b_sort,@type = params[:order] || "created_at",params[:sort] || "desc",params[:type] || 1
@r_sort = @b_sort == "desc" ? "asc" : "desc"
@type = @type.to_i
if @type == 1
tea_courses = @user.courses.visible.not_deleted.select{|course| @user.has_teacher_role(course)}
tea_course_ids = tea_courses.empty? ? "(-1)" : "(" + tea_courses.map{|course| course.id}.join(',') + ")"
@homeworks = HomeworkCommon.where("course_id in #{tea_course_ids}").order("#{@order} #{@b_sort}")
else
stu_courses = @user.courses.visible.not_deleted.select{|course| @user.has_student_role(course)}
stu_course_ids = stu_courses.empty? ? "(-1)" : "(" + stu_courses.map{|course| course.id}.join(',') + ")"
@homeworks = HomeworkCommon.where("course_id in #{stu_course_ids} and publish_time <= '#{Date.today}'").order("#{@order} #{@b_sort}")
end
if params[:property]
all_homework_ids = @homeworks.empty? ? "(-1)" : "(" + @homeworks.map{|h| h.id}.join(",") + ")"
if params[:property] == "1"
@homeworks = HomeworkCommon.find_by_sql("select * from homework_commons where id in #{all_homework_ids} and homework_type = 1")
elsif params[:property] == "2"
@homeworks = HomeworkCommon.find_by_sql("select * from homework_commons where id in #{all_homework_ids} and homework_type = 2")
elsif params[:property] == "3"
@homeworks = HomeworkCommon.find_by_sql("select * from homework_commons where id in #{all_homework_ids} and homework_type = 3")
end
end
@limit = 10
@is_remote = true
@hw_count = @homeworks.count
@hw_pages = Paginator.new @hw_count, @limit, params['page'] || 1
@offset ||= @hw_pages.offset
@homeworks = paginateHelper @homeworks,@limit
@search = ""
@property = params[:property]
respond_to do |format|
format.js
format.html {render :layout => 'static_base'}
end
end
#搜索作业
def search_m_r_homeworks
@order,@b_sort,@type = params[:order] || "created_at",params[:sort] || "desc",params[:type].to_i || 1
@r_sort = @b_sort == "desc" ? "asc" : "desc"
search = params[:name].to_s.strip.downcase
type_ids = (params[:property]=="" || params[:property].nil? || params[:property]=="0") ? "(1, 2, 3)" : "(" + params[:property] + ")"
if @type == 1
tea_courses = @user.courses.visible.not_deleted.select{|course| @user.has_teacher_role(course)}
tea_course_ids = tea_courses.empty? ? "(-1)" : "(" + tea_courses.map{|course| course.id}.join(',') + ")"
#user_ids = hw_publisher_user_ids search, tea_course_ids
@homeworks = HomeworkCommon.where("course_id in #{tea_course_ids} and homework_type in #{type_ids} and name like '%#{search}%'").order("#{@order} #{@b_sort}")
else
stu_courses = @user.courses.visible.not_deleted.select{|course| @user.has_student_role(course)}
stu_course_ids = stu_courses.empty? ? "(-1)" : "(" + stu_courses.map{|course| course.id}.join(',') + ")"
#user_ids = hw_publisher_user_ids search, stu_course_ids
@homeworks = HomeworkCommon.where("course_id in #{stu_course_ids} and homework_type in #{type_ids} and publish_time <= '#{Date.today}' and name like '%#{search}%'")
if @order == "status"
@homeworks.each do |homework|
work = cur_user_works_for_homework homework
if work.blank?
homework[:infocount] = 0
else
homework[:infocount] = 1
end
end
@b_sort == "asc" ? (@homeworks = @homeworks.sort{|x,y| x[:infocount] <=> y[:infocount] }) : (@homeworks = @homeworks.sort{|x,y| y[:infocount] <=> x[:infocount]})
@homeworks = sortby_time_countcommon_nosticky @homeworks,"created_at"
else
@homeworks = @homeworks.order("#{@order} #{@b_sort}")
end
end
@limit = 10
@is_remote = true
@hw_count = @homeworks.count
@hw_pages = Paginator.new @hw_count, @limit, params['page'] || 1
@offset ||= @hw_pages.offset
@homeworks = paginateHelper @homeworks,@limit
@search = search
@property = params[:property]
respond_to do |format|
format.js
end
end
def user_feedback4show
query = @user.journals_for_messages
if params[:lastid]!=nil && !params[:lastid].empty?
@ -3247,6 +3344,7 @@ class UsersController < ApplicationController
@join_syllabuses = syllabus_course_list_sort @join_syllabuses
@my_syllabuses = @my_syllabuses.sort{|x,y| y[:last_update] <=> x[:last_update]}
@join_syllabuses = @join_syllabuses.sort{|x,y| y[:last_update] <=> x[:last_update]}
@is_course = 1
#分页
# @limit = 10
@ -3356,6 +3454,7 @@ class UsersController < ApplicationController
@atta_pages = Paginator.new @atta_count, @limit, params['page'] || 1
@offset ||= @atta_pages.offset
@projects = paginateHelper @projects,@limit
@is_project = 1
respond_to do |format|
format.js

View File

@ -2754,7 +2754,39 @@ module ApplicationHelper
else
link_to "作品(#{count})",student_work_index_url_in_org(homework.id),:class => "c_blue"
end
end
#根据传入作业确定显示为提交作品、补交作品、查看作品等
def student_for_homework_common homework
if User.current.member_of_course?(homework.course)
work = cur_user_works_for_homework homework
project = cur_user_projects_for_homework homework
if work.nil? && Time.parse(homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d")
if homework.homework_type ==3 && project.nil? && homework.homework_detail_group.base_on_project == 1
link_to "查看详情", homework_common_index_path(:course_id => homework.course_id), :class => 'hw_btn_green2 fr mt5',:title => '查看分组作业详情', :target => '_blank'
else
link_to "提交作品", new_student_work_url_without_domain(homework.id),:class => 'hw_btn_green2 fr mt5', :target => '_blank'
end
elsif work.nil? && Time.parse(homework.end_time.to_s).strftime("%Y-%m-%d") < Time.now.strftime("%Y-%m-%d")
if homework.homework_type ==3 && project.nil? && homework.homework_detail_group.base_on_project == 1
link_to "查看详情", homework_common_index_path(:course_id => homework.course_id), :class => 'hw_btn_green2 fr mt5',:title => '查看分组作业详情', :target => '_blank'
else
link_to "补交作品", new_student_work_url_without_domain(homework.id),:class => 'btn_orange_big fr mt5', :target => '_blank'
end
else
if homework.homework_detail_manual && homework.homework_detail_manual.comment_status == 2 #匿评作业,且作业状态不是在开启匿评之前
link_to "作品匿评", student_work_index_url_in_org(homework.id), :class => 'hw_btn_green2 fr mt5', :title => "开启匿评后不可修改作品", :target => '_blank'
elsif homework.homework_detail_manual && homework.homework_detail_manual.comment_status == 3
link_to "查看作品",student_work_index_url_in_org(homework.id), :class => 'hw_btn_green2 fr mt5', :title => "匿评已结束", :target => '_blank'
elsif homework.homework_type == 2 && Time.parse(homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d")#编程作业不能修改作品
link_to "修改作品", new_student_work_url_without_domain(homework.id),:class => 'hw_btn_green2 fr mt5', :target => '_blank'
elsif Time.parse(homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d") && work.user_id == User.current.id
link_to "修改作品", edit_student_work_url_without_domain(work.id),:class => 'hw_btn_green2 fr mt5', :target => '_blank'
else
link_to "查看作品", student_work_index_url_in_org(homework.id), :class => 'hw_btn_green2 fr mt5', :title => "作业截止后不可修改作品", :target => '_blank'
end
end
end
end
def relate_project homework,is_teacher,is_in_course,user_activity_id,course_activity
@ -2806,6 +2838,17 @@ module ApplicationHelper
homework.student_work_projects.where("user_id = ?",User.current).first
end
#获取当前作业的提交截止时间/互评截止时间
def cur_homework_end_time homework
str = ""
if homework.anonymous_comment == 0 && homework.end_time < Date.today && homework.homework_detail_manual
str = "互评截止:#{format_date homework.homework_detail_manual.evaluation_end}"
else
str = "提交截止:#{homework.end_time ? (format_date homework.end_time) : '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'}"
end
str
end
def file_preview_tag(file, html_options={})
if %w(pdf pptx doc docx xls xlsx).any?{|x| file.filename.downcase.end_with?(x)}
link_to '预览', download_named_attachment_path(file.id, file.filename, preview: true),html_options

View File

@ -105,6 +105,22 @@ module UsersHelper
end
end
# 单位申请消息:通过用户的状态判断
# status(0申请消息1,2,3系统消息)
def applied_school_users applied_message
user = User.find(applied_message.applied_user_id)
end
# 单位申请消息通过状态判断tip描述
def applied_school_tip applied_message
case applied_message.status
when 1,2,3
"您添加新的单位:"
when 0
"申请了单位:"
end
end
def applied_project_tip_header applied_message
case applied_message.status
when 4
@ -117,6 +133,7 @@ module UsersHelper
end
def get_resource_origin attach
type = attach.container_type
content = attach.container
@ -767,4 +784,17 @@ module UsersHelper
end
syllabuses
end
#获取按作业的发布者排序的用户ID
def hw_publisher_user_ids search, course_ids
if search && search != ""
all_homeworks = HomeworkCommon.where("course_id in #{course_ids}")
all_user_ids = all_homeworks.map{|hw| hw.user_id}
user_str_ids = search_user_by_name all_user_ids, search
user_ids = user_str_ids.empty? ? "(-1)" : "(" + user_str_ids.join(",") + ")"
else
user_ids = "(-1)"
end
return user_ids
end
end

View File

@ -34,6 +34,20 @@ class HomeworkCommon < ActiveRecord::Base
after_save :act_as_course_activity
after_destroy :delete_kindeditor_assets
#作业类型
def homework_type_ch
type = self.homework_type
case type
when 1
type = "普通"
when 2
type = "编程"
when 3
type = "分组"
end
type
end
def act_as_activity
self.acts << Activity.new(:user_id => self.user_id)
end

View File

@ -926,6 +926,13 @@ class User < Principal
!role.blank?
end
#是否具有学生角色
def has_student_role(course)
member = course.members.where("user_id = #{self.id}").first
role = MemberRole.where("member_id = #{member.id} and role_id = 10")
!role.blank?
end
# Return true if the user is allowed to do the specified action on a specific context
# Action can be:
# * a parameter-like Hash (eg. :controller => 'projects', :action => 'edit')

View File

@ -2,7 +2,7 @@
<div>
<%#= hidden_field_tag(:send_id, edit_id) %>
<div class="courseReferContainer">
<% if !schools.empty? %>
<% if !schools.empty? && !@search.nil? %>
<% schools.each do |school| %>
<ul class="courseSend">
<li class="" style="display:inline-block">

View File

@ -1,11 +1,11 @@
<% if params[:search].nil? %>
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'admin/all_schools', :locals => {:schools => @schools, :edit_id => @edit_id}) %>');
showModal('ajax-modal', '452px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='hideModal();' style='margin-left: 435px;' class='resourceClose'></a>");
$('#ajax-modal').parent().css("top","50%").css("left","50%");
$('#ajax-modal').parent().addClass("popbox").addClass("resourceUploadPopup");
$('#ajax-modal').css("padding-left","16px").css("padding-bottom","16px");
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'admin/all_schools', :locals => {:schools => @schools, :edit_id => @edit_id}) %>');
showModal('ajax-modal', '452px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='hideModal();' style='margin-left: 435px;' class='resourceClose'></a>");
$('#ajax-modal').parent().css("top","50%").css("left","50%");
$('#ajax-modal').parent().addClass("popbox").addClass("resourceUploadPopup");
$('#ajax-modal').css("padding-left","16px").css("padding-bottom","16px");
<% else %>
$("#schools_list").html("<%= escape_javascript(render :partial => 'admin/update_school_form', :locals => {:schools => @schools, :edit_id => @edit_id}) %>");
$("#schools_list").html("<%= escape_javascript(render :partial => 'admin/update_school_form', :locals => {:schools => @schools, :edit_id => @edit_id}) %>");
<% end %>

View File

@ -11,7 +11,7 @@
</label>
<%= text_field_tag 'name', params[:name], :size => 30, :placeholder => '输入单位名称进行搜索' %>
<%= submit_tag l(:button_apply ), :class => "small", :name => nil %>
<%= link_to l(:button_clear), {:controller => 'admin', :action => 'applied_shcools'}, :class => 'icon icon-reload' %>
<%= link_to l(:button_clear), {:controller => 'admin', :action => 'applied_schools'}, :class => 'icon icon-reload' %>
</fieldset>
<% end %>
&nbsp;
@ -60,7 +60,7 @@
<td class="center">
<% user = User.where("id=?", apply.user_id).first %>
<% unless user.nil? %>
<%=link_to user.show_name, user_path(user),:target => '_blank' %>
<%=link_to user.show_name, user_path(user),:target => '_blank', :class => "application-default-link" %>
<% end %>
</td>
<td class="center">
@ -132,7 +132,7 @@
<td>
</td>
<td style="text-align: left;" colspan="6">
<td style="text-align: left;" colspan="7">
<%= apply.remarks %>
</td>
</tr>

View File

@ -11,7 +11,7 @@
</label>
<%= text_field_tag 'name', params[:name], :size => 30, :placeholder => '输入单位名称进行搜索' %>
<%= submit_tag l(:button_apply ), :class => "small", :name => nil %>
<%= link_to l(:button_clear), {:controller => 'admin', :action => 'applied_shcools'}, :class => 'icon icon-reload' %>
<%= link_to l(:button_clear), {:controller => 'admin', :action => 'has_applied_schools'}, :class => 'icon icon-reload' %>
</fieldset>
<% end %>
&nbsp;
@ -20,7 +20,7 @@
<table class="list" style="width: 100%;table-layout: fixed">
<thead>
<tr>
<th style="width: 20px;">
<th style="width: 25px;">
序号
</th>
<th style="width: 80px;">

View File

@ -10,15 +10,9 @@
<li class="navHomepageMenu fl">
<%= link_to "资源库", user_resource_user_path(User.current, :type => 6), :class => "c_white f16 db p10" %>
</li>
<% if User.current.user_extensions && User.current.user_extensions.identity == 0 && User.current.allowed_to?(:add_course, nil, :global => true)%>
<li class="navHomepageMenu fl">
<%= link_to "题库", user_homeworks_user_path(User.current), :class => "c_white f16 db p10"%>
</li>
<% else %>
<li class="navHomepageMenu fl">
<%= link_to "我的作业", student_homeworks_user_path(User.current), :class => "c_white f16 db p10"%>
</li>
<% end %>
<li class="navHomepageMenu fl mr30">
<%= link_to "帮助中心", "https://#{Setting.host_name}/forums/1/memos/1168", :class =>"c_white f16 db p10" %>
</li>
@ -79,9 +73,9 @@
</div>
<div class="navHomepageNews" id="user_messages">
<%= link_to "", user_message_path(User.current), :class => "homepageNewsIcon", :target =>"_Blank", :title => "您的所有消息" %>
<% if User.current.count_new_message.to_i >0 %>
<div ><%= link_to User.current.count_new_message , user_message_path(User.current), :class => "newsActive", :target =>"_Blank" %></div>
<%= link_to "", user_message_path(User.current), :class => "homepageNewsIcon", :target => "_Blank", :title => "您的所有消息" %>
<% if User.current.count_new_message.to_i > 0 %>
<div ><%= link_to User.current.count_new_message , user_message_path(User.current), :class => "newsActive", :target => "_Blank" %></div>
<% end %>
<%#= link_to User.current.count_new_message, user_message_path(User.current), :class => "homepageNewsIcon" %>
<div class="shadowbox_news undis" id="user_messages_list">

View File

@ -72,10 +72,10 @@
<% elsif ma.course_message_type == "Course" %>
<li><a href="<%=course_path(ma.course_message) %>" target="_blank" title="系统提示 您成功创建了班级:班级名称:<%=ma.course_message.name %>"><span class="shadowbox_news_user">系统提示 </span>您成功创建了班级:班级名称:<%=ma.course_message.name %></a></li>
<% elsif ma.course_message_type == "JoinCourseRequest" %>
<% content = User.find(ma.course_message_id).name+"申请成为班级\""+"#{Course.find(ma.course_id).name}"+"\"的"+"#{ma.content == '9' ? "教师" : "教辅"}" %>
<% content = User.find(ma.course_message_id).name+"申请成为班级\""+"#{Course.find(ma.course_id).name}"+"\"的"+"#{ma.content && ma.content.include?('9') ? "教师" : "教辅"}" %>
<li><a href="<%=user_path(User.find(ma.course_message_id), :course_id => ma.course_id) %>" target="_blank" title="系统提示 您有了新的班级成员申请:<%=content %>"><span class="shadowbox_news_user">系统提示 </span>您有了新的班级成员申请:<%=content %></a></li>
<% elsif ma.course_message_type == "CourseRequestDealResult" %>
<% content = ma.status == 1 ? '您申请成为班级"'+Course.find(ma.course_id).name+'"的'+(ma.content == '9' ? '老师' : '教辅')+'申请已通过' : '您申请成为班级"'+Course.find(ma.course_id).name+'"的'+(ma.content == '9' ? '老师' : '教辅')+'的申请被拒绝' %>
<% content = ma.status == 1 ? '您申请成为班级"'+Course.find(ma.course_id).name+'"的'+(ma.content == '9' ? '老师' : '教辅')+'申请已通过' : '您申请成为班级"'+Course.find(ma.course_id).name+'"的'+(ma.content && ma.content.include?('9') ? '教师' : '教辅')+'的申请被拒绝' %>
<li><a href="<%=course_path(Course.find(ma.course_id)) %>" target="_blank" title="系统提示 班级申请进度反馈:<%=content %>"><span class="shadowbox_news_user">系统提示 </span>班级申请进度反馈:<%=content %></a></li>
<% elsif ma.course_message_type == "JoinCourse" and ma.status == 0 %>
<li><a href="<%=course_member_path(ma.course) %>" target="_blank" title="<%=User.find(ma.course_message_id).show_name %> 将您加入了班级:<%=ma.course.name %>"><span class="shadowbox_news_user"><%=User.find(ma.course_message_id).show_name %> </span>将您加入了班级:<%=ma.course.name %></a></li>
@ -142,6 +142,28 @@
<% content = '<span class="shadowbox_news_user">'+ma.author.show_name+' </span>提到了你:'+ma.subject.html_safe %>
<li><%=link_to content.html_safe, ma.url, :title => ma.author.show_name+' 提到了你:'+ma.subject.html_safe, :target => '_blank' %></li>
<% end %>
<% elsif ma.class == AppliedMessage %>
<% if ma.applied_type == "ApplyAddSchools" && ma.status == 0 %>
<li>
<% content = '<span class="shadowbox_news_user">'+User.where("id=?", ma.applied_user_id).first.show_name+' </span>提交了申请:添加新的单位:'+"“"+ma.name+"”" %>
<%= link_to content.html_safe, unapplied_schools_path(:flag => 1, :applied_message_id => ma.id), :title => "#{User.where("id=?", ma.applied_user_id).first.show_name}提交了申请:添加新的单位“#{ma.name}”", :target => '_blank' %>
</li>
<% elsif ma.applied_type == "ApplyAddSchools" && ma.status == 1 %>
<li>
<% content = "<span class='shadowbox_news_user'>系统提示:</span>“#{ma.name}”的申请,已通过审核。谢谢!" %>
<%= link_to content.html_safe, { :controller=> "my",:action => "account",:flag => 1, :applied_message_id => ma.id }, :title => "系统提示:“#{ma.name}”的申请,已通过审核。谢谢!", :target => '_blank'%>
</li>
<% elsif ma.applied_type == "ApplyAddSchools" && ma.status == 2 %>
<li>
<% content = "<span class='shadowbox_news_user'>系统提示:</span>“#{ma.applied.name}”的申请,因名称不符合规范,系统已将其更改为“#{ma.name}”。谢谢!" %>
<%= link_to content.html_safe, { :controller=> "my",:action => "account", :flag => 1, :applied_message_id => ma.id }, :title => "系统提示:“#{ma.applied.name}”的申请,因名称不符合规范,系统已将其更改为“#{ma.name}”。谢谢!", :target => '_blank'%>
</li>
<% elsif ma.applied_type == "ApplyAddSchools" && ma.status == 3 %>
<li>
<% content = "<span class='shadowbox_news_user'>系统提示:</span>“#{ma.name}”的申请,经确认为无效的单位信息,已被删除,请重新编辑您的单位资料。谢谢!" %>
<%= link_to content.html_safe, { :controller=> "my",:action => "account", :flag => 1, :applied_message_id => ma.id }, :title => "系统提示:“#{ma.name}”的申请,经确认为无效的单位信息,已被删除,请重新编辑您的单位资料。谢谢!", :target => '_blank'%>
</li>
<% end %>
<% end %>
<% end %>
</ul>

View File

@ -2,7 +2,7 @@
<% if user.user_extensions && user.user_extensions.brief_introduction && !user.user_extensions.brief_introduction.empty? %>
<%= user.user_extensions.brief_introduction %>
<% else%>
位童鞋很懒,什么也没有留下~
个小伙伴很懒,什么都没留下~
<% end %>
</span>
<% if User.current == user%>

View File

@ -1,99 +1,98 @@
<% courses.each do |course|%>
<li class="homepageLeftMenuCoursesLine pr">
<li>
<span class="user_icons_class"></span>
<% is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,course)) %>
<%= link_to course.name+"("+current_time_and_term_short(course)+")", course_path(course.id,:host=>Setting.host_course), :class => "coursesLineGrey hidden #{course_endTime_timeout?(course) ? 'c_dark_grey' : ''}",
:id => "show_course_#{course.id}", :target => '_blank', :title => (course.is_public? ? "公开班级:":"私有班级:")+course.name+""+current_time_and_term(course)+""%>
<%= link_to course.name+"("+current_time_and_term_short(course)+")", course_path(course.id,:host=>Setting.host_course),
:id => "show_course_#{course.id}", :class => 'course_list_menu hidden', :target => '_blank', :title => (course.is_public? ? "公开班级:":"私有班级:")+course.name+""+current_time_and_term(course)+""%>
<% count = ShieldActivity.where("container_type='User' and container_id=#{user.id} and shield_type='Course' and shield_id=#{course.id}").count %>
<% wechat_count = ShieldWechatMessage.where("container_type='User' and container_id=#{user.id} and shield_type='Course' and shield_id=#{course.id}").count %>
<ul class="<%= count > 0 ? 'shild shildP':'subNavArrow'%>">
<li>
<ul class="subNavMenu boxShadow">
<div class="user_navmore_box">
<ul class="<%#= count > 0 ? 'shild shildP':'subNavArrow'%>">
<li class="user_navmore_icons">
<ul class="user_navmore_txt">
<% if is_teacher %>
<li class="subNavRow">
<%= link_to "作业",homework_common_index_path(:course => course.id), :class => 'fl fontGrey2 w48', :target => '_blank' %>
<%= link_to '+',homework_common_index_path(:course => course.id,:is_new => 1), :class => 'fr fb', :title => '发布作业',:target => '_blank' %>
<div class="cl"></div>
<li class="clear">
<%= link_to "作业",homework_common_index_path(:course => course.id), :class => 'user_navmore_li fl', :target => '_blank' %>
<%= link_to '+',homework_common_index_path(:course => course.id,:is_new => 1), :class => 'user_navmore_add fl', :title => '发布作业',:target => '_blank' %>
</li>
<li class="subNavRow">
<%= link_to "通知", course_news_index_path(course), :class => 'fl w48',:target => '_blank' %>
<%= link_to "+", new_course_news_path(course,:is_new=>1), :class => 'fr fb', :title => '发布通知',:target => '_blank' %>
<div class="cl"></div>
<li class="clear">
<%= link_to "通知", course_news_index_path(course), :class => 'user_navmore_li fl',:target => '_blank' %>
<%= link_to "+", new_course_news_path(course,:is_new=>1), :class => 'user_navmore_add fl', :title => '发布通知',:target => '_blank' %>
</li>
<% else %>
<li class="subNavRow">
<%= link_to "作业",homework_common_index_path(:course => course.id), :target => '_blank' %>
<li>
<%= link_to "作业",homework_common_index_path(:course => course.id), :class => 'user_navmore_li', :target => '_blank' %>
<div class="cl"></div>
</li>
<li class="subNavRow">
<%= link_to "通知", course_news_index_path(course),:target => '_blank' %>
<li>
<%= link_to "通知", course_news_index_path(course), :class => 'user_navmore_li',:target => '_blank' %>
<div class="cl"></div>
</li>
<% end %>
<% if is_teacher || (course.publish_resource == 1 && User.current.member_of_course?(course)) %>
<li class="subNavRow">
<%= link_to "资源",course_files_path(course), :class => 'fl w48',:target => '_blank' %>
<%= link_to "+",upload_files_menu_path(:course_id => course.id), :class => 'fr fb',:remote => true, :title => '上传资源' %>
<div class="cl"></div>
<li class="clear">
<%= link_to "资源",course_files_path(course), :class => 'user_navmore_li fl',:target => '_blank' %>
<%= link_to "+",upload_files_menu_path(:course_id => course.id), :class => 'user_navmore_add fl',:remote => true, :title => '上传资源' %>
</li>
<% else %>
<li class="subNavRow">
<%= link_to "资源",course_files_path(course),:target => '_blank' %>
<li>
<%= link_to "资源",course_files_path(course), :class => 'user_navmore_li',:target => '_blank' %>
<div class="cl"></div>
</li>
<% end %>
<li class="subNavRow">
<%= link_to "论坛",course_boards_path(course), :class => 'fl w48',:target => '_blank' %>
<%= link_to "+",course_boards_path(course, :flag => true, :is_new => 1), :class => 'fr fb', :title => '发布帖子',:target => '_blank' %>
<div class="cl"></div>
<li class="clear">
<%= link_to "论坛",course_boards_path(course), :class => 'user_navmore_li fl',:target => '_blank' %>
<%= link_to "+",course_boards_path(course, :flag => true, :is_new => 1), :class => 'user_navmore_add fl', :title => '发布帖子',:target => '_blank' %>
</li>
<% if type=='User' && !course.syllabus.nil? %>
<li class="subNavRow">
<%= link_to "所属课程",syllabus_path(course.syllabus_id), :class => 'fl w48',:target => '_blank' %>
<% if !course.syllabus.nil? %>
<li>
<%= link_to "所属课程",syllabus_path(course.syllabus_id), :class => 'user_navmore_li',:target => '_blank' %>
<div class="cl"></div>
</li>
<% end %>
<% if User.current == user %>
<li class="subNavRow">
<li>
<% if count == 0 %>
<%= link_to "屏蔽动态", shield_activities_path(:user_id => user.id, :course_id => course.id), :method => 'post',:remote => true %>
<%= link_to "屏蔽动态", shield_activities_path(:user_id => user.id, :course_id => course.id), :method => 'post', :class => 'user_navmore_li',:remote => true %>
<% else %>
<%= link_to "显示动态", show_acts_shield_activities_path(:user_id => user.id, :course_id => course.id),:remote => true,:method => 'delete' %>
<%= link_to "显示动态", show_acts_shield_activities_path(:user_id => user.id, :course_id => course.id),:remote => true,:method => 'delete', :class => 'user_navmore_li' %>
<% end %>
</li>
<li class="subNavRow">
<li>
<% if wechat_count == 0 %>
<%= link_to "屏蔽微信消息", shield_wechat_messages_path(:user_id => user.id, :course_id => course.id), :method => 'post',:remote => true %>
<%= link_to "屏蔽微信消息", shield_wechat_messages_path(:user_id => user.id, :course_id => course.id), :method => 'post',:remote => true, :class => 'user_navmore_li' %>
<% else %>
<%= link_to "接收微信消息", show_messages_shield_wechat_messages_path(:user_id => user.id, :course_id => course.id),:remote => true,:method => 'delete' %>
<%= link_to "接收微信消息", show_messages_shield_wechat_messages_path(:user_id => user.id, :course_id => course.id),:remote => true,:method => 'delete', :class => 'user_navmore_li' %>
<% end %>
</li>
<% end %>
<% if User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,course)) %>
<li class="subNavRow">
<li>
<%= link_to course.is_public == 0 ? "设为公开" : "设为私有", {:controller => 'courses', :action => 'private_or_public', :id => course,:user_page => true},
:id => "set_course_public_#{course.id.to_s}",:remote=>true,:confirm=>"您确定要设置为"+(course.is_public == 0 ? "公开" : "私有")+"吗"%>
:id => "set_course_public_#{course.id.to_s}",:remote=>true, :class => 'user_navmore_li',:confirm=>"您确定要设置为"+(course.is_public == 0 ? "公开" : "私有")+"吗"%>
<div class="cl"></div>
</li>
<% end %>
</ul>
</li>
</ul>
</div>
</li>
<% end %>
<% if all_count > (page.to_i+1) * 5%>
<li class="homepageLeftMenuMore" id="user_show_more_course">
<input type="hidden" value="<%= page%>" id="course_page_num">
<a href="javascript:void(0);" class="homepageLeftMenuMoreIcon" onclick="show_more_course('<%= type=='User' ? user_courses4show_user_path(user.id,:type=>type) : user_courses4show_user_path(user.id,:type=>type,:syllabus=>@syllabus.id)%>');"></a>
</li>
<% if all_count > (page.to_i+1) * 10%>
<input type="hidden" value="<%= page%>" id="course_page_num">
<a class="user_navmorebox" href="javascript:void(0);" id="user_show_more_course" onclick="show_more_course('<%= user_courses4show_user_path(user.id,:page => page)%>');">
<span class="user_icons_moreclass"></span>
</a>
<% end%>
<script type="text/javascript">
var coursecount = <%= all_count %>;
var courseshowcount = document.getElementsByClassName("coursesLineGrey").length;
var courseshowcount = document.getElementsByClassName("course_list_menu").length;
if((coursecount <= courseshowcount)&&(coursecount > 5) ){
if((coursecount <= courseshowcount)&&(coursecount > 10) ){
$("#user_show_more_course").hide();
$('#user_hide_course').show();
}

View File

@ -1,71 +1,73 @@
<% projects.each do |project|%>
<li class="homepageLeftMenuCoursesLine pr">
<li>
<span class="user_icons_class"></span>
<% count = ShieldActivity.where("container_type='User' and container_id=#{user.id} and shield_type='Project' and shield_id=#{project.id}").count %>
<%= link_to project.name, project_path(project.id,:host=>Setting.host_name), :target => '_blank', :class => "projectsLineGrey hidden",:id => "show_project_#{project.id}", :title => (project.is_public? ? "公开项目:":"私有项目:") + project.name%>
<ul class="<%= count > 0 ? 'shild shildP':'subNavArrow'%>">
<li>
<ul class="subNavMenu boxShadow">
<li class="subNavRow">
<%=link_to "问题跟踪", project_issues_path(project), :class => 'fl fontGrey2', :target => '_blank',:style => "width:48px;" %>
<%=link_to "+", new_project_issue_path(project), :class => 'fr fb', :target => '_blank',:style => "width:48px;", :title => '发布问题',:style =>'width:10px;' %>
<div class="cl"></div>
<%= link_to project.name, project_path(project.id,:host=>Setting.host_name), :target => '_blank', :class => "course_list_menu hidden",:id => "show_project_#{project.id}", :title => (project.is_public? ? "公开项目:":"私有项目:") + project.name%>
<div class="user_navmore_box">
<ul class="<%#= count > 0 ? 'shild shildP':'subNavArrow'%>">
<li class="user_navmore_icons">
<ul class="user_navmore_txt">
<li class="clear">
<%=link_to "问题跟踪", project_issues_path(project), :class => 'user_navmore_li fl', :target => '_blank' %>
<%=link_to "+", new_project_issue_path(project), :class => 'user_navmore_add fl', :target => '_blank', :title => '发布问题' %>
</li>
<li class="subNavRow">
<%=link_to "资源", project_files_path(project),:class => 'fl fontGrey2 w48' %>
<%=link_to "+", upload_files_menu_path(:project_id => project.id),:remote => true,:class => 'fr fb',:title => '上传资源'%>
<div class="cl"></div>
<li class="clear">
<%=link_to "资源", project_files_path(project),:class => 'user_navmore_li fl' %>
<%=link_to "+", upload_files_menu_path(:project_id => project.id),:remote => true,:class => 'user_navmore_add fl',:title => '上传资源'%>
</li>
<li class="subNavRow">
<%=link_to "论坛", project_boards_path(project),:class => 'fl fontGrey2 w48', :target => '_blank'%>
<%=link_to "+", project_boards_path(project, :flag => true),:class => 'fr fb', :target => '_blank',:title => '发布帖子'%>
<div class="cl"></div>
<li class="clear">
<%=link_to "论坛", project_boards_path(project),:class => 'user_navmore_li fl', :target => '_blank'%>
<%=link_to "+", project_boards_path(project, :flag => true),:class => 'user_navmore_add fl', :target => '_blank',:title => '发布帖子'%>
</li>
<% if (User.current.admin? || User.current.allowed_to?({:controller => 'projects', :action => 'settings'}, project)) && rep_is_gitlab?(project) %>
<li class="subNavRow">
<%= link_to '版本库', url_for(:controller => 'projects', :action => 'settings', :id => project.id, :tab=>'repositories') , :target => '_blank',:class => "fl w48",:title => '版本库' %>
<li>
<%= link_to '版本库', url_for(:controller => 'projects', :action => 'settings', :id => project.id, :tab=>'repositories') , :target => '_blank',:class => "user_navmore_li",:title => '版本库' %>
<div class="cl"></div>
</li>
<% end %>
<% if User.current == @user %>
<li class="subNavRow">
<li>
<% if ShieldActivity.where("container_type='User' and container_id=#{user.id} and shield_type='Project' and shield_id=#{project.id}").count == 0 %>
<%= link_to "屏蔽动态", shield_activities_path(:user_id => user.id, :project_id => project.id), :method => 'post',:remote => true %>
<%= link_to "屏蔽动态", shield_activities_path(:user_id => user.id, :project_id => project.id), :method => 'post',:remote => true,:class => "user_navmore_li" %>
<% else %>
<%= link_to "显示动态", show_acts_shield_activities_path(:user_id => user.id, :project_id => project.id),:method => 'delete',:remote => true %>
<%= link_to "显示动态", show_acts_shield_activities_path(:user_id => user.id, :project_id => project.id),:method => 'delete',:remote => true,:class => "user_navmore_li" %>
<% end %>
<div class="cl"></div>
</li>
<li class="subNavRow">
<li>
<% if ShieldWechatMessage.where("container_type='User' and container_id=#{user.id} and shield_type='Project' and shield_id=#{project.id}").count == 0 %>
<%= link_to "屏蔽微信消息", shield_wechat_messages_path(:user_id => user.id, :project_id => project.id), :method => 'post',:remote => true %>
<%= link_to "屏蔽微信消息", shield_wechat_messages_path(:user_id => user.id, :project_id => project.id), :method => 'post',:remote => true,:class => "user_navmore_li" %>
<% else %>
<%= link_to "接收微信消息", show_messages_shield_wechat_messages_path(:user_id => user.id, :project_id => project.id),:method => 'delete',:remote => true %>
<%= link_to "接收微信消息", show_messages_shield_wechat_messages_path(:user_id => user.id, :project_id => project.id),:method => 'delete',:remote => true,:class => "user_navmore_li" %>
<% end %>
<div class="cl"></div>
</li>
<% end %>
<% if User.current.logged? && (User.current.admin? || is_project_manager?(User.current,project)) %>
<li class="subNavRow">
<li>
<%= link_to project.is_public? ? "设为私有" : "设为公开", {:controller => 'projects', :action => 'set_public_or_private', :id => project.id,:user_page => true},
:id => 'set_project_public_'+ project.id.to_s,:method => 'post',:remote=>true,:confirm=>"您确定要设置为"+(project.is_public? ? "私有" : "公开")+"吗"%>
:id => 'set_project_public_'+ project.id.to_s,:method => 'post',:remote=>true,:confirm=>"您确定要设置为"+(project.is_public? ? "私有" : "公开")+"吗",:class => "user_navmore_li"%>
<div class="cl"></div>
</li>
<% end %>
</ul>
</li>
</ul>
</div>
</li>
<% end %>
<% if projects.size == 5%>
<li class="homepageLeftMenuMore" id="user_show_more_project">
<input type="hidden" value="<%= page%>" id="project_page_num">
<a href="javascript:void(0);" class="homepageLeftMenuMoreIcon" onclick="show_more_project('<%= user_projects4show_user_path(user.id)%>');"></a>
</li>
<% if all_count > (page.to_i+1) * 10%>
<input type="hidden" value="<%= page%>" id="project_page_num">
<a class="user_navmorebox" href="javascript:void(0);" id="user_show_more_project" onclick="show_more_project('<%= user_projects4show_user_path(user.id)%>');">
<span class="user_icons_moreclass"></span>
</a>
<% end%>
<script type="text/javascript">
var projectcount = <%= @user.projects.visible.count %>;
var projectshowcount = document.getElementsByClassName("projectsLineGrey").length;
var projectshowcount = document.getElementsByClassName("course_list_menu").length;
if((projectcount <= projectshowcount)&&(projectcount > 5)){
$("#user_show_more_project").hide();

View File

@ -1,11 +1,11 @@
<% if User.current.logged?%>
<% if User.current == target%>
<%= link_to("编辑资料", my_account_path, :class => "fl UsersEditBtn")%>
<%= link_to("编辑个人资料", my_account_path, :class => "user_editinfo")%>
<% else%>
<%if(target.watched_by?(User.current))%>
<%= link_to "取消关注",watch_path(:object_type=> 'user',:object_id=>target.id,:target_id=>target.id),:class => "UsersApBtn", :method => "delete",:remote => "true", :title => "取消关注"%>
<%= link_to "取消关注",watch_path(:object_type=> 'user',:object_id=>target.id,:target_id=>target.id),:class => "user_editinfo", :method => "delete",:remote => "true", :title => "取消关注"%>
<% else %>
<%= link_to "添加关注",watch_path(:object_type=> 'user',:object_id=>target.id,:target_id=>target.id),:class => "UsersAttBtn", :method => "post",:remote => "true", :title => "添加关注"%>
<%= link_to "添加关注",watch_path(:object_type=> 'user',:object_id=>target.id,:target_id=>target.id),:class => "user_editinfo", :method => "post",:remote => "true", :title => "添加关注"%>
<% end %>
<% end%>
<% end %>

View File

@ -100,207 +100,135 @@
<!--div class="homepageRightBannerImg"></div-->
<div class="cl"></div>
<div class="homepageContent">
<div class="homepageLeft" id="LSide">
<div class="homepagePortraitContainer">
<div class="homepagePortraitImage fl" id="homepage_portrait_image">
<%= image_tag(url_to_avatar(@user),width:"78", height: "78", :id=>'nh_user_tx') %>
<% if User.current.logged?%>
<% if is_current_user%>
<div id="edit_user_file_btn" class="none">
<div class="homepageEditProfile">
<a href="<%= url_for(:controller => 'my', :action => 'clear_user_avatar_temp') %>" data-remote="true" class="homepageEditProfileIcon"></a>
</div>
</div>
<% end %>
<% end%>
</div>
<div class="fl ml10">
<p class="homepageImageName hidden db mb5" style="margin-left:0px;margin-right:0px;">
<%= @user.realname.blank? ? @user.login : @user.realname %>
</p>
<% if (@user.user_extensions && (@user.user_extensions.identity != 2) ) %>
<span class="<%= @user.user_extensions.gender == 1 ? 'homepageImageSexWomen' : 'homepageImageSexMan' %> "></span>
<% end %>
<div class="cl"></div>
<% if @user.user_extensions && @user.user_extensions.identity %>
<p class="mb8 c_dark f14">
<%= get_user_roll @user %>
</p>
<% end%>
<div id="watch_user_btn_div">
<%= render :partial => 'layouts/user_watch_btn', :locals => {:target => @user} %>
<div class="homepageLeft mt10" id="LSide">
<div class="user_leftinfo mb10">
<% if User.current.logged?%>
<%=link_to image_tag(url_to_avatar(@user),width:"74", height: "74", :id=>'nh_user_tx'), my_clear_user_avatar_temp_path, :class => "user_leftinfo_img", :remote => true%>
<% else %>
<img src="images/user/male.jpg" width="74" height="74" />
<% end %>
<% if (@user.user_extensions && (@user.user_extensions.identity != 2) ) %>
<span class="<%= @user.user_extensions.gender == 1 ? 'user_leftinfo_female' : 'user_leftinfo_male' %> "></span>
<% end %>
<div class="user_info_inner">
<div class=" user_leftinfo_namebox" >
<a href="javascript:void(0);" class="user_leftinfo_name"><%=@user.show_name %></a>
<% if @user.user_extensions && @user.user_extensions.identity %>
<span class="user_cirbtn_yellow" ><%= get_user_roll @user %></span>
<% end%>
</div>
</div>
<div class="cl"></div>
<%# 更新访问数,刷新的时候更新访问次数 %>
<% update_visiti_count @user %>
<%# over %>
<div>
<div class="homepageSignature break_word">
<div id="user_brief_introduction_show">
<div>
<div class="user_info_intro">
<div id="user_brief_introduction_show">
<%= render :partial => 'layouts/user_brief_introduction', :locals => {:user => @user} %>
</div>
</div>
<textarea class="homepageSignatureTextarea none" placeholder="请编辑签名" id="user_brief_introduction_edit" onblur="edit_user_introduction('<%= edit_brief_introduction_user_path(@user.id)%>');"><%= @user.user_extensions.brief_introduction %></textarea>
</div>
<textarea class="homepageSignatureTextarea none" placeholder="请编辑签名" id="user_brief_introduction_edit" onblur="edit_user_introduction('<%= edit_brief_introduction_user_path(@user.id)%>');"><%= @user.user_extensions.brief_introduction %></textarea>
<ul class="user_atten clear">
<li>
<a href="<%=user_blogs_path(:user_id => @user.id) %>">
<strong>博客</strong><br />
<span class="sy_cgrey"><%=@user.blog.blog_comments.where("#{BlogComment.table_name}.parent_id is null").count %></span>
</a>
</li>
<li>
<a href="<%=user_watchlist_user_path(@user.id) %>">
<strong>关注</strong><br />
<span class="sy_cgrey"><%=User.watched_by(@user.id).count %></span>
</a>
</li>
<li>
<a href="<%=user_fanslist_user_path(@user.id) %>">
<strong>粉丝</strong><br />
<span class="sy_cgrey"><%= @user.watcher_users.count %></span>
</a>
</li>
</ul>
</div>
<div>
<div class="homepageImageBlock">
<div>
<%= link_to(@user.blog.blog_comments.where("#{BlogComment.table_name}.parent_id is null").count,
{:controller => 'blogs', :action => 'index', :user_id => @user.id }, :class => 'homepageImageNumber',:id => 'user_score') %>
</div>
<div class="homepageImageText">
<%= link_to('博客',
{:controller => 'blogs', :action => 'index', :user_id => @user.id }, :class => 'homepageImageNumber',:id => 'user_score') %>
</div>
</div>
<div class="homepageVerDiv"></div>
<div class="homepageImageBlock">
<div id="watch_user_number_div">
<%= link_to User.watched_by(@user.id).count.to_s, {:controller=>"users", :action=>"user_watchlist",:id=>@user.id},:class=>"homepageImageNumber" %>
</div>
<div class="homepageImageText">
<%= link_to '关注', {:controller=>"users", :action=>"user_watchlist",:id=>@user.id},:class=>"homepageImageNumber" %>
</div>
</div>
<div class="homepageVerDiv"></div>
<div class="homepageImageBlock">
<div id="fans_user_number_div">
<%= link_to @user.watcher_users.count.to_s, {:controller=>"users", :action=>"user_fanslist",:id=>@user.id},:class=>"homepageImageNumber", :id => "user_fans_number"%>
</div>
<div class="homepageImageText">
<%= link_to '粉丝', {:controller=>"users", :action=>"user_fanslist",:id=>@user.id},:class=>"homepageImageNumber", :id => "user_fans_number"%>
</div>
</div>
<div class="cl"></div>
<div id="watch_user_btn_div">
<%= render :partial => 'layouts/user_watch_btn', :locals => {:target => @user} %>
</div>
</div>
<div class="homepageLeftMenuContainer">
<div class="homepageLeftMenuBlock">
<%= link_to "动态",user_activities_path(@user.id),:class => "homepageMenuText"%>
</div>
<div class="user_leftnav ">
<% hidden_courses = Setting.find_by_name("hidden_courses") %>
<% unvisiable = hidden_courses && hidden_courses.value == "1"%>
<% if !unvisiable %>
<div class="homepageLeftMenuBlock">
<%= link_to '课程',{:controller => "users", :action => "user_courselist", :id => @user.id}, :class => "homepageMenuText" %>
<% if is_current_user%>
<%# if User.current.user_extensions && User.current.user_extensions.identity == 0 && User.current.allowed_to?(:add_course, nil, :global => true)%>
<div class="courseMenu" id="courseMenu">
<ul>
<li class="courseMenuIcon fr" style="margin-right:10px;" id="courseMenuIcon">
<ul class="topnav_course_menu" id="topnav_course_menu">
<li>
<%= link_to "新建课程", new_syllabus_path(:host=> Setting.host_course), :class => "menuGrey"%>
</li>
<li>
<%= link_to "新建班级", new_course_path(:host=> Setting.host_course), :class => "menuGrey"%>
</li>
<!--<li><a href="javascript:void(0);" class="menuGrey">账号设置</a> </li>-->
<li>
<%= link_to "加入班级",join_private_courses_courses_path,:remote => true,:class => "menuGrey",:method => "post"%>
</li>
</ul>
</li>
</ul>
</div>
<%# else%>
<%#=link_to "", join_private_courses_courses_path, :class => "homepageMenuSetting fr",:style => "margin-right:10px;", :remote => true, :title => "加入班级"%>
<%# end%>
<% end%>
</div>
<% end %>
<%# if @user.courses.visible.count > 0
course_order_ids = "(" +
CourseActivity.find_by_sql("SELECT c.course_id, updated_at FROM
(SELECT ca.course_id, MAX(ca.updated_at) AS updated_at FROM course_activities ca WHERE ca.course_id IN (" + @user.courses.visible.select('courses.id').map{|c| c.id}.join(',') + ")
GROUP BY ca.course_id) AS c
ORDER BY c.updated_at DESC limit 5").map {|c| c.course_id}.join(",") + ")"
courses = Course.where("id in #{course_order_ids}")
else
courses = []
end
%>
<% courses = @user.courses.visible.where("is_delete =?", 0).select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS a").order("a desc").limit(5) %>
<% all_count = @user.courses.visible.where("is_delete =?", 0).count%>
<div class="homepageLeftMenuCourses <%= courses.empty? ? 'none' : ''%>" >
<div class = "leftCoursesList" id="homepageLeftMenuCourses">
<ul>
<%= render :partial => 'layouts/user_courses', :locals => {:courses => courses,:user => @user,:all_count => all_count,:type =>'User',:page => 0} %>
</ul>
</div>
<% if !courses.empty? %>
<div class="homepageLeftMenuMore" id="user_hide_course">
<a href="javascript:void(0);" class="homepageLeftMenuHideIcon" id="hide_show_courseicon" onclick="leftCourseslistChange();"></a>
</div>
<% end %>
</div>
<div class="homepageLeftMenuBlock">
<%= link_to '项目',{:controller => "users", :action => "user_projectlist", :id => @user.id}, :class => "homepageMenuText" %>
<% if is_current_user %>
<div class="courseMenu" id="projectMenu">
<ul>
<li class="courseMenuIcon fr" style="margin-right:10px;" id="courseMenuIcon">
<ul class="topnav_course_menu" id="topnav_project_menu">
<li>
<%= link_to "新建项目", new_project_path(:host=> Setting.host_name), :class => "menuGrey"%>
</li>
<li>
<%= link_to "加入项目", applied_join_project_path,:remote => true,:class => "menuGrey",:method => "post"%>
</li>
</ul>
</li>
<ul class="users_accordion mb10">
<li id="user_01" class="user_icons_course">
<%= link_to '课程',{:controller => "users", :action => "user_courselist", :id => @user.id}, :id => "user_course_list" %>
<% courses = @user.courses.visible.where("is_delete =?", 0).select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS a").order("a desc").limit(10) %>
<% all_count = @user.courses.visible.where("is_delete =?", 0).count%>
<div class="<%= courses.empty? ? 'none' : ''%>" >
<div id="homepageLeftMenuCourses">
<ul class="user_sub_menu" id="user_courses_li">
<%= render :partial => 'layouts/user_courses', :locals => {:courses => courses,:user => @user,:all_count => all_count,:page => 0} %>
</ul>
</div>
<% end%>
</div>
<%# if @user.projects.visible.count > 0
project_order_ids = "(" +
ForgeActivity.find_by_sql("SELECT p.project_id, p.created_at FROM
(SELECT fa.project_id, MAX(fa.created_at) AS created_at FROM forge_activities fa WHERE fa.project_id IN (" + @user.projects.visible.select('projects.id').map{|p| p.id}.join(',') + ")
GROUP BY fa.project_id) AS p
ORDER BY p.created_at DESC limit 5").map {|p| p.project_id}.join(",") + ")"
projects = Project.where("projects.id in #{project_order_ids}")
else
projects = []
end
%>
<% projects = @user.projects.visible.select("projects.*, (SELECT MAX(updated_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS a").order("a desc").limit(5)%>
<div class="homepageLeftMenuCourses <%= projects.empty? ? 'none' : ''%>" >
<div class = "leftProjecsList" id="homepageLeftMenuForge">
<ul>
<%= render :partial => 'layouts/user_projects', :locals => {:projects => projects,:user => @user, :page => 0} %>
</ul>
</div>
<% if !projects.empty? %>
<div class="homepageLeftMenuMore" id="user_hide_project">
<a href="javascript:void(0);" class="homepageLeftMenuHideIcon" id="hide_show_projecticon" onclick="leftProjectslistChange();"></a>
</div>
<% if !courses.empty? %>
<a class="user_navmorebox" href="javascript:void(0);" id="user_hide_course" onclick="leftCourseslistChange();">
<span id="hide_show_courseicon" class="user_icons_closeclass"></span>
</a>
<% end %>
</div>
</li>
<% if is_current_user %>
<li id="user_02" class="user_icons_new">
<%= link_to "新建课程", new_syllabus_path(:host=> Setting.host_course), :target => "_blank"%>
</li>
<li id="user_03" class="user_icons_new">
<%= link_to "新建班级", new_course_path(:host=> Setting.host_course), :target => "_blank"%>
</li>
<li id="user_04" class="user_icons_addclass">
<%= link_to "加入班级",join_private_courses_courses_path,:remote => true, :method => "post"%>
</li>
<% if @user == User.current %>
<li id="user_05" class="user_icons_myhw">
<%=link_to '我的作业', my_homeworks_user_path(@user.id), :target => "_blank" %>
</li>
<% end %>
<% end %>
</div>
<div class="homepageLeftMenuBlock">
<!--<a href="javascript:void(0);" class="homepageMenuText">留言</a>-->
<%= link_to '留言',feedback_path(@user, :host=> Setting.host_user),:class=>'homepageMenuText'%>
</div>
</div>
<div class="homepageLeftLabelContainer">
<div class="project_Label_New">
<span class="homepageLabelText">标签</span>
<div class="tag_h ml10" >
<%= render :partial => 'tags/user_tag', :locals => {:obj => @user,:object_flag => "1"}%>
</div>
<div class="cl"></div>
</div>
</div>
</ul>
<% end %>
<ul class="users_accordion mb10">
<li id="user_06" class="user_icons_project">
<%= link_to '项目',{:controller => "users", :action => "user_projectlist", :id => @user.id}, :id => 'user_project_list'%>
<% all_count = @user.projects.visible.count%>
<% projects = @user.projects.visible.select("projects.*, (SELECT MAX(updated_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS a").order("a desc").limit(10)%>
<div class="<%= projects.empty? ? 'none' : ''%>" >
<div id="homepageLeftMenuForge">
<ul class="user_sub_menu" id="user_projects_li">
<%= render :partial => 'layouts/user_projects', :locals => {:projects => projects,:user => @user, :all_count => all_count, :page => 0} %>
</ul>
</div>
<% if !projects.empty? %>
<a class="user_navmorebox" href="javascript:void(0);" id="user_hide_project" onclick="leftProjectslistChange();">
<span id="hide_show_projecticon" class="user_icons_closeclass"></span>
</a>
<% end %>
</div>
</li>
<% if is_current_user %>
<li id="user_07" class="user_icons_new">
<%= link_to "新建项目", new_project_path(:host=> Setting.host_name), :target => "_blank"%>
</li>
<li id="user_08" class="user_icons_addproject">
<%= link_to "加入项目", applied_join_project_path, :remote => true, :method => "post"%>
</li>
<!--<li id="user_09" class="user_icons_myissues">-->
<!--<a href="#user_09" >我的任务</a>-->
<!--</li>-->
<% end %>
</ul>
<ul class="users_accordion mb10">
<li id="user_10" class="user_icons_mes">
<%= link_to '留言', feedback_path(@user, :host=> Setting.host_user)%>
</li>
</ul>
</div><!--sy_class_leftnav end-->
<div class="fontGrey5 mt10 ml20">访问计数 <%= @user.visits.to_i %> 自2016年5月</div>
</div>
<div class="homepageRight">
@ -367,6 +295,11 @@
$('#user_hide_course').hide();
$('#user_hide_project').hide();
autoUrl("user_brief_introduction_show");
if(<%= @is_course == 1 %>) {
$("#user_course_list").addClass('active');
} else if(<%= @is_project == 1 %>) {
$("#user_project_list").addClass('active');
}
});
$("#courseMenu").mouseenter(function(){
@ -382,18 +315,23 @@
$("#topnav_project_menu").hide();
});
function leftCourseslistChange(){
$('#homepageLeftMenuCourses').slideToggle();
$('#hide_show_courseicon').toggleClass("homepageLeftMenuHideIcon");
$('#hide_show_courseicon').toggleClass("homepageLeftMenuMoreIcon");
var target = $('#user_courses_li>li');
for(var i = 10; i < target.length; i++){
target.eq(i).slideToggle();
}
$('#hide_show_courseicon').toggleClass("user_icons_closeclass");
$('#hide_show_courseicon').toggleClass("user_icons_moreclass");
}
function leftProjectslistChange(){
var target = $('#user_projects_li>li');
for(var i = 10; i < target.length; i++){
target.eq(i).slideToggle();
}
$('#homepageLeftMenuForge').slideToggle();
$('#hide_show_projecticon').toggleClass("homepageLeftMenuHideIcon");
$('#hide_show_projecticon').toggleClass("homepageLeftMenuMoreIcon");
$('#hide_show_projecticon').toggleClass("user_icons_closeclass");
$('#hide_show_projecticon').toggleClass("user_icons_moreclass");
}
</script>
</body>
</html>

View File

@ -16,7 +16,7 @@
<%= call_hook :view_layouts_base_html_head %>
<!-- page specific tags -->
<%= yield :header_tags -%>
<%= stylesheet_link_tag 'css/common','css/structure','css/public', :media => 'all'%>
<%= stylesheet_link_tag 'css/common','css/structure','css/public','css/popup','syllabus','sy_public', :media => 'all'%>
<!-- MathJax的配置 -->
<script type="text/javascript"
src="/javascripts/MathJax/MathJax.js?config=TeX-AMS-MML_HTMLorMML">

View File

@ -80,7 +80,7 @@
<input nhname="tag" autocomplete="off" maxlength="36" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" id="province" name="province" style="display: none;" class="w210 fl" type="text" placeholder="--请搜索您所在的高校(单位)--" >
<input nhname="tag" nh_tag_4="true" id="occupation" name="occupation" style="display: none;" class="w210" type="text" value="" placeholder=" --请选择您所属的单位--"/>
<p class="fl ml10">
<span id="errortip" class="icons_warning fl mt5" style="display: none;"></span>
<!-- <span id="errortip" class="icons_warning fl mt5" style="display: none;"></span> -->
<span id="hint" style="color: #7f7f7f;display: none">平台找到了<a id="school_num" href="javascript:void(0)" style="color: red" >0</a>个包含<a id="search_condition" href="javascript:void(0)">"国防"</a>的高校</span>
</p>
<!--<input nhname="tag" nh_tag_0="true" nh_tag_1="true" id="occupation_name" type="text" style="display: none;width:117px;" readonly/>-->
@ -88,7 +88,7 @@
<input nhname="tag" autocomplete="off" maxlength="36" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" id="province" name="province" style="display: none;" class="w210 fl" type="text" placeholder="--请搜索您所在的高校(单位)--" >
<input nhname="tag" nh_tag_4="true" id="occupation" name="occupation" style="display: none;" class="w210" type="text" value="<%= @user.user_extensions.occupation %>" />
<p class="fl ml10">
<span id="errortip" class="icons_warning fl mt5" style="display: none;"></span>
<!-- <span id="errortip" class="icons_warning fl mt5" style="display: none;"></span> -->
<span id="hint" style="color: #7f7f7f;display: none">平台找到了<a id="school_num" href="javascript:void(0)" style="color: red" >0</a>个包含<a id="search_condition" href="javascript:void(0)">"国防"</a>的高校</span>
</p>
<!--<input nhname="tag" nh_tag_0="true" nh_tag_1="true" id="occupation_name" type="text" style="display: none;width:117px;" readonly/>-->
@ -96,7 +96,7 @@
<input nhname="tag" autocomplete="off" maxlength="36" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" id="province" name="province" style="display: none;" class="w210 fl" type="text" placeholder="--请搜索您所在的高校(单位)--" >
<input nhname="tag" nh_tag_4="true" id="occupation" name="occupation" style="display: none;" class="w210" type="text" placeholder=" --请选择您所属的单位--" />
<p class="fl ml10">
<span id="errortip" class="icons_warning fl mt5" style="display: none;"></span>
<!-- <span id="errortip" class="icons_warning fl mt5" style="display: none;"></span> -->
<span id="hint" style="color: #7f7f7f;display: none">平台找到了<a id="school_num" href="javascript:void(0)" style="color: red" >0</a>个包含<a id="search_condition" href="javascript:void(0)">"国防"</a>的高校</span>
</p>
<!--<input nhname="tag" nh_tag_0="true" nh_tag_1="true" id="occupation_name" type="text" style="display: none;width:117px;" readonly/>-->
@ -104,7 +104,7 @@
<input nhname="tag" autocomplete="off" maxlength="36" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" id="province" name="province" style="display: none;" class="w210 fl" type="text" value="<%= User.current.user_extensions.school %>" />
<input nhname="tag" nh_tag_4="true" id="occupation" name="occupation" type="text" style="display: none;" class="w210" value="<%= User.current.user_extensions.school.id %>"/>
<p class="fl ml10">
<span id="errortip" class="icons_warning fl mt5" style="display: none;"></span>
<!-- <span id="errortip" class="icons_warning fl mt5" style="display: none;"></span> -->
<span id="hint" style="color: #7f7f7f;display: none">平台找到了<a id="school_num" href="javascript:void(0)" style="color: red" >0</a>个包含<a id="search_condition" href="javascript:void(0)">"国防"</a>的高校</span>
</p>
<!--<input nhname="tag" nh_tag_0="true" nh_tag_1="true" id="occupation_name" type="text" style="display: none;width:117px;" value="<%#= User.current.user_extensions.school.name %>" readonly="true" style="background-color: #E2E2E2;"/>-->
@ -466,7 +466,7 @@
}else{
$("#search_school_result_list").html('');
str = e.target.value.length > 4 ? e.target.value.substr(0, 4)+"..." : e.target.value;
$("#hint").html('您输入的名称尚不存在,<a style="color:#64bdd9" onclick="apply_add_school();" href="javascript:void(0);">申请添加</a>');
$("#hint").html('如果找不到自己的单位,您可以<a style="color:#64bdd9" onclick="apply_add_school();" href="javascript:void(0);">添加单位</a>');
$("#hint").show();
$("#errortip").show();
}

View File

@ -1,12 +1,17 @@
<div id="popbox02">
<div class="ni_con">
<p style="display: block;font-size: 14px;margin-left: 30px;margin-top: 20px;">
题目已发送到目标课程的作业列表,但需要您设置发布和截止时间,以激活相应作业,谢谢!
</p>
<div class="ni_btn">
<a href="javascript:void(0)" class="tijiao c_white ml45" onclick="hideModal();">
确&nbsp;&nbsp;定
</a>
</div>
<div id="sy_popup_box" style="width:380px;">
<div class="sy_popup_top sy_popup_top_tishi">
<h3 class="fl">提示</h3>
<a href="javascript:void(0);" class="sy_icons_close02 fr" onclick="hideModal()"></a>
<div class="cl"></div>
</div>
<div class="sy_popup_con02" >
<ul class="sy_popup_tishi">
<li>
题目已发送到目标课程的作业列表,但需要您设置发布和截止时间,以激活相应作业,谢谢!
</li>
<li>
<a href="javascript:void(0);" class="sy_btn_blue mt10" onclick="hideModal()">知道了</a>
</li>
</ul>
</div>
</div>

View File

@ -1,52 +1,42 @@
<div class="subjectDetail fl mt10">
<div class="subjectInfo">题目信息</div>
<div class="subject-content-wrapper">
<% if homework.nil? %>
<span id="homework_notice_span"><span class="center db">本题库遵循创作共用许可证</span><br>
教师给学生出题本质上是一种创作行为,题目的作者通常为此付出大量时间和精力。好的题目不仅能加深学生对知识点的理解,还能激发学生兴趣,提升学习效率。为此,本网站的题库许可证基于创作共用许可证( Creative Commons License )建立,其核心条款包括:<br/><br/>
1. 署名:必须提到原作者。<br/><br/>
2. 非商业用途:不得用于盈利性目的。<br/><br/>
3. 相同方式共享:允许修改原作品,但必须使用相同的许可证发布。<br/><br/>
对此许可证的支持或反对,请在网站中留言,我们不断完善,谢谢!
</span>
<!-- <%# elsif homework.nil? && status == 1 %>
<span class="c_red">您选中的作业目前为私有作业,您的分享请求已发送至老师,请耐心等待老师的同意。</span>
<%# elsif homework.nil? && status == 2 %>
<span class="c_red">您选中的作业目前为私有作业,请点击“请求分享”按钮向题目的作者发送分享请求吧!<br/>
祝您成功:)
</span>
<%# elsif homework.nil? && status == 3 %>
<span class="c_red">您选中的作业目前为私有作业,您的分享请求已被老师拒绝,暂时不可查看作业详情。</span>-->
<% else %>
<div class="subjectIntro mb15">标题:<%=homework.name %><br />
来源:<%=homework.course.name %><br />
<% if homework.homework_type == 2 && homework.homework_detail_programing %>
编程语言:<%=homework.language_name %><br/>
<% end %>
贡献者:<%=homework.user.show_name %>
<% if homework.user.user_extensions.occupation && homework.user.user_extensions.occupation!="" %>
<%=homework.user.user_extensions.occupation%>
<% end %>
<br />
描述如下:
</div>
<div class="subjectContent" id="homework_description">
<%=homework.description.html_safe %>
</div>
<% if homework.homework_type == 2 %>
<div class="subjectContent mt10">
测试集:<%=homework.homework_tests.count %>组
</div>
<% elsif homework.homework_type ==3 && homework.homework_detail_group %>
<div class="subjectContent mt10">
分组人数:<%=homework.homework_detail_group.min_num %> - <%=homework.homework_detail_group.max_num %>人
</div>
<% end %>
<% end %>
<div class="hw_popup_box">
<div class="hw_popup_top clear">
<a href="javascript:void(0);" class="hw_icons_close fr" style="outline: none;" onclick="hideModal()"></a>
</div>
</div>
<div class="hw_popup_con">
<div class="clear">
<h3 class="sy_classlist_title fl"><%=@homework.name %></h3>
<span class="hw_icon_open fl mt3"></span>
</div>
<span class=" mr15">作者:<%=link_to @homework.user.show_name, user_path(@homework.user_id), :class => 'hw_cgrey', :target => '_blank'%></span>
<div class="hw_popup_txt">
<p><%=@homework.description.html_safe %></p>
<% if @homework.homework_type == 2 %>
<p class="subjectContent mt10">
测试集:<%=@homework.homework_tests.count %>组
</p>
<% if @homework.user == User.current && @homework.homework_tests.count > 0 %>
<table class="hw_popup_testtable" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td class="test_td_min">&nbsp;</td>
<td class="test_td_title">测试集输入</td>
<td class="test_td_title">测试集输出</td>
</tr>
<% @homework.homework_tests.each_with_index do |test, i| %>
<tr>
<td class="test_td_min"><%=i+1 %></td>
<td><%=test.input %></td>
<td ><%=test.output %></td>
</tr>
<% end %>
</tbody>
</table>
<% end %>
<% elsif @homework.homework_type ==3 && @homework.homework_detail_group %>
<p class="subjectContent mt10">
分组人数:<%=@homework.homework_detail_group.min_num %> - <%=@homework.homework_detail_group.max_num %>人
</p>
<% end %>
</div>
</div>
</div>

View File

@ -1,39 +1,58 @@
<ul class="subject-list-banner">
<li class="subject-list-name fl hidden"><span style="padding-left:15px;">作业名称</span></li>
<li class="subject-list-from fl">
<%= link_to "来源",user_search_homeworks_user_path(@user,:name=>search,:type => type,:is_import=>is_import,:property=>property,:order => "course_name", :sort => @r_sort),:class => "fl ml55",:remote => true%>
<% if @order == "course_name"%>
<%= link_to "", user_search_homeworks_user_path(@user,:name=>search,:type => type,:is_import=>is_import,:property=>property,:order => "course_name", :sort => @r_sort),:class => "#{@r_sort == 'desc' ? 'st_up' : 'st_down'} mt12 fl" ,:remote => true%>
<% end%>
</li>
<li class="subject-list-type fl">
<%= link_to "类别",user_search_homeworks_user_path(@user,:name=>search,:type => type,:is_import=>is_import,:property=>property,:order => "homework_type", :sort => @r_sort),:class => "fl ml10",:remote => true%>
<% if @order == "homework_type"%>
<%= link_to "", user_search_homeworks_user_path(@user,:name=>search,:type => type,:is_import=>is_import,:property=>property,:order => "homework_type", :sort => @r_sort),:class => "#{@r_sort == 'desc' ? 'st_up' : 'st_down'} mt12 fl" ,:remote => true%>
<% end%>
</li>
<li class="subject-list-publisher fl">
<%= link_to "贡献者",user_search_homeworks_user_path(@user,:name=>search,:type => type,:is_import=>is_import,:property=>property,:order => "user_name", :sort => @r_sort),:class => "fl ml20",:remote => true%>
<% if @order == "user_name"%>
<%= link_to "", user_search_homeworks_user_path(@user,:name=>search,:type => type,:is_import=>is_import,:property=>property,:order => "user_name", :sort => @r_sort),:class => "#{@r_sort == 'desc' ? 'st_up' : 'st_down'} mt12 fl" ,:remote => true%>
<% end%>
</li>
<li class="subject-list-count fl">
<%= link_to "引用数",user_search_homeworks_user_path(@user,:name=>search,:type => type,:is_import=>is_import,:property=>property,:order => "quotes", :sort => @r_sort),:class => "fl ml5",:remote => true%>
<% if @order == "quotes"%>
<%= link_to "", user_search_homeworks_user_path(@user,:name=>search,:type => type,:is_import=>is_import,:property=>property,:order => "quotes", :sort => @r_sort),:class => "#{@r_sort == 'desc' ? 'st_up' : 'st_down'} mt12 fl" ,:remote => true%>
<% end%>
</li>
<li class="fl subject-list-date">
<%= link_to "发布时间",user_search_homeworks_user_path(@user,:name=>search,:type => type,:is_import=>is_import,:property=>property,:order => "publish_time", :sort => @r_sort),:class => "fl",:remote => true%>
<% if @order == "publish_time"%>
<%= link_to "", user_search_homeworks_user_path(@user,:name=>search,:type => type,:is_import=>is_import,:property=>property,:order => "publish_time", :sort => @r_sort),:class => "#{@r_sort == 'desc' ? 'st_up' : 'st_down'} mt12 fl" ,:remote => true%>
<% end%>
</li>
<li class="fl subject-list-option">
操作
</li>
</ul>
<div id="homework_repository">
<%=render :partial => 'homework_repository', :locals => {:homeworks => homeworks} %>
</div>
<% if homeworks.empty? %>
<div class="icons_tishi"><img src="/images/sy/icons_tan.png" width="110" height="110" alt="" ></div>
<p class="sy_tab_con_p">暂无可显示的内容~</p>
<% else %>
<% homeworks.each do |homework| %>
<ul class="sy_classlist">
<span class="hw_icons_cir fl mt5 mr5"></span>
<div class="fl ">
<h3 class="sy_classlist_title fl">
<% if type == "1" %>
<%=link_to homework.name, student_work_index_path(:homework => homework), :class => 'hw_cgrey', :target => "_blank" %>
<% else %>
<%=homework.name %>
<% end %>
</h3>
<span class="<%=homework.course.is_public? ? 'hw_icon_open' : 'hw_icon_private'%> fl mt3"></span>
<div class="cl"></div>
<p class="sy_cgrey">
<span class="fl">
<span class="fl">来源:</span>
<%=link_to homework.course.name.to_s + "#{current_time_and_term_short(homework.course)}", course_path(homework.course), :class => 'hw_cgrey hw_list_classname fl mr15', :target => '_blank' %>
</span>
<% if type == "2" %>
<span class="mr15 fl">
<span class="fl">贡献者:</span>
<%=link_to homework.user.show_name, user_path(homework.user_id), :class => 'hw_cgrey hw_list_teachername fl', :target => '_blank'%>
</span>
<% end %>
<span class="mr15 fl">类别:
<% case homework.homework_type %>
<% when 1 %>
普通
<% when 2 %>
编程
<% when 3 %>
分组
<% end %>
</span>
<span class="fl mr15">引用数:<span id="subject_count_homework_<%=homework.id %>"><%= homework.quotes %></span></span>
<% if homework.publish_time.nil? %>
<span class="fl mr15">发布时间:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- -</span>
<% else %>
<span class="fl mr15">发布时间:<%= format_date(homework.publish_time) %></span>
<% end %>
</p>
<div class="cl"></div>
</div>
<% student_ids = homework.course.student.empty? ? [] : homework.course.student.map{|student| student.student_id}.join(',') %>
<% if student_ids.include?(User.current.id.to_s) %>
<a href="javascript:void(0);" class="hw_btn_grey fr mt5" title="您选中的题是“我收到的作业”,不能发送">发送</a>
<% else %>
<a href="javascript:void(0);" class="hw_btn_green fr mt5" onclick="choose_course('<%=User.current.id%>', '<%=homework.id %>');" data-remote="true">发送</a>
<% end %>
<a href="javascript:void(0);" class="hw_btn_green fr mt5 mr5" onclick="show_homework_detail('<%=show_homework_detail_user_path(@user,:homework=>homework.id,:is_import => 0) %>')" data-remote="true">预览</a>
<div class="cl"></div>
</ul>
<% end %>
<% end %>

View File

@ -1,4 +1,12 @@
<input type="text" name="search" placeholder="输入作业、老师姓名的关键词进行搜索" class="subject-pop-search fr" />
<div id="homework_repository_sort">
<%= render :partial => 'users/homework_repository_sort', :locals => {:type => type,:is_import => is_import,:property => property,:order => @order,:search => search} %>
</div>
<div class="hw_search_box fr mr10">
<input class="hw_search-input" name="search" value='<%=search %>' placeholder="输入作业、老师姓名的关键词进行搜索" type="text" >
<span class="hw_btn_search"></span>
</div>
<div class="cl"></div>
<script type="text/javascript">
var lastSearchCondition = '';
var count = 0;

View File

@ -0,0 +1,13 @@
<span class="sy_cgrey ">排序:</span>
<%= link_to "发布时间",user_search_homeworks_user_path(@user,:name=>search,:type => type,:is_import=>is_import,:property=>property,:order => "publish_time", :sort => @r_sort),:class => "sy_cgrey fl",:remote => true%>
<% if order == "publish_time" %>
<%= link_to "", user_search_homeworks_user_path(@user,:name=>search,:type => type,:is_import=>is_import,:property=>property,:order => "publish_time", :sort => @r_sort), :class => "#{@r_sort == 'asc' ? 'sortupbtn' : 'sortdownbtn'} mt15 fl", :remote => true %>
<% else %>
<%= link_to "", user_search_homeworks_user_path(@user,:name=>search,:type => type,:is_import=>is_import,:property=>property,:order => "publish_time", :sort => @r_sort), :class => "sortdownbtn sort_no mt15 fl", :remote => true %>
<% end %>
<%= link_to "引用数",user_search_homeworks_user_path(@user,:name=>search,:type => type,:is_import=>is_import,:property=>property,:order => "quotes", :sort => @r_sort),:class => "sy_cgrey fl",:remote => true%>
<% if order == "quotes" %>
<%= link_to "", user_search_homeworks_user_path(@user,:name=>search,:type => type,:is_import=>is_import,:property=>property,:order => "quotes", :sort => @r_sort), :class => "#{@r_sort == 'asc' ? 'sortupbtn' : 'sortdownbtn'} mt15 fl", :remote => true %>
<% else %>
<%= link_to "", user_search_homeworks_user_path(@user,:name=>search,:type => type,:is_import=>is_import,:property=>property,:order => "quotes", :sort => @r_sort), :class => "sortdownbtn sort_no mt15 fl", :remote => true %>
<% end %>

View File

@ -0,0 +1,45 @@
<div class="sy_classbox" >
<% if homeworks.empty? %>
<div class="icons_tishi"><img src="/images/sy/icons_tan.png" width="110" height="110" alt="" ></div>
<p class="sy_tab_con_p">暂无可显示的内容~</p>
<% else %>
<% homeworks.each do |homework| %>
<ul class="sy_classlist">
<span class="hw_icons_cir fl mt5 mr5"></span>
<div class="fl ">
<h3 class="sy_classlist_title fl">
<%= link_to homework.name, student_work_index_path(:homework => homework.id), :class => 'sy_cblack', :target => '_blank' %>
</h3>
<div class="cl"></div>
<p class="sy_cgrey clear">
<span class="fl">来源:</span>
<%= link_to homework.course.name, course_path(homework.course), :target => '_blank', :class => 'hw_cgrey hw_classname fl mr15' %>
<span class="mr15 fl">类别:<%=homework.homework_type_ch %></span>
<span class="fl">作品:</span>
<span class="sy_corange hw_w20 fl "><%=homework.student_works.has_committed.count %></span>
<span class="fl">/</span>
<span class="sy_cgrey hw_w20 fl mr15"><%= homework.homework_type == 3 ? '--' : homework.course.student.count %></span>
<span class="fl">待评阅:</span>
<span class="sy_corange hw_w20 fl"><%= homework.student_works.has_committed.where("teacher_score is null and teaching_asistant_score is null").count %></span>
<span class="fl">/</span>
<span class="sy_cgrey hw_w20 fl mr15"><%=homework.student_works.has_committed.count %></span>
<span class="mr15 fl">发布时间:
<% if homework.publish_time %>
<%= format_date(homework.publish_time) %>
<% else %>
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
<% end %>
</span>
<span class="mr15 fl"><%=(cur_homework_end_time homework).html_safe %></span>
</p>
</div>
<% if homework.student_works.has_committed.count == 0 %>
<%= link_to '编&nbsp;&nbsp;&nbsp;&nbsp;辑'.html_safe, edit_homework_common_path(homework), :class => 'hw_btn_green fr mt5', :target => '_blank' %>
<% else %>
<%= link_to '评&nbsp;&nbsp;&nbsp;&nbsp;分'.html_safe, student_work_index_path(:homework => homework.id), :class => 'hw_btn_green fr mt5', :target => '_blank' %>
<% end %>
<div class="cl"></div>
</ul>
<% end %>
<% end %>
</div>

View File

@ -0,0 +1,11 @@
<div class="hw_tab_top clear">
<span class="sy_cgrey fl"><%= @manage_pre ? '我管理的作业:' : '我收到的的作业:' %></span>
<%= link_to '查看更多', @manage_pre ? manage_or_receive_homeworks_user_path(@user) : manage_or_receive_homeworks_user_path(@user, :type =>2), :class => 'sy_cgrey fr mr15' %>
</div>
<%= render :partial => "#{@manage_pre ? 'manage_homework_list' : 'receive_homework_list'}", :locals => {:homeworks => @manage_pre ? @manage_homeworks : @receive_homeworks} %>
<div class="hw_tab_top clear">
<span class="sy_cgrey fl"><%= @manage_pre ? '我收到的的作业:' : '我管理的作业:' %></span>
<%= link_to '查看更多', @manage_pre ? manage_or_receive_homeworks_user_path(@user, :type =>2) : manage_or_receive_homeworks_user_path(@user), :class => 'sy_cgrey fr mr15' %>
</div>
<%= render :partial => "#{@manage_pre ? 'receive_homework_list' : 'manage_homework_list'}", :locals => {:homeworks => @manage_pre ? @receive_homeworks : @manage_homeworks} %>

View File

@ -0,0 +1,22 @@
<span class="sy_cgrey ">排序:</span>
<% if type == 1 %>
<%= link_to "发布时间",search_m_r_homeworks_user_path(@user,:name=>search,:type => type,:property=>property,:order => "publish_time", :sort => @r_sort),:class => "sy_cgrey fl",:remote => true%>
<% if order == "publish_time" %>
<%= link_to "", search_m_r_homeworks_user_path(@user,:name=>search,:type => type,:property=>property,:order => "publish_time", :sort => @r_sort), :class => "#{@r_sort == 'asc' ? 'sortupbtn' : 'sortdownbtn'} mt15 fl", :remote => true %>
<% else %>
<%= link_to "", search_m_r_homeworks_user_path(@user,:name=>search,:type => type,:property=>property,:order => "publish_time", :sort => @r_sort), :class => "sortdownbtn sort_no mt15 fl", :remote => true %>
<% end %>
<% else %>
<%= link_to "状态", search_m_r_homeworks_user_path(@user,:name=>search,:type => type,:property=>property,:order => "status", :sort => @r_sort),:class => "sy_cgrey fl",:remote => true%>
<% if order == "status" %>
<%= link_to "", search_m_r_homeworks_user_path(@user,:name=>search,:type => type,:property=>property,:order => "status", :sort => @r_sort), :class => "#{@r_sort == 'asc' ? 'sortupbtn' : 'sortdownbtn'} mt15 fl", :remote => true %>
<% else %>
<%= link_to "", search_m_r_homeworks_user_path(@user,:name=>search,:type => type,:property=>property,:order => "status", :sort => @r_sort), :class => "sortdownbtn sort_no mt15 fl", :remote => true %>
<% end %>
<% end %>
<%= link_to "截止时间",search_m_r_homeworks_user_path(@user,:name=>search,:type => type,:property=>property,:order => "end_time", :sort => @r_sort),:class => "sy_cgrey fl",:remote => true%>
<% if order == "end_time" %>
<%= link_to "", search_m_r_homeworks_user_path(@user,:name=>search,:type => type,:property=>property,:order => "end_time", :sort => @r_sort), :class => "#{@r_sort == 'asc' ? 'sortupbtn' : 'sortdownbtn'} mt15 fl", :remote => true %>
<% else %>
<%= link_to "", search_m_r_homeworks_user_path(@user,:name=>search,:type => type,:property=>property,:order => "end_time", :sort => @r_sort), :class => "sortdownbtn sort_no mt15 fl", :remote => true %>
<% end %>

View File

@ -0,0 +1,36 @@
<div id="my_homework_sort">
<%= render :partial => 'users/my_homework_sort', :locals => {:type => type,:property => property,:order => @order,:search => search} %>
</div>
<div class="hw_search_box fr mr10">
<input class="hw_search-input" name="search" value='<%=search %>' placeholder="输入作业关键词进行搜索" type="text" >
<span class="hw_btn_search"></span>
</div>
<div class="cl"></div>
<script type="text/javascript">
var lastSearchCondition = '';
var count = 0;
function search_hws(e){
if($(e.target).val().trim() == lastSearchCondition && lastSearchCondition != '')
{
return;
}
lastSearchCondition = $(e.target).val().trim();
$.ajax({
url: '<%= url_for(:controller => 'users', :action => 'search_m_r_homeworks') %>'+'?name='+ e.target.value+'&type=<%=type %>&property=<%=property %>',
type:'get'
});
}
function throttle(method,context,e){
clearTimeout(method.tId);
method.tId=setTimeout(function(){
method.call(context,e);
},500);
}
//查询项目
$("input[name='search']").on('input', function (e) {
throttle(search_hws,window,e);
});
</script>

View File

@ -0,0 +1,36 @@
<div class="sy_classbox">
<% if homeworks.empty? %>
<div class="icons_tishi"><img src="/images/sy/icons_tan.png" width="110" height="110" alt="" ></div>
<p class="sy_tab_con_p">暂无可显示的内容~</p>
<% else %>
<% homeworks.each do |homework| %>
<ul class="sy_classlist">
<span class="hw_icons_cir fl mt5 mr5"></span>
<div class="fl ">
<h3 class="sy_classlist_title fl">
<%= link_to homework.name, student_work_index_path(:homework => homework.id), :class => 'sy_cblack', :target => '_blank' %>
</h3>
<div class="cl"></div>
<p class="sy_cgrey clear">
<span class=" fl">来源:</span>
<%= link_to homework.course.name, course_path(homework.course), :target => '_blank', :class => 'hw_cgrey hw_classname fl mr15' %>
<span class="mr15 fl">类别:<%=homework.homework_type_ch %></span>
<% my_work = cur_user_works_for_homework(homework) %>
<span class="fl">状态:</span><span class="<%= my_work ? '' : 'hw_cir_nomal hw_cir_lorange' %> fl mr15"><%= my_work ? '已提交' : '未提交' %></span>
<span class="fl">作品:</span><span class="sy_corange hw_w20 fl mr15"><%=homework.student_works.has_committed.count %></span>
<span class="fl">成绩:</span>
<% if my_work && !my_work.work_score.nil? %>
<span class="sy_corange hw_w40 fl mr15"><%= format("%.1f",my_work.work_score.to_f) %></span>
<% else %>
<span class="sy_cgrey hw_w40 fl mr15">--</span>
<% end %>
<span class="mr15 fl">发布时间:<%= format_date homework.publish_time %></span>
<span class="mr15 fl"><%=cur_homework_end_time homework %></span>
</p>
</div>
<%= student_for_homework_common homework %>
<div class="cl"></div>
</ul>
<% end %>
<% end %>
</div>

View File

@ -1,18 +1,49 @@
<div class="boxContainer" style="height: auto;">
<div>
<div class="sendText fl mr10" style="width: auto">发送到</div>
<div class="hw_sendpopup_box">
<div class="hw_sendpopup_top">
<h3 class="fl">发送</h3>
<a href="javascript:void(0);" class="hw_sendpopup_close fr" onclick="hideModal()"></a>
<div class="cl"></div>
</div>
<!--<div class="resourcePopupClose"> <a href="javascript:void(0);" class="resourceClose" onclick="closeModal();"></a></div>-->
<div class="fl">
<!--<input type="text" name="search" placeholder="输入班级ID或者名称搜索" class="subjectSearch fr" />-->
<input type="text" id="search_course_input" value="<%= @search %>" name="search" placeholder="输入班级ID或者名称搜索" class="mt10 mb10 course-search" />
</div>
<div id="send_homework_to_course_form">
<%= render :partial => "users/send_homework_to_course_form", :locals => {:user => user, :courses => courses, :send_id => send_id} %>
<div class="hw_sendpopup_con">
<div class="hw_sendpopup_tishi">
<p>选择的题目将被发送到班级作业</p>
</div>
<div class="hw_sendpopup_con_innner">
<div class="hw_search_box mb10" >
<input class="hw_sendpopup_search_input" id="search_course_input" value="<%= @search %>" name="search" placeholder="输入班级名称进行搜索" type="text" >
<span class="hw_btn_search" style="margin-top: -10px;"></span>
</div>
<div id="send_homework_to_course_form">
<%= render :partial => "users/send_homework_to_course_form", :locals => {:user => user, :courses => courses, :send_id => send_id} %>
</div>
</div>
</div>
</div>
<script type="text/javascript">
//全选与取消全选
//复选框事件
//全选、取消全选的事件
function selectAll() {
if ($("#SelectAll").is(":checked")) {
$(":checkbox").attr("checked", true);
} else {
$(":checkbox").attr("checked", false);
}
}
//子复选框的事件
function setSelectAll() {
//当没有选中某个子复选框时SelectAll取消选中
if (!$("#subcheck").checked) {
$("#SelectAll").attr("checked", false);
}
var chsub = $("input[type='checkbox'][id='subcheck']").length; //获取subcheck的个数
var checkedsub = $("input[type='checkbox'][id='subcheck']:checked").length; //获取选中的subcheck的个数
if (checkedsub == chsub) {
$("#SelectAll").attr("checked", true);
}
}
function send_submit() {
var checkboxs = $("input[name='course_ids[]']:checked");
if(checkboxs.length == 0) {
@ -32,7 +63,7 @@
}
lastSearchCondition = $(e.target).val().trim();
$.ajax({
url: '<%= url_for(:controller => 'users', :action => 'choose_user_course') %>'+'?search='+ e.target.value+'&send_id=<%=send_id %>',
url: '<%= url_for(:controller => 'users', :action => 'choose_user_course') %>'+'?search='+ e.target.value+'&homework=<%=send_id %>',
type:'get',
data: {is_observe:true},
success: function(data){ },

View File

@ -1,27 +1,25 @@
<%= form_tag send_homework_to_course_user_path(user), :remote => true, :id => 'choose_course_list_form' %>
<div>
<%= hidden_field_tag(:send_id, send_id) %>
<div class="courseReferContainer">
<ul class="hw_sendpopup_searchli">
<% if !courses.empty? %>
<% courses.each do |course| %>
<ul class="courseSend">
<li class="" style="display:inline-block">
<input name="course_ids[]" type="checkbox" value="<%= course.id %>" class="courseSendCheckbox"/>
</li>
<li class="sendCourseName"><%= truncate(course.name, :lendght => 25) + '['+current_time_and_term(course) + ']' %></li>
</ul>
<li>
<input type="checkbox" name="course_ids[]" id="subcheck" onclick="setSelectAll();" value="<%= course.id %>" />
<label><%=course.name + ''+current_time_and_term_short(course) + ''%></label>
</li>
<% end %>
<% end %>
</ul>
<div>
<p><input type="checkbox" name="check_all" id="SelectAll" onclick="selectAll();"/><label>全选</label></p>
<p class="clear mt5">
<label>&nbsp;</label>
<a href="javascript:void(0);" onfocus='this.blur();' onclick="send_submit();" class="sy_btn_blue fl">发&nbsp;&nbsp;送</a>
<a href="javascript:void(0);" onclick="hideModal();" class="sy_btn_grey fl ml10">取&nbsp;&nbsp;消</a>
</p>
</div>
<span id="choose_courses_notice" class="c_red"></span>
</div>
<div class="cl"></div>
<span id="choose_courses_notice" class="c_red"></span>
<div>
<div class="courseSendSubmit">
<a href="javascript:void(0);" onfocus='this.blur();' onclick="send_submit();" class="sendSourceText">确定</a>
</div>
<div class="courseSendCancel">
<a href="javascript:void(0);" class="sendSourceText" onclick="hideModal();">取消</a>
</div>
</div>
<div class="cl"></div>
<span id="choose_courses_notice" class="c_red"></span>

View File

@ -25,8 +25,9 @@
<%= render :partial => 'users/show_user_homework_form', :locals => {:homeworks => @homeworks}%>
</div>
<% end %>
<div><span id="choose_courses_notice" class="c_red"></span></div>
<div class="courseSendSubmit mr15">
<a href="javascript:void(0);" class="sendSourceText" onclick="$('#select_homework_form').submit();hideModal()">选用</a>
<a href="javascript:void(0);" class="sendSourceText" onclick="choose_homework_submit();">选用</a>
</div>
<div class="courseSendCancel">
<a href="javascript:void(0);" class="sendSourceText" onclick="hideModal()">取消</a>
@ -44,6 +45,26 @@
<div class="cl"></div>
</div>
<script type="text/javascript">
function choose_homework_submit() {
var checkboxs = $("input[name='checkMenu']:checked");
if(checkboxs.length == 0) {
$("#choose_courses_notice").html("请先选择作业");
} else{
$.post(
'<%=check_homework_users_path() %>',
{homework: checkboxs.val()},
function(data){
if(data.status == 1) {
$("#choose_courses_notice").html("您选中的题是“我收到的作业”,不能选用");
} else if(data.status == 0) {
$("#choose_courses_notice").html("");
$('#select_homework_form').submit();
hideModal();
}
}
);
}
}
$("#public_homeworks_choose").click(function(){
$(this).addClass("resource-tab-active");
$("#user_homeworks_choose").removeClass("resource-tab-active");

View File

@ -1,51 +1,24 @@
<% if ma.class == AppliedMessage %>
<!--申请加入项目-->
<% if ma.applied_type == "ApplyAddSchools" %>
<% if ma.status == 1 || ma.status == 2 || ma.status == 3 || ma.status == 0 %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl">
<a href="javascript:void(0);">
<% if ma.status == 1 || ma.status == 2 || ma.status == 3 %>
<%= image_tag("/images/trustie_logo1.png", width: "30px", height: "30px", class: "mt3") %>
<% elsif ma.status == 0 %>
<%= link_to image_tag(url_to_avatar(ma.user), :width => "30", :height => "30"), user_path(ma.user), :target => '_blank' %>
<% if ma.status == 0 %>
<%= link_to image_tag(url_to_avatar(ma.user), :width => "30", :height => "30"), user_path(ma.user), :target => '_blank' %>
<% else %>
<%= image_tag("/images/trustie_logo1.png", width: "30px", height: "30px", class: "mt3") %>
<% end %>
</a>
</li>
<li class="homepageNewsPubType fl">
<% if ma.status == 1 %>
<span class="newsBlue homepageNewsPublisher">系统提示</span>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">您添加新的高校(单位):</span>
<li class="homepageNewsContent fl">
<a class ="#{ma.viewed == 0 ? 'newsBlack' : 'newsGrey'}" target = '_blank' title="<%= ma.name %>的申请,已通过">“<%= ma.name %>”的申请,已通过</a>
</li>
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
<% elsif ma.status == 2 %>
<span class="newsBlue homepageNewsPublisher">系统提示</span>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">您添加新的高校(单位):</span>
<li class="homepageNewsContent fl">
<a class ="#{ma.viewed == 0 ? 'newsBlack' : 'newsGrey'}" target = '_blank' title="“<%= ma.applied.name %>”的申请,因名称不合法,系统已将其更改为“<%= ma.name %>”">“<%= ma.applied.name %>”的申请,因名称不合法,系统已将其更改为“<%= ma.name %>”</a>
</li>
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
<% elsif ma.status == 3 %>
<span class="newsBlue homepageNewsPublisher">系统提示</span>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">您添加新的高校(单位):</span>
<li class="homepageNewsContent fl">
<%= link_to "“"+ma.name+"”" + "的申请,因名称不合法,已被拒绝,请重新编辑您的基本资料", { :controller=> "my",:action => "account" }, :title => "“#{ma.name}”的申请,因名称不合法,已被拒绝,请重新编辑您的基本资料", :target => '_blank'%>
</li>
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
<% elsif ma.status == 0 %>
<%=link_to User.where("id=?", ma.applied_user_id).first.show_name, user_path(ma.user), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>"> 申请了单位:</span>
<li class="homepageNewsContent fl">
<a class ="#{ma.viewed == 0 ? 'newsBlack' : 'newsGrey'}" target = '_blank'>
<%= link_to User.where("id=?", ma.applied_user_id).first.show_name + "提交了申请:添加新的单位“#{ma.name}”", unapplied_schools_path(), :title => "#{User.where("id=?", ma.applied_user_id).first.show_name}提交了申请:添加新的单位“#{ma.name}”" %></a>
</li>
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
<% end %>
<%= render :partial => "users/user_message_applied_schools", :locals =>{:ma => ma} %>
<li class = "homepageNewsContent fl">
<%= render :partial => "users/user_message_applied_school_action", :locals =>{:ma => ma} %>
</li>
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
</li>
</ul>
<% end %>
<% elsif ma && ma.applied_type == "AppliedProject" %>
<ul class="homepageNewsList fl" id="applied_project_<%= ma.id %>">
<%= render :partial => "users/applied_project_content", :locals =>{:ma => ma} %>

View File

@ -0,0 +1,15 @@
<% if ma.status == 1 %>
<a class ="#{ma.viewed == 0 ? 'newsBlack' : 'newsGrey'}" target = '_blank' title="<%= ma.name %>的申请,已通过审核。谢谢!">
“<%= ma.name %>”的申请,已通过审核。谢谢!
</a>
<% elsif ma.status == 2 %>
<a class ="#{ma.viewed == 0 ? 'newsBlack' : 'newsGrey'}" target = '_blank' title="“<%= ma.applied.name %>”的申请,因名称不符合规范,系统已将其更改为“<%= ma.name %>”。谢谢!">
“<%= ma.applied.name %>”的申请,因名称不符合规范,系统已将其更改为“<%= ma.name %>”。谢谢!
</a>
<% elsif ma.status == 3 %>
<%= link_to "“"+ma.name+"”" + "的申请,经确认为无效的单位信息,已被删除,请重新编辑您的单位资料。谢谢!", { :controller=> "my",:action => "account" }, :title => "“#{ma.name}”的申请,经确认为无效的单位信息,已被删除,请重新编辑您的单位资料。谢谢!", :target => '_blank'%>
<% elsif ma.status == 0 %>
<a class ="#{ma.viewed == 0 ? 'newsBlack' : 'newsGrey'}" target = '_blank'>
<%= link_to User.where("id=?", ma.applied_user_id).first.show_name + "提交了申请:添加新的单位“#{ma.name}”", unapplied_schools_path(), :title => "#{User.where("id=?", ma.applied_user_id).first.show_name}提交了申请:添加新的单位“#{ma.name}”" %>
</a>
<% end %>

View File

@ -0,0 +1,7 @@
<% if ma.status != 0 %>
<span class="newsBlue homepageNewsPublisher">系统提示</span>
<% else %>
<%=link_to User.where("id=?", ma.applied_user_id).first.show_name, user_path(ma.user), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
<% end %>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>"><%= applied_school_tip(ma) %></span>

View File

@ -1,20 +1,15 @@
<% if @status == 1 || @status == 2 || @status == 3 %>
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/send_notice', :locals => {:status => @status}) %>');
showModal('ajax-modal', '500px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
"<a href='javascript:' onclick='hideModal();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
$('#ajax-modal').parent().css("top","30%").css("left","30%").css("position","fixed").css("border","3px solid #269ac9");
<% else %>
<%# if @status == 1 || @status == 2 || @status == 3 %>
// $("#ajax-modal").html('<%#= escape_javascript( render :partial => 'users/send_notice', :locals => {:status => @status}) %>');
// showModal('ajax-modal', '500px');
// $('#ajax-modal').siblings().remove();
// $('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
// "<a href='javascript:' onclick='hideModal();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
// $('#ajax-modal').parent().css("top","30%").css("left","30%").css("position","fixed").css("border","3px solid #269ac9");
<%# else %>
<% if params[:is_observe].nil? %>
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/send_homework_to_course', :locals => {:courses => @course, :user => @user, :send_id => @send_id}) %>');
showModal('ajax-modal', '452px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='hideModal();' style='margin-left: 435px;' class='resourceClose'></a>");
$('#ajax-modal').parent().css("top","50%").css("left","50%");
$('#ajax-modal').parent().addClass("popbox").addClass("resourceUploadPopup");
$('#ajax-modal').css("padding-left","16px").css("padding-bottom","16px");
var htmlvalue = "<%= escape_javascript(render :partial => 'users/send_homework_to_course', :locals => {:courses => @course, :user => @user, :send_id => @send_id}) %>";
pop_box_new(htmlvalue,460,50,50);
<% else %>
$("#send_homework_to_course_form").html("<%= escape_javascript(render :partial => 'users/send_homework_to_course_form', :locals => {:courses => @course, :user => @user, :send_id => @send_id}) %>");
<% end %>
<% end %>
<%# end %>

View File

@ -0,0 +1,53 @@
<script type="text/javascript" language="javascript">
function HoverLi(url){
window.location.href = url;
}
</script>
<div class="hw_content" >
<ul id="hw_tab_nav">
<li id="hw_tab_nav_1" onclick="HoverLi('<%= my_homeworks_user_path(@user) %>');">
<a href="javascript:void(0);" class="hw_tab_type">我的作业</a>
</li>
<li id="hw_tab_nav_2" class="<%=@type == 1 ? 'hw_tab_hover' : '' %>" onclick="HoverLi('<%= manage_or_receive_homeworks_user_path(@user) %>');">
<a href="javascript:void(0);" class="hw_tab_type">我管理的作业</a>
</li>
<li id="hw_tab_nav_3" class="<%=@type == 2 ? 'hw_tab_hover' : '' %>" onclick="HoverLi('<%= manage_or_receive_homeworks_user_path(@user, :type =>2) %>');">
<a href="javascript:void(0);" class="hw_tab_type" >我收到的作业</a>
</li>
</ul>
<div class="hw_more_box" >
<ul>
<li class="hw_more_icons">
<ul class="hw_more_txt">
<li> <a href="<%= manage_or_receive_homeworks_user_path(@user, :type => @type, :property => 0) %>" id="homework_type_all" class="hw_more_li" data-method="get" data-remote="true">全部作业</a> </li>
<li> <a href="<%= manage_or_receive_homeworks_user_path(@user, :type => @type, :property => 1) %>" id="homework_type_nor" class="hw_more_li" data-method="get" data-remote="true">普通作业</a> </li>
<li> <a href="<%= manage_or_receive_homeworks_user_path(@user, :type => @type, :property => 2) %>" id="homework_type_pro" class="hw_more_li" data-method="get" data-remote="true">编程作业</a> </li>
<li> <a href="<%= manage_or_receive_homeworks_user_path(@user, :type => @type, :property => 3) %>" id="homework_type_gro" class="hw_more_li" data-method="get" data-remote="true">分组作业</a> </li>
</ul>
</li>
</ul>
</div>
<div id="hw_tab_con_2">
<div class="sy_category" id="homework_search_input">
<%=render :partial=>'my_homeworks_search', :locals=>{:type => @type,:property => nil,:order => @order, :search => ''} %>
</div>
<div class="sy_classbox" style="min-height:800px;" id="my_homework_list">
<% if @type == 1 %>
<%= render :partial => "manage_homework_list", :locals => {:homeworks => @homeworks} %>
<% else %>
<%= render :partial => "receive_homework_list", :locals => {:homeworks => @homeworks} %>
<% end %>
</div>
<div style="text-align:center;">
<div class="pages" style="width:auto; display:inline-block;">
<ul id="homework_list_ref_pages">
<%= pagination_links_full @hw_pages, @hw_count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true%>
</ul>
<div class="cl"></div>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,11 @@
<% if @type == 1 %>
$("#my_homework_list").html('<%= escape_javascript(render :partial => "manage_homework_list", :locals => {:homeworks => @homeworks})%>');
<% else %>
$("#my_homework_list").html('<%= escape_javascript(render :partial => "receive_homework_list", :locals => {:homeworks => @homeworks})%>');
<% end %>
$("#homework_list_ref_pages").html('<%= pagination_links_full @hw_pages, @hw_count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true %>');
$("#my_homework_sort").html('<%= escape_javascript( render :partial => 'users/my_homework_sort', :locals => {:type => @type,:property => @property,:order => @order,:search => @search})%>');
$("#homework_type_all").attr('href','<%= manage_or_receive_homeworks_user_path(@user, :type => @type, :property => 0) %>');
$("#homework_type_nor").attr('href','<%= manage_or_receive_homeworks_user_path(@user, :type => @type, :property => 1) %>');
$("#homework_type_pro").attr('href','<%= manage_or_receive_homeworks_user_path(@user, :type => @type, :property => 2) %>');
$("#homework_type_gro").attr('href','<%= manage_or_receive_homeworks_user_path(@user, :type => @type, :property => 3) %>');

View File

@ -0,0 +1,28 @@
<script type="text/javascript" language="javascript">
//课程大纲tab
//function g(o){return document.getElementById(o);}
function HoverLi(url){
// for(var i=1;i<=3;i++){
// g('hw_tab_nav_'+i).className='hw_tab_nomal';
// }
// g('hw_tab_nav_'+n).className='hw_tab_hover';
window.location.href = url;
}
</script>
<div class="hw_content" >
<ul id="hw_tab_nav">
<li id="hw_tab_nav_1" class="hw_tab_hover" onclick="HoverLi('<%= my_homeworks_user_path(@user) %>');">
<a href="javascript:void(0);" class="hw_tab_type">我的作业</a>
</li>
<li id="hw_tab_nav_2" onclick="HoverLi('<%= manage_or_receive_homeworks_user_path(@user) %>');">
<a href="javascript:void(0);" class="hw_tab_type">我管理的作业</a>
</li>
<li id="hw_tab_nav_3" onclick="HoverLi('<%= manage_or_receive_homeworks_user_path(@user, :type =>2) %>');">
<a href="javascript:void(0);" class="hw_tab_type" >我收到的作业</a>
</li>
</ul>
<div id="hw_tab_con_1">
<%=render :partial => 'my_homework_list' %>
</div> <!-- hw_tab_con_1 end-->
</div><!--sy_content end-->

View File

@ -0,0 +1 @@
$("#hw_tab_con_1").html("<%= escape_javascript(render :partial => 'users/my_homework_list') %>");

View File

@ -0,0 +1,7 @@
<% if @type == 1 %>
$("#my_homework_list").html('<%= escape_javascript(render :partial => "manage_homework_list", :locals => {:homeworks => @homeworks})%>');
<% else %>
$("#my_homework_list").html('<%= escape_javascript(render :partial => "receive_homework_list", :locals => {:homeworks => @homeworks})%>');
<% end %>
$("#homework_list_ref_pages").html('<%= pagination_links_full @hw_pages, @hw_count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true %>');
$("#my_homework_sort").html('<%= escape_javascript( render :partial => 'users/my_homework_sort', :locals => {:type => @type,:property => @property,:order => @order,:search => @search})%>');

View File

@ -1,9 +1,4 @@
$("#subject_count_homework_<%=@homework.id %>").html(<%= @homework.quotes %>);
$("#ajax-modal").html("<%=escape_javascript(render :partial => 'homework_post_notice') %>");
showModal('ajax-modal', '500px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
"<a href='javascript:' onclick='hideModal();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
$('#ajax-modal').parent().css("top","50%").css("left","50%");
$('#ajax-modal').parent().addClass("popbox").addClass("resourceUploadPopup");
$('#ajax-modal').css("padding-left","16px").css("padding-bottom","16px");
hideModal();
var htmlvalue = "<%= escape_javascript(render :partial => 'homework_post_notice') %>";
pop_box_new(htmlvalue,380,40,50);

View File

@ -1,5 +1,7 @@
<% if @is_import.to_i == 1 %>
$("#homework_detail_information").html("<%=escape_javascript(render :partial => 'users/homework_detail_information', :locals => {:homework=>@homework}) %>");
$("#choose_courses_notice").html("");
<% else %>
$("#homework_repository_detail").html("<%=escape_javascript(render :partial => 'users/homework_repository_detail', :locals => {:homework=>@homework}) %>");
var htmlvalue = "<%= escape_javascript(render :partial => 'users/homework_repository_detail') %>";
pop_box_new(htmlvalue,820,50,50);
<% end %>

View File

@ -1 +1 @@
$("#user_show_more_course").replaceWith("<%= escape_javascript( render :partial => 'layouts/user_courses',:locals => {:courses => @courses,:user => @user,:type=>@type,:page => @page, :all_count => @all_count} )%>");
$("#user_show_more_course").replaceWith("<%= escape_javascript( render :partial => 'layouts/user_courses',:locals => {:courses => @courses,:user => @user,:page => @page, :all_count => @all_count} )%>");

View File

@ -3,11 +3,11 @@ $("#homework_list_form_show").html('<%= escape_javascript(render :partial => 'us
$("#homewrok_ref_pages").html('<%= pagination_links_full @hw_pages, @hw_count, :per_page_links => false, :remote => @is_remote, :flag => true %>');
$("#homework_detail_information").html("<%=escape_javascript(render :partial => 'users/homework_detail_information', :locals => {:homework=>nil}) %>");
$("#homework_search_input").html("<%=escape_javascript(render :partial=>'homework_search_input', :locals=>{:type=>@type,:is_import=>@is_import}) %>");
$("#choose_courses_notice").html("");
<% else %>
$("#homework_repository_list").html('<%= escape_javascript(render :partial => 'users/homework_repository_list', :locals => {:homeworks => @homeworks,:sort => @order,:b_sort => @b_sort,:type=>@type,:is_import => @is_import,:property => @property,:search=>''})%>');
$("#homework_pository_ref_pages").html('<%= pagination_links_full @hw_pages, @hw_count, :per_page_links => false, :remote => @is_remote, :flag => true %>');
$("#homework_repository_detail").html("<%=escape_javascript(render :partial => 'users/homework_repository_detail', :locals => {:homework=>nil}) %>");
$("#homework_search_input").html("<%=escape_javascript(render :partial=>'homework_repository_search', :locals=>{:type=>@type,:is_import=>@is_import,:property=>@property}) %>");
$("#homework_pository_ref_pages").html('<%= pagination_links_full @hw_pages, @hw_count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true %>');
$("#homework_search_input").html('<%= escape_javascript(render :partial => 'users/homework_repository_search', :locals => {:type => @type,:is_import => @is_import,:property => @property,:order => @order, :b_sort => @b_sort, :search => ''})%>');
$("#homework_type_all").attr('href','<%= user_homework_type_user_path(@user,:type => @type,:is_import => 0,:property => 0) %>');
$("#homework_type_nor").attr('href','<%= user_homework_type_user_path(@user,:type => @type,:is_import => 0,:property => 1) %>');
$("#homework_type_pro").attr('href','<%= user_homework_type_user_path(@user,:type => @type,:is_import => 0,:property => 2) %>');

View File

@ -1,89 +1,68 @@
<%= stylesheet_link_tag 'css/common','css/structure','css/public','css/org','repository' %>
<%= stylesheet_link_tag 'css/org','repository' %>
<script>
$(document).ready(function(){
$(".resource-switch").click(function(){
$(".resource-switch").children().removeClass("resource-tab-active");
$(this).children().addClass("resource-tab-active");
});
$("input[name='checkMenu']").click(function(){
if($("input[name='checkMenu']:checked").length >= 1){
$(".resourcesSelectSendButton").removeClass("inactive-border");
$(".resourcesSelectSendButton").mouseover(function(){
$(this).css("backgroundColor","#297fb8");
});
$(".resourcesSelectSendButton").mouseout(function(){
$(this).css("backgroundColor","#fff");
});
$(".sendButtonBlue").removeClass("inactive-text");
}
});
});
function choose_course(user_id) {
var check = $('input[name="checkMenu"]:checked');
if(check.length == 0) {
$("#choose_homework_notice").text("请先选择一个作业");
} else {
var hw_id = $('input[name="checkMenu"]:checked').val();
$("#choose_homework_notice").text("");
$.ajax({
type: 'get',
url: '/users/' + user_id + '/choose_user_course?homework='+hw_id,
data:{send_id:$('input[name="checkMenu"]:checked').val()}
});
function g(o){return document.getElementById(o);}
function HoverLi(n, url){
for(var i=1;i<=2;i++){
g('hw_tab_nav_'+i).className='hw_tab_nomal';
}
g('hw_tab_nav_'+n).className='hw_tab_hover';
$.get(url, {}, function(data){});
}
function show_homework_detail(url){
$.get(
url,
{},
function (data) {
}
);
};
function choose_course(user_id, hw_id) {
$.ajax({
type: 'get',
url: '/users/' + user_id + '/choose_user_course?homework='+hw_id
});
}
</script>
<div class="homepageContentContainer">
<div class="homepageContent">
<div class="resource-wrapper mb10">
<ul class="resource-banner">
<li class="fl resource-switch">
<a href="<%= user_homework_type_user_path(@user,:is_import => 0) %>" id="public_homeworks_choose" class="resource-tab resource-tab-active" data-remote="true">我的题库</a>
</li>
<li class="fl resource-switch">
<a href="<%= user_homework_type_user_path(@user,:type=>'2',:is_import => 0) %>" id="user_homeworks_choose" class="resource-tab" style="text-align: center;" data-remote="true">题库</a>
</li>
<li class="fl resource-switch">
<a href="<%= user_homework_type_user_path(@user,:type=>'3',:is_import => 0) %>" id="apply_homeworks_choose" class="resource-tab" data-remote="true">申请题库</a>
</li>
<li class="fl w680 border-bottom h34">&nbsp;</li>
<li class="fr resource-banner-li border-bottom h34">
<ul class="resourcesSelect">
<li class="resourcesSelected"><a href="javascript:void(0);" class="resourcesIcon"></a>
<ul class="resourcesType">
<li> <a href="<%= user_homework_type_user_path(@user,:type => @type,:is_import => 0) %>" id="homework_type_all" class="resourcesTypeAll resourcesGrey" data-method="get" data-remote="true">全部</a> </li>
<li> <a href="<%= user_homework_type_user_path(@user,:type => @type,:is_import => 0,:property => 1) %>" id="homework_type_nor" class="homepagePostTypeAssignment postTypeGrey" data-method="get" data-remote="true">普通作业</a> </li>
<li> <a href="<%= user_homework_type_user_path(@user,:type => @type,:is_import => 0,:property => 2) %>" id="homework_type_pro" class="program-btn postTypeGrey" data-method="get" data-remote="true" style="white-space:nowrap;">编程作业</a> </li>
<li> <a href="<%= user_homework_type_user_path(@user,:type => @type,:is_import => 0,:property => 3) %>" id="homework_type_gro" class="group-btn resourcesGrey" data-method="get" data-remote="true">分组作业</a> </li>
</ul>
</li>
</ul>
</li>
<div class="cl"></div>
<div class="hw_content mb10">
<ul id="hw_tab_nav">
<li id="hw_tab_nav_1" class="hw_tab_hover" onclick="HoverLi(1, '<%= user_homework_type_user_path(@user,:is_import => 0) %>');">
<a href="javascript:void(0)" id="public_homeworks_choose" class="hw_tab_type" style="text-align: center;">我的题库</a>
</li>
<li id="hw_tab_nav_2" onclick="HoverLi(2, '<%= user_homework_type_user_path(@user,:type=>'2',:is_import => 0) %>');">
<a href="javascript:void(0)" id="user_homeworks_choose" class="hw_tab_type" style="text-align: center;">公共题库</a>
</li>
</ul>
<div class="hw_more_box" >
<ul>
<li class="hw_more_icons">
<ul class="hw_more_txt">
<li> <a href="<%= user_homework_type_user_path(@user,:type => @type,:is_import => 0) %>" id="homework_type_all" class="hw_more_li" data-method="get" data-remote="true">全部作业</a> </li>
<li> <a href="<%= user_homework_type_user_path(@user,:type => @type,:is_import => 0,:property => 1) %>" id="homework_type_nor" class="hw_more_li" data-method="get" data-remote="true">普通作业</a> </li>
<li> <a href="<%= user_homework_type_user_path(@user,:type => @type,:is_import => 0,:property => 2) %>" id="homework_type_pro" class="hw_more_li" data-method="get" data-remote="true" style="white-space:nowrap;">编程作业</a> </li>
<li> <a href="<%= user_homework_type_user_path(@user,:type => @type,:is_import => 0,:property => 3) %>" id="homework_type_gro" class="hw_more_li" data-method="get" data-remote="true">分组作业</a> </li>
</ul>
</li>
</ul>
</div>
<div class="cl"></div>
<div id="hw_tab_con_1">
<div class="sy_category" id="homework_search_input">
<%=render :partial=>'homework_repository_search', :locals=>{:type => '1',:is_import => 0,:property => nil,:order => @order, :search => ''} %>
</div>
<div class="sy_classbox" style="min-height:800px;" id="homework_repository_list">
<%=render :partial => 'homework_repository_list', :locals => {:homeworks => @homeworks,:type=>'1',:is_import => 0,:property => @property,:search=>''} %>
</div>
<div style="text-align:center;">
<div class="pages" style="width:auto; display:inline-block;">
<ul id="homework_pository_ref_pages">
<%= pagination_links_full @hw_pages, @hw_count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true%>
</ul>
<div class="cl"></div>
<div id="homework_search_input" class="mt10 fl">
<%=render :partial=>'homework_repository_search', :locals=>{:type => @type,:is_import => 0,:property => nil} %>
</div>
<div class="cl"></div>
<div class="w683 fl mr10 mt10" id="homework_repository_list">
<%=render :partial => 'homework_repository_list', :locals => {:homeworks => @homeworks,:type=>@type,:is_import => 0,:property => @property,:search=>''} %>
</div>
<div id="homework_repository_detail">
<%=render :partial => 'homework_repository_detail', :locals => {:homework => nil} %>
</div>
<div class="cl"></div>
<div>
<ul class="wlist mt10" id="homework_pository_ref_pages" style="margin-top: 5px;margin-right: 295px">
<%= pagination_links_full @hw_pages, @hw_count, :per_page_links => false, :remote => @is_remote, :flag => true%>
</ul>
</div>
<div class="fl resourcesSelectSendButton mr15 inactive-border mt10">
<a href="javascript:void(0)" onclick="choose_course('<%=User.current.id %>');" class="sendButtonBlue db inactive-text" data-remote="true">发送至</a>
</div>
<span class="c_red fl mt15" id="choose_homework_notice"></span>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@ -1,4 +1,3 @@
/*$("#homework_repository").html('<%#= escape_javascript(render :partial => 'users/homework_repository', :locals => {:homeworks => @homeworks})%>');*/
$("#homework_repository_list").html('<%= escape_javascript(render :partial => 'users/homework_repository_list', :locals => {:homeworks => @homeworks,:sort => @order,:b_sort => @b_sort,:type=>@type,:is_import => 0,:property => @property,:search=>''})%>');
$("#homework_pository_ref_pages").html('<%= pagination_links_full @hw_pages, @hw_count, :per_page_links => false, :remote => @is_remote, :flag => true %>');
$("#homework_repository_detail").html("<%=escape_javascript(render :partial => 'users/homework_repository_detail', :locals => {:homework=>nil}) %>");
$("#homework_pository_ref_pages").html('<%= pagination_links_full @hw_pages, @hw_count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true %>');

View File

@ -2,8 +2,9 @@
$("#homework_list_form_show").html('<%= escape_javascript(render :partial => 'users/show_user_homework_form', :locals => {:homeworks => @homeworks})%>');
$("#homewrok_ref_pages").html('<%= pagination_links_full @hw_pages, @hw_count, :per_page_links => false, :remote => @is_remote, :flag => true %>');
$("#homework_detail_information").html("<%=escape_javascript(render :partial => 'users/homework_detail_information', :locals => {:homework=>nil}) %>");
$("#choose_courses_notice").html("");
<% else %>
$("#homework_repository_list").html('<%= escape_javascript(render :partial => 'users/homework_repository_list', :locals => {:homeworks => @homeworks,:sort => @order,:b_sort => @b_sort,:type=>@type,:is_import => @is_import,:property => @property,:search=>@search})%>');
$("#homework_pository_ref_pages").html('<%= pagination_links_full @hw_pages, @hw_count, :per_page_links => false, :remote => @is_remote, :flag => true %>');
$("#homework_repository_detail").html("<%=escape_javascript(render :partial => 'users/homework_repository_detail', :locals => {:homework=>nil}) %>");
$("#homework_pository_ref_pages").html('<%= pagination_links_full @hw_pages, @hw_count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true %>');
$("#homework_repository_sort").html('<%= escape_javascript(render :partial => 'users/homework_repository_sort', :locals => {:type => @type,:is_import => @is_import,:property => @property,:order => @order, :search => @search})%>');
<% end %>

View File

@ -565,6 +565,7 @@ RedmineApp::Application.routes.draw do
get 'user_messages_unviewed'
post "user_commit_homework"
post 'user_select_homework'
post 'check_homework'
get 'all_journals'
get 'expand_courses'
end
@ -587,6 +588,7 @@ RedmineApp::Application.routes.draw do
match 'apply_for_homework', :to => 'users#apply_for_homework', :via => :post
match 'apply_homework', :to => 'users#apply_homework', :via => :get
match 'user_homeworks', :to => 'users#user_homeworks', :via => :get
match 'my_homeworks', :to => 'users#my_homeworks', :via => :get
match 'student_homeworks', :to => 'users#student_homeworks', :via => :get
get 'apply_resource'
get 'user_import_homeworks'
@ -662,6 +664,8 @@ RedmineApp::Application.routes.draw do
get 'show_homework_detail'
post 'apply_for_homework'
post 'apply_for_resource'
match 'manage_or_receive_homeworks', :to => 'users#manage_or_receive_homeworks', :via => :get
get 'search_m_r_homeworks'
# end
end
#resources :blogs

View File

@ -231,6 +231,7 @@ module Redmine
per_page_links = options[:per_page_links]
remote = options[:remote] ? options[:remote] : false
flag = options[:flag] ? options[:flag] : false
is_new = options[:is_new] ? options[:is_new] : false
per_page_links = false if count.nil?
page_param = paginator.page_param
@ -242,7 +243,11 @@ module Redmine
else
text = "\xc2\xab " + l(:label_previous)
end
html << '<li>' << yield(text, {page_param => paginator.previous_page}, :class => 'previous c_blue', :remote => remote) << '</li>' + ' '
if is_new
html << '<li>' << yield(text, {page_param => paginator.previous_page}, :class => 'pages-big', :remote => remote) << '</li>' + ' '
else
html << '<li>' << yield(text, {page_param => paginator.previous_page}, :class => 'previous c_blue', :remote => remote) << '</li>' + ' '
end
end
unless paginator.previous_page
if paginator.next_page
@ -251,7 +256,11 @@ module Redmine
else
text = "\xc2\xab " + l(:label_previous)
end
html << '<li>' << yield(text, {page_param => paginator.previous_page}, :class => 'previous c_blue', :remote => remote) << '</li>' + ' '
if is_new
html << '<li>' << yield(text, {page_param => paginator.previous_page}, :class => 'pages-big', :remote => remote) << '</li>' + ' '
else
html << '<li>' << yield(text, {page_param => paginator.previous_page}, :class => 'previous c_blue', :remote => remote) << '</li>' + ' '
end
end
end
@ -259,14 +268,22 @@ module Redmine
paginator.linked_pages.each do |page|
if previous && previous != page - 1
if flag
html << '<li>' << content_tag('a', '...', :class => 'c_blue') << '</li>' + ' '
if is_new
html << '<li>' << content_tag('a', '...', :class => 'c_blue') << '</li>' + ' '
else
html << '<li>' << content_tag('a', '...') << '</li>' + ' '
end
else
html << '<li>' << content_tag('span', '...', :class => 'spacer ') << '</li>' + ' '
end
end
if page == paginator.page
if flag
html << '<li class = "wlist_select">' << content_tag('a', page.to_s, :class => 'current-page c_white') << '</li>'
if is_new
html << '<li>' << content_tag('a', page.to_s, :class => 'active') << '</li>'
else
html << '<li class = "wlist_select">' << content_tag('a', page.to_s, :class => 'current-page c_white') << '</li>'
end
else
html << '<li>' << content_tag('span', page.to_s, :class => 'current-page') << '</li>'
end
@ -283,7 +300,11 @@ module Redmine
else
text = l(:label_next) + " \xc2\xbb"
end
html << '<li>' << yield(text, {page_param => paginator.next_page}, :class => 'next c_blue', :remote => remote) << '</li>' + ' '
if is_new
html << '<li>' << yield(text, {page_param => paginator.next_page}, :class => 'pages-big', :remote => remote) << '</li>' + ' '
else
html << '<li>' << yield(text, {page_param => paginator.next_page}, :class => 'next c_blue', :remote => remote) << '</li>' + ' '
end
end
unless paginator.next_page
@ -293,7 +314,11 @@ module Redmine
else
text = l(:label_next) + " \xc2\xbb"
end
html << "<li>" << yield(text, {page_param => paginator.next_page}, :class => 'next c_blue', :remote => remote) << "</li>" + ' '
if is_new
html << '<li>' << yield(text, {page_param => paginator.next_page}, :class => 'pages-big', :remote => remote) << '</li>' + ' '
else
html << '<li>' << yield(text, {page_param => paginator.next_page}, :class => 'next c_blue', :remote => remote) << '</li>' + ' '
end
end
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

BIN
public/images/user/male.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

View File

@ -1965,6 +1965,7 @@ function edit_school_name(url,id){
url,
{id: id ,name: $("#school_name_edit_"+id).val() },
function (data) {
$("#school_name_edit_"+id).val("");
if(data.status == 0){
$("#apply_title_"+data.id).show();
$("#school_name_edit_"+data.id).hide();
@ -1998,6 +1999,7 @@ function edit_school_address(url,id){
url,
{id: id ,address: $("#school_address_edit_"+id).val() },
function (data) {
$("#school_address_edit_"+data.id).val("");
if(data.status == 0){
$("#apply_address_"+data.id).show();
$("#school_address_edit_"+data.id).hide();
@ -2075,3 +2077,24 @@ function show_edit_school_province(id){
}
//自动搜索
function throttle_search(e, condition, url) {
if($(e.target).val().trim() == condition && condition != '')
{
return;
}
condition = $(e.target).val().trim();
$.ajax({
url: url,
data:{search: e.target.value},
type:'get'
});
}
function throttle_me(method, context, e, condition, url){
clearTimeout(method.tId);
method.tId=setTimeout(function(){
method.call(context, e, condition, url);
},500);
}

View File

@ -80,6 +80,8 @@ h4{ font-size:14px;}/*color:#3b3b3b;*/
.text_c{ text-align:center;}
/* Float & Clear */
.clear{ zoom:1;}
.clear:after {content:".";height:0;visibility:hidden;display:block;clear:both;}
.cl{ clear:both; overflow:hidden; }
.fl{float:left;}
.fr{float:right;}

View File

@ -422,6 +422,7 @@ a.sy_icons_close02{
margin:8px 10px 0 0;
border: none;
outline: none;
transition: all 0s linear;
}
a:hover.sy_icons_close02{
background: url(/images/sy/sy_icons_close02.png) -40px 0px no-repeat;

View File

@ -526,6 +526,7 @@ a.list-title{ font-size:14px; font-weight: bold; color:#000; white-space:nowrap;
a.pages-big{ width:50px;}
.pages .active{ background-color:#3b94d6; border:1px solid #3b94d6; color:#fff;}
.pages{width:330px; margin:20px auto 10px;}
.pages li {display:inline-block;}
/*课程列表界面样式*/
a.course-title{ font-size:14px; font-weight: bold; color:#000;white-space:nowrap; overflow:hidden; text-overflow:ellipsis; display:block; width:590px;}

View File

@ -477,3 +477,172 @@ a.f_grey:hover {color:#000000;}
.shadowbox_news_list li:hover{ background-color:#eee;}
span.shadowbox_news_user{ color:#3b94d6;}
a.shadowbox_news_all{ display:block; width:305px; height:40px; line-height:40px; color:#3b94d6; text-align:center;border-top:1px solid #eee;}
/* 个人主页左侧信息 */
.user_leftinfo{ width:238px;border:1px solid #e5e5e5; background:#fff url(/images/user/user_bg_info.jpg) 0 0 no-repeat; position:relative; }
a.user_leftinfo_img { display:block; width:80px; height:80px; margin:15px auto;}
.user_leftinfo_img img{ width:74px; height:74px;-webkit-border-radius:50px;-moz-border-radius:50px;-o-border-radius:50px;border-radius:50px; border:3px solid #dcdcdc; }
.user_leftinfo_female{ display:block; width:20px; height:20px;background:url(/images/user/icons_user_leftnav.png) 5px -378px no-repeat; position:absolute; top:80px; left:160px;}
.user_leftinfo_male{ display:block; width:20px; height:20px;background:url(/images/user/icons_user_leftnav.png) -25px -378px no-repeat; position:absolute; top:80px; left:160px;}
.user_leftinfo_namebox{ text-align:center; height:16px; line-height:16px; }
.user_leftinfo_name{ display: inline-block; max-width:160px; font-size:14px; font-weight:bold; overflow:hidden;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
.user_leftinfo_namebox a{ color: #333;}
.user_leftinfo_namebox a:hover{ color:#3b94d6;}
.user_cirbtn_yellow{ color:#fff; background:#ffb400; padding:0 5px;-webkit-border-radius:10px;-moz-border-radius:10px;-o-border-radius:10px;border-radius:10px; line-height:16px; }
.user_info_inner{ width:210px; margin:0 15px 15px;}
.user_atten li{ width:68px; float:left; border-right:1px solid #e5e5e5; text-align:center; font-size:14px;}
.user_atten li:last-child{ border:none;}
.user_info_intro{ margin:10px auto; width:210px; color:#888;}
.user_atten li a{ color:#333;}
.user_atten li a:hover{ color:#3b94d6;}
/* 个人主页左侧导航 */
.user_leftnav{ width:240px;}
.users_accordion li > a {
display: block;
padding: 0 10px 0 32px;
height:49px;
line-height:49px;
color: #333;
font-size:16px;
background: #f8f8f8;
border:1px solid #e5e5e5;
border-bottom:none;
}
.users_accordion > li:hover > a{
color: #3b94d6;
background: #fff;
}
.users_accordion > li:target > a,
.users_accordion > li > a.active {
color: #3b94d6;
background: #fff;
border:1px solid #e5e5e5;
border-left:3px solid #3b94d6;
border-bottom:none;
}
.users_accordion li{ position:relative;}
.users_accordion li > a span {
margin-top:15px;
font-size:12px;
padding: 0 10px;
background: #dbdbdb;
-webkit-border-radius: 15px;
-moz-border-radius: 15px;
border-radius: 15px;
margin-left:10px;
color: #333;
}
.users_accordion > li:hover > a span,
.users_accordion > li:target > a span,
.users_accordion > li > a.active span {
margin-left:10px;
color: #333;
background: #dbdbdb;
}
/* Images */
.users_accordion > li > a:before {
position: absolute;
top: 0;
left: 0;
content: '';
width: 24px;
height: 50px;
margin: 4px 8px;
background-repeat: no-repeat;
background-image:url(/images/user/icons_user_leftnav.png);
background-position: 5px 15px;
}
.users_accordion li.user_icons_course > a:before { background-position: 5px 15px; }
.users_accordion li.user_icons_course:hover > a:before,
.users_accordion li.user_icons_course:target > a:before,
.users_accordion li.user_icons_course > a.active:before { background-position: -25px 15px; }
.users_accordion li.user_icons_new > a:before { background-position: 5px -48px; }
.users_accordion li.user_icons_new:hover > a:before,
.users_accordion li.user_icons_new:target > a:before,
.users_accordion li.user_icons_new > a.active:before { background-position: -25px -48px; }
.users_accordion li.user_icons_addclass > a:before { background-position: 5px -87px; }
.users_accordion li.user_icons_addclass:hover > a:before,
.users_accordion li.user_icons_addclass:target > a:before,
.users_accordion li.user_icons_addclass > a.active:before { background-position: -25px -87px; }
.users_accordion li.user_icons_myhw > a:before { background-position: 5px -124px; }
.users_accordion li.user_icons_myhw:hover > a:before,
.users_accordion li.user_icons_myhw:target > a:before,
.users_accordion li.user_icons_myhw > a.active:before { background-position: -25px -124px; }
.users_accordion li.user_icons_project > a:before { background-position: 5px -167px; }
.users_accordion li.user_icons_project:hover > a:before,
.users_accordion li.user_icons_project:target > a:before,
.users_accordion li.user_icons_project > a.active:before { background-position: -25px -167px; }
.users_accordion li.user_icons_addproject > a:before { background-position: 5px -205px; }
.users_accordion li.user_icons_addproject:hover > a:before,
.users_accordion li.user_icons_addproject:target > a:before,
.users_accordion li.user_icons_addproject > a.active:before { background-position: -25px -205px; }
.users_accordion li.user_icons_myissues > a:before { background-position: 5px -246px; }
.users_accordion li.user_icons_myissues:hover > a:before,
.users_accordion li.user_icons_myissues:target > a:before,
.users_accordion li.user_icons_myissues > a.active:before { background-position: -25px -246px; }
.users_accordion li.user_icons_mes > a:before { background-position: 5px -289px; }
.users_accordion li.user_icons_mes:hover > a:before,
.users_accordion li.user_icons_mes:target > a:before,
.users_accordion li.user_icons_mes > a.active:before { background-position: -25px -289px; }
/* Sub Menu */
.user_sub_menu li a {
color: #797979;
background: #f8f8f8;
height:39px;
line-height:39px;
font-size:14px;
}
.user_sub_menu li a:hover,.user_sub_menu li a:target { color:#3b94d6; background:#fff url(/images/user/user_navmore_icons.png) 0px 0px no-repeat;}
.user_sub_menu li a:hover,.user_sub_menu li a:target{}
.user_sub_menu li:last-child a { }
.users_accordion li > .user_sub_menu {
display: none;
}
.users_accordion li:target > .user_sub_menu {
display: block;
}
.user_sub_menu > li > span.user_icons_class {
padding:0;
border:none;
display:block;
position: absolute;
top:18px;
left:10px;
width:20px;
height:20px;
background:url(/images/user/icons_user_leftnav.png) 0px -34px no-repeat;
}
a.user_navmorebox{ display:block; width:238px; height:20px; position:relative; background:#f8f8f8;border:1px solid #e5e5e5; border-bottom:none;}
a:hover.user_navmorebox{ background:#fff;}
a.user_navmorebox .user_icons_moreclass{
display:block;
position: absolute;
top:5px;
left:100px;
width:25px;
height:10px;
background:url(/images/user/icons_user_leftnav.png) 5px -347px no-repeat;
}
a.user_navmorebox .user_icons_closeclass{
display:block;
position: absolute;
top:5px;
left:100px;
width:25px;
height:10px;
background:url(/images/user/icons_user_leftnav.png) -25px -347px no-repeat;
}
/* 个人主页左侧导航更多功能 */
.user_navmore_box {position:absolute; width:15px; height:15px; right:13px; top:17px; cursor:pointer;}
.user_navmore_box ul li:hover ul {display:block; }
.user_navmore_icons {background:url(/images/user/icons_user_leftnav.png) -15px -34px no-repeat; width:19px; height:15px; }
.user_navmore_icons:hover {background:url(/images/user/icons_user_leftnav.png) -30px -34px no-repeat;}
.user_navmore_txt { display:inline-block; font-size:12px; color:#616060; background-color:#f8f8f8; border:1px solid #eaeaea; border-radius:3px; position:absolute; left:17px; top:-3px; padding:5px 0px; display:none; box-shadow: 0px 0px 8px rgba(146, 153, 169, 0.5); z-index:1000; width:115px;}
.user_navmore_txt li a{ display:inline-block; padding:0 10px; border:none; height:24px;line-height:24px;color:#888;width:75px;}
.user_navmore_txt li a.user_navmore_li {font-size:12px;color:#888; display:block; width:75px;height:24px;line-height:24px; }
.user_navmore_txt li a.user_navmore_add{ width:10px;color:#888; padding:0 5px; }
.user_navmore_txt li:hover,.user_navmore_txt li a:hover{background-color:#f0f0f0;}
a.user_editinfo{border-top:1px solid #e5e5e5; height:30px; line-height:30px; text-align:center; color:#3b94d6; width:100%; display:inline-block;}

View File

@ -9,9 +9,69 @@ a.sy_corange{ color: #ee4a1f; }
a:hover.sy_corange{ text-decoration:underline;}
a.sy_cblue{ color: #3b94d6;}
a.sy_cblack{ color: #333;}
a:hover.sy_cblack{color: #3b94d6;}
a.sy_cgrey{ color: #888;}
a.sy_cmore{ font-size:12px; color:#888; font-weight:normal;}
a:hover.sy_cmore{color: #ee4a1f;}
/* 题库新增*/
a.hw_cgreen{ color: #60b25e;}
a:hover.hw_cgreen{ color: #49a047;}
a.hw_cgrey{ color: #888;}
a:hover.hw_cgrey{ color: #3b94d6;}
a.hw_btn_green{
color: #60b25e !important;
border:1px solid #60b25e;
background:#fff;
text-align: center;
font-size: 12px;
padding:0 15px;
height: 30px;
line-height: 30px;
-webkit-border-radius:3px;
-moz-border-radius:3px;
-o-border-radius:3px;
border-radius:3px;
}
a:hover.hw_btn_green,a:active.hw_btn_green{ background: #51a74f; color:#fff !important;}
a.hw_btn_green2{
color: #60b25e !important;
border:1px solid #60b25e;
background:#fff;
text-align: center;
font-size: 14px;
padding:0 10px;
height: 30px;
line-height: 30px;
-webkit-border-radius:3px;
-moz-border-radius:3px;
-o-border-radius:3px;
border-radius:3px;
}
a:hover.hw_btn_green2,a:active.hw_btn_green{ background: #51a74f; color:#fff !important;}
a.hw_btn_grey{
color: #888 !important;
border:1px solid #888;
background:#fff;
text-align: center;
font-size: 12px;
padding:0 15px;
height: 30px;
line-height: 30px;
-webkit-border-radius:3px;
-moz-border-radius:3px;
-o-border-radius:3px;
border-radius:3px;
}
.hw_icons_cir{ display:block; width:15px; height:15px; background:url(../images/hw/icons_hw.png) 0 0px no-repeat;}
.hw_icons_lock{ display:block; width:15px; height:16px; background:url(../images/hw/icons_hw.png) 0 -90px no-repeat;}
/* 我的作业新增*/
a.hw_corange{ color: #ee4a1f;}
a:hover.hw_corange{ color: #e1412b;}
.hw_cir_nomal{display:block;display:inline-block; color:#fff; font-size:10px; padding:0 5px; background:#c1c1c1;-webkit-border-radius:3px; -moz-border-radius:3px; -o-border-radius:3px; border-radius:3px;}
.hw_cir_lorange{ background:#f79981;}
.hw_cir_lgreen{ background:#7ecfa2;}
.hw_w20{ width:20px; display:block; text-align:center;}
.hw_w20{ width:20px; display:block; text-align:center;}
/* 按钮*/
a.btn_orange_big{
display:inline-block;
@ -168,3 +228,21 @@ a.sy_icons_close{
padding:0 5px;
width:220px;
}
/* 题库预览弹框 */
.hw_popup_box{width:790px; max-height:770px; padding:15px; background:#fff;-webkit-border-radius:5px;-moz-border-radius:5px;-o-border-radius:5px;border-radius:5px;-webkit-box-shadow: 0px 0px 8px rgba(20, 124, 17, 0.5);-moz-box-shadow: 0px 0px 8px rgba(20, 124, 17, 0.5);box-shadow: 0px 0px 8px rgba(20, 124, 17, 0.5);}
.hw_popup_top a.hw_icons_close{display:block;width:26px; height:26px;background: url(../images/hw/icons_hw.png) 0 -95px no-repeat; transition: all 0s linear;}
.hw_popup_top a:hover.hw_icons_close{background: url(../images/hw/icons_hw.png) -41px -95px no-repeat; }
.hw_popup_con{ width:770px; max-height:770px; margin:0 auto;}
.hw_popup_txt{width:770px; max-height:700px; margin:15px auto;overflow:auto;}
/* 题库发送弹框 */
.hw_sendpopup_box{ width:460px;background:#fff;padding-bottom:15px;-webkit-border-radius:5px;-moz-border-radius:5px;-o-border-radius:5px;border-radius:5px;-webkit-box-shadow: 0px 0px 8px rgba(146, 153, 169, 0.5);-moz-box-shadow: 0px 0px 8px rgba(146, 153, 169, 0.5);box-shadow: 0px 0px 8px rgba(146, 153, 169, 0.5);}
.hw_sendpopup_top{background:#3b94d6;height:40px;-webkit-border-radius: 5px 5px 0px 0px;-o-border-radius: 5px 5px 0px 0px;border-radius: 5px 5px 0px 0px;}
.hw_sendpopup_top h3{ font-size:16px; color:#fff; font-weight:normal; line-height:40px; padding-left:10px;}
a.hw_sendpopup_close{width:20px; height:20px;display:block;background: url(../images/hw/icons_hw.png) -42px 0 no-repeat;margin:10px 5px 0 0;}
.hw_sendpopup_tishi{ border:1px solid #eee5a8; background:#faf9da; width:423px; margin:15px auto 0; height:38px; line-height:38px; color:#ff964d; padding-left:5px;}
.hw_sendpopup_con_innner{ padding:15px; width:400px; margin:15px auto 0; border:1px solid #d3d8e7; background:#f7f9fd;}
.hw_sendpopup_searchli{ max-height: 300px; overflow: auto; width:400px;}
.hw_sendpopup_searchli li{ font-size:14px; margin-bottom:5px;color:#333; width:370px;}
.hw_sendpopup_searchli li label{ margin-left:5px;}
.hw_sendpopup_search_input{width:393px; height:28px; border:none; border:1px solid #d3d8e7; background:#fff; padding-left:5px}

View File

@ -188,6 +188,7 @@ input.syllabus_input_min{
white-space: nowrap;
text-overflow:ellipsis;
}
.sy_classlist_title a:hover{ color:#333;}
.sy_con_r{
width:205px;
}
@ -509,7 +510,7 @@ a:hover.sy_btn_orange{
line-height:39px;
font-size:14px;
}
.sub-menu li:last-child a { border-bottom:1px solid #e5e5e5; }
.sub-menu li:last-child a {}
.accordion li > .sub-menu {
display: none;
}
@ -581,3 +582,37 @@ a:hover.sy_class_ltitle{ color:#333;}
.sy_class_lclass li:last-child { border-bottom:none;}
.sy_class_r{ width: 748px; background: #fff; border: 1px solid #e5e5e5;}
/* 题库tab */
.hw_content{ width: 998px; margin: 0 auto; background:#fff; border:1px solid #e1e1e1; position:relative; }
#hw_tab_nav {border-bottom:1px solid #e7e7e7;height:50px;background: #f8f8f8; }
#hw_tab_nav li {float:left; padding:0px 50px;text-align:center;height: 47px;line-height: 47px; }
#hw_tab_nav li a{font-size:16px;}
.hw_tab_hover {border-top:3px solid #60b25e;border-bottom:1px solid #fff; background: #fff;}
.hw_tab_hover a{ color:#60b25e !important; }
.hw_tab_nomal {border-bottom:none; }
.hw_tab_nomal a{ color:#333;}
.undis {display:none;}
.dis {display:block;}
.hw_more_box {position:absolute; width:24px; height:15px; right:15px; top:15px;}
.hw_more_box ul li:hover ul {display:block; }
.hw_more_icons {background:url(../images/hw/icons_hw.png) 0px -30px no-repeat; width:24px; height:15px; }
.hw_more_icons:hover {background:url(../images/hw/icons_hw.png) -40px -30px no-repeat;}
.hw_more_txt {width:75px; font-size:12px; color:#616060; background-color:#fff; border:1px solid #eaeaea; border-radius:3px; position:absolute; left:-40px; top:15px; padding:5px 0px; display:none; box-shadow: 0px 0px 8px rgba(146, 153, 169, 0.5); z-index:1000;}
.hw_more_txt li a.hw_more_li {font-size:12px;color:#888; display:block; width:75px;height:24px;line-height:24px;text-align:center; }
.hw_more_txt li a.hw_more_li:hover {background-color:#f0f0f0;}
.hw_search_box{ position:relative; }
.hw_search_box input.hw_search-input{ width:293px; height:28px; border:none; border:1px solid #e7e7e7; background:#fff; padding-left:5px;}
.hw_search_box span.hw_btn_search{display:block; width:20px; height:20px; background:url(../images/hw/icons_hw.png) 0 -57px no-repeat; position:absolute; right:5px; top:15px;}
/*.hw_search_box a:hover.hw_btn_search{background:url(../images/hw/icons_hw.png) -40px -57px no-repeat;}*/
.hw_files_icon{display:block; width:17px; height:14px; background:url(../images/hw/icons_hw.png) 0 -135px no-repeat;}
.hw_list_classname{ width:300px; overflow:hidden; display:block;overflow:hidden;white-space: nowrap; text-overflow:ellipsis;}
.hw_list_teachername{ width:80px; overflow:hidden; display:block;overflow:hidden;white-space: nowrap; text-overflow:ellipsis;}
/* 测试集显示 */
.hw_popup_testtable{background:#fff; color:#888888; margin:10px 0; border-right:1px solid #e7e7e7; border-bottom:1px solid #e7e7e7;}
.hw_popup_testtable tr td{ width:47%; padding:10px; color:#888; border-left:1px solid #e7e7e7; border-top:1px solid #e7e7e7; }
.hw_popup_testtable tr td.test_td_min{ width:5%; color:#888;}
.hw_popup_testtable tr td.test_td_title{ text-align:center; color:#888888;}
/* 我的作业 */
.hw_classname{ width:180px; overflow:hidden; display:block;overflow:hidden;white-space: nowrap; text-overflow:ellipsis;}
.hw_tab_top{ height: 50px; line-height: 50px; padding-left: 15px; border-bottom:1px solid #ddd; border-left:3px solid #3b94d6; }