Merge branch 'develop' into hjq_new_course

Conflicts:
	app/controllers/news_controller.rb
	app/views/users/_user_message_userfeedaback.html.erb
hjq_new_course
huang 10 years ago
commit 5681d329d6

@ -51,6 +51,37 @@ class AdminController < ApplicationController
end end
end end
#管理员界面精品课程列表
def excellent_courses
@courses = Course.where("is_excellent =? or excellent_option =?", 1, 1 )
respond_to do |format|
format.html
end
end
#管理员界面课程资源列表
def course_resource_list
@resource = Attachment.where(:container_type => 'Course')
@resource = paginateHelper @resource,30
@page = (params['page'] || 1).to_i - 1
respond_to do |format|
format.html
end
end
#管理员界面項目资源列表
def project_resource_list
@pro_resource = Attachment.where(:container_type => 'Project')
@pro_resource = paginateHelper @pro_resource,30
@page = (params['page'] || 1).to_i - 1
respond_to do |format|
format.html
end
end
def users def users
sort_init 'login', 'asc' sort_init 'login', 'asc'
sort_update %w(login firstname lastname mail admin created_on last_login_on) sort_update %w(login firstname lastname mail admin created_on last_login_on)

@ -240,6 +240,18 @@ class CoursesController < ApplicationController
# req[:message] = l(:modal_valid_passing) if req[:message].blank? # req[:message] = l(:modal_valid_passing) if req[:message].blank?
render :json => req render :json => req
end end
def teacher_assign_group
member = Member.where(:course_id => @course.id, :user_id => params[:user_id]).first
member.course_group_id = params[:course_group_id].to_i
member.save
@course_groups = @course.course_groups
@canShowCode = isCourseTeacher(User.current.id,@course) && params[:role] != '1'
respond_to do |format|
format.js
end
end
def join_group def join_group
@subPage_title = l :label_student_list @subPage_title = l :label_student_list
group = CourseGroup.find(params[:object_id]) group = CourseGroup.find(params[:object_id])
@ -838,6 +850,8 @@ class CoursesController < ApplicationController
# render_403 # render_403
# return # return
# end # end
# 统计访问量
@course.update_attribute(:visits, @course.visits.to_i + 1)
#更新创建课程消息状态 #更新创建课程消息状态
create_course_messages = @course.course_messages.where("user_id =? and course_message_type =? and course_id =? and viewed =?", User.current.id, 'Course', @course.id, 0) create_course_messages = @course.course_messages.where("user_id =? and course_message_type =? and course_id =? and viewed =?", User.current.id, 'Course', @course.id, 0)
create_course_messages.update_all(:viewed => true) create_course_messages.update_all(:viewed => true)

@ -854,9 +854,7 @@ class FilesController < ApplicationController
@result = visable_attachemnts @result @result = visable_attachemnts @result
if params[:other] if params[:other]
@result = @result.select{|attachment| @result = @result.select{|attachment|
attachment.tag_list.exclude?('软件') && attachment.tag_list.index{|tag|tag != '软件' and tag != '媒体' and tag != '代码'}.present?
attachment.tag_list.exclude?('媒体') &&
attachment.tag_list.exclude?('代码')
} }
else else
@result = @result.select{|attachment| attachment.tag_list.include?(@tag_name)} unless @tag_name.blank? @result = @result.select{|attachment| attachment.tag_list.include?(@tag_name)} unless @tag_name.blank?

@ -107,28 +107,18 @@ class NewsController < ApplicationController
def show def show
# 更新news对应的forge_messages的消息viewed字段 # 更新news对应的forge_messages的消息viewed字段
ids = @news.comments.map { |comment| comment.id }.join(",") unless @news.comments.nil?
if @project if @project
query_message_news = ForgeMessage.where("forge_message_id =? and user_id =?", @news.id, User.current.id).first # 更新新闻
query_message_news = ForgeMessage.where("forge_message_id =? and user_id =? and viewed =?", @news.id, User.current.id, 0).first
# 更新新闻的时候一并更新回复
ForgeMessage.where("forge_message_id in (#{ids}) and forge_message_type = 'Comment' and user_id = #{User.current.id}").update_all(:viewed => true) unless ids.blank?
else else
query_message_news = CourseMessage.where("course_message_id =? and user_id =?", @news.id, User.current.id).first query_message_news = CourseMessage.where("course_message_id =? and user_id =? and viewed =?", @news.id, User.current.id, 0).first
CourseMessage.where("course_message_id in (#{ids}) and course_message_type = 'Comment' and user_id = #{User.current.id}").update_all(:viewed => true) unless ids.blank?
end end
query_message_news.update_attribute(:viewed, true) query_message_news.update_attribute(:viewed, true) unless query_message_news.nil?
# 更新项目新闻的评阅的消息viewed字段 # over
current_message_comments = @news.comments
current_message_comments.each do |current_message_comment|
if @project
query_message_comment = current_message_comment.forge_messages
else
query_message_comment = current_message_comment.course_messages
end
query_message_comment.each do |query|
if User.current.id == query.user_id
query.update_attributes(:viewed => true)
end
end
end
# end
cs = CoursesService.new cs = CoursesService.new
result = cs.show_course_news params,User.current result = cs.show_course_news params,User.current
@news = result[:news] @news = result[:news]

@ -69,6 +69,8 @@ class OrganizationsController < ApplicationController
def show def show
if @organization.is_public? || User.current.admin? || User.current.member_of_org?(@organization) if @organization.is_public? || User.current.admin? || User.current.member_of_org?(@organization)
@organization = Organization.find(params[:id]) @organization = Organization.find(params[:id])
# 统计访问量
@organization.update_attribute(:visits, @organization.visits.to_i + 1)
if params[:org_subfield_id] if params[:org_subfield_id]
@org_subfield = OrgSubfield.find(params[:org_subfield_id]) @org_subfield = OrgSubfield.find(params[:org_subfield_id])
@org_subfield_ids = @org_subfield.org_document_comments.map(&:id) << 0 @org_subfield_ids = @org_subfield.org_document_comments.map(&:id) << 0

@ -298,6 +298,8 @@ class ProjectsController < ApplicationController
if params[:jump] && redirect_to_project_menu_item(@project, params[:jump]) if params[:jump] && redirect_to_project_menu_item(@project, params[:jump])
return return
end end
# 统计访问量
@project.update_attribute(:visits, @project.visits.to_i + 1)
=begin =begin
cond = @project.project_condition(Setting.display_subprojects_issues?) cond = @project.project_condition(Setting.display_subprojects_issues?)
has = { has = {

@ -99,16 +99,18 @@ class StudentWorkController < ApplicationController
else else
student_in_group = '(' + group_students.map{|user| user.id}.join(',') + ')' student_in_group = '(' + group_students.map{|user| user.id}.join(',') + ')'
end end
#老师 || 超级管理员 || 禁用匿评&&作业截止&&已提交作品 显示所有列表 #开放作品 || 老师 || 超级管理员 || 禁用匿评&&作业截止&&已提交作品 显示所有列表
if @homework.is_open == 1 if @homework.is_open == 1 || @is_teacher || User.current.admin? || (User.current.member_of_course?(@course) && @homework.anonymous_comment == 1 && Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.now.strftime("%Y-%m-%d") && !@homework.student_works.where(:user_id => User.current.id).empty?)
@stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,IF(final_score = 0, 0, final_score - absence_penalty - late_penalty)) as score").joins(:user).where("users.id in #{student_in_group}").order("#{@order} #{@b_sort}"),@name if @order == 'lastname'
@show_all = true @stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,IF(final_score = 0, 0, final_score - absence_penalty - late_penalty)) as score").joins(:user).where("users.id in #{student_in_group}").order("CONVERT(lastname USING gbk) COLLATE gbk_chinese_ci #{@b_sort}, login #{@b_sort}"),@name
elsif @homework.is_open == 0 && User.current.member_of_course?(@course) || User.current.admin? elsif @order == 'student_id'
if @is_teacher || @homework.homework_detail_manual.nil? || @stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,IF(final_score = 0, 0, final_score - absence_penalty - late_penalty)) as score").joins(:user).where("users.id in #{student_in_group}").joins("join user_extensions on student_works.user_id = user_extensions.user_id").order("#{@order} #{@b_sort}"),@name
(@homework.anonymous_comment == 1 && Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.now.strftime("%Y-%m-%d") && !@homework.student_works.where(:user_id => User.current.id).empty?) else
@stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,IF(final_score = 0, 0, final_score - absence_penalty - late_penalty)) as score").joins(:user).where("users.id in #{student_in_group}").order("#{@order} #{@b_sort}"),@name @stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,IF(final_score = 0, 0, final_score - absence_penalty - late_penalty)) as score").joins(:user).where("users.id in #{student_in_group}").order("#{@order} #{@b_sort}"),@name
end
@show_all = true @show_all = true
elsif @homework.homework_detail_manual.comment_status == 1 #学生 && 未开启匿评 只看到自己的 elsif User.current.member_of_course?(@course)
if @homework.homework_detail_manual.comment_status == 1 #学生 && 未开启匿评 只看到自己的
if @homework.homework_type == 3 if @homework.homework_type == 3
pro = @homework.student_work_projects.where(:user_id => User.current.id).first pro = @homework.student_work_projects.where(:user_id => User.current.id).first
if pro.nil? if pro.nil?
@ -144,8 +146,14 @@ class StudentWorkController < ApplicationController
end end
if my_work.empty? if my_work.empty?
@stundet_works = [] @stundet_works = []
else
if @order == 'lastname'
@stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,IF(final_score = 0, 0, final_score - absence_penalty - late_penalty)) as score").joins(:user).where("users.id in #{student_in_group}").order("CONVERT(lastname USING gbk) COLLATE gbk_chinese_ci #{@b_sort}, login #{@b_sort}"),@name
elsif @order == 'student_id'
@stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,IF(final_score = 0, 0, final_score - absence_penalty - late_penalty)) as score").joins(:user).where("users.id in #{student_in_group}").joins("join user_extensions on student_works.user_id = user_extensions.user_id").order("#{@order} #{@b_sort}"),@name
else else
@stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,IF(final_score = 0, 0, final_score - absence_penalty - late_penalty)) as score").joins(:user).where("users.id in #{student_in_group}").order("#{@order} #{@b_sort}"),@name @stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,IF(final_score = 0, 0, final_score - absence_penalty - late_penalty)) as score").joins(:user).where("users.id in #{student_in_group}").order("#{@order} #{@b_sort}"),@name
end
@show_all = true @show_all = true
end end
else else
@ -158,14 +166,17 @@ class StudentWorkController < ApplicationController
@student_work_count = (search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,IF(final_score = 0, 0, final_score - absence_penalty - late_penalty)) as score").joins(:user).where("users.id in #{student_in_group}").order("#{@order} #{@b_sort}"),@name).count @student_work_count = (search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,IF(final_score = 0, 0, final_score - absence_penalty - late_penalty)) as score").joins(:user).where("users.id in #{student_in_group}").order("#{@order} #{@b_sort}"),@name).count
else else
if @homework.is_open == 1 if @homework.is_open == 1 || @is_teacher || User.current.admin? || (User.current.member_of_course?(@course) && @homework.anonymous_comment == 1 && Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.now.strftime("%Y-%m-%d") && !@homework.student_works.where(:user_id => User.current.id).empty?)
@stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,IF(final_score = 0, 0, final_score - absence_penalty - late_penalty)) as score").order("#{@order} #{@b_sort}"),@name if @order == 'lastname'
@show_all = true @stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,IF(final_score = 0, 0, final_score - absence_penalty - late_penalty)) as score").joins(:user).order("CONVERT(lastname USING gbk) COLLATE gbk_chinese_ci #{@b_sort}, login #{@b_sort}"),@name
elsif @homework.is_open == 0 && User.current.member_of_course?(@course) || User.current.admin? elsif @order == 'student_id'
if @is_teacher || @homework.homework_detail_manual.nil? || (@homework.anonymous_comment == 1 && Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.now.strftime("%Y-%m-%d") && !@homework.student_works.where(:user_id => User.current.id).empty?) #老师 || 超级管理员 显示所有列表 @stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,IF(final_score = 0, 0, final_score - absence_penalty - late_penalty)) as score").joins("join user_extensions on student_works.user_id = user_extensions.user_id").order("#{@order} #{@b_sort}"),@name
else
@stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,IF(final_score = 0, 0, final_score - absence_penalty - late_penalty)) as score").order("#{@order} #{@b_sort}"),@name @stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,IF(final_score = 0, 0, final_score - absence_penalty - late_penalty)) as score").order("#{@order} #{@b_sort}"),@name
end
@show_all = true @show_all = true
elsif @homework.homework_detail_manual.comment_status == 1 #学生 && 未开启匿评 只看到自己的 elsif User.current.member_of_course?(@course)
if @homework.homework_detail_manual.comment_status == 1 #学生 && 未开启匿评 只看到自己的
if @homework.homework_type == 3 if @homework.homework_type == 3
pro = @homework.student_work_projects.where(:user_id => User.current.id).first pro = @homework.student_work_projects.where(:user_id => User.current.id).first
if pro.nil? if pro.nil?
@ -201,8 +212,14 @@ class StudentWorkController < ApplicationController
end end
if my_work.empty? if my_work.empty?
@stundet_works = [] @stundet_works = []
else
if @order == 'lastname'
@stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,IF(final_score = 0, 0, final_score - absence_penalty - late_penalty)) as score").joins(:user).order("CONVERT(lastname USING gbk) COLLATE gbk_chinese_ci #{@b_sort}, login #{@b_sort}"),@name
elsif @order == 'student_id'
@stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,IF(final_score = 0, 0, final_score - absence_penalty - late_penalty)) as score").joins("join user_extensions on student_works.user_id = user_extensions.user_id").order("#{@order} #{@b_sort}"),@name
else else
@stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,IF(final_score = 0, 0, final_score - absence_penalty - late_penalty)) as score").order("#{@order} #{@b_sort}"),@name @stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,IF(final_score = 0, 0, final_score - absence_penalty - late_penalty)) as score").order("#{@order} #{@b_sort}"),@name
end
@show_all = true @show_all = true
end end
else else

@ -377,13 +377,15 @@ class UsersController < ApplicationController
#用户作业列表 #用户作业列表
def user_homeworks def user_homeworks
@order,@b_sort = params[:order] || "created_at",params[:sort] || "desc"
@user = User.current @user = User.current
@r_sort = @b_sort == "desc" ? "asc" : "desc"
if(params[:type].blank? || params[:type] == "1") #公共题库 if(params[:type].blank? || params[:type] == "1") #公共题库
visible_course = Course.where("is_public = 1 && is_delete = 0") visible_course = Course.where("is_public = 1 && is_delete = 0")
visible_course_ids = visible_course.empty? ? "(-1)" : "(" + visible_course.map{|course| course.id}.join(",") + ")" visible_course_ids = visible_course.empty? ? "(-1)" : "(" + visible_course.map{|course| course.id}.join(",") + ")"
@homeworks = HomeworkCommon.where("course_id in #{visible_course_ids} and publish_time <= '#{Date.today}'").order("created_at desc") @homeworks = HomeworkCommon.where("course_id in #{visible_course_ids} and publish_time <= '#{Date.today}'").order("#{@order} #{@b_sort}")
elsif params[:type] == "2" #我的题库 elsif params[:type] == "2" #我的题库
@homeworks = HomeworkCommon.where("user_id = #{@user.id} and publish_time <= '#{Date.today}'").order("created_at desc") @homeworks = HomeworkCommon.where("user_id = #{@user.id} and publish_time <= '#{Date.today}'").order("#{@order} #{@b_sort}")
end end
@type = params[:type] @type = params[:type]
@limit = 15 @limit = 15
@ -526,20 +528,22 @@ class UsersController < ApplicationController
end end
def user_homework_type def user_homework_type
@order,@b_sort = params[:order] || "created_at",params[:sort] || "desc"
@r_sort = @b_sort == "desc" ? "asc" : "desc"
@user = User.current @user = User.current
if(params[:type].blank? || params[:type] == "1") #公共题库 if(params[:type].blank? || params[:type] == "1") #公共题库
visible_course = Course.where("is_public = 1 && is_delete = 0") visible_course = Course.where("is_public = 1 && is_delete = 0")
visible_course_ids = visible_course.empty? ? "(-1)" : "(" + visible_course.map{|course| course.id}.join(",") + ")" visible_course_ids = visible_course.empty? ? "(-1)" : "(" + visible_course.map{|course| course.id}.join(",") + ")"
@homeworks = HomeworkCommon.where("course_id in #{visible_course_ids} and publish_time <= '#{Date.today}'").order("created_at desc") @homeworks = HomeworkCommon.where("course_id in #{visible_course_ids} and publish_time <= '#{Date.today}'").order("#{@order} #{@b_sort}")
elsif params[:type] == "2" #我的题库 elsif params[:type] == "2" #我的题库
@homeworks = HomeworkCommon.where("user_id = #{@user.id} and publish_time <= '#{Date.today}'").order("created_at desc") @homeworks = HomeworkCommon.where("user_id = #{@user.id} and publish_time <= '#{Date.today}'").order("#{@order} #{@b_sort}")
end end
if params[:property] && params[:property] == "1" if params[:property] && params[:property] == "1"
@homeworks = @homeworks.where("homework_type = 1").reorder("created_at desc") @homeworks = @homeworks.where("homework_type = 1").reorder("#{@order} #{@b_sort}")
elsif params[:property] && params[:property] == "2" elsif params[:property] && params[:property] == "2"
@homeworks = @homeworks.where("homework_type = 2").reorder("created_at desc") @homeworks = @homeworks.where("homework_type = 2").reorder("#{@order} #{@b_sort}")
elsif params[:property] && params[:property] == "3" elsif params[:property] && params[:property] == "3"
@homeworks = @homeworks.where("homework_type = 3").reorder("created_at desc") @homeworks = @homeworks.where("homework_type = 3").reorder("#{@order} #{@b_sort}")
end end
@type = params[:type] @type = params[:type]
@property = params[:property] @property = params[:property]
@ -565,6 +569,8 @@ class UsersController < ApplicationController
#用户主页过滤作业 #用户主页过滤作业
def user_search_homeworks def user_search_homeworks
@order,@b_sort = params[:order] || "created_at",params[:sort] || "desc"
@r_sort = @b_sort == "desc" ? "asc" : "desc"
@user = User.current @user = User.current
search = params[:name].to_s.strip.downcase search = params[:name].to_s.strip.downcase
if(params[:type].blank? || params[:type] == "1") #全部 if(params[:type].blank? || params[:type] == "1") #全部
@ -574,16 +580,16 @@ class UsersController < ApplicationController
all_user_ids = all_homeworks.map{|hw| hw.user_id} all_user_ids = all_homeworks.map{|hw| hw.user_id}
user_str_ids = search_user_by_name all_user_ids, search user_str_ids = search_user_by_name all_user_ids, search
user_ids = user_str_ids.empty? ? "(-1)" : "(" + user_str_ids.join(",") + ")" user_ids = user_str_ids.empty? ? "(-1)" : "(" + user_str_ids.join(",") + ")"
@homeworks = HomeworkCommon.where("course_id in #{visible_course_ids} and publish_time <= '#{Date.today}' and (name like '%#{search}%' or user_id in #{user_ids})").order("created_at desc") @homeworks = HomeworkCommon.where("course_id in #{visible_course_ids} and publish_time <= '#{Date.today}' and (name like '%#{search}%' or user_id in #{user_ids})").order("#{@order} #{@b_sort}")
elsif params[:type] == "2" #课程资源 elsif params[:type] == "2" #课程资源
@homeworks = HomeworkCommon.where("user_id = #{@user.id} and publish_time <= '#{Date.today}' and (name like '%#{search}%')").order("created_at desc") @homeworks = HomeworkCommon.where("user_id = #{@user.id} and publish_time <= '#{Date.today}' and (name like '%#{search}%')").order("#{@order} #{@b_sort}")
end end
if params[:property] && params[:property] == "1" if params[:property] && params[:property] == "1"
@homeworks = @homeworks.where("homework_type = 1").reorder("created_at desc") @homeworks = @homeworks.where("homework_type = 1").reorder("#{@order} #{@b_sort}")
elsif params[:property] && params[:property] == "2" elsif params[:property] && params[:property] == "2"
@homeworks = @homeworks.where("homework_type = 2").reorder("created_at desc") @homeworks = @homeworks.where("homework_type = 2").reorder("#{@order} #{@b_sort}")
elsif params[:property] && params[:property] == "3" elsif params[:property] && params[:property] == "3"
@homeworks = @homeworks.where("homework_type = 3").reorder("created_at desc") @homeworks = @homeworks.where("homework_type = 3").reorder("#{@order} #{@b_sort}")
end end
@type = params[:type] @type = params[:type]
@limit = 15 @limit = 15
@ -593,6 +599,8 @@ class UsersController < ApplicationController
@offset ||= @hw_pages.offset @offset ||= @hw_pages.offset
@homeworks = paginateHelper @homeworks,15 @homeworks = paginateHelper @homeworks,15
@is_import = params[:is_import] @is_import = params[:is_import]
@property = params[:property]
@search = search
respond_to do |format| respond_to do |format|
format.js format.js
end end
@ -818,18 +826,18 @@ class UsersController < ApplicationController
# user_org_ids = User.current.organizations.map {|o| o.id} # user_org_ids = User.current.organizations.map {|o| o.id}
if(params[:type].blank? || params[:type] == "1") #全部 if(params[:type].blank? || params[:type] == "1") #全部
# 修正:我的资源库的话,那么应该是我上传的所有资源加上,我加入的课程、项目、组织的所有资源 # 修正:我的资源库的话,那么应该是我上传的所有资源加上,我加入的课程、项目、组织的所有资源
@attachments = get_my_resources(params[:id], user_course_ids, user_project_ids) @attachments = get_my_resources(params[:id], user_course_ids, user_project_ids, params[:order])
elsif params[:type] == "2" # 课程资源 elsif params[:type] == "2" # 课程资源
@attachments = get_course_resources(params[:id], user_course_ids) @attachments = get_course_resources(params[:id], user_course_ids, params[:order])
elsif params[:type] == "3" # 项目资源 elsif params[:type] == "3" # 项目资源
@attachments = get_project_resources(params[:id], user_project_ids) @attachments = get_project_resources(params[:id], user_project_ids, params[:order])
elsif params[:type] == "4" #附件 elsif params[:type] == "4" #附件
@attachments = get_attch_resources params[:id] @attachments = get_attch_resources params[:id], params[:order]
elsif params[:type] == "5" #用户资源 elsif params[:type] == "5" #用户资源
@attachments = get_principal_resources params[:id] @attachments = get_principal_resources params[:id], params[:order]
elsif params[:type] == "6" # 公共资源 elsif params[:type] == "6" # 公共资源
# 公共资源库:所有公开资源或者我上传的私有资源 # 公共资源库:所有公开资源或者我上传的私有资源
@attachments = get_public_resources(user_course_ids, user_project_ids) @attachments = get_public_resources(user_course_ids, user_project_ids, params[:order])
end end
@type = params[:type] @type = params[:type]
@limit = 7 @limit = 7
@ -939,12 +947,7 @@ class UsersController < ApplicationController
return return
end end
# 自己访问自己的页面才更新消息状态 # 自己访问自己的页面才更新消息状态
if User.current == @user UserFeedbackMessage.where("user_id =? and viewed =? and journals_for_message_type =? ", User.current.id, 0, "JournalsForMessage").update_all(:viewed => true)
journals_messages = UserFeedbackMessage.where("user_id =? and journals_for_message_type =? and viewed =?", User.current.id, "JournalsForMessage", 0)
journals_messages.each do |journals_message|
journals_message.update_attributes(:viewed => true)
end
end
# end # end
@page = params[:page] ? params[:page].to_i + 1 : 0 @page = params[:page] ? params[:page].to_i + 1 : 0
if params[:type].present? if params[:type].present?
@ -1175,6 +1178,10 @@ class UsersController < ApplicationController
end end
def show def show
# 统计访问量
unless User.current == @user
@user.update_attribute(:visits, @user.visits.to_i + 1)
end
#更新用户申请成为课程老师或教辅消息的状态 #更新用户申请成为课程老师或教辅消息的状态
if params[:course_id] != nil if params[:course_id] != nil
join_course_messages = CourseMessage.where("course_id =? and course_message_type =? and user_id =? and course_message_id =? and viewed =?", join_course_messages = CourseMessage.where("course_id =? and course_message_type =? and user_id =? and course_message_id =? and viewed =?",
@ -1544,41 +1551,41 @@ class UsersController < ApplicationController
@user = User.find(params[:id]) @user = User.find(params[:id])
#@user.save_attachments(params[:attachments],User.current) #@user.save_attachments(params[:attachments],User.current)
# Container_type为Principal # Container_type为Principal
Attachment.attach_filesex(@user, params[:attachments], params[:attachment_type]) attach = Attachment.attach_filesex_public(@user, params[:attachments], params[:attachment_type], is_public = true)
if(params[:type].blank? || params[:type] == "1") # 我的资源 if(params[:type].blank? || params[:type] == "1") # 我的资源
# 修正:我的资源库的话,那么应该是我上传的所有资源加上,我加入的课程、项目、组织的所有资源 # 修正:我的资源库的话,那么应该是我上传的所有资源加上,我加入的课程、项目、组织的所有资源
if params[:status] == 2 if params[:status] == 2
@attachments = get_course_resources(params[:id], user_course_ids) @attachments = get_course_resources(params[:id], user_course_ids, params[:order])
elsif params[:status] == "3" elsif params[:status] == "3"
@attachments = get_project_resources(params[:id], user_project_ids) @attachments = get_project_resources(params[:id], user_project_ids, params[:order])
elsif params[:status] == "4" elsif params[:status] == "4"
@attachments = get_attch_resources params[:id] @attachments = get_attch_resources params[:id], params[:order]
elsif params[:status] == "5" elsif params[:status] == "5"
@attachments = get_principal_resources params[:id] @attachments = get_principal_resources params[:id], params[:order]
else else
# 公共资源库:所有公开资源或者我上传的私有资源 # 公共资源库:所有公开资源或者我上传的私有资源
@attachments = get_my_resources(params[:id], user_course_ids, user_project_ids) @attachments = get_my_resources(params[:id], user_course_ids, user_project_ids, params[:order])
end end
elsif params[:type] == "2" # 课程资源 elsif params[:type] == "2" # 课程资源
@attachments = get_course_resources(params[:id], user_course_ids) @attachments = get_course_resources(params[:id], user_course_ids, params[:order])
elsif params[:type] == "3" # 项目资源 elsif params[:type] == "3" # 项目资源
@attachments = get_project_resources(params[:id], user_project_ids) @attachments = get_project_resources(params[:id], user_project_ids, params[:order])
elsif params[:type] == "4" #附件 elsif params[:type] == "4" #附件
@attachments = get_attch_resources params[:id] @attachments = get_attch_resources params[:id], params[:order]
elsif params[:type] == "5" #用户资源 elsif params[:type] == "5" #用户资源
@attachments = get_principal_resources params[:id] @attachments = get_principal_resources params[:id], params[:order]
elsif params[:type] == "6" # 公共资源 elsif params[:type] == "6" # 公共资源
if params[:status] == "2" if params[:status] == "2"
@attachments = get_course_resources_public( user_course_ids) @attachments = get_course_resources_public( user_course_ids, params[:order])
elsif params[:status] == "3" elsif params[:status] == "3"
@attachments = get_project_resources_public(user_project_ids) @attachments = get_project_resources_public(user_project_ids, params[:order])
elsif params[:status] == "4" elsif params[:status] == "4"
@attachments = get_attch_resources_public @attachments = get_attch_resources_public params[:order]
elsif params[:status] == "5" elsif params[:status] == "5"
@attachments = get_principal_resources_public @attachments = get_principal_resources_public params[:order]
else else
# 公共资源库:所有公开资源或者我上传的私有资源 # 公共资源库:所有公开资源或者我上传的私有资源
@attachments = get_public_resources(user_course_ids, user_project_ids) @attachments = get_public_resources(user_course_ids, user_project_ids, params[:order])
end end
end end
@status = params[:status] @status = params[:status]
@ -1610,37 +1617,37 @@ class UsersController < ApplicationController
if(params[:type].blank? || params[:type] == "1") # 我的资源 if(params[:type].blank? || params[:type] == "1") # 我的资源
# 修正:我的资源库的话,那么应该是我上传的所有资源加上,我加入的课程、项目、组织的所有资源 # 修正:我的资源库的话,那么应该是我上传的所有资源加上,我加入的课程、项目、组织的所有资源
if params[:status] == 2 if params[:status] == 2
@attachments = get_course_resources(params[:id], user_course_ids) @attachments = get_course_resources(params[:id], user_course_ids, params[:order])
elsif params[:status] == "3" elsif params[:status] == "3"
@attachments = get_project_resources(params[:id], user_project_ids) @attachments = get_project_resources(params[:id], user_project_ids, params[:order])
elsif params[:status] == "4" elsif params[:status] == "4"
@attachments = get_attch_resources params[:id] @attachments = get_attch_resources params[:id], params[:order]
elsif params[:status] == "5" elsif params[:status] == "5"
@attachments = get_principal_resources params[:id] @attachments = get_principal_resources params[:id], params[:order]
else else
# 公共资源库:所有公开资源或者我上传的私有资源 # 公共资源库:所有公开资源或者我上传的私有资源
@attachments = get_my_resources(params[:id], user_course_ids, user_project_ids) @attachments = get_my_resources(params[:id], user_course_ids, user_project_ids, params[:order])
end end
elsif params[:type] == "2" # 课程资源 elsif params[:type] == "2" # 课程资源
@attachments = get_course_resources(params[:id], user_course_ids) @attachments = get_course_resources(params[:id], user_course_ids, params[:order])
elsif params[:type] == "3" # 项目资源 elsif params[:type] == "3" # 项目资源
@attachments = get_project_resources(params[:id], user_project_ids) @attachments = get_project_resources(params[:id], user_project_ids, params[:order])
elsif params[:type] == "4" #附件 elsif params[:type] == "4" #附件
@attachments = get_attch_resources params[:id] @attachments = get_attch_resources params[:id], params[:order]
elsif params[:type] == "5" #用户资源 elsif params[:type] == "5" #用户资源
@attachments = get_principal_resources params[:id] @attachments = get_principal_resources params[:id], params[:order]
elsif params[:type] == "6" # 公共资源 elsif params[:type] == "6" # 公共资源
if params[:status] == "2" if params[:status] == "2"
@attachments = get_course_resources_public( user_course_ids) @attachments = get_course_resources_public( user_course_ids, params[:order])
elsif params[:status] == "3" elsif params[:status] == "3"
@attachments = get_project_resources_public(user_project_ids) @attachments = get_project_resources_public(user_project_ids, params[:order])
elsif params[:status] == "4" elsif params[:status] == "4"
@attachments = get_attch_resources_public @attachments = get_attch_resources_public params[:order]
elsif params[:status] == "5" elsif params[:status] == "5"
@attachments = get_principal_resources_public @attachments = get_principal_resources_public params[:order]
else else
# 公共资源库:所有公开资源或者我上传的私有资源 # 公共资源库:所有公开资源或者我上传的私有资源
@attachments = get_public_resources(user_course_ids, user_project_ids) @attachments = get_public_resources(user_course_ids, user_project_ids, params[:order])
end end
end end
@status = params[:status] @status = params[:status]
@ -2328,61 +2335,73 @@ class UsersController < ApplicationController
end end
# 获取公共资源 # 获取公共资源
def get_public_resources user_course_ids, user_project_ids def get_public_resources user_course_ids, user_project_ids, order, score
attachments = Attachment.where("(is_publish = 1 and container_id is not null and container_type in('Project','OrgSubfield','Principal','Course')) "+ attachments = Attachment.where("(is_publish = 1 and is_public =1 and container_id is not null and container_type in('Project','OrgSubfield','Principal','Course')) ").order("#{order.nil? ? 'created_on' : order} #{score}")
"or (container_type = 'Course' and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')}) and is_publish = 1 and container_id is not null)" +
"or (container_type = 'Project' and container_id in (#{user_project_ids.empty? ? '0': user_project_ids.join(',')}) and is_publish = 1 and container_id is not null)" ).order("created_on desc")
end end
# 获取我的资源 # 获取我的资源
def get_my_resources author_id, user_course_ids, user_project_ids def get_my_resources author_id, user_course_ids, user_project_ids, order, score
attachments = Attachment.where("(author_id = #{author_id} and is_publish = 1 and container_id is not null and container_type in('Project','OrgSubfield','Principal','Course','Issue','Document','Message','News','StudentWorkScore','HomewCommon')) "+ attachments = Attachment.where("(author_id = #{author_id} and is_publish = 1 and container_id is not null and container_type in('Project','OrgSubfield','Principal','Course','Issue','Document','Message','News','StudentWorkScore','HomewCommon')) "+
"or (container_type = 'Course' and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')}) and is_publish = 1 and container_id is not null)" + "or (container_type = 'Course' and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')}) and is_publish = 1 and container_id is not null)" +
"or (container_type = 'Project' and container_id in (#{user_project_ids.empty? ? '0': user_project_ids.join(',')}) and is_publish = 1 and container_id is not null)" ).order("created_on desc") "or (container_type = 'Project' and container_id in (#{user_project_ids.empty? ? '0': user_project_ids.join(',')}) and is_publish = 1 and container_id is not null)" ).order("#{order.nil? ? 'created_on' : order} #{score}")
end
# 获取我的资源查询结果
def get_my_resources_search (author_id, user_course_ids, user_project_ids, order, score, search)
@attachments = Attachment.where("((author_id = #{params[:id]} and is_publish = 1 and container_id is not null and container_type in('Project','OrgSubfield','Principal','Course','Issue','Document','Message','News','StudentWorkScore','HomewCommon')) "+
"or (container_type = 'Course' and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')}) and is_publish = 1 and container_id is not null)" +
"or (container_type = 'Project' and container_id in (#{user_project_ids.empty? ? '0': user_project_ids.join(',')}) and is_publish = 1 and container_id is not null)) and (filename like :p)" ,:p => search).order("#{order.nil? ? 'created_on' : order} #{score}")
end end
# 获取我的课程资源 # 获取我的课程资源
def get_course_resources author_id, user_course_ids def get_course_resources author_id, user_course_ids, order, score
attchments = Attachment.where("(author_id = #{author_id} and container_type = 'Course' and is_publish = 1) or (container_type = 'Course' and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')}) and is_publish = 1) ").order("created_on desc") attchments = Attachment.where("(author_id = #{author_id} and is_publish = 1 and container_id is not null and container_type = 'Course')"+
"or (container_type = 'Course' and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')})
and is_publish = 1 and container_id is not null)" ).order("#{order.nil? ? 'created_on' : order} #{score}")
end end
# 获取公共资源课程 # 获取公共资源课程
def get_course_resources_public user_course_ids def get_course_resources_public user_course_ids, order, score
attchments = Attachment.where("(container_type = 'Course' and is_publish = 1) or (container_type = 'Course' and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')}) and is_publish = 1) ").order("created_on desc") attchments = Attachment.where("(container_type = 'Course'and container_id is not null and is_publish = 1 and is_public =1)").order("#{order.nil? ? 'created_on' : order} #{score}")
end end
# 获取我的项目资源 # 获取我的项目资源
def get_project_resources author_id, user_project_ids def get_project_resources author_id, user_project_ids, order, score
attchments = Attachment.where("(author_id = #{author_id} and container_type = 'Project') or (container_type = 'Course' and container_id in (#{user_project_ids.empty? ? '0': user_project_ids.join(',')}) and is_publish = 1) ").order("created_on desc") attchments = Attachment.where("(author_id = #{author_id} and is_publish = 1 and container_id is not null and container_type = 'Project') "+
"or (container_type = 'Project' and container_id in (#{user_project_ids.empty? ? '0': user_project_ids.join(',')})
and is_publish = 1 and container_id is not null)").order("#{order.nil? ? 'created_on' : order} #{score}")
end end
# 获取公共资源的项目资源 # 获取公共资源的项目资源
def get_project_resources_public user_project_ids def get_project_resources_public user_project_ids, order, score
attchments = Attachment.where("(container_type = 'Project') or (container_type = 'Project' and container_id in (#{user_project_ids.empty? ? '0': user_project_ids.join(',')}) and is_publish = 1) ").order("created_on desc") attchments = Attachment.where("container_type = 'Project' and container_id is not null and is_public =1").order("#{order.nil? ? 'created_on' : order} #{score}")
end end
# 获取我上传的附件 # 获取我上传的附件
def get_attch_resources author_id def get_attch_resources author_id, order, score
attchments = Attachment.where("author_id = #{author_id} and container_type in('Issue','Document','Message','News','StudentWorkScore','HomewCommon','OrgSubfield','Principal')").order("created_on desc") attchments = Attachment.where("(author_id = #{author_id} and is_publish = 1 and container_id is not null and container_type in('Project','OrgSubfield','Principal','Course','Issue',
'Document','Message','News','StudentWorkScore','HomewCommon')) ").order("#{order.nil? ? 'created_on' : order} #{score}")
end end
# 获取公共资源中我上传的附件 # 获取公共资源中我上传的附件
def get_attch_resources_public def get_attch_resources_public order, score
attchments = Attachment.where("container_type in('Issue','Document','Message','News','StudentWorkScore','HomewCommon','OrgSubfield','Principal')").order("created_on desc") attchments = Attachment.where("container_type in('Issue','Document','Message','News','StudentWorkScore','HomewCommon','OrgSubfield','Principal') and container_id is not null and is_public =1").order("#{order.nil? ? 'created_on' : order} #{score}")
end end
# 获取我的用户类型资源 # 获取我的用户类型资源
def get_principal_resources author_id def get_principal_resources author_id, order, score
attchments = Attachment.where("author_id = #{author_id} and container_type = 'Principal'").order("created_on desc") attchments = Attachment.where("author_id = #{params[:id]} and is_publish = 1 and container_id is not null and container_type = 'Principal'").order("#{order.nil? ? 'created_on' : order} #{score}")
end end
# 获取我的用户类型资源 # 获取我的用户类型资源
def get_principal_resources_public def get_principal_resources_public order, score
attchments = Attachment.where("container_type = 'Principal'").order("created_on desc") attchments = Attachment.where("container_type = 'Principal'and container_id is not null and is_public =1").order("#{order.nil? ? 'created_on' : order} #{score}")
end end
# 资源库 分为全部 课程资源 项目资源 附件 # 资源库 分为全部 课程资源 项目资源 附件
def user_resource def user_resource
@order, @b_sort = params[:order] || "created_on", params[:sort] || "asc"
@score = @b_sort == "desc" ? "asc" : "desc"
# 别人的资源库是没有权限去看的 # 别人的资源库是没有权限去看的
if User.current.id.to_i != params[:id].to_i if User.current.id.to_i != params[:id].to_i
render_403 render_403
@ -2394,37 +2413,37 @@ class UsersController < ApplicationController
if(params[:type].blank? || params[:type] == "1") # 我的资源 if(params[:type].blank? || params[:type] == "1") # 我的资源
# 修正:我的资源库的话,那么应该是我上传的所有资源加上,我加入的课程、项目、组织的所有资源 # 修正:我的资源库的话,那么应该是我上传的所有资源加上,我加入的课程、项目、组织的所有资源
if params[:status] == "2" if params[:status] == "2"
@attachments = get_course_resources(params[:id], user_course_ids) @attachments = get_course_resources(params[:id], user_course_ids, @order, @score)
elsif params[:status] == "3" elsif params[:status] == "3"
@attachments = get_project_resources(params[:id], user_project_ids) @attachments = get_project_resources(params[:id], user_project_ids, @order, @score)
elsif params[:status] == "4" elsif params[:status] == "4"
@attachments = get_attch_resources params[:id] @attachments = get_attch_resources(params[:id], @order, @score)
elsif params[:status] == "5" elsif params[:status] == "5"
@attachments = get_principal_resources params[:id] @attachments = get_principal_resources(params[:id], @order, @score)
else else
# 公共资源库:所有公开资源或者我上传的私有资源 # 公共资源库:所有公开资源或者我上传的私有资源
@attachments = get_my_resources(params[:id], user_course_ids, user_project_ids) @attachments = get_my_resources(params[:id], user_course_ids, user_project_ids, @order, @score)
end end
elsif params[:type] == "2" # 课程资源 elsif params[:type] == "2" # 课程资源
@attachments = get_course_resources(params[:id], user_course_ids) @attachments = get_course_resources(params[:id], user_course_ids, params[:order], @score)
elsif params[:type] == "3" # 项目资源 elsif params[:type] == "3" # 项目资源
@attachments = get_project_resources(params[:id], user_project_ids) @attachments = get_project_resources(params[:id], user_project_ids, params[:order], @score)
elsif params[:type] == "4" #附件 elsif params[:type] == "4" #附件
@attachments = get_attch_resources params[:id] @attachments = get_attch_resources(params[:id], params[:order], @score)
elsif params[:type] == "5" #用户资源 elsif params[:type] == "5" #用户资源
@attachments = get_principal_resources params[:id] @attachments = get_principal_resources(params[:id], params[:order], @score)
elsif params[:type] == "6" # 公共资源 elsif params[:type] == "6" # 公共资源
if params[:status] == "2" if params[:status] == "2"
@attachments = get_course_resources_public( user_course_ids) @attachments = get_course_resources_public( user_course_ids, params[:order], @score)
elsif params[:status] == "3" elsif params[:status] == "3"
@attachments = get_project_resources_public(user_project_ids) @attachments = get_project_resources_public(user_project_ids, params[:order], @score)
elsif params[:status] == "4" elsif params[:status] == "4"
@attachments = get_attch_resources_public @attachments = get_attch_resources_public(params[:order], @score)
elsif params[:status] == "5" elsif params[:status] == "5"
@attachments = get_principal_resources_public @attachments = get_principal_resources_public(params[:order], @score)
else else
# 公共资源库:所有公开资源或者我上传的私有资源 # 公共资源库:所有公开资源或者我上传的私有资源
@attachments = get_public_resources(user_course_ids, user_project_ids) @attachments = get_public_resources(user_course_ids, user_project_ids, params[:order], @score)
end end
end end
@status = params[:status] @status = params[:status]
@ -2454,10 +2473,10 @@ class UsersController < ApplicationController
# user_org_ids = User.current.organizations.map {|o| o.id} # user_org_ids = User.current.organizations.map {|o| o.id}
if(params[:type].blank? || params[:type] == "1") # 我的资源 if(params[:type].blank? || params[:type] == "1") # 我的资源
# 修正:我的资源库的话,那么应该是我上传的所有资源加上,我加入的课程、项目、组织的所有资源 # 修正:我的资源库的话,那么应该是我上传的所有资源加上,我加入的课程、项目、组织的所有资源
@attachments = get_my_resources(params[:id], user_course_ids, user_project_ids) @attachments = get_my_resources(params[:id], user_course_ids, user_project_ids, params[:order])
elsif params[:type] == "6" # 公共资源 elsif params[:type] == "6" # 公共资源
# 公共资源库:所有公开资源或者我上传的私有资源 # 公共资源库:所有公开资源或者我上传的私有资源
@attachments = get_public_resources(user_course_ids, user_project_ids) @attachments = get_public_resources(user_course_ids, user_project_ids, params[:order])
end end
@type = params[:type] @type = params[:type]
@limit = 10 @limit = 10
@ -2490,10 +2509,10 @@ class UsersController < ApplicationController
# user_org_ids = User.current.organizations.map {|o| o.id} # user_org_ids = User.current.organizations.map {|o| o.id}
@attachments = Attachment.where("((author_id = #{params[:id]} and is_publish = 1 and container_id is not null and container_type in('Project','OrgSubfield','Principal','Course','Issue','Document','Message','News','StudentWorkScore','HomewCommon')) "+ @attachments = Attachment.where("((author_id = #{params[:id]} and is_publish = 1 and container_id is not null and container_type in('Project','OrgSubfield','Principal','Course','Issue','Document','Message','News','StudentWorkScore','HomewCommon')) "+
"or (container_type = 'Course' and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')}) and is_publish = 1 and container_id is not null)" + "or (container_type = 'Course' and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')}) and is_publish = 1 and container_id is not null)" +
"or (container_type = 'Project' and container_id in (#{user_project_ids.empty? ? '0': user_project_ids.join(',')}) and is_publish = 1 and container_id is not null)) and (filename like :p)" ,:p => search).order("created_on desc") "or (container_type = 'Project' and container_id in (#{user_project_ids.empty? ? '0': user_project_ids.join(',')}) and is_publish = 1 and container_id is not null)) and (filename like :p)" ,:p => search).order("#{params[:order].nil? ? 'created_on' : params[:order]} desc")
elsif params[:type] == "6" # 公共资源 elsif params[:type] == "6" # 公共资源
# 公共资源库:所有公开资源或者我上传的私有资源 # 公共资源库:所有公开资源或者我上传的私有资源
@attachments = get_public_resources(user_course_ids, user_project_ids) @attachments = get_public_resources(user_course_ids, user_project_ids, params[:order])
end end
@type = params[:type] @type = params[:type]
@limit = 10 @limit = 10
@ -2563,57 +2582,71 @@ class UsersController < ApplicationController
# 根据资源关键字进行搜索 # 根据资源关键字进行搜索
def resource_search def resource_search
search = "%#{params[:search].strip.downcase}%" @order, @b_sort = params[:order] || "created_on", params[:sort] || "desc"
@score = @b_sort == "desc" ? "asc" : "desc"
@user = User.current
switch_search = params[:search].nil? ? " " : params[:search]
search = "%#{switch_search.strip.downcase}%"
user_course_ids = User.current.courses.map { |c| c.id} user_course_ids = User.current.courses.map { |c| c.id}
user_project_ids = User.current.projects.map {|p| p.id} user_project_ids = User.current.projects.map {|p| p.id}
# user_org_ids = User.current.organizations.map {|o| o.id} # user_org_ids = User.current.organizations.map {|o| o.id}
if(params[:type].nil? || params[:type].blank? || params[:type] == "1" || params[:type] == 'all') # 全部 if(params[:type].nil? || params[:type].blank? || params[:type] == "1" || params[:type] == 'all') # 全部
if User.current.id.to_i == params[:id].to_i if params[:status] == "2"
@attachments = Attachment.where("(author_id = #{params[:id]} and container_type = 'Course') or (container_type = 'Course' and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')})) and (filename like :p) ",:p=>search).order("#{params[:order].nil? ? 'created_on' : params[:order]} #{@score}")
@attachments = Attachment.where("((author_id = #{params[:id]} and is_publish = 1 and container_id is not null and container_type in('Project','OrgSubfield','Principal','Course','Issue','Document','Message','News','StudentWorkScore','HomewCommon')) "+ elsif params[:status] == "3"
"or (container_type = 'Course' and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')}) and is_publish = 1 and container_id is not null)" + @attachments = Attachment.where("author_id = #{params[:id]} and container_type = 'Project' and (filename like :p)",:p=>search).order("#{params[:order].nil? ? 'created_on' : params[:order]} #{@score}")
"or (container_type = 'Project' and container_id in (#{user_project_ids.empty? ? '0': user_project_ids.join(',')}) and is_publish = 1 and container_id is not null)) and (filename like :p)" ,:p => search).order("created_on desc") elsif params[:status] == "4"
@attachments = Attachment.where("author_id = #{params[:id]} and container_type in('Project','Issue','Document','Message','News','StudentWorkScore','HomewCommon') and (filename like :p)",:p=>search).order("#{params[:order].nil? ? 'created_on' : params[:order]} #{@score}")
elsif params[:status] == "5"
@attachments = Attachment.where("author_id = #{params[:id]} and container_type = 'Principal' and (filename like :p)",:p=>search).order("#{params[:order].nil? ? 'created_on' : params[:order]} #{@score}")
else else
user_course_ids = User.find(params[:id]).courses.visible.map { |c| c.id} #如果课程私有资源,那么要看这个资源的课程是不是在 这个user的所有我可见的课程中 # 公共资源库:所有公开资源或者我上传的私有资源
@attachments = Attachment.where("((author_id = #{params[:id]} and is_public = 1 and container_type in" + get_my_resources_search(@user.id, user_course_ids, user_project_ids, @order, @score, search)
" ('Project','Principal','Course','Issue','Document','Message','News','StudentWorkScore','HomewCommon'))"+
" or (container_type = 'Course' and is_public = 1 and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')})) )" +
" and (filename like :p) ",:p=>search).order("created_on desc")
end end
elsif params[:type] == "2" #课程资源 elsif params[:type] == "2" #课程资源
if User.current.id.to_i == params[:id].to_i if User.current.id.to_i == params[:id].to_i
user_course_ids = User.current.courses.map { |c| c.id} user_course_ids = User.current.courses.map { |c| c.id}
@attachments = Attachment.where("(author_id = #{params[:id]} and container_type = 'Course') or (container_type = 'Course' and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')})) and (filename like :p) ",:p=>search).order("created_on desc") @attachments = Attachment.where("(author_id = #{params[:id]} and container_type = 'Course') or (container_type = 'Course' and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')})) and (filename like :p) ",:p=>search).order("#{params[:order].nil? ? 'created_on' : params[:order]} #{@score}")
else else
user_course_ids = User.find(params[:id]).courses.visible.map { |c| c.id} #如果课程私有资源,那么要看这个资源的课程是不是在 这个user的所有我可见的课程中 user_course_ids = User.find(params[:id]).courses.visible.map { |c| c.id} #如果课程私有资源,那么要看这个资源的课程是不是在 这个user的所有我可见的课程中
@attachments = Attachment.where("((author_id = #{params[:id]} and is_public = 1 and container_type = 'Course') "+ @attachments = Attachment.where("((author_id = #{params[:id]} and is_public = 1 and container_type = 'Course') "+
"or (container_type = 'Course' and is_public = 1 and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')})) )"+ "or (container_type = 'Course' and is_public = 1 and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')})) )"+
" and (filename like :p) ",:p=>search).order("created_on desc") " and (filename like :p) ",:p=>search).order("#{params[:order].nil? ? 'created_on' : params[:order]} #{@score}")
end end
elsif params[:type] == "3" # 项目资源 elsif params[:type] == "3" # 项目资源
if User.current.id.to_i == params[:id].to_i if User.current.id.to_i == params[:id].to_i
@attachments = Attachment.where("author_id = #{params[:id]} and container_type = 'Project' and (filename like :p)",:p=>search).order("created_on desc") @attachments = Attachment.where("author_id = #{params[:id]} and container_type = 'Project' and (filename like :p)",:p=>search).order("#{params[:order].nil? ? 'created_on' : params[:order]} #{@score}")
else else
@attachments = Attachment.where("author_id = #{params[:id]} and is_public = 1 and container_type = 'Project' and (filename like :p) ",:p=>search).order("created_on desc") @attachments = Attachment.where("author_id = #{params[:id]} and is_public = 1 and container_type = 'Project' and (filename like :p) ",:p=>search).order("#{params[:order].nil? ? 'created_on' : params[:order]} #{@score}")
end end
elsif params[:type] == "4" # 附件 elsif params[:type] == "4" # 附件
if User.current.id.to_i == params[:id].to_i if User.current.id.to_i == params[:id].to_i
@attachments = Attachment.where("author_id = #{params[:id]} and container_type in('Project','Issue','Document','Message','News','StudentWorkScore','HomewCommon') and (filename like :p)",:p=>search).order("created_on desc") @attachments = Attachment.where("author_id = #{params[:id]} and container_type in('Project','Issue','Document','Message','News','StudentWorkScore','HomewCommon') and (filename like :p)",:p=>search).order("#{params[:order].nil? ? 'created_on' : params[:order]} #{@score}")
else else
@attachments = Attachment.where("author_id = #{params[:id]} and is_public = 1 and container_type in('Issue','Document','Message','News','StudentWorkScore','HomewCommon') and (filename like :p)",:p=>search).order("created_on desc") @attachments = Attachment.where("author_id = #{params[:id]} and is_public = 1 and container_type in('Issue','Document','Message','News','StudentWorkScore','HomewCommon') and (filename like :p)",:p=>search).order("#{params[:order].nil? ? 'created_on' : params[:order]} #{@score}")
end end
elsif params[:type] == "5" # 用户资源 elsif params[:type] == "5" # 用户资源
if User.current.id.to_i == params[:id].to_i if User.current.id.to_i == params[:id].to_i
@attachments = Attachment.where("author_id = #{params[:id]} and container_type = 'Principal' and (filename like :p)",:p=>search).order("created_on desc") @attachments = Attachment.where("author_id = #{params[:id]} and container_type = 'Principal' and (filename like :p)",:p=>search).order("#{params[:order].nil? ? 'created_on' : params[:order]} #{@score}")
else else
@attachments = Attachment.where("author_id = #{params[:id]} and is_public = 1 and container_type = 'Principal' and (filename like :p)",:p=>search).order("created_on desc") @attachments = Attachment.where("author_id = #{params[:id]} and is_public = 1 and container_type = 'Principal' and (filename like :p)",:p=>search).order("#{params[:order].nil? ? 'created_on' : params[:order]} #{@score}")
end end
elsif params[:type] == "6" # 全部资源 elsif params[:type] == "6" # 全部资源
if params[:status] == "2"
@attachments = Attachment.where("(author_id = #{params[:id]} and container_type = 'Course') or (container_type = 'Course' and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')})) and (filename like :p) ",:p=>search).order("#{params[:order].nil? ? 'created_on' : params[:order]} #{@score}")
elsif params[:status] == "3"
@attachments = Attachment.where("container_type = 'Project' and (filename like :p)",:p=>search).order("#{params[:order].nil? ? 'created_on' : params[:order]} #{@score}")
elsif params[:status] == "4"
@attachments = Attachment.where("container_type in('Project','Issue','Document','Message','News','StudentWorkScore','HomewCommon') and (filename like :p)",:p=>search).order("#{params[:order].nil? ? 'created_on' : params[:order]} #{@score}")
elsif params[:status] == "5"
@attachments = Attachment.where("container_type = 'Principal' and (filename like :p)",:p=>search).order("#{params[:order].nil? ? 'created_on' : params[:order]} #{@score}")
else
# 公共资源库:所有公开资源或者我上传的私有资源 # 公共资源库:所有公开资源或者我上传的私有资源
@attachments = Attachment.where("((is_publish = 1 and container_id is not null and container_type in('Project','OrgSubfield','Principal','Course')) "+ @attachments = Attachment.where("is_publish = 1 and is_public = 1 and container_id is not null and container_type in('Project','OrgSubfield','Principal','Course') and (filename like :p)" ,:p => search).order("created_on desc")
"or (container_type = 'Course' and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')}) and is_publish = 1 and container_id is not null)" + end
"or (container_type = 'Project' and container_id in (#{user_project_ids.empty? ? '0': user_project_ids.join(',')}) and is_publish = 1 and container_id is not null)) and (filename like :p)" ,:p => search).order("created_on desc")
end end
@status = params[:status]
@type = params[:type]
@type = params[:type] @type = params[:type]
@limit = 25 @limit = 25
@is_remote = true @is_remote = true

@ -2951,3 +2951,33 @@ def user_url_in_org(user_id)
return "https://www.trustie.net/users/" + user_id.to_s return "https://www.trustie.net/users/" + user_id.to_s
end end
end end
def logout_url_without_domain
if Rails.env.development?
return "http://localhost:3000/logout"
elsif Rails.env.test?
return "https://test.forge.trustie.net/logout"
else
return "https://www.trustie.net/logout"
end
end
def signin_url_without_domain
if Rails.env.development?
return "http://localhost:3000/login?login=true"
elsif Rails.env.test?
return "https://test.forge.trustie.net/login?login=true"
else
return "https://www.trustie.net/login?login=true"
end
end
def register_url_without_domain
if Rails.env.development?
return "http://localhost:3000/login?login=false"
elsif Rails.env.test?
return "https://test.forge.trustie.net/login?login=false"
else
return "https://www.trustie.net/login?login=false"
end
end

@ -71,6 +71,11 @@ module CoursesHelper
project.members.count project.members.count
end end
# 统计课程中作品的数量
def student_works_num course
StudentWork.find_by_sql("SELECT * FROM student_works WHERE homework_common_id IN (SELECT id FROM homework_commons WHERE course_id = '#{course.id}')").count
end
# 返回教师数量即roles表中定义的Manager # 返回教师数量即roles表中定义的Manager
def teacherCount project def teacherCount project
project ? project.members.count - studentCount(project).to_i : 0 project ? project.members.count - studentCount(project).to_i : 0
@ -601,6 +606,24 @@ module CoursesHelper
Course.tagged_with(tag_name).order('updated_at desc') Course.tagged_with(tag_name).order('updated_at desc')
end end
#分班下拉框
def course_group_option course
type = []
option1 = []
option1 << "暂无"
option1 << 0
type << option1
unless course.course_groups.nil?
course.course_groups.each do |cg|
option = []
option << cg.name
option << cg.id
type << option
end
end
type
end
#课程实践年份下拉框 #课程实践年份下拉框
def course_time_option year def course_time_option year
type = [] type = []
@ -762,7 +785,7 @@ module CoursesHelper
return[] unless course return[] unless course
result = [] result = []
course.attachments.each do |attachment| course.attachments.each do |attachment|
if attachment.is_public? ||User.current == attachment.author ||User.current.allowed_to?(:as_teacher,Course.find(attachment.container_id))|| (User.current.member_of_course?(course) && attachment.is_publish == 1) || User.current.admin? if (attachment.is_public? && attachment.is_publish == 1) ||User.current == attachment.author ||User.current.allowed_to?(:as_teacher,course)|| (User.current.member_of_course?(course) && attachment.is_publish == 1) || User.current.admin?
result << attachment result << attachment
end end
end end

@ -121,7 +121,8 @@ module FilesHelper
def visable_attachemnts attachments def visable_attachemnts attachments
result = [] result = []
attachments.each do |attachment| attachments.each do |attachment|
if attachment.is_public? || if (attachment.is_public? && attachment.container_type != "Course") ||
(attachment.is_public? && attachment.container_type == "Course" && attachment.is_publish == 1)||
(attachment.container_type == "Project" && User.current.member_of?(attachment.project)) || (attachment.container_type == "Project" && User.current.member_of?(attachment.project)) ||
(attachment.container_type == "Course" && User.current.allowed_to?(:as_teacher,Course.find(attachment.container_id)))|| (attachment.container_type == "Course" && User.current.allowed_to?(:as_teacher,Course.find(attachment.container_id)))||
(attachment.container_type == "Course" && User.current.member_of_course?(Course.find(attachment.container_id)) && attachment.is_publish == 1)|| (attachment.container_type == "Course" && User.current.member_of_course?(Course.find(attachment.container_id)) && attachment.is_publish == 1)||

@ -62,7 +62,7 @@ module UsersHelper
when 'Course' when 'Course'
result = current_time_and_term_resource content result = current_time_and_term_resource content
when 'Project' when 'Project'
result = content.name result = content.name + "(" + content.id.to_s + ")"
when 'Issue' when 'Issue'
result = content.subject result = content.subject
when 'Message' when 'Message'

@ -499,6 +499,12 @@ class Attachment < ActiveRecord::Base
result result
end end
def self.attach_filesex_public(obj, attachments,attachment_type, is_public)
result = obj.save_attachmentsex_public(attachments, User.current,attachment_type, is_public)
obj.attach_saved_attachments
result
end
def self.latest_attach(attachments, filename) def self.latest_attach(attachments, filename)
attachments.sort_by(&:created_on).reverse.detect { attachments.sort_by(&:created_on).reverse.detect {
|att| att.filename.downcase == filename.downcase |att| att.filename.downcase == filename.downcase

@ -2,8 +2,8 @@ class PraiseTread < ActiveRecord::Base
attr_accessible :user_id,:praise_tread_object_id,:praise_tread_object_type,:praise_or_tread attr_accessible :user_id,:praise_tread_object_id,:praise_tread_object_type,:praise_or_tread
belongs_to :user belongs_to :user
belongs_to :praise_tread_object, polymorphic: true belongs_to :praise_tread_object, polymorphic: true
after_create :be_user_score #after_create :be_user_score
after_destroy :down_user_score #after_destroy :down_user_score
include UserScoreHelper include UserScoreHelper
def self.find_object_by_type_and_id(type,id) def self.find_object_by_type_and_id(type,id)
@obj = nil @obj = nil

@ -0,0 +1,64 @@
<h3><%=l(:label_course_resource_list)%></h3>
<div class="autoscroll">
<table class="list" style="width: 100%;table-layout: fixed">
<thead>
<tr>
<th style="width: 60px;">
资源名称
</th>
<th style="width: 30px;">
资源大小
</th>
<th style="width: 25px;">
资源类型
</th>
<th style="width: 23px;">
上传时间
</th>
<th style="width: 15px;">
下载次数
</th>
<th style="width: 20px;">
上传者
</th>
<th style="width: 35px;">
所属课程
</th>
</tr>
</thead>
<tbody>
<% @resource.each do |resource| %>
<tr class="<%= cycle("odd", "even") %>">
<td style="text-align: left;">
<%= link_to truncate(resource.filename, :length => 18), download_named_attachment_path(resource.id, resource.filename ), :title => resource.filename,:class=>'resourcesBlack'%>
</td>
<td style=" text-align: center;">
<%= number_to_human_size(resource.filesize)%>
</td>
<td style=" text-align: center;">
课程资源
</td>
<td style=" text-align: center;">
<%= format_date(resource.created_on)%>
</td>
<td style=" text-align: center;">
<%= resource.downloads %>
</td>
<td style=" text-align: center;">
<%= link_to(User.find(resource.author_id).realname, user_path(User.find(resource.author_id)) ) %>
</td>
<td style=" text-align: center;">
<%=link_to truncate(Course.find(resource.container_id).name, :length => 10), course_path(Course.find(resource.container_id)), :title => Course.find(resource.container_id).name, :class => "hidden fl w170" %>
</td>
</tr>
<% end %>
</tbody>
</table>
</div>
<div class="pagination">
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false %>
</div>

@ -0,0 +1,75 @@
<h3>
<%=l(:label_excellent_courses_list)%>
</h3>
<div class="autoscroll">
<table class="list" style="width: 100%;table-layout: fixed">
<thead>
<tr>
<th style="width: 25px;">
序号
</th>
<th style="width: 120px;">
课程名
</th>
<th style="width: 50px;">
主讲老师
</th>
<th style="width: 30px;">
学生数
</th>
<th style="width: 25px;">
作业数
</th>
<th style="width: 25px;">
作品数
</th>
<th style="width: 25px;">
资源数
</th>
<th style="width: 70px;">
帖子数
</th>
<th style="width: 70px;">
动态数
</th>
</tr>
</thead>
<tbody>
<% @courses.each do |course| %>
<tr class="<%= cycle("odd", "even") %>">
<td style="text-align: center;">
<%= course.id %>
</td>
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="name" title='<%=course.name%>'>
<span>
<%= link_to(course.name, course_path(course.id)) %>
</span>
</td>
<td align="center">
<%= link_to(course.try(:teacher).try(:realname).truncate(6, omission: '...'), user_path(course.teacher)) %>
</td>
<td align="center">
<%= studentCount(course) %>
</td>
<td class="center">
<%= course.homework_commons.count%>
</td>
<td class="center">
<%= student_works_num(course) %>
</td>
<td class="center">
<%= visable_attachemnts_incourse(course).count%>
</td>
<td class="center">
<%= course.boards.first.topics.count + Message.where("board_id =? and parent_id is not ?", course.boards.first.id, nil).count %>
</td>
<td class="center">
<%= course.course_activities.count%>
</td>
</tr>
<% end %>
</tbody>
</table>
</div>

@ -0,0 +1,64 @@
<h3><%=l(:label_project_resource_list)%></h3>
<div class="autoscroll">
<table class="list" style="width: 100%;table-layout: fixed">
<thead>
<tr>
<th style="width: 60px;">
资源名称
</th>
<th style="width: 30px;">
资源大小
</th>
<th style="width: 25px;">
资源类型
</th>
<th style="width: 23px;">
上传时间
</th>
<th style="width: 15px;">
下载次数
</th>
<th style="width: 20px;">
上传者
</th>
<th style="width: 35px;">
所属项目
</th>
</tr>
</thead>
<tbody>
<% @pro_resource.each do |pro_resource| %>
<tr class="<%= cycle("odd", "even") %>">
<td style="text-align: left;">
<%= link_to truncate(pro_resource.filename, :length => 18), download_named_attachment_path(pro_resource.id, pro_resource.filename ), :title => pro_resource.filename,:class=>'resourcesBlack'%>
</td>
<td style=" text-align: center;">
<%= number_to_human_size(pro_resource.filesize)%>
</td>
<td style=" text-align: center;">
项目资源
</td>
<td style=" text-align: center;">
<%= format_date(pro_resource.created_on)%>
</td>
<td style=" text-align: center;">
<%= pro_resource.downloads %>
</td>
<td style=" text-align: center;">
<%= link_to(User.find(pro_resource.author_id).realname, user_path(User.find(pro_resource.author_id)) ) %>
</td>
<td style=" text-align: center;">
<%=link_to truncate(Project.find(pro_resource.container_id).name, :length => 10), project_path(Project.find(pro_resource.container_id)), :title => Project.find(pro_resource.container_id).name, :class => "hidden fl w170" %>
</td>
</tr>
<% end %>
</tbody>
</table>
</div>
<div class="pagination">
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false %>
</div>

@ -10,7 +10,7 @@
<input type="hidden" name="blog_comment[title]" id="reply_subject"> <input type="hidden" name="blog_comment[title]" id="reply_subject">
<div nhname='toolbar_container_<%= reply.id%>'></div> <div nhname='toolbar_container_<%= reply.id%>'></div>
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= reply.id%>' name="blog_comment[content]"></textarea> <textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= reply.id%>' name="blog_comment[content]"></textarea>
<a id="new_message_submit_btn_<%= reply.id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:2px;">发送</a> <a id="new_message_submit_btn_<%= reply.id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:2px;">发送</a>
<div class="cl"></div> <div class="cl"></div>
<p nhname='contentmsg_<%= reply.id%>'></p> <p nhname='contentmsg_<%= reply.id%>'></p>
<% end%> <% end%>

@ -200,7 +200,7 @@
<input type="hidden" name="user_activity_id" value="<%=user_activity_id%>"> <input type="hidden" name="user_activity_id" value="<%=user_activity_id%>">
<div nhname='toolbar_container_<%= user_activity_id%>'></div> <div nhname='toolbar_container_<%= user_activity_id%>'></div>
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="blog_comment[content]"></textarea> <textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="blog_comment[content]"></textarea>
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a> <a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
<div class="cl"></div> <div class="cl"></div>
<p nhname='contentmsg_<%= user_activity_id%>'></p> <p nhname='contentmsg_<%= user_activity_id%>'></p>
<% end%> <% end%>

@ -24,7 +24,8 @@
<ul class="st_box_top"> <ul class="st_box_top">
<li class="ml50" style="padding-right: 5px;"><a href="">姓名</a></li> <li class="ml50" style="padding-right: 5px;"><a href="">姓名</a></li>
<li class="ml10" style="padding-right: 15px;"><a href="">学号</a></li> <li class="ml10" style="padding-right: 15px;"><a href="">学号</a></li>
<li class="ml358"> <li style="padding-right: 55px; margin-left: 260px;"><a href="">分班</a></li>
<li style="margin-left: 25px;">
<%= link_to '作业积分', member_score_sort_course_path(:sort_by => (@score_sort_by == "desc" ? "asc" : "desc"), :group_id => (@group ? @group.id : 0),:search_name => (@search_name ? @search_name : nil)) ,:result => members,method: 'get', remote: true%> <%= link_to '作业积分', member_score_sort_course_path(:sort_by => (@score_sort_by == "desc" ? "asc" : "desc"), :group_id => (@group ? @group.id : 0),:search_name => (@search_name ? @search_name : nil)) ,:result => members,method: 'get', remote: true%>
<% if @score_sort_by == 'desc' %> <% if @score_sort_by == 'desc' %>
<a id="pic" href="javascript:" class= "st_down"></a> <a id="pic" href="javascript:" class= "st_down"></a>
@ -58,11 +59,31 @@
<li><%= link_to("#{l(:label_bidding_user_studentcode)}<span >#{member.user.user_extensions.student_id}</span>".html_safe,user_path(member.user)) %></li> <li><%= link_to("#{l(:label_bidding_user_studentcode)}<span >#{member.user.user_extensions.student_id}</span>".html_safe,user_path(member.user)) %></li>
<% end%> <% end%>
</ul> </ul>
<% if User.current.allowed_to?(:as_teacher, @course) || User.current.admin? %>
<% if @course.course_groups.nil? || @group %>
<div class="select-class-option fl" style="margin-left: 105px;">
<span style="width: 100px; text-align: center; float: left;" class="hidden"><%=member.course_group_id == 0 ? "暂无" : member.course_group.name %></span>
</div>
<% else %>
<%= form_tag({:controller => 'courses', :action => 'teacher_assign_group', :id => @course.id,:user_id => member.user_id},:remote=>'true', :method => 'post', :id=>"join_group_form_#{member.id}", :class => 'query_form') do %>
<div class="select-class-option fl" style="margin-left: 105px;"><span style="width: 100px; text-align: center; float: left;" class="hidden"><%=member.course_group_id == 0 ? "暂无" : member.course_group.name %></span>
<a style="display: inline-block;" href="javascript:void(0)" class="pic_edit2 ml5"></a>
</div>
<%= select( :name,:group_id, course_group_option(@course),
{ :include_blank => false,:selected => member.course_group_id},
{:onchange=>"join_group_function('#join_group_form_#{member.id}');", :id =>"course_group_id", :name => "course_group_id",:class=>"w125 undis class-edit fl", :style => "margin-left: 105px;"}) %>
<% end %>
<% end %>
<% else %>
<div class="select-class-option fl" style="margin-left: 105px;">
<span style="width: 100px; text-align: center; float: left;" class="hidden"><%=member.course_group_id == 0 ? "暂无" : member.course_group.name %></span>
</div>
<% end %>
<%= link_to format("%0.2f",member.score.nil? ? 0 : member.score.to_s), { <%= link_to format("%0.2f",member.score.nil? ? 0 : member.score.to_s), {
:action => 'show_member_score', :action => 'show_member_score',
:member_id => member.id, :member_id => member.id,
:remote => true}, :remote => true},
:class => 'ml258 c_red' %> :class => 'ml25 c_red' %>
<span class="fr mr15 c_grey"><%= format_date(member.created_on)%></span> <span class="fr mr15 c_grey"><%= format_date(member.created_on)%></span>
<%= call_hook(:view_projects_settings_members_table_row, { :course => @course, :member => member}) %> <%= call_hook(:view_projects_settings_members_table_row, { :course => @course, :member => member}) %>
</div> </div>
@ -79,3 +100,40 @@
</p> </p>
<% end%> <% end%>
<script>
$(document).ready(function(){
/*$(".select-class-option").mouseover(function(){
$(this).children(".pic_edit2").css("display","inline-block");
});
$(".select-class-option").mouseout(function(){
$(this).children(".pic_edit2").css("display","none");
});*/
$(".pic_edit2").click(function(){
$(this).parent().hide();
$(this).parent().next().show();
});
$(".class-edit").blur(function(){
$(this).hide();
$(this).prev().show();
var editValue = $(this).children("option:selected").text();
$(this).prev().children(":first").text(editValue);
});
function stopPropagation(e) {
if (e.stopPropagation)
e.stopPropagation();
else
e.cancelBubble = true;
};
$(document).bind('click',function(){
$('.class-edit').css('display','none');
$('.select-class-option').show();
});
$('.class-edit,.pic_edit2').bind('click',function(e){
stopPropagation(e);
});
});
function join_group_function(id){
$(id).submit();
}
</script>

@ -192,7 +192,7 @@
<input type="hidden" name="blog_comment[locked]" value="0"> <input type="hidden" name="blog_comment[locked]" value="0">
<div nhname='toolbar_container_<%= @article.id%>'></div> <div nhname='toolbar_container_<%= @article.id%>'></div>
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= @article.id%>' name="blog_comment[content]"></textarea> <textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= @article.id%>' name="blog_comment[content]"></textarea>
<a id="new_message_submit_btn_<%= @article.id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:2px;">发送</a> <a id="new_message_submit_btn_<%= @article.id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:2px;">发送</a>
<div class="cl"></div> <div class="cl"></div>
<p nhname='contentmsg_<%= @article.id%>'></p> <p nhname='contentmsg_<%= @article.id%>'></p>
<% end%> <% end%>

@ -0,0 +1 @@
$("#st_groups").html("<%=escape_javascript(render :partial => 'new_groups_name', :locals => {:course_groups => @course_groups}) %>");

@ -74,7 +74,7 @@
<%= render :partial => 'attachments/issue_reply', :locals => {:container => @issue} %> <%= render :partial => 'attachments/issue_reply', :locals => {:container => @issue} %>
</div> </div>
<span nhname='contentmsg_<%= @issue.id %>' class="fl"></span> <span nhname='contentmsg_<%= @issue.id %>' class="fl"></span>
<a id="new_message_submit_btn_<%= @issue.id %>" href="javascript:void(0)" class="blue_n_btn fr mt5" style="display:none;">发送</a> <a id="new_message_submit_btn_<%= @issue.id %>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr mt5" style="display:none;">发送</a>
<div class="cl"></div> <div class="cl"></div>
<% end %> <% end %>
</div> </div>

@ -16,7 +16,7 @@
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= @issue.id%>' name="notes"></textarea> <textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= @issue.id%>' name="notes"></textarea>
<div class="cl"></div> <div class="cl"></div>
<span nhname='contentmsg_<%= @issue.id%>' class="fl"></span> <span nhname='contentmsg_<%= @issue.id%>' class="fl"></span>
<a id="new_message_submit_btn_<%= @issue.id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a> <a id="new_message_submit_btn_<%= @issue.id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
<div class="cl"></div> <div class="cl"></div>
<% end %> <% end %>
</div> </div>

@ -100,7 +100,7 @@
</li> </li>
<!--<li><a href="javascript:void(0);" class="menuGrey">账号设置</a> </li>--> <!--<li><a href="javascript:void(0);" class="menuGrey">账号设置</a> </li>-->
<li> <li>
<%= link_to "退出",signout_path,:class => "menuGrey",:method => "post"%> <%= link_to "退出",logout_url_without_domain,:class => "menuGrey",:method => "post"%>
</li> </li>
</ul> </ul>
</li> </li>

@ -77,10 +77,10 @@
</div> </div>
<div id="loginInButton" class="fr ml20"> <div id="loginInButton" class="fr ml20">
<a href="<%= signin_path(:login=>true) %>" class="c_white db">登录</a> <a href="<%= signin_url_without_domain %>" class="c_white db">登录</a>
</div> </div>
<div id="loginSignButton" class="fr"> <div id="loginSignButton" class="fr">
<a href="<%= signin_path(:login=>false) %>" class="c_white db">注册</a> <a href="<%= register_url_without_domain %>" class="c_white db">注册</a>
</div> </div>
</div> </div>

@ -2,7 +2,7 @@
<li class="homepageLeftMenuCoursesLine pr"> <li class="homepageLeftMenuCoursesLine pr">
<% is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,course)) %> <% is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,course)) %>
<%= link_to course.name, course_path(course.id,:host=>Setting.host_course), :class => "coursesLineGrey hidden #{course_endTime_timeout?(course) ? 'c_dark_grey' : ''}", <%= link_to course.name, course_path(course.id,:host=>Setting.host_course), :class => "coursesLineGrey hidden #{course_endTime_timeout?(course) ? 'c_dark_grey' : ''}",
:id => "show_course_#{course.id}",:title => (course.is_public? ? "公开课程:":"私有课程:")+course.name+""+current_time_and_term(course)+""%> :id => "show_course_#{course.id}", :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 %> <% count = ShieldActivity.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'%>"> <ul class="<%= count > 0 ? 'shild shildP':'subNavArrow'%>">
<li> <li>

@ -1,7 +1,7 @@
<% projects.each do |project|%> <% projects.each do |project|%>
<li class="homepageLeftMenuCoursesLine pr"> <li class="homepageLeftMenuCoursesLine pr">
<% count = ShieldActivity.where("container_type='User' and container_id=#{user.id} and shield_type='Project' and shield_id=#{project.id}").count %> <% 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), :class => "coursesLineGrey hidden",:id => "show_project_#{project.id}", :title => (project.is_public? ? "公开项目:":"私有项目:") + project.name%> <%= link_to project.name, project_path(project.id,:host=>Setting.host_name), :target => '_blank', :class => "coursesLineGrey hidden",:id => "show_project_#{project.id}", :title => (project.is_public? ? "公开项目:":"私有项目:") + project.name%>
<ul class="<%= count > 0 ? 'shild shildP':'subNavArrow'%>"> <ul class="<%= count > 0 ? 'shild shildP':'subNavArrow'%>">
<li> <li>
<ul class="subNavMenu boxShadow"> <ul class="subNavMenu boxShadow">

@ -250,6 +250,7 @@
</div><!--项目标签 end--> </div><!--项目标签 end-->
<!--课程推荐--> <!--课程推荐-->
<%= render :partial => 'courses/recommendation', :locals => {:course => @course} %> <%= render :partial => 'courses/recommendation', :locals => {:course => @course} %>
<div class="fontGrey5 mt10 ml10 mb10">访问计数 <%= @course.visits.to_i %></div>
</div><!--LSide end--> </div><!--LSide end-->
<div id="RSide" class="fl"> <div id="RSide" class="fl">

@ -46,7 +46,7 @@
<li class="navOrgMenu fr" id="orgUser" style="cursor:pointer;"> <li class="navOrgMenu fr" id="orgUser" style="cursor:pointer;">
<%= link_to image_tag(url_to_avatar(User.current),:width => '23',:height => '23'), request.local? ? user_path(User.current):("https://www.trustie.net/users/" + User.current.id.to_s),:alt => '用户头像', :target => '_blank',:style=>'border-radius:3px; vertical-align:top; margin-top:3px; display:inline-block; margin-right:3px;' %> <%= link_to image_tag(url_to_avatar(User.current),:width => '23',:height => '23'), request.local? ? user_path(User.current):("https://www.trustie.net/users/" + User.current.id.to_s),:alt => '用户头像', :target => '_blank',:style=>'border-radius:3px; vertical-align:top; margin-top:3px; display:inline-block; margin-right:3px;' %>
<%= link_to User.current, (request.local? || request.subdomain.blank?) ? user_path(User.current):("https://www.trustie.net/users/" + User.current.id.to_s),:id => "orgUserName",:class => 'fontGrey2 f14 mr5',:target => '_blank' %> <%= link_to User.current, (request.local? || request.subdomain.blank?) ? user_path(User.current):("https://www.trustie.net/users/" + User.current.id.to_s),:id => "orgUserName",:class => 'fontGrey2 f14 mr5',:target => '_blank' %>
<%= link_to "退出",(request.local? || request.subdomain.blank?) ? signout_path():"https://www.trustie.net/logout", :class =>"menuGrey", :method => 'post', :rel => "nofollow" %> <%= link_to "退出",logout_url_without_domain, :class =>"menuGrey", :method => 'post', :rel => "nofollow" %>
</li> </li>
<!--<li class="navOrgMenu fr"><%#=link_to User.current, user_path(User.current), :class => "linkGrey8 f14" %></li>--> <!--<li class="navOrgMenu fr"><%#=link_to User.current, user_path(User.current), :class => "linkGrey8 f14" %></li>-->
<% else %> <% else %>
@ -132,6 +132,7 @@
<div class="homepageLeftMenuContainer" id="sub_field_left_lists"> <div class="homepageLeftMenuContainer" id="sub_field_left_lists">
<%= render :partial => "organizations/org_left_subfield_list", :locals => {:organization => @organization} %> <%= render :partial => "organizations/org_left_subfield_list", :locals => {:organization => @organization} %>
</div> </div>
<div class="fontGrey5 mt10 ml20">访问计数 <%= @organization.visits.to_i %></div>
</div> </div>
<div class="homepageRight" style="margin-top:<%= (params[:show_homepage].nil? && User.current.logged?) ? '10px':'0px' %>;"> <div class="homepageRight" style="margin-top:<%= (params[:show_homepage].nil? && User.current.logged?) ? '10px':'0px' %>;">
<%= render_flash_messages %> <%= render_flash_messages %>

@ -158,9 +158,12 @@
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div><!--项目标签 end--> </div><!--项目标签 end-->
<div class="fontGrey5 mt10 ml10 mb10">访问计数 <%= @project.visits.to_i %></div>
</div> </div>
</div> </div>
<div id="RSide" class="fl"> <div id="RSide" class="fl">
<%= render_flash_messages %> <%= render_flash_messages %>
<%= yield %> <%= yield %>

@ -226,6 +226,7 @@
<div class="cl"></div> <div class="cl"></div>
</div> </div>
</div> </div>
<div class="fontGrey5 mt10 ml20">访问计数 <%= @user.visits.to_i %></div>
</div> </div>
<div class="homepageRight"> <div class="homepageRight">
<%= yield %> <%= yield %>

@ -61,7 +61,7 @@
<%= link_to @memo.author.name, user_path(@memo.author), :class => "linkBlue2", :target=> "_blank"%></div> <%= link_to @memo.author.name, user_path(@memo.author), :class => "linkBlue2", :target=> "_blank"%></div>
<div class="postDetailDate mb5"><%= format_date( @memo.created_at)%></div> <div class="postDetailDate mb5"><%= format_date( @memo.created_at)%></div>
<div class="cl"></div> <div class="cl"></div>
<div class="homepagePostIntro memo-content" id="message_description_<%= @memo.id %>" style="word-break: break-all; word-wrap:break-word;margin-bottom: 0px !important;" > <div class="homepagePostIntro memo-content" id="activity_description_<%= @memo.id %>" style="word-break: break-all; word-wrap:break-word;margin-bottom: 0px !important;" >
<%= @memo.content.html_safe%> <%= @memo.content.html_safe%>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
@ -95,8 +95,21 @@
</div> </div>
<div class="homepagePostReplyDes"> <div class="homepagePostReplyDes">
<div class="homepagePostReplyPublisher mt-4"><a href="<%=user_path(reply.author)%>" class="newsBlue mr10 f14"><%= reply.author.name%></a><%= format_date(reply.created_at) %></div> <div class="homepagePostReplyPublisher mt-4"><a href="<%=user_path(reply.author)%>" class="newsBlue mr10 f14"><%= reply.author.name%></a><%= format_date(reply.created_at) %></div>
<div class="homepagePostReplyContent"><%= reply.content.html_safe%></div> <div class="homepagePostReplyContent" id="activity_description_<%= reply.id %>"><%= reply.content.html_safe%></div>
</div> </div>
<script type="text/javascript">
$(function(){
$("#activity_description_<%= reply.id %> p,#activity_description__<%= reply.id %> span,#activity_description_<%= reply.id %> em").each(function(){
var postContent = $(this).html();
postContent = postContent.replace(/&nbsp;/g," ");
postContent= postContent.replace(/ {2}/g,"&nbsp; ");
postContent=postContent.replace(/&nbsp; &nbsp;/g,"&nbsp;&nbsp;&nbsp;");
postContent=postContent.replace(/&nbsp; /g,"&nbsp;&nbsp; ");
$(this).html(postContent);
});
description_show_hide(<%= reply.id %>);
});
</script>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<% end %> <% end %>
@ -113,7 +126,7 @@
<%= hidden_field_tag :quote,"",:required => false,:style => 'display:none' %> <%= hidden_field_tag :quote,"",:required => false,:style => 'display:none' %>
<div nhname='toolbar_container_<%= @memo.id%>'></div> <div nhname='toolbar_container_<%= @memo.id%>'></div>
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= @memo.id%>' name="memo[content]"></textarea> <textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= @memo.id%>' name="memo[content]"></textarea>
<a id="new_message_submit_btn_<%= @memo.id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a> <a id="new_message_submit_btn_<%= @memo.id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
<div class="cl"></div> <div class="cl"></div>
<p nhname='contentmsg_<%= @memo.id%>'></p> <p nhname='contentmsg_<%= @memo.id%>'></p>
<% end%> <% end%>
@ -126,7 +139,7 @@
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
$(function(){ $(function(){
$("#message_description_<%= @memo.id %> p,#message_description_<%= @memo.id %> span,#message_description_<%= @memo.id %> em").each(function(){ $("#activity_description_<%= @memo.id %> p,#activity_description__<%= @memo.id %> span,#activity_description_<%= @memo.id %> em").each(function(){
var postContent = $(this).html(); var postContent = $(this).html();
postContent = postContent.replace(/&nbsp;/g," "); postContent = postContent.replace(/&nbsp;/g," ");
postContent= postContent.replace(/ {2}/g,"&nbsp; "); postContent= postContent.replace(/ {2}/g,"&nbsp; ");
@ -134,5 +147,6 @@
postContent=postContent.replace(/&nbsp; /g,"&nbsp;&nbsp; "); postContent=postContent.replace(/&nbsp; /g,"&nbsp;&nbsp; ");
$(this).html(postContent); $(this).html(postContent);
}); });
description_show_hide(<%= @memo.id %>);
}); });
</script> </script>

@ -8,7 +8,7 @@
<input type="hidden" name="reply[subject]" id="reply_subject"> <input type="hidden" name="reply[subject]" id="reply_subject">
<div nhname='toolbar_container_<%= reply.id%>'></div> <div nhname='toolbar_container_<%= reply.id%>'></div>
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= reply.id%>' name="reply[content]"></textarea> <textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= reply.id%>' name="reply[content]"></textarea>
<a id="new_message_submit_btn_<%= reply.id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a> <a id="new_message_submit_btn_<%= reply.id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
<div class="cl"></div> <div class="cl"></div>
<p nhname='contentmsg_<%= reply.id%>'></p> <p nhname='contentmsg_<%= reply.id%>'></p>
<% end%> <% end%>

@ -7,7 +7,7 @@
<input type="hidden" name="org_document_comment[title]" id="reply_subject"> <input type="hidden" name="org_document_comment[title]" id="reply_subject">
<div nhname='toolbar_container_<%= reply.id%>'></div> <div nhname='toolbar_container_<%= reply.id%>'></div>
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= reply.id%>' name="org_document_comment[content]"></textarea> <textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= reply.id%>' name="org_document_comment[content]"></textarea>
<a id="new_message_submit_btn_<%= reply.id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:2px;">发送</a> <a id="new_message_submit_btn_<%= reply.id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:2px;">发送</a>
<div class="cl"></div> <div class="cl"></div>
<p nhname='contentmsg_<%= reply.id%>'></p> <p nhname='contentmsg_<%= reply.id%>'></p>
<% end%> <% end%>

@ -47,7 +47,7 @@
<% end%> <% end%>
<div class="cl"></div> <div class="cl"></div>
<% if activity.homework_type == 3 && activity.homework_detail_group.base_on_project == 1%> <% if activity.homework_type == 3 && activity.homework_detail_group.base_on_project == 1%>
<span class="c_red">系统提示:该作业要求各组长<%=link_to "创建项目", new_project_path(:host=>Setting.host_name),:class=>"c_red",:title=>"新建项目",:style=>"text-decoration:underline;"%>,组成员加入项目,然后由组长关联项目。谢谢配合!</span> <span class="c_red">系统提示:该作业要求各组长<%=link_to "创建项目", new_project_path(:host=>Setting.host_name),:class=>"linkBlue",:title=>"新建项目",:style=>"text-decoration:underline;"%>,组成员加入项目,然后由组长关联项目。谢谢配合!</span>
<% elsif activity.homework_type == 3 && activity.homework_detail_group.base_on_project == 0%> <% elsif activity.homework_type == 3 && activity.homework_detail_group.base_on_project == 0%>
<span class="c_red">系统提示:该作业要求各组长提交作品,提交作品时请添加组成员。谢谢配合!</span> <span class="c_red">系统提示:该作业要求各组长提交作品,提交作品时请添加组成员。谢谢配合!</span>
<% end %> <% end %>
@ -356,7 +356,7 @@
<%= hidden_field_tag 'course_activity',params[:course_activity],:value =>course_activity %> <%= hidden_field_tag 'course_activity',params[:course_activity],:value =>course_activity %>
<div nhname='toolbar_container_<%= user_activity_id%>'></div> <div nhname='toolbar_container_<%= user_activity_id%>'></div>
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="homework_message"></textarea> <textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="homework_message"></textarea>
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a> <a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
<div class="cl"></div> <div class="cl"></div>
<p nhname='contentmsg_<%= user_activity_id%>'></p> <p nhname='contentmsg_<%= user_activity_id%>'></p>
<% end%> <% end%>

@ -144,7 +144,7 @@
<input type="hidden" name="user_activity_id" value="<%=user_activity_id%>"> <input type="hidden" name="user_activity_id" value="<%=user_activity_id%>">
<div nhname='toolbar_container_<%= user_activity_id%>'></div> <div nhname='toolbar_container_<%= user_activity_id%>'></div>
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="reply[content]"></textarea> <textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="reply[content]"></textarea>
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a> <a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
<div class="cl"></div> <div class="cl"></div>
<p nhname='contentmsg_<%= user_activity_id%>'></p> <p nhname='contentmsg_<%= user_activity_id%>'></p>
<% end%> <% end%>

@ -110,7 +110,7 @@
<input type="hidden" name="user_activity_id" value="<%=user_activity_id%>"> <input type="hidden" name="user_activity_id" value="<%=user_activity_id%>">
<div nhname='toolbar_container_<%= user_activity_id%>'></div> <div nhname='toolbar_container_<%= user_activity_id%>'></div>
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="comment"></textarea> <textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="comment"></textarea>
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a> <a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
<div class="cl"></div> <div class="cl"></div>
<p nhname='contentmsg_<%= user_activity_id%>'></p> <p nhname='contentmsg_<%= user_activity_id%>'></p>
<% end%> <% end%>

@ -127,7 +127,7 @@
<input type="hidden" name="user_activity_id" value="<%=user_activity_id%>"> <input type="hidden" name="user_activity_id" value="<%=user_activity_id%>">
<div nhname='toolbar_container_<%= user_activity_id%>'></div> <div nhname='toolbar_container_<%= user_activity_id%>'></div>
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="notes"></textarea> <textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="notes"></textarea>
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a> <a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
<div class="cl"></div> <div class="cl"></div>
<p nhname='contentmsg_<%= user_activity_id%>'></p> <p nhname='contentmsg_<%= user_activity_id%>'></p>
<% end%> <% end%>

@ -147,7 +147,7 @@
<input type="hidden" name="user_activity_id" value="<%=user_activity_id%>"> <input type="hidden" name="user_activity_id" value="<%=user_activity_id%>">
<div nhname='toolbar_container_<%= user_activity_id%>'></div> <div nhname='toolbar_container_<%= user_activity_id%>'></div>
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="reply[content]"></textarea> <textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="reply[content]"></textarea>
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a> <a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
<div class="cl"></div> <div class="cl"></div>
<p nhname='contentmsg_<%= user_activity_id%>'></p> <p nhname='contentmsg_<%= user_activity_id%>'></p>
<% end%> <% end%>

@ -130,7 +130,7 @@
<input type="hidden" name="user_activity_id" value="<%=user_activity_id%>"> <input type="hidden" name="user_activity_id" value="<%=user_activity_id%>">
<div nhname='toolbar_container_<%= user_activity_id%>'></div> <div nhname='toolbar_container_<%= user_activity_id%>'></div>
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="comment"></textarea> <textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="comment"></textarea>
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a> <a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
<div class="cl"></div> <div class="cl"></div>
<p nhname='contentmsg_<%= user_activity_id%>'></p> <p nhname='contentmsg_<%= user_activity_id%>'></p>
<% end%> <% end%>

@ -122,7 +122,7 @@
<input type="hidden" name="user_activity_id" value="<%=user_activity_id%>"> <input type="hidden" name="user_activity_id" value="<%=user_activity_id%>">
<div nhname='toolbar_container_<%= user_activity_id%>'></div> <div nhname='toolbar_container_<%= user_activity_id%>'></div>
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="reply[content]"></textarea> <textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="reply[content]"></textarea>
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a> <a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
<div class="cl"></div> <div class="cl"></div>
<p nhname='contentmsg_<%= user_activity_id%>'></p> <p nhname='contentmsg_<%= user_activity_id%>'></p>
<% end%> <% end%>

@ -119,7 +119,7 @@
<input type="hidden" name="org_activity_id" value="<%= act.id %>"/> <input type="hidden" name="org_activity_id" value="<%= act.id %>"/>
<div nhname='toolbar_container_<%= act.id %>'></div> <div nhname='toolbar_container_<%= act.id %>'></div>
<textarea placeholder="有问题或建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= act.id %>' name="org_content"></textarea> <textarea placeholder="有问题或建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= act.id %>' name="org_content"></textarea>
<a id="new_message_submit_btn_<%= act.id %>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;line-height:18px;">发送</a> <a id="new_message_submit_btn_<%= act.id %>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;line-height:18px;">发送</a>
<div class="cl"></div> <div class="cl"></div>
<p nhname='contentmsg_<%= act.id %>'></p> <p nhname='contentmsg_<%= act.id %>'></p>

@ -110,7 +110,7 @@
<input type="hidden" name="user_activity_id" value="<%=user_activity_id%>"> <input type="hidden" name="user_activity_id" value="<%=user_activity_id%>">
<div nhname='toolbar_container_<%= user_activity_id%>'></div> <div nhname='toolbar_container_<%= user_activity_id%>'></div>
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="comment"></textarea> <textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="comment"></textarea>
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a> <a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
<div class="cl"></div> <div class="cl"></div>
<p nhname='contentmsg_<%= user_activity_id%>'></p> <p nhname='contentmsg_<%= user_activity_id%>'></p>
<% end%> <% end%>

@ -2,8 +2,16 @@
<li class="hworkList340 hworkH30 <%= @homework.homework_type == 2 ? '' : 'width385'%>"> <li class="hworkList340 hworkH30 <%= @homework.homework_type == 2 ? '' : 'width385'%>">
<span class="c_dark f14 fb fl <%= @homework.homework_type == 2 ? 'mr90 ml50' : 'mr150 ml50'%>">作品名称</span> <span class="c_dark f14 fb fl <%= @homework.homework_type == 2 ? 'mr90 ml50' : 'mr150 ml50'%>">作品名称</span>
<% if @homework.homework_type != 3 %> <% if @homework.homework_type != 3 %>
<span class="c_dark f14 fb fl mr50">姓名</span> <!--<span class="c_dark f14 fb fl mr50">姓名</span>-->
<span class="c_dark f14 fb fl">学号</span> <%= link_to "姓名",@show_all ? student_work_index_path(:homework => @homework.id,:order => "lastname", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl" ,:remote => true%>
<% if @show_all && @order == "lastname"%>
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "lastname", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10" ,:remote => true%>
<% end%>
<!--<span class="c_dark f14 fb fl">学号</span>-->
<%= link_to "学号",@show_all ? student_work_index_path(:homework => @homework.id,:order => "student_id", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml50" ,:remote => true%>
<% if @show_all && @order == "student_id"%>
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "student_id", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10" ,:remote => true%>
<% end%>
<% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1 %> <% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1 %>
<span class="c_dark f14 fb fl">关联项目</span> <span class="c_dark f14 fb fl">关联项目</span>
<% end %> <% end %>

@ -47,7 +47,7 @@
<% end%> <% end%>
<div class="cl"></div> <div class="cl"></div>
<% if activity.homework_type == 3 && activity.homework_detail_group.base_on_project == 1%> <% if activity.homework_type == 3 && activity.homework_detail_group.base_on_project == 1%>
<span class="c_red">系统提示:该作业要求各组长<%=link_to "创建项目", new_project_path(:host=>Setting.host_name),:class=>"c_red",:title=>"新建项目",:style=>"text-decoration:underline;"%>,组成员加入项目,然后由组长关联项目。谢谢配合!</span> <span class="c_red">系统提示:该作业要求各组长<%=link_to "创建项目", new_project_path(:host=>Setting.host_name),:class=>"linkBlue",:title=>"新建项目",:style=>"text-decoration:underline;"%>,组成员加入项目,然后由组长关联项目。谢谢配合!</span>
<% elsif activity.homework_type == 3 && activity.homework_detail_group.base_on_project == 0%> <% elsif activity.homework_type == 3 && activity.homework_detail_group.base_on_project == 0%>
<span class="c_red">系统提示:该作业要求各组长提交作品,提交作品时请添加组成员。谢谢配合!</span> <span class="c_red">系统提示:该作业要求各组长提交作品,提交作品时请添加组成员。谢谢配合!</span>
<% end %> <% end %>
@ -356,7 +356,7 @@
<%= hidden_field_tag 'course_activity',params[:course_activity],:value =>course_activity %> <%= hidden_field_tag 'course_activity',params[:course_activity],:value =>course_activity %>
<div nhname='toolbar_container_<%= user_activity_id%>'></div> <div nhname='toolbar_container_<%= user_activity_id%>'></div>
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="homework_message"></textarea> <textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="homework_message"></textarea>
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a> <a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
<div class="cl"></div> <div class="cl"></div>
<p nhname='contentmsg_<%= user_activity_id%>'></p> <p nhname='contentmsg_<%= user_activity_id%>'></p>
<% end%> <% end%>

@ -96,7 +96,7 @@
<%= hidden_field_tag 'user_activity_id',params[:user_activity_id],:value =>user_activity_id %> <%= hidden_field_tag 'user_activity_id',params[:user_activity_id],:value =>user_activity_id %>
<div nhname='toolbar_container_<%= user_activity_id%>'></div> <div nhname='toolbar_container_<%= user_activity_id%>'></div>
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="user_notes"></textarea> <textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="user_notes"></textarea>
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a> <a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
<div class="cl"></div> <div class="cl"></div>
<p nhname='contentmsg_<%= user_activity_id%>'></p> <p nhname='contentmsg_<%= user_activity_id%>'></p>
<% end%> <% end%>

@ -178,7 +178,7 @@
<input type="hidden" name="user_activity_id" value="<%=user_activity_id%>"> <input type="hidden" name="user_activity_id" value="<%=user_activity_id%>">
<div nhname='toolbar_container_<%= user_activity_id%>'></div> <div nhname='toolbar_container_<%= user_activity_id%>'></div>
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="reply[content]"></textarea> <textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="reply[content]"></textarea>
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a> <a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
<div class="cl"></div> <div class="cl"></div>
<p nhname='contentmsg_<%= user_activity_id%>'></p> <p nhname='contentmsg_<%= user_activity_id%>'></p>
<% end%> <% end%>

@ -135,7 +135,7 @@
<input type="hidden" name="user_activity_id" value="<%=user_activity_id%>"> <input type="hidden" name="user_activity_id" value="<%=user_activity_id%>">
<div nhname='toolbar_container_<%= user_activity_id%>'></div> <div nhname='toolbar_container_<%= user_activity_id%>'></div>
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="comment"></textarea> <textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="comment"></textarea>
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a> <a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
<div class="cl"></div> <div class="cl"></div>
<p nhname='contentmsg_<%= user_activity_id%>'></p> <p nhname='contentmsg_<%= user_activity_id%>'></p>
<% end%> <% end%>

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

@ -76,7 +76,7 @@
<input type="hidden" name="user_activity_id" value="<%=user_activity_id%>"> <input type="hidden" name="user_activity_id" value="<%=user_activity_id%>">
<div nhname='toolbar_container_<%= user_activity_id%>'></div> <div nhname='toolbar_container_<%= user_activity_id%>'></div>
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="notes"></textarea> <textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="notes"></textarea>
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a> <a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
<div class="cl"></div> <div class="cl"></div>
<p nhname='contentmsg_<%= user_activity_id%>'></p> <p nhname='contentmsg_<%= user_activity_id%>'></p>
<% end%> <% end%>

@ -154,7 +154,7 @@
<input type="hidden" name="user_activity_id" value="<%=user_activity_id%>"> <input type="hidden" name="user_activity_id" value="<%=user_activity_id%>">
<div nhname='toolbar_container_<%= user_activity_id%>'></div> <div nhname='toolbar_container_<%= user_activity_id%>'></div>
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="reply[content]"></textarea> <textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="reply[content]"></textarea>
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a> <a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
<div class="cl"></div> <div class="cl"></div>
<p nhname='contentmsg_<%= user_activity_id%>'></p> <p nhname='contentmsg_<%= user_activity_id%>'></p>
<% end%> <% end%>

@ -132,7 +132,7 @@
<input type="hidden" name="user_activity_id" value="<%=user_activity_id%>"> <input type="hidden" name="user_activity_id" value="<%=user_activity_id%>">
<div nhname='toolbar_container_<%= user_activity_id%>'></div> <div nhname='toolbar_container_<%= user_activity_id%>'></div>
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="comment"></textarea> <textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="comment"></textarea>
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a> <a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
<div class="cl"></div> <div class="cl"></div>
<p nhname='contentmsg_<%= user_activity_id%>'></p> <p nhname='contentmsg_<%= user_activity_id%>'></p>
<% end%> <% end%>

@ -122,7 +122,7 @@
<input type="hidden" name="user_activity_id" value="<%=user_activity_id%>"> <input type="hidden" name="user_activity_id" value="<%=user_activity_id%>">
<div nhname='toolbar_container_<%= user_activity_id%>'></div> <div nhname='toolbar_container_<%= user_activity_id%>'></div>
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="blog_comment[content]"></textarea> <textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="blog_comment[content]"></textarea>
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a> <a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
<div class="cl"></div> <div class="cl"></div>
<p nhname='contentmsg_<%= user_activity_id%>'></p> <p nhname='contentmsg_<%= user_activity_id%>'></p>
<% end%> <% end%>

@ -48,7 +48,7 @@
<% end%> <% end%>
<div class="cl"></div> <div class="cl"></div>
<% if homework_common.homework_type == 3 && homework_common.homework_detail_group.base_on_project == 1%> <% if homework_common.homework_type == 3 && homework_common.homework_detail_group.base_on_project == 1%>
<span class="c_red">系统提示:该作业要求各组长<%=link_to "创建项目", new_project_path(:host=>Setting.host_name),:class=>"c_red",:title=>"新建项目",:style=>"text-decoration:underline;"%>,组成员加入项目,然后由组长关联项目。谢谢配合!</span> <span class="c_red">系统提示:该作业要求各组长<%=link_to "创建项目", new_project_path(:host=>Setting.host_name),:class=>"linkBlue",:title=>"新建项目",:style=>"text-decoration:underline;"%>,组成员加入项目,然后由组长关联项目。谢谢配合!</span>
<% elsif homework_common.homework_type == 3 && homework_common.homework_detail_group.base_on_project == 0%> <% elsif homework_common.homework_type == 3 && homework_common.homework_detail_group.base_on_project == 0%>
<span class="c_red">系统提示:该作业要求各组长提交作品,提交作品时请添加组成员。谢谢配合!</span> <span class="c_red">系统提示:该作业要求各组长提交作品,提交作品时请添加组成员。谢谢配合!</span>
<% end %> <% end %>
@ -360,7 +360,7 @@
<%= hidden_field_tag 'is_in_course',params[:is_in_course],:value =>is_in_course %> <%= hidden_field_tag 'is_in_course',params[:is_in_course],:value =>is_in_course %>
<div nhname='toolbar_container_<%= homework_common.id%>'></div> <div nhname='toolbar_container_<%= homework_common.id%>'></div>
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= homework_common.id%>' name="homework_message"></textarea> <textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= homework_common.id%>' name="homework_message"></textarea>
<a id="new_message_submit_btn_<%= homework_common.id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a> <a id="new_message_submit_btn_<%= homework_common.id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
<div class="cl"></div> <div class="cl"></div>
<p nhname='contentmsg_<%= homework_common.id%>'></p> <p nhname='contentmsg_<%= homework_common.id%>'></p>
<% end%> <% end%>

@ -139,7 +139,7 @@
<%= hidden_field_tag 'is_activity',params[:is_activity],:value =>is_activity %> <%= hidden_field_tag 'is_activity',params[:is_activity],:value =>is_activity %>
<div nhname='toolbar_container_<%= user_activity_id%>'></div> <div nhname='toolbar_container_<%= user_activity_id%>'></div>
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="user_notes"></textarea> <textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="user_notes"></textarea>
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a> <a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
<div class="cl"></div> <div class="cl"></div>
<p nhname='contentmsg_<%= user_activity_id%>'></p> <p nhname='contentmsg_<%= user_activity_id%>'></p>
<% end%> <% end%>

@ -9,9 +9,6 @@
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>"><%= ma.journals_for_message.reply_id == 0 ? "给你留言了:" : "回复了你的留言:" %></span> <span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>"><%= ma.journals_for_message.reply_id == 0 ? "给你留言了:" : "回复了你的留言:" %></span>
</li> </li>
<li class="homepageNewsContent fl"> <li class="homepageNewsContent fl">
<!--<a href="/users/<%= ma.journals_for_message.jour_id %>/user_newfeedback" class = "#{ma.viewed == 0 ? 'newsBlack' : 'newsGrey' }" onmouseover ="message_titile_show($(this),event)" onmouseout = "message_titile_hide($(this))">-->
<!--<%#= ma.journals_for_message.notes.gsub("<p>","").gsub("</p>","").gsub("<br />","").html_safe %>-->
<!--</a>-->
<%= link_to ma.journals_for_message.notes.gsub("<p>","").gsub("</p>","").gsub("<br />","").html_safe, feedback_path(ma.journals_for_message.jour_id), :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}", <%= link_to ma.journals_for_message.notes.gsub("<p>","").gsub("</p>","").gsub("<br />","").html_safe, feedback_path(ma.journals_for_message.jour_id), :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
:onmouseover =>"message_titile_show($(this),event)", :onmouseover =>"message_titile_show($(this),event)",
:onmouseout => "message_titile_hide($(this))" %> :onmouseout => "message_titile_hide($(this))" %>

@ -1,21 +1,11 @@
<div id="users_setting"> <div id="users_setting">
<div class="resourcesUploadBox mt10"><a href="javascript:void(0);" onclick="show_upload();" class="uploadBoxIcon">上传资源</a></div> <div class="resourcesUploadBox mt10"><a href="javascript:void(0);" onclick="show_upload();" class="uploadBoxIcon">上传资源</a></div>
<div id="search_div"> <div id="search_div">
<%= render :partial => 'users/resource_search_form',:locals => {:user => @user, :type => @type} %> <%= render :partial => 'users/resource_search_form',:locals => {:user => @user, :type => @type, :order => @order, :sort => @score, :status => @status} %>
</div> </div>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<ul class="resource-list-tab mt10"> <%= render :partial => 'users/user_resource_tip_list', :locals => { :type => @type, :status => @status} %>
<li class="resource-list-checkbox fl"> </li>
<li class="resource-list-name fl">资源名称</li>
<li class="resource-list-time fr">上传时间</li>
<li class="resource-list-quote fr">引用数</li>
<li class="resource-list-download fr">下载数</li>
<li class="resource-list-size fr">大小</li>
<li class="resource-list-uploader fr">上传者</li>
<li class="resource-list-type fr">类别</li>
<li class="resource-list-from fr">来源</li>
</ul>
<div class="cl"></div> <div class="cl"></div>
<form id="resources_list_form"> <form id="resources_list_form">
<div id="resources_list"> <div id="resources_list">
@ -23,7 +13,6 @@
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<div class="resource-list-option fl"> <div class="resource-list-option fl">
<div class="resource-check-all"> <div class="resource-check-all">
<input id="checkboxAll" type="checkbox" value="" onclick="all_select();" class="resourcesCheckbox" /> <input id="checkboxAll" type="checkbox" value="" onclick="all_select();" class="resourcesCheckbox" />

@ -0,0 +1,33 @@
<ul class="resource-list-tab mt10" id="resource_tip_list">
<li class="resource-list-checkbox fl"> </li>
<li class="resource-list-name fl">资源名称</li>
<li class="resource-list-time fr">
<%= link_to "上传时间", resource_search_user_path(:type => @type, :status => @status, :sort => @score, :order => "created_on", :search => " "), :class => "fl", :remote => true %>
<% if @order == "created_on" %>
<%= link_to "", user_resource_user_path(:type => @type, :status => @status, :sort => @score, :order => "created_on", :search => " "), :class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt16", :remote => true %>
<% end %>
</li>
<li class="resource-list-quote fr">
<%= link_to "引用数", resource_search_user_path(:type => @type, :status => @status, :sort => @score, :order => "quotes"), :class => "fl", :remote => true %>
<% if @order == "quotes" %>
<%= link_to "", user_resource_user_path(:type => @type, :status => @status, :sort => @score, :order => "quotes"), :class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt16", :remote => true %>
<% end %>
</li>
<li class="resource-list-download fr">
<%= link_to "下载数", resource_search_user_path(:type => @type, :status => @status, :sort => @score, :order => "downloads"), :class => "fl", :remote => true %>
<% if @order == "downloads" %>
<%= link_to "", user_resource_user_path(:type => @type, :status => @status, :sort => @score, :order => "downloads"), :class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt16", :remote => true %>
<% end %>
</li>
<li class="resource-list-size fr">
<div style="margin: 0 auto; width: 40px">
<%= link_to "大小", resource_search_user_path(:type => @type, :status => @status, :sort => @score, :order => "filesize"), :class => "fl", :remote => true %>
<% if @order == "filesize" %>
<%= link_to "", user_resource_user_path(:type => @type, :status => @status, :sort => @score, :order => "filesize"), :class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt16", :remote => true %>
<% end %>
</div>
</li>
<li class="resource-list-uploader fr">上传者</li>
<li class="resource-list-type fr">类别</li>
<li class="resource-list-from fr">来源</li>
</ul>

@ -0,0 +1,29 @@
<ul class="resourcesSelect">
<li class="resourcesSelected"><a href="javascript:void(0);" class="resourcesIcon"></a>
<ul class="resourcesType">
<li>
<a href="<%= user_resource_user_path(:id => @user.id, :type => @type, :status => 1)%>" id="resource_type_all" class="resourcesTypeAll resourcesGrey" data-method="get" data-remote="true">全部 </a>
</li>
<li>
<a href="<%= user_resource_user_path(:id => @user.id, :type => @type, :status => 2) %>" id="resource_type_course" class="homepagePostTypeAssignment postTypeGrey'" data-method="get" data-remote="true">课程资源 </a>
<%#= link_to '课程资源' ,user_resource_user_path(:id => @user.id, :type => 2), id="resource_type_course", :remote => true, :method => 'get', :class=> 'homepagePostTypeAssignment postTypeGrey' %>
</li>
<li>
<a href="<%= user_resource_user_path(:id => @user.id, :type => @type, :status => 3) %>" id="resource_type_project" class="homepagePostTypeQuiz postTypeGrey" data-method="get" data-remote="true">项目资源 </a>
<%#= link_to '项目资源' ,user_resource_user_path(:id => @user.id, :type => 3), id="resource_type_project", :remote => true, :method => 'get', :class => 'homepagePostTypeQuiz postTypeGrey' %>
</li>
<li>
<a href="<%= user_resource_user_path(:id => @user.id, :type => @type, :status => 5) %>" id="resource_type_user" class="resourcesTypeUser resourcesGrey" data-method="get" data-remote="true">用户资源 </a>
<%#= link_to '用户资源' ,user_resource_user_path(:id=>@user.id,:type=>5), id="resource_type_user", :remote=>true,:method => 'get', :class=>'resourcesTypeUser resourcesGrey' %>
</li>
<div id="my_files_resource">
<% if @type != "6" %>
<li>
<a href="<%= user_resource_user_path(:id => @user.id, :type => @type, :status => 4) %>" id="resource_type_file" class="resourcesTypeAtt resourcesGrey" data-method="get" data-remote="true">附件 </a>
<%#= link_to '附件' ,user_resource_user_path(:id=>@user.id,:type=>4), id="resource_type_file", :remote=>true,:method => 'get',:class=>'resourcesTypeAtt resourcesGrey' %>
</li>
<% end %>
</div>
</ul>
</li>
</ul>

@ -1,5 +1,14 @@
$("#resources_list").html('<%= escape_javascript( render :partial => 'resources_list' ,:locals=>{ :attachments => @attachments})%>'); $("#resources_list").html('<%= escape_javascript( render :partial => 'resources_list' ,:locals=>{ :attachments => @attachments})%>');
$("#resource_tip_list").html('<%= escape_javascript( render :partial => 'users/user_resource_tip_list', :locals => {:user => @user, :type => @type, :status => @status}) %>');
$("#pages").html('<%= pagination_links_full @atta_pages, @atta_count, :per_page_links => false, :remote => @is_remote, :flag => true %>'); $("#pages").html('<%= pagination_links_full @atta_pages, @atta_count, :per_page_links => false, :remote => @is_remote, :flag => true %>');
$("#res_all_count").html(<%= @atta_count%>); $("#res_all_count").html(<%= @atta_count%>);
$("#res_count").html(0); $("#res_count").html(0);
$("#checkboxAll").attr('checked',false); $("#checkboxAll").attr('checked',false);
//更新状态
$("#public_resource_list").attr('href','<%= user_resource_user_path(@user, :type => '6', :status => @status) %>');
$("#my_resource_list").attr('href','<%= user_resource_user_path(@user, :type => '1', :status => @status) %>');
$("#resource_type_all").attr('href','<%= resource_search_user_path(@user,:type => @type, :status => 1) %>');
$("#resource_type_course").attr('href','<%= resource_search_user_path(@user,:type => @type, :status => 2) %>');
$("#resource_type_project").attr('href','<%= resource_search_user_path(@user,:type => @type, :status => 3) %>');
$("#resource_type_user").attr('href','<%= resource_search_user_path(@user,:type => @type, :status => 5) %>');
$("#resource_type_file").attr('href','<%= resource_search_user_path(@user,:type => @type, :status => 4) %>');

@ -4,7 +4,7 @@ $("#homewrok_ref_pages").html('<%= pagination_links_full @hw_pages, @hw_count, :
$("#homework_detail_information").html("<%=escape_javascript(render :partial => 'users/homework_detail_information', :locals => {:homework=>nil}) %>"); $("#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}) %>"); $("#homework_search_input").html("<%=escape_javascript(render :partial=>'homework_search_input', :locals=>{:type=>@type,:is_import=>@is_import}) %>");
<% else %> <% else %>
$("#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 => @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_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_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_search_input").html("<%=escape_javascript(render :partial=>'homework_repository_search', :locals=>{:type=>@type,:is_import=>@is_import,:property=>@property}) %>");

@ -60,23 +60,9 @@
<div id="homework_search_input" class="mt10 fl"> <div id="homework_search_input" class="mt10 fl">
<%=render :partial=>'homework_repository_search', :locals=>{:type => @type,:is_import => 0,:property => @property} %> <%=render :partial=>'homework_repository_search', :locals=>{:type => @type,:is_import => 0,:property => @property} %>
</div> </div>
<!--<form class="resourcesSearchloadBox mt10">
<input type="text" name="serach" placeholder="输入题库关键词进行搜索" class="searchResource" />
<a href="javascript:void(0);" class="homepageSearchIcon"></a>
</form>-->
<div class="cl"></div> <div class="cl"></div>
<div class="w583 fl mr10 mt10"> <div class="w583 fl mr10 mt10" id="homework_repository_list">
<ul class="subject-list-banner"> <%=render :partial => 'homework_repository_list', :locals => {:homeworks => @homeworks,:type=>@type,:is_import => 0,:property => @property,:search=>''} %>
<li class="subject-list-name fl hidden"><span style="padding-left:15px;">作业名称</span></li>
<li class="subject-list-from fl">来源</li>
<li class="subject-list-type fl">类别</li>
<li class="subject-list-publisher fl">贡献者</li>
<li class="subject-list-count fl">引用数</li>
<li class="fl subject-list-date">发布时间</li>
</ul>
<div id="homework_repository">
<%=render :partial => 'homework_repository', :locals => {:homeworks => @homeworks} %>
</div>
</div> </div>
<div id="homework_repository_detail"> <div id="homework_repository_detail">
<%=render :partial => 'homework_repository_detail', :locals => {:homework => nil} %> <%=render :partial => 'homework_repository_detail', :locals => {:homework => nil} %>

@ -1,3 +1,4 @@
$("#homework_repository").html('<%= escape_javascript(render :partial => 'users/homework_repository', :locals => {:homeworks => @homeworks})%>'); /*$("#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_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_repository_detail").html("<%=escape_javascript(render :partial => 'users/homework_repository_detail', :locals => {:homework=>nil}) %>");

@ -21,14 +21,6 @@
$("#resource_search_form").submit(); $("#resource_search_form").submit();
} }
function show_public_resource(){
$("#resource_remote").html('<%= escape_javascript( render :partial => 'user_resource_info' ,:locals => { :tpye => 6}) %>');
}
function show_public_resource(){
$("#resource_remote").html('<%= escape_javascript( render :partial => 'user_resource_info' ,:locals => { :tpye => 1}) %>');
}
function closeModal() function closeModal()
{ {
hideModal($(".uploadBoxContainer")); hideModal($(".uploadBoxContainer"));
@ -62,38 +54,16 @@
<div> <div>
<ul class="resource-banner"> <ul class="resource-banner">
<li class="fl resource-switch"> <li class="fl resource-switch">
<a href="<%= user_resource_user_path(@user, :type => '6', :status => @status) %>" class="resource-tab resource-tab-active" id="public_resource_list" data-remote="true">公共资源</a> <a href="<%= user_resource_user_path(@user, :type => '6', :status => 6) %>" class="resource-tab resource-tab-active" id="public_resource_list" data-remote="true">公共资源</a>
</li> </li>
<li class="fl resource-switch"> <li class="fl resource-switch">
<a href="<%= user_resource_user_path(@user, :type => '1', :status => @status) %>" class="resource-tab" id="my_resource_list" data-remote="true">我的资源</a> <a href="<%= user_resource_user_path(@user, :type => '1', :status => 6) %>" class="resource-tab" id="my_resource_list" data-remote="true">我的资源</a>
</li> </li>
<li class="fl w770 border-bottom h34">&nbsp;</li> <li class="fl w770 border-bottom h34">&nbsp;</li>
<li class="fr resource-banner-li border-bottom h34"> <li class="fr resource-banner-li border-bottom h34">
<ul class="resourcesSelect"> <div id="user_resource_type_filter">
<li class="resourcesSelected"><a href="javascript:void(0);" class="resourcesIcon"></a> <%= render :partial => 'user_resource_type_filter' %>
<ul class="resourcesType"> </div>
<li>
<a href="<%= user_resource_user_path(:id => @user.id, :type => @type, :status => 1)%>" id="resource_type_all" class="resourcesTypeAll resourcesGrey" data-method="get" data-remote="true">全部 </a>
</li>
<li>
<a href="<%= user_resource_user_path(:id => @user.id, :type => @type, :status => 2) %>" id="resource_type_course" class="homepagePostTypeAssignment postTypeGrey'" data-method="get" data-remote="true">课程资源 </a>
<%#= link_to '课程资源' ,user_resource_user_path(:id => @user.id, :type => 2), id="resource_type_course", :remote => true, :method => 'get', :class=> 'homepagePostTypeAssignment postTypeGrey' %>
</li>
<li>
<a href="<%= user_resource_user_path(:id => @user.id, :type => @type, :status => 3) %>" id="resource_type_project" class="homepagePostTypeQuiz postTypeGrey" data-method="get" data-remote="true">项目资源 </a>
<%#= link_to '项目资源' ,user_resource_user_path(:id => @user.id, :type => 3), id="resource_type_project", :remote => true, :method => 'get', :class => 'homepagePostTypeQuiz postTypeGrey' %>
</li>
<li>
<a href="<%= user_resource_user_path(:id => @user.id, :type => @type, :status => 5) %>" id="resource_type_user" class="resourcesTypeUser resourcesGrey" data-method="get" data-remote="true">用户资源 </a>
<%#= link_to '用户资源' ,user_resource_user_path(:id=>@user.id,:type=>5), id="resource_type_user", :remote=>true,:method => 'get', :class=>'resourcesTypeUser resourcesGrey' %>
</li>
<li>
<a href="<%= user_resource_user_path(:id => @user.id, :type => @type, :status => 4) %>" id="resource_type_file" class="resourcesTypeAtt resourcesGrey" data-method="get" data-remote="true">附件 </a>
<%#= link_to '附件' ,user_resource_user_path(:id=>@user.id,:type=>4), id="resource_type_file", :remote=>true,:method => 'get',:class=>'resourcesTypeAtt resourcesGrey' %>
</li>
</ul>
</li>
</ul>
</li> </li>
<div class="cl"></div> <div class="cl"></div>
</ul> </ul>

@ -1,12 +1,14 @@
$("#search_div").html('<%= escape_javascript( render :partial => 'resource_search_form', :locals => {:user => @user, :type => @type} ) %>'); $("#search_div").html('<%= escape_javascript( render :partial => 'resource_search_form', :locals => {:user => @user, :type => @type} ) %>');
$("#resource_tip_list").html('<%= escape_javascript( render :partial => 'users/user_resource_tip_list', :locals => {:user => @user, :type => @type, :status => @status}) %>');
$("#resources_list").html('<%= escape_javascript( render :partial => 'resources_list' , :locals => { :attachments => @attachments}) %>'); $("#resources_list").html('<%= escape_javascript( render :partial => 'resources_list' , :locals => { :attachments => @attachments}) %>');
$("#user_resource_type_filter").html('<%= escape_javascript( render :partial => 'user_resource_type_filter' , :locals => {:user => @user, :type => @type, :status => @status}) %>');
$("#pages").html('<%= pagination_links_full @atta_pages, @atta_count, :per_page_links => false, :remote => @is_remote, :flag => true %>'); $("#pages").html('<%= pagination_links_full @atta_pages, @atta_count, :per_page_links => false, :remote => @is_remote, :flag => true %>');
$("#res_count").html(0); $("#res_count").html(0);
$("#checkboxAll").attr('checked',false); $("#checkboxAll").attr('checked',false);
$("#res_all_count").html(<%= @atta_count %>); $("#res_all_count").html(<%= @atta_count %>);
$("#public_resource_list").attr('href','<%= user_resource_user_path(@user, :type => '6', :status => @status) %>'); $("#public_resource_list").attr('href','<%= user_resource_user_path(@user, :type => '6') %>');
$("#my_resource_list").attr('href','<%= user_resource_user_path(@user, :type => '1', :status => @status) %>'); $("#my_resource_list").attr('href','<%= user_resource_user_path(@user, :type => '1') %>');
$("#resource_type_all").attr('href','<%= user_resource_user_path(@user,:type => @type, :status => 1) %>'); $("#resource_type_all").attr('href','<%= user_resource_user_path(@user,:type => @type, :status => 1) %>');
$("#resource_type_course").attr('href','<%= user_resource_user_path(@user,:type => @type, :status => 2) %>'); $("#resource_type_course").attr('href','<%= user_resource_user_path(@user,:type => @type, :status => 2) %>');

@ -1,4 +1,3 @@
closeModal(); closeModal();
$("#resources_list").html('<%= escape_javascript( render :partial => 'resources_list' ,:locals=>{ :attachments => @attachments})%>'); $("#resources_list").html('<%= escape_javascript( render :partial => 'resources_list' ,:locals=>{ :attachments => @attachments})%>');
//这里不能将翻页的更新 //这里不能将翻页的更新

@ -3,7 +3,7 @@ $("#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 %>'); $("#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_detail_information").html("<%=escape_javascript(render :partial => 'users/homework_detail_information', :locals => {:homework=>nil}) %>");
<% else %> <% else %>
$("#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 => @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_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_repository_detail").html("<%=escape_javascript(render :partial => 'users/homework_repository_detail', :locals => {:homework=>nil}) %>");
<% end %> <% end %>

@ -21,6 +21,6 @@
</ul> </ul>
<% end %> <% end %>
<div class="pageRoll"> <div class="pageRoll">
<%= paginate attachments,:params => {:controller => 'welcome', :action => 'search',:search_type=>'attachment'}%> <!%= paginate attachments,:params => {:controller => 'welcome', :action => 'search',:search_type=>'attachment'}%>
</div> </div>
<% end %> <% end %>

@ -1520,6 +1520,9 @@ en:
label_submit_comments: Submit_comments label_submit_comments: Submit_comments
label_course_empty_select: You have not selected course label_course_empty_select: You have not selected course
label_enterprise_page_made: enterprise_page label_enterprise_page_made: enterprise_page
label_excellent_courses_list: excellent_courses
label_course_resource_list: course_resource_list
label_project_resource_list: project_resource_list
#api #api
label_recently_updated_notification: Recently updated notification label_recently_updated_notification: Recently updated notification

@ -483,6 +483,9 @@ zh:
label_requirement: 需求 label_requirement: 需求
label_new_course: 课程列表 label_new_course: 课程列表
label_course_all: 课程列表 label_course_all: 课程列表
label_excellent_courses_list: 精品课程列表
label_course_resource_list: 课程资源列表
label_project_resource_list: 項目资源列表
label_teacher_all: 所有教师 label_teacher_all: 所有教师
label_requirement_enterprise_list: 众包列表 label_requirement_enterprise_list: 众包列表
label_new_homework: 作业 label_new_homework: 作业

@ -939,6 +939,9 @@ RedmineApp::Application.routes.draw do
match 'admin', :to => 'admin#index', :via => :get match 'admin', :to => 'admin#index', :via => :get
match 'admin/projects', :via => :get match 'admin/projects', :via => :get
get 'admin/courses' get 'admin/courses'
get 'admin/excellent_courses'
get 'admin/course_resource_list'
get 'admin/project_resource_list'
match 'admin/users', :via => :get match 'admin/users', :via => :get
match 'admin/messages', :via => :get match 'admin/messages', :via => :get
match 'admin/first_page_made', as: :first_page_made match 'admin/first_page_made', as: :first_page_made
@ -1005,6 +1008,7 @@ RedmineApp::Application.routes.draw do
get 'course_outline' get 'course_outline'
post 'search_course_outline' post 'search_course_outline'
post 'set_course_outline' post 'set_course_outline'
post 'teacher_assign_group'
get 'syllabus' get 'syllabus'
get 'search_public_orgs_not_in_course' get 'search_public_orgs_not_in_course'
get "homework_search" get "homework_search"

@ -0,0 +1,5 @@
class AddVisitsToUser < ActiveRecord::Migration
def change
add_column :users, :visits, :integer, :default => 0
end
end

@ -0,0 +1,5 @@
class AddVisitsToProject < ActiveRecord::Migration
def change
add_column :projects, :visits, :integer, :default => 0
end
end

@ -0,0 +1,5 @@
class AddVisitsToCourse < ActiveRecord::Migration
def change
add_column :courses, :visits, :integer, :default => 0
end
end

@ -0,0 +1,5 @@
class AddVisitsToOrganization < ActiveRecord::Migration
def change
add_column :organizations, :visits, :integer, :default => 0
end
end

@ -11,7 +11,7 @@
# #
# It's strongly recommended to check this file into your version control system. # It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20160310033019) do ActiveRecord::Schema.define(:version => 20160225031230) do
create_table "activities", :force => true do |t| create_table "activities", :force => true do |t|
t.integer "act_id", :null => false t.integer "act_id", :null => false
@ -435,8 +435,6 @@ ActiveRecord::Schema.define(:version => 20160310033019) do
t.datetime "created_at", :null => false t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false t.datetime "updated_at", :null => false
t.integer "total_score" t.integer "total_score"
t.integer "homework_journal_num", :default => 0
t.integer "news_num", :default => 0
end end
create_table "course_groups", :force => true do |t| create_table "course_groups", :force => true do |t|
@ -2015,6 +2013,11 @@ ActiveRecord::Schema.define(:version => 20160310033019) do
add_index "wikis", ["project_id"], :name => "wikis_project_id" add_index "wikis", ["project_id"], :name => "wikis_project_id"
create_table "wlcs", :force => true do |t|
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "workflows", :force => true do |t| create_table "workflows", :force => true do |t|
t.integer "tracker_id", :default => 0, :null => false t.integer "tracker_id", :default => 0, :null => false
t.integer "old_status_id", :default => 0, :null => false t.integer "old_status_id", :default => 0, :null => false

@ -99,6 +99,13 @@ module Redmine
result result
end end
def save_attachmentsex_public(attachments, author=User.current,attachment_type, is_public)
@curattachment_type = attachment_type
@is_public = true
result = save_attachments(attachments,author)
result
end
def save_attachments(attachments, author=User.current) def save_attachments(attachments, author=User.current)
# 清除临时文件 # 清除临时文件
if attachments if attachments
@ -142,7 +149,11 @@ module Redmine
end end
if a && !attachment['is_public_checkbox'] if a && !attachment['is_public_checkbox']
if @is_public
a.is_public = true
else
a.is_public = false a.is_public = false
end
elsif a && attachment['is_public_checkbox'] elsif a && attachment['is_public_checkbox']
a.is_public = true a.is_public = true
end end

@ -391,6 +391,9 @@ Redmine::MenuManager.map :admin_menu do |menu|
menu.push :messages_list, {:controller => 'admin', :action => 'messages_list'}, :caption => :label_message_plural menu.push :messages_list, {:controller => 'admin', :action => 'messages_list'}, :caption => :label_message_plural
menu.push :notices, {:controller => 'admin', :action => 'notices'}, :caption => :label_notification_list menu.push :notices, {:controller => 'admin', :action => 'notices'}, :caption => :label_notification_list
menu.push :latest_login_users, {:controller => 'admin', :action => 'latest_login_users'}, :caption => :label_latest_login_user_list menu.push :latest_login_users, {:controller => 'admin', :action => 'latest_login_users'}, :caption => :label_latest_login_user_list
menu.push :excellent_courses, {:controller => 'admin', :action => 'excellent_courses'}, :caption => :label_excellent_courses_list
menu.push :course_resource_list, {:controller => 'admin', :action => 'course_resource_list'}, :caption => :label_course_resource_list
menu.push :project_resource_list, {:controller => 'admin', :action => 'project_resource_list'}, :caption => :label_project_resource_list
menu.push :homework, {:controller => 'admin', :action => 'homework'}, :caption => :label_user_homework menu.push :homework, {:controller => 'admin', :action => 'homework'}, :caption => :label_user_homework
end end

@ -929,14 +929,35 @@ function _mediaClass(type) {
function _mediaAttrs(srcTag) { function _mediaAttrs(srcTag) {
return _getAttrList(unescape(srcTag)); return _getAttrList(unescape(srcTag));
} }
function _mediaEmbed(attrs) { function _mediaEmbed(attrs,target) {
var html = '<embed '; if(target && target === "media"){
var html = [[],"<img class=\"mediaIco\" src=\"../../images/video.png\" "],_ww = window.screen.width,_wh = window.screen.height;//_docHeight(window.document);
_each(attrs, function(key, val) {
if(key === "src"){
html[0].push("<a class=\"mediaIcobox\" href=\"javascript:window.open('"+ val+"','newwindow','");
}else{
if(key === "width"){
html[0].push("width="+val,",left="+(_ww-val)/2 + ",");
}else if(key === "height"){
html[0].push("height="+val,",top="+(_wh-val)/2);
}else{
html.push(key, "=\"" , val , "\" ");
}
}
});
html[0].push("')\">");
html[0] = html[0].join("");
html.push("/></a>");
return html.join("");
}else{
var html = '<img ';
_each(attrs, function(key, val) { _each(attrs, function(key, val) {
html += key + '="' + val + '" '; html += key + '="' + val + '" ';
}); });
html += '/>'; html += '/>';
return html; return html;
} }
}
function _mediaImg(blankPath, attrs) { function _mediaImg(blankPath, attrs) {
var width = attrs.width, var width = attrs.width,
height = attrs.height, height = attrs.height,
@ -2765,7 +2786,7 @@ _extend(KCmd, {
sel.addRange(rng); sel.addRange(rng);
if (doc !== document) { if (doc !== document) {
var pos = K(rng.endContainer).pos(); var pos = K(rng.endContainer).pos();
win.scrollTo(pos.x, pos.y); //win.scrollTo(pos.x, pos.y);
} }
} }
win.focus(); win.focus();
@ -5646,8 +5667,29 @@ _plugin('core', function(K) {
}else{ }else{
//TODO 暂时什么也不做 //TODO 暂时什么也不做
} }
var _bod = $(self.cmd.doc.body);
var body = self.cmd.doc.body;
var _bw = _bod.width(),_bh = Math.max((K.IE ? body.scrollHeight : (K.GECKO ? body.offsetHeight+26:body.offsetHeight)));
var _bsh = 0;
_bod.children().each(function(){
_bsh += $(this).height();
});
var _imgbase = _bod.find("img");
_imgbase[0].onload = function(){
var _iw=_imgbase.width(),_ih = _imgbase.height();
var _alh = _bsh + _ih;
var _rhig = _alh > _bh ? _alh : _bh;
switch(self.resizeType){
case 1:
var _defh = self.toolbar.div.height() + self.statusbar.height();
_defh = _defh > 0 ? _defh + 6 : _defh;
self.resize(null,_rhig + _defh);
break;
}
}
} else { } else {
alert(data.message); //alert(data.message);
alert("仅支持如下图片格式:bmp,jpeg,jpg,png,gif,BMP,JPEG,JPG,PNG,GIF");
} }
}, },
afterError : function(str) { afterError : function(str) {
@ -6018,7 +6060,7 @@ _plugin('core', function(K) {
} }
attrs.width = _undef(imgAttrs.width, width); attrs.width = _undef(imgAttrs.width, width);
attrs.height = _undef(imgAttrs.height, height); attrs.height = _undef(imgAttrs.height, height);
return _mediaEmbed(attrs); return _mediaEmbed(attrs,"media");
}) })
.replace(/<img[^>]*class="?ke-anchor"?[^>]*>/ig, function(full) { .replace(/<img[^>]*class="?ke-anchor"?[^>]*>/ig, function(full) {
var imgAttrs = _getAttrList(full); var imgAttrs = _getAttrList(full);

@ -1,5 +1,7 @@
.ke-content { .ke-content {
font-size: 10pt; font-size: 12px;
font: 14px/1.5 "sans serif",tahoma,verdana,helvetica;font-family: ΢ÈíÑźÚ, ËÎÌå;
font-family:Tahoma;
} }
.ke-content pre { .ke-content pre {
font-size:9pt; font-size:9pt;

@ -98,6 +98,9 @@ KindEditor.plugin('image', function(K) {
yesBtn : { yesBtn : {
name : self.lang('yes'), name : self.lang('yes'),
click : function(e) { click : function(e) {
if(/^\s*<\w*\s*\w*\=\"\w*\"\s*\w*\=\"\w*\:\s*\#\d*\;\s*\w*\-\w*\:\s*\w*\;\"\>[\u4e00-\u9fa5]*<\/\w*\>\s*$/.test(self.edit.html())){
self.edit.html('');
}
// Bugfix: http://code.google.com/p/kindeditor/issues/detail?id=319 // Bugfix: http://code.google.com/p/kindeditor/issues/detail?id=319
if (dialog.isLoading) { if (dialog.isLoading) {
return; return;

@ -29,6 +29,8 @@ KindEditor.plugin('lineheight', function(K) {
}); });
self.updateState(); self.updateState();
self.addBookmark(); self.addBookmark();
//curVal = key;
//self.cmd.doc.body.style.lineHeight = key;
self.hideMenu(); self.hideMenu();
} }
}); });

@ -47,6 +47,9 @@ KindEditor.plugin('media', function(K) {
yesBtn : { yesBtn : {
name : self.lang('yes'), name : self.lang('yes'),
click : function(e) { click : function(e) {
if(/^\s*<\w*\s*\w*\=\"\w*\"\s*\w*\=\"\w*\:\s*\#\d*\;\s*\w*\-\w*\:\s*\w*\;\"\>[\u4e00-\u9fa5]*<\/\w*\>\s*$/.test(self.edit.html())){
self.edit.html('');
}
var url = K.trim(urlBox.val()), var url = K.trim(urlBox.val()),
width = widthBox.val(), width = widthBox.val(),
height = heightBox.val(); height = heightBox.val();

@ -25,7 +25,7 @@ KindEditor.plugin('preview', function(K) {
doc.open(); doc.open();
doc.write(self.fullHtml()); doc.write(self.fullHtml());
doc.close(); doc.close();
K(doc.body).css('background-color', '#FFF'); K(doc.body).css({'background-color': '#FFF','word-break':'break-all','word-wrap':'wrap-all'});
iframe[0].contentWindow.focus(); iframe[0].contentWindow.focus();
}); });
}); });

@ -129,6 +129,9 @@ KindEditor.plugin('table', function(K) {
yesBtn : { yesBtn : {
name : self.lang('yes'), name : self.lang('yes'),
click : function(e) { click : function(e) {
if(/^\s*<\w*\s*\w*\=\"\w*\"\s*\w*\=\"\w*\:\s*\#\d*\;\s*\w*\-\w*\:\s*\w*\;\"\>[\u4e00-\u9fa5]*<\/\w*\>\s*$/.test(self.edit.html())){
self.edit.html('');
}
var rows = rowsBox.val(), var rows = rowsBox.val(),
cols = colsBox.val(), cols = colsBox.val(),
width = widthBox.val(), width = widthBox.val(),
@ -225,8 +228,10 @@ KindEditor.plugin('table', function(K) {
} }
if (borderColor !== '') { if (borderColor !== '') {
table.attr('borderColor', borderColor); table.attr('borderColor', borderColor);
table.css("border-color",borderColor);
} else { } else {
table.removeAttr('borderColor'); table.removeAttr('borderColor');
table.css("border-color","none");
} }
self.hideDialog().focus(); self.hideDialog().focus();
self.cmd.range.moveToBookmark(bookmark); self.cmd.range.moveToBookmark(bookmark);
@ -248,7 +253,10 @@ KindEditor.plugin('table', function(K) {
if (border !== ''){ if (border !== ''){
style += 'border:'+border+'px solid;'; style += 'border:'+border+'px solid;';
} }
if (borderColor !== ''){
style += 'border-color:'+borderColor+';';
}
style += 'table-layout: '+'fixed;';
var html = '<table'; var html = '<table';
if (style !== '') { if (style !== '') {
html += ' style="' + style + '"'; html += ' style="' + style + '"';
@ -275,7 +283,7 @@ KindEditor.plugin('table', function(K) {
for (var i = 0; i < rows; i++) { for (var i = 0; i < rows; i++) {
html += '<tr>'; html += '<tr>';
for (var j = 0; j < cols; j++) { for (var j = 0; j < cols; j++) {
html += '<td style="border:solid windowtext 1.0px;" >' + (K.IE ? '&nbsp;' : '<br />') + '</td>'; html += '<td style="border:solid windowtext 1.0px;text-overflow:inherit;overflow: hidden;white-space: nowrap" >' + (K.IE ? '&nbsp;' : '<br />') + '</td>';
} }
html += '</tr>'; html += '</tr>';
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

@ -1011,6 +1011,13 @@ function showNormalImage(id) {
if (description_images.length>0) { if (description_images.length>0) {
for (var i=0; i<description_images.length; i++){ for (var i=0; i<description_images.length; i++){
var image=$(description_images[i]); var image=$(description_images[i]);
var _path = getRootPath();
//如果图片是视频图片,不处理。
if($(image).hasClass("mediaIco")){
var _src = _path+"/"+$(image).attr('src');
$(image).attr('src',_src);
return;
}
var element=$("<a></a>").attr("href",image.attr('src')); var element=$("<a></a>").attr("href",image.attr('src'));
image.wrap(element); image.wrap(element);
$(image).parent().colorbox({rel:'nofollow', close: "关闭", returnFocus: false}); $(image).parent().colorbox({rel:'nofollow', close: "关闭", returnFocus: false});
@ -1020,6 +1027,7 @@ function showNormalImage(id) {
} }
//文件、帖子、通知分享 //文件、帖子、通知分享
function org_id_click(){ function org_id_click(){
var sendText = $("input[name='org_id']:checked").next().text(); var sendText = $("input[name='org_id']:checked").next().text();
@ -1152,3 +1160,18 @@ function disable_down(source, des, hint){
} }
} }
function getRootPath(){
//获取当前网址,如: http://localhost:8083/uimcardprj/share/meun.jsp
var curWwwPath=window.document.location.href;
//获取主机地址之后的目录,如: uimcardprj/share/meun.jsp
var pathName=window.document.location.pathname;
var pos=curWwwPath.indexOf(pathName);
//获取主机地址,如: http://localhost:8083
var localhostPaht=curWwwPath.substring(0,pos);
//获取带"/"的项目名,如:/uimcardprj
// var projectName=pathName.substring(0,pathName.substr(1).indexOf('/')+1);
var projectName="";
return(localhostPaht+projectName);
}

@ -11,10 +11,16 @@ function sd_create_editor(params){
height:"33px",// == undefined ? "30px":paramsHeight+"px", height:"33px",// == undefined ? "30px":paramsHeight+"px",
minHeight:"33px",// == undefined ? "30px":paramsHeight+"px", minHeight:"33px",// == undefined ? "30px":paramsHeight+"px",
width:params.width, width:params.width,
/*
items:['emoticons','fontname', items:['emoticons','fontname',
'forecolor', 'hilitecolor', 'bold', '|', 'justifyleft', 'justifycenter', 'insertorderedlist','insertunorderedlist', '|', 'forecolor', 'hilitecolor', 'bold', '|', 'justifyleft', 'justifycenter', 'insertorderedlist','insertunorderedlist', '|',
'formatblock', 'fontsize', '|','indent', 'outdent', 'formatblock', 'fontsize', '|','indent', 'outdent',
'|','imagedirectupload','more'], '|','imagedirectupload','more'],*/
items : ['code','emoticons','fontname',
'forecolor', 'hilitecolor', 'bold', '|', 'justifyleft', 'justifycenter', 'insertorderedlist','insertunorderedlist', '|',
'formatblock', 'fontsize', '|','indent', 'outdent',
'|','imagedirectupload','table', 'media', 'preview',"more"
],
afterChange:function(){//按键事件 afterChange:function(){//按键事件
var edit = this.edit; var edit = this.edit;
var body = edit.doc.body; var body = edit.doc.body;

@ -32,9 +32,9 @@ table{ background:#fff;}
.min_search{ width:150px; height:20px; border:1px solid #d0d0d0; color:#666; background:url(../images/public_icon.png) 135px -193px no-repeat; cursor:pointer;} .min_search{ width:150px; height:20px; border:1px solid #d0d0d0; color:#666; background:url(../images/public_icon.png) 135px -193px no-repeat; cursor:pointer;}
.db {display:block;} .db {display:block;}
/* font & color */ /* font & color */
h2{ font-size:18px; color:#269ac9;} h2{ font-size:18px; } /*color:#269ac9;*/
h3{ font-size:14px; color:#e8770d;} h3{ font-size:14px;}/* color:#e8770d;*/
h4{ font-size:14px; color:#3b3b3b;} h4{ font-size:14px; }/*color:#3b3b3b;*/
.f12{font-size:12px; font-weight:normal;} .f12{font-size:12px; font-weight:normal;}
.f14{font-size:14px;} .f14{font-size:14px;}
.f16{font-size:16px;} .f16{font-size:16px;}
@ -192,6 +192,7 @@ a.c_green{ color:#28be6c;}
.fontGrey {color:#cecece;} .fontGrey {color:#cecece;}
.fontGrey2 {color:#888888;} .fontGrey2 {color:#888888;}
.fontGrey3 {color:#484848;} .fontGrey3 {color:#484848;}
.fontGrey5 {color:#a1a1a1;}
.fontBlue {color:#3498db;} .fontBlue {color:#3498db;}
a.underline {text-decoration:underline;} a.underline {text-decoration:underline;}
a.fontBlue {color:#297fb8;} a.fontBlue {color:#297fb8;}
@ -702,7 +703,7 @@ a.postOptionLink:hover {color:#ffffff; background-color:#269ac9;}
.imageFuzzy {filter:alpha(opacity=50); -moz-opacity:0.5; -khtml-opacity:0.5;opacity: 0.5;} .imageFuzzy {filter:alpha(opacity=50); -moz-opacity:0.5; -khtml-opacity:0.5;opacity: 0.5;}
.homepagePostReplyDes {float:left; width:642px; margin-left:15px;} .homepagePostReplyDes {float:left; width:642px; margin-left:15px;}
.homepagePostReplyPublisher {font-size:12px; color:#888888; margin-bottom:5px;} .homepagePostReplyPublisher {font-size:12px; color:#888888; margin-bottom:5px;}
.homepagePostReplyContent {font-size:12px; color:#484848; margin-bottom:12px;} .homepagePostReplyContent {font-size:12px; color:#484848; margin:3px 5px 12px 5px;font: 14px/1.5 "sans serif",tahoma,verdana,helvetica;font-family: , ;}
.table_maxWidth table {max-width: 642px;} .table_maxWidth table {max-width: 642px;}
.homepagePostProjectState {width:52px; height:20px; line-height:20px; border-radius:1px; background-color:#28be6c; color:#ffffff; text-align:center; vertical-align:middle; font-size:12px; display:inline-block; margin-left:5px;} .homepagePostProjectState {width:52px; height:20px; line-height:20px; border-radius:1px; background-color:#28be6c; color:#ffffff; text-align:center; vertical-align:middle; font-size:12px; display:inline-block; margin-left:5px;}
.homepagePostAssignTo {float:left; font-size:14px; color:#269ac9;} .homepagePostAssignTo {float:left; font-size:14px; color:#269ac9;}
@ -844,7 +845,7 @@ a.sortArrowActiveU {background:url(images/post_image_list.png) -17px -20px no-re
.postDetailTitle {width:580px; max-width:580px; margin-bottom:5px;} .postDetailTitle {width:580px; max-width:580px; margin-bottom:5px;}
.postDetailDes {width:580px; max-width:580px; margin-bottom:6px; color:#888888;display:block;overflow:hidden;word-break:keep-all;text-overflow:ellipsis;} .postDetailDes {width:580px; max-width:580px; margin-bottom:6px; color:#888888;display:block;overflow:hidden;word-break:keep-all;text-overflow:ellipsis;}
.postDetailDes p,div,em{word-break: break-all;word-wrap: break-word;} .postDetailDes p,div,em{word-break: break-all;word-wrap: break-word;}
.homepagePostIntro p,.homepagePostIntro div,.homepagePostIntro em, .homepagePostIntro span{text-align: justify; text-justify:inter-ideograph; word-break: normal !important; word-wrap: break-word !important; line-height: 18px !important;} .homepagePostIntro p,.homepagePostIntro div,.homepagePostIntro em, .homepagePostIntro span{text-align: justify; text-justify:inter-ideograph; word-break: normal !important; word-wrap: break-word !important; line-height: 23px !important;}
.postDetailCreater {color:#888888; font-size:12px; float:left; margin-right:25px;} .postDetailCreater {color:#888888; font-size:12px; float:left; margin-right:25px;}
.postDetailDate {color:#888888; font-size:12px; float:left;} .postDetailDate {color:#888888; font-size:12px; float:left;}
.postDetailReply { margin-top:28px; color:#888888; float:right;display: inline} .postDetailReply { margin-top:28px; color:#888888; float:right;display: inline}
@ -1479,3 +1480,10 @@ a.choose-active {background-color:#269ac9; color:#ffffff;}
.subject-list-type {width:50px; text-align:center;} .subject-list-type {width:50px; text-align:center;}
.subject-list-count {width:60px; text-align:center;} .subject-list-count {width:60px; text-align:center;}
.subject-list-from {width:105px; text-align:center;} .subject-list-from {width:105px; text-align:center;}
/*视频播放默认图标*/
.mediaIco{margin: 30px 0 30px 20px;}
a.st_up{ display: block; width:8px; float:left; height:13px; background:url(../images/pic_up.png) 0 0 no-repeat; margin-top:5px; margin-left:3px;}
a.st_down{ display: block; width:8px; float:left; height:13px; background:url(../images/pic_up.png) 0 -22px no-repeat; margin-top:5px; margin-left:3px;}
a.st_img { display:block;width:32px; height:32px; border:1px solid #CCC; padding:1px;}
a:hover.st_img { border:1px solid #1c9ec7; }

@ -218,7 +218,7 @@ a.talk_btn{ background:#64bdd9; width:50px; height:20px; color:#fff; text-align:
a:hover.talk_btn{ background:#2a9dc1;} a:hover.talk_btn{ background:#2a9dc1;}
/****讨论区内页***/ /****讨论区内页***/
.mt0{ margin-top:0px;} .mt0{ margin-top:0px;}
.talk_info{ color:#7d7d7d; margin-left:60px; margin-top:10px;} .talk_info{ margin-left:60px; margin-top:10px;}
.issue_desc li{list-style-type: decimal;margin-left: 20px;} .issue_desc li{list-style-type: decimal;margin-left: 20px;}
.talk_info img {max-width:100%;} .talk_info img {max-width:100%;}
a.talk_edit{ color:#426e9a; margin-right:5px;} a.talk_edit{ color:#426e9a; margin-right:5px;}

@ -117,6 +117,7 @@ h4{ font-size:14px; color:#3b3b3b;}
.mt6{ margin-top:6px;} .mt6{ margin-top:6px;}
.mt8{ margin-top:8px;} .mt8{ margin-top:8px;}
.mt10{ margin-top:10px !important;} .mt10{ margin-top:10px !important;}
.mt16{ margin-top:16px !important;}
.mt20{margin-top: 20px;} .mt20{margin-top: 20px;}
.mt30{ margin-top: 30px;} .mt30{ margin-top: 30px;}
.mt40{ margin-top: 40px;} .mt40{ margin-top: 40px;}
@ -230,6 +231,7 @@ a.c_green{ color:#28be6c;}
.fontGrey2 {color:#888888;} .fontGrey2 {color:#888888;}
.fontGrey3 {color:#484848;} .fontGrey3 {color:#484848;}
.fontGrey4{color:#999999;} .fontGrey4{color:#999999;}
.fontGrey5 {color:#a1a1a1;}
.fontBlue {color:#3498db;} .fontBlue {color:#3498db;}
.fontBlue2 {color:#269ac9 !important;} .fontBlue2 {color:#269ac9 !important;}
a.underline {text-decoration:underline;} a.underline {text-decoration:underline;}
@ -1130,4 +1132,8 @@ a.resource-tab-active {color:#fff; background-color:#269ac9; border-bottom:1px s
a.group-btn{ background: url(../images/course/hwork_icon.png) -2px -58px no-repeat !important; height:20px; display:block; padding-left:23px; color:#888888; -moz-transition :all 0s linear 0s; -webkit-transition :all 0s linear 0s; -o-transition:all 0s linear 0s; transition:all 0s linear 0s;} a.group-btn{ background: url(../images/course/hwork_icon.png) -2px -58px no-repeat !important; height:20px; display:block; padding-left:23px; color:#888888; -moz-transition :all 0s linear 0s; -webkit-transition :all 0s linear 0s; -o-transition:all 0s linear 0s; transition:all 0s linear 0s;}
a.program-btn{background: url(../images/homepage_icon.png) -86px -393px no-repeat; width:30px; height:20px; display:block; padding-left:23px; color:#888888;} a.program-btn{background: url(../images/homepage_icon.png) -86px -393px no-repeat; width:30px; height:20px; display:block; padding-left:23px; color:#888888;}
/*视频播放默认图标*/
.mediaIco{margin: 30px 0 30px 20px;width: 200px;}
/*排序样式*/
a.st_up{ display: block; width:8px; float:left; height:13px; background:url(../images/pic_up.png) 0 0 no-repeat; margin-top:5px; margin-left:3px;}
a.st_down{ display: block; width:8px; float:left; height:13px; background:url(../images/pic_up.png) 0 -22px no-repeat; margin-top:5px; margin-left:3px;}
Loading…
Cancel
Save