Merge branch 'develop' into yuanke
This commit is contained in:
commit
c9c3aa5f31
|
@ -1177,7 +1177,7 @@ class CoursesController < ApplicationController
|
|||
AND homework_commons.course_id = #{@course.id}
|
||||
AND student_works.user_id = members.user_id
|
||||
) AS score,(SELECT (message_num*2 + message_reply_num*1 + news_reply_num*1 + news_num*1 +
|
||||
resource_num*5 + journal_num*1 + homework_journal_num*1 ) FROM `course_contributor_scores` AS ccs WHERE ccs.course_id = 577 AND ccs.user_id = members.user_id
|
||||
resource_num*5 + journal_num*1 + homework_journal_num*1 ) FROM `course_contributor_scores` AS ccs WHERE ccs.course_id = #{@course.id} AND ccs.user_id = members.user_id
|
||||
) AS act_score
|
||||
FROM members
|
||||
JOIN students_for_courses
|
||||
|
@ -1191,7 +1191,7 @@ class CoursesController < ApplicationController
|
|||
AND homework_commons.course_id = #{@course.id}
|
||||
AND student_works.user_id = members.user_id
|
||||
) AS score,(SELECT (message_num*2 + message_reply_num*1 + news_reply_num*1 + news_num*1 +
|
||||
resource_num*5 + journal_num*1 + homework_journal_num*1 ) FROM `course_contributor_scores` AS ccs WHERE ccs.course_id = 577 AND ccs.user_id = members.user_id
|
||||
resource_num*5 + journal_num*1 + homework_journal_num*1 ) FROM `course_contributor_scores` AS ccs WHERE ccs.course_id = #{@course.id} AND ccs.user_id = members.user_id
|
||||
) AS act_score
|
||||
FROM members
|
||||
JOIN students_for_courses
|
||||
|
|
|
@ -256,6 +256,13 @@ class FilesController < ApplicationController
|
|||
@order = ""
|
||||
@is_remote = false
|
||||
if params[:project_id]
|
||||
# 更新资源申请消息为已读
|
||||
# ar_ids = ApplyResource.where("user_id =? and container_id =? and container_type =?", User.current.id, params[:project_id].to_i, "Project").map{|ar| ar.id}
|
||||
# cms = CourseMessage.where("course_message_type =? and user_id =? and course_message_id in (#{ar_ids.empty? ? '0': ar_ids.join(',')})", "ApplyResource", User.current.id)
|
||||
# cms.each do |cm|
|
||||
# cm.update_column(:viewed, true)
|
||||
# end
|
||||
# over
|
||||
@page = params[:page] ? params[:page].to_i + 1 : 2
|
||||
@container_type = 0
|
||||
if params[:sort]
|
||||
|
|
|
@ -164,7 +164,7 @@ class OrganizationsController < ApplicationController
|
|||
return
|
||||
end
|
||||
q = params[:search].nil? ? "" : "#{params[:search].strip}"
|
||||
@field = OrgSubfield.find(params[:org_subfield_id])
|
||||
@field = params[:org_subfield_id].nil? ? OrgSubfield.where("organization_id =? and field_type =?", params[:id].to_i, "Comptec").first : OrgSubfield.find(params[:org_subfield_id])
|
||||
@type = params[:type]
|
||||
if @type == "courses" || @type.nil?
|
||||
@org_teachers = User.find_by_sql("select u.*, ue.technical_title, ue.school_id,(select count(*) from courses where courses.tea_id = u.id) as course_count
|
||||
|
|
|
@ -423,9 +423,13 @@ class PollController < ApplicationController
|
|||
# 将其他地方的问卷导出来
|
||||
def other_poll
|
||||
# 查作者是我,或者作者是当前课程的老师,且不在当前课程内的问卷 进行导入
|
||||
tea_ids = '('
|
||||
tea_ids << Course.find(params[:polls_group_id]).tea_id.to_s << ','<< User.current.id.to_s << ')'
|
||||
@polls = Poll.where("user_id in #{tea_ids} and polls_type = 'course' and polls_group_id != #{params[:polls_group_id]}")
|
||||
courses = User.current.courses.select { |course| User.current.allowed_to?(:as_teacher,course)}
|
||||
course_ids = courses.empty? ? "(-1)" : "(" + courses.map { |course| course.id}.join(',') + ")"
|
||||
none_courses = User.current.courses.where("is_delete = 1 or #{Course.table_name}.id = #{params[:polls_group_id].to_i}")
|
||||
none_course_ids = none_courses.empty? ? "(-1)" : "(" + none_courses.map { |course| course.id}.join(',') + ")"
|
||||
#tea_ids = '('
|
||||
#tea_ids << Course.find(params[:polls_group_id]).tea_id.to_s << ','<< User.current.id.to_s << ')'
|
||||
@polls = Poll.where("(user_id = #{User.current.id} or polls_group_id in #{course_ids}) and polls_type = 'course' and polls_group_id not in #{none_course_ids}")
|
||||
@polls_group_id = params[:polls_group_id]
|
||||
respond_to do |format|
|
||||
format.js
|
||||
|
|
|
@ -362,6 +362,8 @@ update
|
|||
# project_path_cut = RepositoriesHelper::PROJECT_PATH_CUT
|
||||
# ip = RepositoriesHelper::REPO_IP_ADDRESS
|
||||
gitlab_address = Redmine::Configuration['gitlab_address']
|
||||
# REDO:需优化,仅测试用
|
||||
@zip_path = gitlab_address.to_s + "/api/v3/projects/" + @project.gpid.to_s + "/repository/archive?&private_token=YTyCv4978MXmdL2B9C62"
|
||||
if @repository.type.to_s == "Repository::Gitlab"
|
||||
@repos_url = gitlab_address.to_s+"/"+@project.owner.to_s+"/"+@repository.identifier+"."+"git"
|
||||
else
|
||||
|
|
|
@ -376,6 +376,7 @@ class StudentWorkController < ApplicationController
|
|||
##################################################################################################################
|
||||
@order,@b_sort,@name,@group = params[:order] || "score",params[:sort] || "desc",params[:name] || "",params[:group]
|
||||
@homework_commons = @course.homework_commons.where("publish_time <= ?",Time.now.strftime("%Y-%m-%d")).order("created_at desc")
|
||||
@all_homework_commons = @course.homework_commons.order("created_at desc")
|
||||
@is_teacher = User.current.allowed_to?(:as_teacher,@course) || User.current.admin?
|
||||
@is_evaluation = @homework.homework_detail_manual && @homework.homework_detail_manual.comment_status == 2 && !@is_teacher #是不是匿评
|
||||
@show_all = false
|
||||
|
|
|
@ -311,6 +311,28 @@ class UsersController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
# 处理资源引用请求
|
||||
# status
|
||||
def deal_with_apply_resource
|
||||
@msg = CourseMessage.find(params[:msg_id])
|
||||
ar = ApplyResource.where("id = ?", @msg.course_message_id).first
|
||||
unless ar.nil?
|
||||
case params[:agree]
|
||||
when 'Y'
|
||||
ar.update_column('status', 2)
|
||||
@msg.update_attributes(:apply_result => 1, :viewed => 1)
|
||||
ar.course_messages << CourseMessage.new(:user_id => ar.user_id, :course_id => -1, :viewed => false, :apply_result => 2, :status => 1)
|
||||
when 'N'
|
||||
ar.update_column('status', 3)
|
||||
@msg.update_attributes(:apply_result => 2, :viewed => 1)
|
||||
ar.course_messages << CourseMessage.new(:user_id => ar.user_id, :course_id => -1, :viewed => false, :apply_result => 3, :status => 1)
|
||||
end
|
||||
end
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
#处理引用作业的请求
|
||||
#status 1 同意 2 拒绝
|
||||
def dealwith_apply_homework
|
||||
|
@ -419,6 +441,19 @@ class UsersController < ApplicationController
|
|||
end
|
||||
# end
|
||||
|
||||
# 资源分享请求弹框
|
||||
def apply_resource
|
||||
if User.current.logged?
|
||||
@attachment = Attachment.find params[:attachment_id]
|
||||
@state = 2
|
||||
else
|
||||
@state = 1
|
||||
end
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
#引用作业请求弹框
|
||||
def apply_homework
|
||||
if User.current.logged?
|
||||
|
@ -432,6 +467,27 @@ class UsersController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
# 申请引用资源
|
||||
def apply_for_resource
|
||||
if User.current.logged?
|
||||
@attachment = Attachment.where("id =?", params[:attachment_id].to_i).first
|
||||
unless @attachment.nil?
|
||||
ar = ApplyResource.where("user_id = ? and attachment_id = ?", User.current.id, params[:attacment_id].to_i)
|
||||
if ar.empty?
|
||||
ApplyResource.create(:user_id => params[:id].to_i, :attachment_id => params[:attachment_id].to_i, :status => true, :container_id => @attachment.container_id, :container_type => @attachment.container_type, :content => params[:content], :apply_user_id => @attachment.author_id)
|
||||
@state = 2
|
||||
else
|
||||
@state = 3
|
||||
end
|
||||
end
|
||||
else
|
||||
@state = 1
|
||||
end
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
#申请引用非公开作业
|
||||
def apply_for_homework
|
||||
if User.current.logged?
|
||||
|
@ -1886,7 +1942,7 @@ class UsersController < ApplicationController
|
|||
# 将资源发送到对应的课程,分为发送单个,或者批量发送
|
||||
def add_exist_file_to_course
|
||||
@flag = true
|
||||
if params[:send_id].present?
|
||||
if params[:send_id].present?
|
||||
send_id = params[:send_id]
|
||||
@ori = Attachment.find_by_id(send_id)
|
||||
course_ids = params[:course_ids]
|
||||
|
@ -1933,14 +1989,14 @@ class UsersController < ApplicationController
|
|||
end
|
||||
send_ids.each do |send_id|
|
||||
quotes = 0
|
||||
ori = Attachment.find_by_id(send_id)
|
||||
@ori = Attachment.find_by_id(send_id)
|
||||
unless course_ids.nil?
|
||||
course_ids.each do |id|
|
||||
quotes = 0
|
||||
next if ori.blank?
|
||||
next if @ori.blank?
|
||||
@exist = false
|
||||
Course.find(id).attachments.each do |att| #如果课程中包含该资源
|
||||
if att.id == ori.id || (!att.copy_from.nil? && !ori.copy_from.nil? && att.copy_from == ori.copy_from) || att.copy_from == ori.id || att.id == ori.copy_from
|
||||
if att.id == @ori.id || (!att.copy_from.nil? && !@ori.copy_from.nil? && att.copy_from == @ori.copy_from) || att.copy_from == @ori.id || att.id == @ori.copy_from
|
||||
att.created_on = Time.now
|
||||
att.save
|
||||
@exist = true
|
||||
|
@ -1948,21 +2004,21 @@ class UsersController < ApplicationController
|
|||
end
|
||||
end
|
||||
next if @exist
|
||||
attach_copied_obj = ori.copy
|
||||
attach_copied_obj.tag_list.add(ori.tag_list) # tag关联
|
||||
attach_copied_obj = @ori.copy
|
||||
attach_copied_obj.tag_list.add(@ori.tag_list) # tag关联
|
||||
attach_copied_obj.container = Course.find(id)
|
||||
attach_copied_obj.created_on = Time.now
|
||||
attach_copied_obj.author_id = User.current.id
|
||||
attach_copied_obj.is_public = 0
|
||||
attach_copied_obj.copy_from = ori.copy_from.nil? ? ori.id : ori.copy_from #发送要添加copy_from
|
||||
attach_copied_obj.copy_from = @ori.copy_from.nil? ? @ori.id : @ori.copy_from #发送要添加copy_from
|
||||
if attach_copied_obj.attachtype == nil
|
||||
attach_copied_obj.attachtype = 4
|
||||
end
|
||||
if attach_copied_obj.save
|
||||
# 更新引用次数
|
||||
quotes = ori.quotes.to_i + 1
|
||||
ori.update_attribute(:quotes, quotes) unless ori.nil?
|
||||
ori.forwards << Forward.new(:to_type => attach_copied_obj.class.name, :to_id => attach_copied_obj.id,:created_at => Time.now)
|
||||
quotes = @ori.quotes.to_i + 1
|
||||
@ori.update_attribute(:quotes, quotes) unless @ori.nil?
|
||||
@ori.forwards << Forward.new(:to_type => attach_copied_obj.class.name, :to_id => attach_copied_obj.id,:created_at => Time.now)
|
||||
end
|
||||
@save_message = attach_copied_obj.errors.full_messages
|
||||
end
|
||||
|
@ -2002,6 +2058,18 @@ class UsersController < ApplicationController
|
|||
# 公共资源库:所有公开资源或者我上传的私有资源
|
||||
@attachments = get_public_resources(user_course_ids, user_project_ids, params[:order], @score)
|
||||
end
|
||||
elsif params[:type] == "2"
|
||||
apply_ids = ApplyResource.where("user_id =? and status =?", params[:id], 2).map { |ar| ar.attachment_id}
|
||||
if params[:status] == "2"
|
||||
resource_type = "'Course'"
|
||||
elsif params[:status] == "3"
|
||||
resource_type = "'Project'"
|
||||
elsif params[:status] == "5"
|
||||
resource_type = "'Principal'"
|
||||
else
|
||||
resource_type = "'Project','OrgSubfield','Principal','Course'"
|
||||
end
|
||||
@attachments = get_my_private_resources(apply_ids, resource_type, @order, @score)
|
||||
end
|
||||
@type = params[:type]
|
||||
@limit = 25
|
||||
|
@ -2143,6 +2211,18 @@ class UsersController < ApplicationController
|
|||
# 公共资源库:所有公开资源或者我上传的私有资源
|
||||
@attachments = get_public_resources(user_course_ids, user_project_ids, params[:order], @score)
|
||||
end
|
||||
elsif params[:type] == "2"
|
||||
apply_ids = ApplyResource.where("user_id =? and status =?", params[:id], 2).map { |ar| ar.attachment_id}
|
||||
if params[:status] == "2"
|
||||
resource_type = "'Course'"
|
||||
elsif params[:status] == "3"
|
||||
resource_type = "'Project'"
|
||||
elsif params[:status] == "5"
|
||||
resource_type = "'Principal'"
|
||||
else
|
||||
resource_type = "'Project','OrgSubfield','Principal','Course'"
|
||||
end
|
||||
@attachments = get_my_private_resources(apply_ids, resource_type, @order, @score)
|
||||
end
|
||||
@status = params[:status]
|
||||
@type = params[:type]
|
||||
|
@ -2272,6 +2352,18 @@ class UsersController < ApplicationController
|
|||
# 公共资源库:所有公开资源或者我上传的私有资源
|
||||
@attachments = get_public_resources(user_course_ids, user_project_ids, params[:order], @score)
|
||||
end
|
||||
elsif params[:type] == "2"
|
||||
apply_ids = ApplyResource.where("user_id =? and status =?", params[:id], 2).map { |ar| ar.attachment_id}
|
||||
if params[:status] == "2"
|
||||
resource_type = "'Course'"
|
||||
elsif params[:status] == "3"
|
||||
resource_type = "'Project'"
|
||||
elsif params[:status] == "5"
|
||||
resource_type = "'Principal'"
|
||||
else
|
||||
resource_type = "'Project','OrgSubfield','Principal','Course'"
|
||||
end
|
||||
@attachments = get_my_private_resources(apply_ids, resource_type, @order, @score)
|
||||
end
|
||||
@type = params[:type]
|
||||
@limit = 25
|
||||
|
@ -2608,12 +2700,12 @@ class UsersController < ApplicationController
|
|||
|
||||
# 获取公共资源
|
||||
def get_public_resources user_course_ids, user_project_ids, order, score
|
||||
attachments = Attachment.where("(is_publish = 1 and is_public =1 and container_id is not null and container_type in('Project','OrgSubfield','Principal','Course')) ").order("#{order.nil? ? 'created_on' : order} #{score}")
|
||||
attachments = Attachment.where("(is_publish = 1 and container_id is not null and container_type in('Project','OrgSubfield','Principal','Course')) ").order("#{order.nil? ? 'created_on' : order} #{score}")
|
||||
end
|
||||
|
||||
# 获取公共资源搜索
|
||||
def get_public_resources_search user_course_ids, user_project_ids, order, score, search
|
||||
attachments = Attachment.where("is_publish = 1 and is_public = 1 and container_id is not null and container_type in('Project','OrgSubfield','Principal','Course') and (filename like :p)" ,:p => search).order("#{order.nil? ? 'created_on' : order} #{score}")
|
||||
attachments = Attachment.where("is_publish = 1 and is_public = 1 and container_id is not null and container_type in('Project','OrgSubfield','Principal','Course') and (filename like :p)", :p => search).order("#{order.nil? ? 'created_on' : order} #{score}")
|
||||
end
|
||||
|
||||
# 获取我的资源
|
||||
|
@ -2637,6 +2729,16 @@ class UsersController < ApplicationController
|
|||
and is_publish = 1 and container_id is not null)" ).order("#{order.nil? ? 'created_on' : order} #{score}")
|
||||
end
|
||||
|
||||
# 获取我的私有资源分享结果
|
||||
def get_my_private_resources apply_ids, resource_type, order, score
|
||||
attachments = Attachment.where("id in (#{apply_ids.empty? ? '0': apply_ids.join(',')}) and container_type in(#{resource_type})").order("#{order.nil? ? 'created_on' : order} #{score}")
|
||||
end
|
||||
|
||||
# 获取我的私有资源分享搜索结果
|
||||
def get_my_private_resources_search apply_ids, resource_type, order, score, search
|
||||
attachments = Attachment.where("id in (#{apply_ids.empty? ? '0': apply_ids.join(',')}) and container_type in(#{resource_type}) and (filename like :p)", :p => search).order("#{order.nil? ? 'created_on' : order} #{score}")
|
||||
end
|
||||
|
||||
# 获取我的课程资源中搜索结果
|
||||
def get_course_resources_search author_id, user_course_ids, order, score, search
|
||||
attchments = Attachment.where("((author_id = #{author_id} and is_publish = 1 and container_id is not null and container_type = 'Course')"+
|
||||
|
@ -2646,12 +2748,12 @@ class UsersController < ApplicationController
|
|||
|
||||
# 获取公共资源中课程资源
|
||||
def get_course_resources_public user_course_ids, order, score
|
||||
attchments = Attachment.where("(container_type = 'Course'and container_id is not null and is_publish = 1 and is_public =1)").order("#{order.nil? ? 'created_on' : order} #{score}")
|
||||
attchments = Attachment.where("(container_type = 'Course'and container_id is not null and is_publish = 1)").order("#{order.nil? ? 'created_on' : order} #{score}")
|
||||
end
|
||||
|
||||
# 获取公共资源中课程资源搜索结果
|
||||
def get_course_resources_public_search user_course_ids, order, score, search
|
||||
attchments = Attachment.where("(container_type = 'Course'and container_id is not null and is_publish = 1 and is_public =1) and (filename like :p)", :p => search ).order("#{order.nil? ? 'created_on' : order} #{score}")
|
||||
attchments = Attachment.where("(container_type = 'Course'and container_id is not null and is_publish = 1) and (filename like :p)", :p => search ).order("#{order.nil? ? 'created_on' : order} #{score}")
|
||||
end
|
||||
|
||||
# 获取我的项目资源
|
||||
|
@ -2670,12 +2772,12 @@ class UsersController < ApplicationController
|
|||
|
||||
# 获取公共资源的项目资源
|
||||
def get_project_resources_public user_project_ids, order, score
|
||||
attchments = Attachment.where("container_type = 'Project' and container_id is not null and is_public =1").order("#{order.nil? ? 'created_on' : order} #{score}")
|
||||
attchments = Attachment.where("container_type = 'Project' and container_id is not null").order("#{order.nil? ? 'created_on' : order} #{score}")
|
||||
end
|
||||
|
||||
# 获取公共资源的项目资源搜索
|
||||
def get_project_resources_public_search user_project_ids, order, score, search
|
||||
attchments = Attachment.where("(container_type = 'Project' and container_id is not null and is_public =1) and (filename like :p)", :p => search ).order("#{order.nil? ? 'created_on' : order} #{score}")
|
||||
attchments = Attachment.where("(container_type = 'Project' and container_id is not null) and (filename like :p)", :p => search ).order("#{order.nil? ? 'created_on' : order} #{score}")
|
||||
end
|
||||
|
||||
# 获取我上传的附件
|
||||
|
@ -2693,13 +2795,13 @@ class UsersController < ApplicationController
|
|||
# 获取公共资源中我上传的附件
|
||||
def get_attch_resources_public order, score
|
||||
attchments = Attachment.where("container_type in('Issue','Document','Message','News','StudentWorkScore','HomewCommon','OrgSubfield','Principal')
|
||||
and container_id is not null and is_public =1").order("#{order.nil? ? 'created_on' : order} #{score}")
|
||||
and container_id is not null").order("#{order.nil? ? 'created_on' : order} #{score}")
|
||||
end
|
||||
|
||||
# 获取公共资源中我上传的附件
|
||||
def get_attch_resources_public_search order, score, search
|
||||
attchments = Attachment.where("(container_type in('Issue','Document','Message','News','StudentWorkScore','HomewCommon','OrgSubfield','Principal')
|
||||
and container_id is not null and is_public =1) and (filename like :p)", :p => search).order("#{order.nil? ? 'created_on' : order} #{score}")
|
||||
and container_id is not null) and (filename like :p)", :p => search).order("#{order.nil? ? 'created_on' : order} #{score}")
|
||||
end
|
||||
|
||||
# 获取我的用户类型资源
|
||||
|
@ -2714,12 +2816,12 @@ class UsersController < ApplicationController
|
|||
|
||||
# 获取我的用户类型资源
|
||||
def get_principal_resources_public order, score
|
||||
attchments = Attachment.where("container_type = 'Principal'and container_id is not null and is_public =1").order("#{order.nil? ? 'created_on' : order} #{score}")
|
||||
attchments = Attachment.where("container_type = 'Principal' and container_id is not null").order("#{order.nil? ? 'created_on' : order} #{score}")
|
||||
end
|
||||
|
||||
# 获取我的用户类型资源
|
||||
def get_principal_resources_public_search order, score, search
|
||||
attchments = Attachment.where("(container_type = 'Principal'and container_id is not null and is_public =1) and (filename like :p)", :p => search).order("#{order.nil? ? 'created_on' : order} #{score}")
|
||||
attchments = Attachment.where("(container_type = 'Principal'and container_id is not null) and (filename like :p)", :p => search).order("#{order.nil? ? 'created_on' : order} #{score}")
|
||||
end
|
||||
|
||||
# 资源库 分为全部 课程资源 项目资源 附件
|
||||
|
@ -2734,7 +2836,7 @@ class UsersController < ApplicationController
|
|||
user_course_ids = User.current.courses.map { |c| c.is_delete == 0 && c.id}
|
||||
user_project_ids = User.current.projects.map {|p| p.status != 9 && p.id }
|
||||
# user_org_ids = User.current.organizations.map {|o| o.id}
|
||||
if(params[:type].blank? || params[:type] == "1") # 我的资源
|
||||
if( params[:type] == "1") # 我的资源
|
||||
# 修正:我的资源库的话,那么应该是我上传的所有资源加上,我加入的课程、项目、组织的所有资源
|
||||
if params[:status] == "2"
|
||||
@attachments = get_course_resources(params[:id], user_course_ids, @order, @score)
|
||||
|
@ -2748,7 +2850,7 @@ class UsersController < ApplicationController
|
|||
# 公共资源库:所有公开资源或者我上传的私有资源
|
||||
@attachments = get_my_resources(params[:id], user_course_ids, user_project_ids, @order, @score)
|
||||
end
|
||||
elsif params[:type] == "6" # 公共资源
|
||||
elsif (params[:type].blank? || params[:type] == "6") # 公共资源
|
||||
if params[:status] == "2"
|
||||
@attachments = get_course_resources_public( user_course_ids, @order, @score)
|
||||
elsif params[:status] == "3"
|
||||
|
@ -2761,6 +2863,18 @@ class UsersController < ApplicationController
|
|||
# 公共资源库:所有公开资源或者我上传的私有资源
|
||||
@attachments = get_public_resources(user_course_ids, user_project_ids, params[:order], @score)
|
||||
end
|
||||
elsif params[:type] == "2" # 私有资源
|
||||
apply_ids = ApplyResource.where("user_id =? and status =?", params[:id], 2).map { |ar| ar.attachment_id}
|
||||
if params[:status] == "2"
|
||||
resource_type = "'Course'"
|
||||
elsif params[:status] == "3"
|
||||
resource_type = "'Project'"
|
||||
elsif params[:status] == "5"
|
||||
resource_type = "'Principal'"
|
||||
else
|
||||
resource_type = "'Project','OrgSubfield','Principal','Course'"
|
||||
end
|
||||
@attachments = get_my_private_resources(apply_ids, resource_type, @order, @score)
|
||||
end
|
||||
@status = params[:status]
|
||||
@type = params[:type]
|
||||
|
@ -2780,8 +2894,7 @@ class UsersController < ApplicationController
|
|||
# 导入资源
|
||||
def import_resources
|
||||
# 别人的资源库是没有权限去看的
|
||||
@user = User.find_by_login(params[:id])
|
||||
if User.current != @user
|
||||
if User.current.id != params[:id].to_i
|
||||
render_403
|
||||
return
|
||||
end
|
||||
|
@ -2941,6 +3054,19 @@ class UsersController < ApplicationController
|
|||
# 公共资源库:所有公开资源或者我上传的私有资源
|
||||
@attachments = get_public_resources_search(user_course_ids, user_project_ids, @order, @score, search)
|
||||
end
|
||||
elsif params[:type] == "2" # 私有资源
|
||||
apply_ids = ApplyResource.where("user_id =? and status =?", params[:id], 2).map { |ar| ar.attachment_id}
|
||||
if params[:status] == "2"
|
||||
resource_type = "'Course'"
|
||||
elsif params[:status] == "3"
|
||||
resource_type = "'Project'"
|
||||
elsif params[:status] == "5"
|
||||
resource_type = "'Principal'"
|
||||
else
|
||||
resource_type = "'Project','OrgSubfield','Principal','Course'"
|
||||
end
|
||||
@attachments = get_my_private_resources_search(apply_ids, resource_type, @order, @score, search)
|
||||
@attachments
|
||||
end
|
||||
@status = params[:status]
|
||||
@type = params[:type]
|
||||
|
|
|
@ -49,6 +49,21 @@ module ApplicationHelper
|
|||
return result
|
||||
end
|
||||
|
||||
# 判断某个资源是否可以申请
|
||||
def attach_show_allow attach_id
|
||||
attachment = Attachment.find(attach_id)
|
||||
case attachment.container_type
|
||||
when "Project"
|
||||
User.current.member_of?(attachment.container) ? true : false
|
||||
when "Course"
|
||||
User.current.member_of_course?(attachment.container) ? true : false
|
||||
when "OrgSubfield"
|
||||
User.current.member_of_org?(attachment.container) ? true : false
|
||||
when "Principal"
|
||||
User.current.id == attachment.author_id ? true : false
|
||||
end
|
||||
end
|
||||
|
||||
# Time 2015-03-24 15:27:29
|
||||
# Author lizanle
|
||||
# Description 从硬盘上删除对应的资源文件
|
||||
|
@ -3237,6 +3252,7 @@ def strip_html(text,len=0,endss="...")
|
|||
ss = ""
|
||||
if text.length>0
|
||||
ss=text.gsub(/<\/?.*?>/, '').strip
|
||||
ss = ss.gsub(/ /, ' ')
|
||||
|
||||
if len > 0 && ss.length > len
|
||||
ss = ss[0, len] + endss
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
class ApplyResource < ActiveRecord::Base
|
||||
# status:1. 等待回复 2.审核通过 3.已拒绝
|
||||
attr_accessible :attachment_id, :status, :user_id, :container_type, :container_id, :apply_user_id, :content
|
||||
belongs_to :user
|
||||
belongs_to :attachment
|
||||
has_many :course_messages, :class_name => 'CourseMessage', :as => :course_message, :dependent => :destroy
|
||||
after_create :act_as_apply_resource_message
|
||||
|
||||
def act_as_apply_resource_message
|
||||
self.course_messages << CourseMessage.new(:user_id => self.apply_user_id, :course_id => -1, :viewed => false, :status => 0, )
|
||||
# REDO:发送邮件
|
||||
# Mailer.run.apply_for_resource_request(self.container_id, User.current)
|
||||
end
|
||||
|
||||
def find_attachment attachment_id
|
||||
Attachment.find(attachment_id)
|
||||
end
|
||||
|
||||
end
|
|
@ -35,6 +35,7 @@ class Attachment < ActiveRecord::Base
|
|||
# end
|
||||
include UserScoreHelper
|
||||
has_many :attachment_histories
|
||||
has_many :apply_resources, :dependent => :destroy
|
||||
|
||||
validates :filename, presence: true, length: {maximum: 254}
|
||||
validates :author, presence: true
|
||||
|
@ -139,6 +140,11 @@ class Attachment < ActiveRecord::Base
|
|||
}
|
||||
)
|
||||
end
|
||||
|
||||
def get_apply_resource_status attachment_id, author_id
|
||||
ApplyResource.where("attachment_id =? and apply_user_id =?", attachment_id, author_id).first.try(:status)
|
||||
end
|
||||
|
||||
# add by nwb
|
||||
# 公开的项目id列表
|
||||
def self.public_project_id
|
||||
|
@ -536,6 +542,11 @@ class Attachment < ActiveRecord::Base
|
|||
end
|
||||
end
|
||||
|
||||
# 获取资源申请状态
|
||||
def get_status_by_attach user_id
|
||||
ApplyResource.where("user_id =? and attachment_id =?", user_id, self.id).first.try(:status)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
# Physically deletes the file from the file system
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
class CourseMessage < ActiveRecord::Base
|
||||
# status说明: status在课程不同的类型,区分不同的功能 status = 9 作品的提交记录
|
||||
# ApplyResource status:
|
||||
# 0: 发送申请 1:回复允许申请 2:拒绝申请消息
|
||||
# HomeworkCommon:status:
|
||||
# nil:发布了作业; 1:作业截止时间到了提醒!;2:开启匿评; 3:关闭匿评; 4:匿评开始失败; 5:申请引用作业, 6:申请结果
|
||||
# apply_user_id: 申请者的用户id
|
||||
|
|
|
@ -239,8 +239,10 @@ class Journal < ActiveRecord::Base
|
|||
|
||||
#缺陷回复微信模板消息
|
||||
def issue_wechat_message
|
||||
ws = WechatService.new
|
||||
content = strip_html self.notes.html_safe, 200
|
||||
ws.comment_template self.issue.author_id, "issues", self.journalized_id, "#{l(:label_issue_comment_template)}", self.user.try(:realname), format_time(self.created_on), content
|
||||
if !self.notes.nil? && self.notes.gsub(' ','') != ''
|
||||
ws = WechatService.new
|
||||
content = strip_html self.notes.html_safe, 200
|
||||
ws.comment_template self.issue.author_id, "issues", self.journalized_id, "#{l(:label_issue_comment_template)}", self.user.try(:realname), format_time(self.created_on), content
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -259,19 +259,26 @@ class JournalsForMessage < ActiveRecord::Base
|
|||
if self.m_parent_id.nil?
|
||||
if self.user_id != self.jour.user_id
|
||||
self.course_messages << CourseMessage.new(:user_id => self.jour.user_id,:course_id => self.jour.course.id, :viewed => false)
|
||||
count = ShieldWechatMessage.where("container_type='User' and container_id=#{self.jour.user_id} and shield_type='Course' and shield_id=#{self.jour.course_id}").count
|
||||
if count == 0
|
||||
ws = WechatService.new
|
||||
#content = truncate(strip_tags(self.notes.to_s), length: 200)
|
||||
content = strip_html self.notes.html_safe, 200
|
||||
ws.comment_template self.jour.user_id, "homework", self.jour_id, "#{l(:label_homework_comment_template)}", self.user.try(:realname), format_time(self.created_on), content
|
||||
end
|
||||
end
|
||||
else
|
||||
if self.user_id != self.parent.user_id
|
||||
self.course_messages << CourseMessage.new(:user_id => self.parent.user_id,:course_id => self.jour.course.id, :viewed => false)
|
||||
count = ShieldWechatMessage.where("container_type='User' and container_id=#{self.parent.user_id} and shield_type='Course' and shield_id=#{self.jour.course_id}").count
|
||||
if count == 0
|
||||
ws = WechatService.new
|
||||
#content = truncate(strip_tags(self.notes.to_s), length: 200)
|
||||
content = strip_html self.notes.html_safe, 200
|
||||
ws.comment_template self.parent.user_id, "homework", self.jour_id, "#{l(:label_new_second_comment_template)}", self.user.try(:realname), format_time(self.created_on), content
|
||||
end
|
||||
end
|
||||
end
|
||||
count = ShieldWechatMessage.where("container_type='User' and container_id=#{self.jour.user_id} and shield_type='Course' and shield_id=#{self.jour.course_id}").count
|
||||
if count == 0
|
||||
ws = WechatService.new
|
||||
#content = truncate(strip_tags(self.notes.to_s), length: 200)
|
||||
content = strip_html self.notes.html_safe, 200
|
||||
ws.comment_template self.jour.user_id, "homework", self.jour_id, "#{l(:label_homework_comment_template)}", self.user.try(:realname), format_time(self.created_on), content
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -109,6 +109,7 @@ class User < Principal
|
|||
has_many :student_works_scores, :dependent => :destroy
|
||||
has_many :student_work_projects, :dependent => :destroy
|
||||
has_many :apply_homeworks, :dependent => :destroy
|
||||
has_many :apply_resources, :dependent => :destroy
|
||||
#end
|
||||
|
||||
has_and_belongs_to_many :groups, :after_add => Proc.new {|user, group| group.user_added(user)},
|
||||
|
|
|
@ -22,60 +22,6 @@
|
|||
<div class="cl"></div>
|
||||
|
||||
<div class="fl">
|
||||
<%= render :partial => "student_table"%>
|
||||
<%= render :partial => "student_table" %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
||||
<% @exercise_users_list.each do |exercise|%>
|
||||
<script type="text/javascript">
|
||||
$(".student_work_<%= exercise.id%>").mouseenter(function(){
|
||||
$("#work_click_<%= exercise.id%>").show();
|
||||
}).mouseleave(function(){
|
||||
$("#work_click_<%= exercise.id%>").hide();
|
||||
});
|
||||
$(function(){
|
||||
<% if Time.parse(h(@exercise.end_time)).strftime("%Y-%m-%d-%H-%M-%S") <= Time.now.strftime("%Y-%m-%d-%H-%M-%S") %>
|
||||
$("#show_student_result_div_<%= exercise.id%>").on('click',function() {
|
||||
window.location.href = '<%=show_student_result_exercise_path(@exercise,:user_id => exercise.user_id) %>';
|
||||
});
|
||||
<% else %>
|
||||
$("#show_student_result_div_<%= exercise.id%>").attr("title","截止日期未到,暂不能查看学生答题结果");
|
||||
$("#student_name_<%= exercise.id%>").attr("title","截止日期未到,暂不能查看学生答题结果");
|
||||
$("#student_id_<%= exercise.id%>").attr("title","截止日期未到,暂不能查看学生答题结果");
|
||||
$("#student_class_<%= exercise.id%>").attr("title","截止日期未到,暂不能查看学生答题结果");
|
||||
<% end %>
|
||||
});
|
||||
/*function show_result(id) {
|
||||
window.location.href = '<%#=show_student_result_exercise_path(@exercise,:user_id => exercise.user.id) %>';
|
||||
}*/
|
||||
</script>
|
||||
<ul class="hworkListRow" id="student_work_<%= exercise.id%>">
|
||||
<li class="ml5 mr5" style="width:28px; text-align:center;">1</li>
|
||||
<li class="hworkPortrait mt15 mr10">
|
||||
<%= link_to(image_tag(url_to_avatar(exercise.user),:width =>"40",:height => "40",:style => "display:block;"),user_activities_path(exercise.user)) %>
|
||||
</li>
|
||||
<li class="hworkStName" title="姓名" id="student_name_<%= exercise.id%>" style="cursor:pointer;">
|
||||
<%=exercise.user.show_name %>
|
||||
</li><li class="hworkStID pl15 pr10" title="学号" id="student_id_<%= exercise.id%>" style="cursor:pointer;">
|
||||
<%= exercise.user.user_extensions.nil? ? "--" : exercise.user.user_extensions.student_id%>
|
||||
</li>
|
||||
<li class="hworkStID" title="班级" id="student_class_<%= exercise.id%>" style="cursor:pointer;">
|
||||
--
|
||||
</li>
|
||||
<li class="hworkList130 ml200 c_grey student_work_<%= exercise.id%>">
|
||||
<% if exercise.created_at%>
|
||||
<%= Time.parse(format_time(exercise.created_at)).strftime("%m-%d %H:%M")%>
|
||||
<% if @exercise.end_time <= exercise.created_at %>
|
||||
<span class="c_red">[未答]</span>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</li>
|
||||
|
||||
<li class="hworkList50 <%= score_color exercise.score%> student_final_scor_info">
|
||||
<%= exercise.score.nil? ? "--" : format("%.1f",exercise.score)%>
|
||||
</li>
|
||||
<li class="hworkTip" style="display: none" id="work_click_<%= exercise.id%>"><em></em><span></span><font class="fontGrey2">点击查看详情</font></li>
|
||||
</ul>
|
||||
|
||||
<div class="cl"></div>
|
||||
<% end%>
|
||||
<div class="cl"></div>
|
|
@ -0,0 +1,81 @@
|
|||
<div class="fl" style="padding-bottom:10px; width:720px;">
|
||||
<span class="c_dark f14 fb fl mr30">
|
||||
测验
|
||||
<font class="f12 c_red">
|
||||
(<%= @exercise_count%>人已交)
|
||||
</font>
|
||||
<% if !@is_teacher && @exercise_users_list.empty?%>
|
||||
<span class="f12 c_red">您尚未提交</span>
|
||||
<% elsif !@is_teacher && !@exercise_users_list.empty?%>
|
||||
<span class="f12 c_red">您已提交</span>
|
||||
<% end %>
|
||||
</span>
|
||||
<%#if @is_teacher || @exercise.exercise_status == 3%>
|
||||
<!--<div class="hworkSearchBox">
|
||||
<input type="text" id="course_student_name" value="<%#= @name%>" placeholder="姓名、学号、邮箱" class="hworkSearchInput" onkeypress="SearchByName('<%#= student_work_index_path(:homework => @homework.id)%>',event);"/>
|
||||
<a class="hworkSearchIcon" id="search_in_student_work" onclick="SearchByName_1('<%#= student_work_index_path(:homework => @homework.id)%>');" href="javascript:void(0)"></a>
|
||||
</div>-->
|
||||
<%#= select_tag(:student_work_in_group,options_for_select(course_group_list(@course),@group), {:class => "classSplit"}) unless course_group_list(@course).empty? %>
|
||||
<%# end%>
|
||||
<span class="fr c_grey"> <a href="javascript:void(0);" class="linkGrey2" id="homework_info_show" style="display: none">[ 显示测验信息 ]</a> </span>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
||||
<div class="fl">
|
||||
<%= render :partial => "student_table"%>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
||||
<% @exercise_users_list.each do |exercise|%>
|
||||
<script type="text/javascript">
|
||||
$(".student_work_<%= exercise.id%>").mouseenter(function(){
|
||||
$("#work_click_<%= exercise.id%>").show();
|
||||
}).mouseleave(function(){
|
||||
$("#work_click_<%= exercise.id%>").hide();
|
||||
});
|
||||
$(function(){
|
||||
<% if Time.parse(h(@exercise.end_time)).strftime("%Y-%m-%d-%H-%M-%S") <= Time.now.strftime("%Y-%m-%d-%H-%M-%S") %>
|
||||
$("#show_student_result_div_<%= exercise.id%>").on('click',function() {
|
||||
window.location.href = '<%=show_student_result_exercise_path(@exercise,:user_id => exercise.user_id) %>';
|
||||
});
|
||||
<% else %>
|
||||
$("#show_student_result_div_<%= exercise.id%>").attr("title","截止日期未到,暂不能查看学生答题结果");
|
||||
$("#student_name_<%= exercise.id%>").attr("title","截止日期未到,暂不能查看学生答题结果");
|
||||
$("#student_id_<%= exercise.id%>").attr("title","截止日期未到,暂不能查看学生答题结果");
|
||||
$("#student_class_<%= exercise.id%>").attr("title","截止日期未到,暂不能查看学生答题结果");
|
||||
<% end %>
|
||||
});
|
||||
/*function show_result(id) {
|
||||
window.location.href = '<%#=show_student_result_exercise_path(@exercise,:user_id => exercise.user.id) %>';
|
||||
}*/
|
||||
</script>
|
||||
<ul class="hworkListRow" id="student_work_<%= exercise.id%>">
|
||||
<li class="ml5 mr5" style="width:28px; text-align:center;">1</li>
|
||||
<li class="hworkPortrait mt15 mr10">
|
||||
<%= link_to(image_tag(url_to_avatar(exercise.user),:width =>"40",:height => "40",:style => "display:block;"),user_activities_path(exercise.user)) %>
|
||||
</li>
|
||||
<li class="hworkStName" title="姓名" id="student_name_<%= exercise.id%>" style="cursor:pointer;">
|
||||
<%=exercise.user.show_name %>
|
||||
</li><li class="hworkStID pl15 pr10" title="学号" id="student_id_<%= exercise.id%>" style="cursor:pointer;">
|
||||
<%= exercise.user.user_extensions.nil? ? "--" : exercise.user.user_extensions.student_id%>
|
||||
</li>
|
||||
<li class="hworkStID" title="班级" id="student_class_<%= exercise.id%>" style="cursor:pointer;">
|
||||
--
|
||||
</li>
|
||||
<li class="hworkList130 ml200 c_grey student_work_<%= exercise.id%>">
|
||||
<% if exercise.created_at%>
|
||||
<%= Time.parse(format_time(exercise.created_at)).strftime("%m-%d %H:%M")%>
|
||||
<% if @exercise.end_time <= exercise.created_at %>
|
||||
<span class="c_red">[未答]</span>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</li>
|
||||
|
||||
<li class="hworkList50 <%= score_color exercise.score%> student_final_scor_info">
|
||||
<%= exercise.score.nil? ? "--" : format("%.1f",exercise.score)%>
|
||||
</li>
|
||||
<li class="hworkTip" style="display: none" id="work_click_<%= exercise.id%>"><em></em><span></span><font class="fontGrey2">点击查看详情</font></li>
|
||||
</ul>
|
||||
|
||||
<div class="cl"></div>
|
||||
<% end%>
|
|
@ -1,23 +1,71 @@
|
|||
<ul class="hworkUl">
|
||||
<li class="hworkList340 hworkH30 width530">
|
||||
<span class="c_dark f14 fb fl mr5">序号</span>
|
||||
<span class="c_dark f14 fb fl mr55"> </span>
|
||||
<span class="c_dark f14 fb fl mr60">姓名</span>
|
||||
<span class="c_dark f14 fb fl mr60">学号</span>
|
||||
<span class="c_dark f14 fb fl">班级</span>
|
||||
</li>
|
||||
<table class="hwork-table-wrap">
|
||||
<tr class="b_grey hworkH30" style="border-bottom:1px solid #eaeaea;">
|
||||
<th class="hworkList340 width530" colspan="6">
|
||||
<span class="c_dark f14 fb fl mr5">序号</span>
|
||||
<span class="c_dark f14 fb fl mr55"> </span>
|
||||
<span class="c_dark f14 fb fl mr60">姓名</span>
|
||||
<span class="c_dark f14 fb fl mr60">学号</span>
|
||||
<span class="c_dark f14 fb fl">班级</span>
|
||||
</th>
|
||||
<th class="hworkList130">
|
||||
<%= link_to "时间",'',:class => "c_dark f14 fb fl ml50" ,:remote => true%>
|
||||
</th>
|
||||
<th class="hworkList50">
|
||||
<%= link_to "成绩",'',:class => "c_dark f14 fb fl ml10",:remote => true%>
|
||||
</th>
|
||||
</tr>
|
||||
|
||||
<li class="hworkList130 hworkH30">
|
||||
<%= link_to "时间",'',:class => "c_dark f14 fb fl ml50" ,:remote => true%>
|
||||
<%# if @show_all && @order == "created_at"%>
|
||||
<%#= link_to "", student_work_index_path(:homework => @homework.id,:order => "created_at", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10",:remote => true%>
|
||||
<%# end%>
|
||||
</li>
|
||||
<% @exercise_users_list.each do |exercise|%>
|
||||
<script type="text/javascript">
|
||||
$(".student_work_<%= exercise.id%>").mouseenter(function(){
|
||||
$("#work_click_<%= exercise.id%>").show();
|
||||
}).mouseleave(function(){
|
||||
$("#work_click_<%= exercise.id%>").hide();
|
||||
});
|
||||
$(function(){
|
||||
<% if Time.parse(h(@exercise.end_time)).strftime("%Y-%m-%d-%H-%M-%S") <= Time.now.strftime("%Y-%m-%d-%H-%M-%S") %>
|
||||
$("#show_student_result_div_<%= exercise.id%>").on('click',function() {
|
||||
window.location.href = '<%=show_student_result_exercise_path(@exercise,:user_id => exercise.user_id) %>';
|
||||
});
|
||||
<% else %>
|
||||
$("#show_student_result_div_<%= exercise.id%>").attr("title","截止日期未到,暂不能查看学生答题结果");
|
||||
$("#student_name_<%= exercise.id%>").attr("title","截止日期未到,暂不能查看学生答题结果");
|
||||
$("#student_id_<%= exercise.id%>").attr("title","截止日期未到,暂不能查看学生答题结果");
|
||||
$("#student_class_<%= exercise.id%>").attr("title","截止日期未到,暂不能查看学生答题结果");
|
||||
<% end %>
|
||||
});
|
||||
/*function show_result(id) {
|
||||
window.location.href = '<%#=show_student_result_exercise_path(@exercise,:user_id => exercise.user.id) %>';
|
||||
}*/
|
||||
</script>
|
||||
|
||||
<li class="hworkList50 hworkH30">
|
||||
<%= link_to "成绩",'',:class => "c_dark f14 fb fl ml10",:remote => true%>
|
||||
<%# if @show_all && @order == "score"%>
|
||||
<%#= link_to "", student_work_index_path(:homework => @homework.id,:order => "score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10",:remote => true%>
|
||||
<%# end%>
|
||||
</li>
|
||||
</ul>
|
||||
<tr class="hworkListRow" id="student_work_<%= exercise.id%>">
|
||||
<td class="pl5 pr5" style="width:28px; text-align:center;">1</td>
|
||||
<td class="hworkPortrait pr10 float-none">
|
||||
<%= link_to(image_tag(url_to_avatar(exercise.user),:width =>"40",:height => "40",:style => "display:block;", :class => "mt15"),user_activities_path(exercise.user)) %>
|
||||
</td>
|
||||
<td class="hworkStName" title="姓名" id="student_name_<%= exercise.id%>" style="cursor:pointer;">
|
||||
<%=exercise.user.show_name %>
|
||||
</td>
|
||||
<td class="hworkStID pl15 pr10 float-none" title="学号" id="student_id_<%= exercise.id%>" style="cursor:pointer;">
|
||||
<%= exercise.user.user_extensions.nil? ? "--" : exercise.user.user_extensions.student_id%>
|
||||
</td>
|
||||
<td class="hworkStID float-none" title="班级" id="student_class_<%= exercise.id%>" style="cursor:pointer;">
|
||||
--
|
||||
</td>
|
||||
<td width="200"> </td>
|
||||
<td class="hworkList130 c_grey student_work_<%= exercise.id%>">
|
||||
<% if exercise.created_at%>
|
||||
<%= Time.parse(format_time(exercise.created_at)).strftime("%m-%d %H:%M")%>
|
||||
<% if @exercise.end_time <= exercise.created_at %>
|
||||
<span class="c_red">[未答]</span>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td class="hworkList50 <%= score_color exercise.score%> student_final_scor_info">
|
||||
<%= exercise.score.nil? ? "--" : format("%.1f",exercise.score)%>
|
||||
</td>
|
||||
<td class="hworkTip" style="display: none" id="work_click_<%= exercise.id%>"><em></em><span></span><font class="fontGrey2">点击查看详情</font></td>
|
||||
</tr>
|
||||
<% end%>
|
||||
</table>
|
|
@ -0,0 +1,23 @@
|
|||
<ul class="hworkUl">
|
||||
<li class="hworkList340 hworkH30 width530">
|
||||
<span class="c_dark f14 fb fl mr5">序号</span>
|
||||
<span class="c_dark f14 fb fl mr55"> </span>
|
||||
<span class="c_dark f14 fb fl mr60">姓名</span>
|
||||
<span class="c_dark f14 fb fl mr60">学号</span>
|
||||
<span class="c_dark f14 fb fl">班级</span>
|
||||
</li>
|
||||
|
||||
<li class="hworkList130 hworkH30">
|
||||
<%= link_to "时间",'',:class => "c_dark f14 fb fl ml50" ,:remote => true%>
|
||||
<%# if @show_all && @order == "created_at"%>
|
||||
<%#= link_to "", student_work_index_path(:homework => @homework.id,:order => "created_at", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10",:remote => true%>
|
||||
<%# end%>
|
||||
</li>
|
||||
|
||||
<li class="hworkList50 hworkH30">
|
||||
<%= link_to "成绩",'',:class => "c_dark f14 fb fl ml10",:remote => true%>
|
||||
<%# if @show_all && @order == "score"%>
|
||||
<%#= link_to "", student_work_index_path(:homework => @homework.id,:order => "score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10",:remote => true%>
|
||||
<%# end%>
|
||||
</li>
|
||||
</ul>
|
|
@ -9,8 +9,7 @@
|
|||
</div>
|
||||
<div class="resources mt10">
|
||||
<div class="function-row" id="org_teacher_search">
|
||||
<%= form_tag( url_for(:controller => 'organizations', :action => 'teachers', :type => @type),
|
||||
:remote => true , :method => 'get', :id => 'resource_search_form') do %>
|
||||
<%= form_tag(url_for(:controller => 'organizations', :action => 'teachers', :type => @type), :remote => true , :method => 'get', :id => 'resource_search_form') do %>
|
||||
<input type="text" name="search" placeholder="输入教师名进行搜索" class="teacher-list-search fl" />
|
||||
<%= submit_tag '', :class => 'homepageSearchIcon', :onfocus => 'this.blur();', :class => "teacher-search-icon fl" %>
|
||||
<!--<a href="javascript:void(0);" onclick='this.parent.submit();return false;' class="searchIcon"></a>-->
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<%= call_hook(:view_repositories_show_contextual, {:repository => @repository, :project => @project}) %>
|
||||
<div class="project_r_h">
|
||||
<div class="fl"><h2 class="project_h2_repository"><%= render :partial => 'breadcrumbs', :locals => {:path => @path, :kind => 'dir', :revision => @rev} %></h2></div>
|
||||
<!--<a href="javascript:void(0);" class="btn_zipdown fr" onclick="">ZIP下载</a>-->
|
||||
<a href="<%= @zip_path %>" class="btn_zipdown fr" onclick="">ZIP下载</a>
|
||||
|
||||
</div>
|
||||
<div class="repository_con" style="line-height:1.9;">
|
||||
|
|
|
@ -1,27 +1,39 @@
|
|||
<ul class="hworkUl">
|
||||
<li class="hworkList30 hworkH30 ml5 mr5"><span class="c_dark f14 fb fl">序号</span></li>
|
||||
<li class="hworkList50 hworkH30"> </li>
|
||||
<li class="hworkList260 hworkH30">
|
||||
<span class="f14 fb fl">作品名称</span>
|
||||
</li>
|
||||
<table class="hwork-table-wrap">
|
||||
<tr class="b_grey hworkH30" style="border-bottom:1px solid #eaeaea;">
|
||||
<th class="hworkList30 hworkH30 pl5 pr5">序号</th>
|
||||
<th class="hworkList50"> </th>
|
||||
<th class="hworkList260" style="text-align:left;">作品名称</th>
|
||||
<% if @homework.homework_type != 3 %>
|
||||
<li class="hworkList80 hworkH30"><span class="HomeworkStuTitle f14 fb fl">姓名</span></li>
|
||||
<li class="hworkList80 hworkH30"><span class="HomeworkStuTitle f14 fb fl">学号</span></li>
|
||||
<th class="hworkList80">
|
||||
<span class="HomeworkStuTitle f14 fb fl">姓名</span>
|
||||
</th>
|
||||
<th class="hworkList80">
|
||||
<span class="HomeworkStuTitle f14 fb fl">学号</span>
|
||||
</th>
|
||||
<% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1 %>
|
||||
<li class="hworkList160 hworkH30"><span class="HomeworkStuTitle f14 fb fl">关联项目</span></li>
|
||||
<th class="hworkList160">
|
||||
<span class="HomeworkStuTitle f14 fb fl">关联项目</span>
|
||||
</th>
|
||||
<% end %>
|
||||
|
||||
<li class="hworkList130 hworkH30 fb ml10">
|
||||
时间
|
||||
</li>
|
||||
|
||||
<% if @homework.homework_type == 2%>
|
||||
<li class="hworkList50 hworkH30 fb">
|
||||
系统
|
||||
</li>
|
||||
<th class="hworkList130 pl10">
|
||||
时间
|
||||
</th>
|
||||
<% if @homework.homework_type == 2%>
|
||||
<th class="hworkList50">
|
||||
系统
|
||||
</th>
|
||||
<% end%>
|
||||
<th class="hworkList50 pr10 pl10">
|
||||
我的评分
|
||||
</th>
|
||||
</tr>
|
||||
<% @stundet_works.each_with_index do |student_work, i|%>
|
||||
<%= render :partial => "evaluation_work", :locals => {:student_work => student_work, :index => i}%>
|
||||
<tr>
|
||||
<td colspan="12">
|
||||
<div id="about_hwork_<%= student_work.id%>">
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<% end%>
|
||||
|
||||
<li class="hworkList50 hworkH30 fb mr10 ml10">
|
||||
我的评分
|
||||
</li>
|
||||
</ul>
|
||||
</table>
|
|
@ -0,0 +1,27 @@
|
|||
<ul class="hworkUl">
|
||||
<li class="hworkList30 hworkH30 ml5 mr5"><span class="c_dark f14 fb fl">序号</span></li>
|
||||
<li class="hworkList50 hworkH30"> </li>
|
||||
<li class="hworkList260 hworkH30">
|
||||
<span class="f14 fb fl">作品名称</span>
|
||||
</li>
|
||||
<% if @homework.homework_type != 3 %>
|
||||
<li class="hworkList80 hworkH30"><span class="HomeworkStuTitle f14 fb fl">姓名</span></li>
|
||||
<li class="hworkList80 hworkH30"><span class="HomeworkStuTitle f14 fb fl">学号</span></li>
|
||||
<% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1 %>
|
||||
<li class="hworkList160 hworkH30"><span class="HomeworkStuTitle f14 fb fl">关联项目</span></li>
|
||||
<% end %>
|
||||
|
||||
<li class="hworkList130 hworkH30 fb ml10">
|
||||
时间
|
||||
</li>
|
||||
|
||||
<% if @homework.homework_type == 2%>
|
||||
<li class="hworkList50 hworkH30 fb">
|
||||
系统
|
||||
</li>
|
||||
<% end%>
|
||||
|
||||
<li class="hworkList50 hworkH30 fb mr10 ml10">
|
||||
我的评分
|
||||
</li>
|
||||
</ul>
|
|
@ -1,73 +1,74 @@
|
|||
<ul class="hworkUl">
|
||||
<li class="hworkList30 hworkH30 ml5 mr5"><span class="c_dark f14 fb fl">序号</span></li>
|
||||
<li class="hworkList50"> </li>
|
||||
<li class="<%= @homework.homework_type == 2 ? 'hworkList80 mr10' : 'hworkList130 mr10'%> hworkH30">
|
||||
<span class="c_dark f14 fb fl <%#= @homework.homework_type == 2 ? 'mr90 ml50' : 'mr150 ml50'%>">作品名称</span>
|
||||
</li>
|
||||
<table class="hwork-table-wrap">
|
||||
<tr class="b_grey hworkH30" style="border-bottom:1px solid #eaeaea;">
|
||||
<th class="hworkList30 hworkH30 pl5 pr5">序号</th>
|
||||
<th class="hworkList50"> </th>
|
||||
<th class="<%= @homework.homework_type == 2 ? 'hworkList80 pr10' : 'hworkList130 pr10'%>" style="text-align:left;">作品名称</th>
|
||||
<% if @homework.homework_type != 3 %>
|
||||
<!--<span class="c_dark f14 fb fl mr50">姓名</span>-->
|
||||
<li class="<%=@homework.anonymous_comment == 1 ? 'hworkList100' : 'hworkList60'%> hworkH30 mr10">
|
||||
<%= 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 #{@homework.anonymous_comment == 1 ? 'ml35' : 'ml18'}" ,: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%>
|
||||
</li>
|
||||
<li class="<%=@homework.anonymous_comment == 1 ? 'hworkList90' : 'hworkList80'%> hworkH30 mr10">
|
||||
<!--<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 ml30" ,: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%>
|
||||
</li>
|
||||
<th class="<%=@homework.anonymous_comment == 1 ? 'hworkList100' : 'hworkList60'%> pr10">
|
||||
<%= 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 #{@homework.anonymous_comment == 1 ? 'ml35' : 'ml18'}" ,: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%>
|
||||
</th>
|
||||
<th class="<%=@homework.anonymous_comment == 1 ? 'hworkList90' : 'hworkList80'%> pr10">
|
||||
<%= 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 ml30" ,: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%>
|
||||
</th>
|
||||
<% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1 %>
|
||||
<li class="hworkList160 hworkH30">
|
||||
<span class="c_dark f14 fb">关联项目</span>
|
||||
</li>
|
||||
<th class="hworkList160">
|
||||
<span class="c_dark f14 fb">关联项目</span>
|
||||
</th>
|
||||
<% end %>
|
||||
|
||||
<li class="hworkList130 hworkH30">
|
||||
<%= link_to "时间",@show_all ? student_work_index_path(:homework => @homework.id,:order => "created_at", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml50" ,:remote => true%>
|
||||
<% if @show_all && @order == "created_at"%>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "created_at", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10",:remote => true%>
|
||||
<th class="hworkList130">
|
||||
<%= link_to "时间",@show_all ? student_work_index_path(:homework => @homework.id,:order => "created_at", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml50" ,:remote => true%>
|
||||
<% if @show_all && @order == "created_at"%>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "created_at", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10",:remote => true%>
|
||||
<% end%>
|
||||
</th>
|
||||
<th class="hworkList50">
|
||||
<%= link_to "教师",@show_all ? student_work_index_path(:homework => @homework.id,:order => "teacher_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml10" ,:remote => true%>
|
||||
<% if @show_all && @order == "teacher_score"%>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "teacher_score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10" ,:remote => true%>
|
||||
<% end%>
|
||||
</th>
|
||||
<th class="hworkList50">
|
||||
<%= link_to "教辅",@show_all ? student_work_index_path(:homework => @homework.id,:order => "teaching_asistant_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml10",:remote => true%>
|
||||
<% if @show_all && @order == "teaching_asistant_score"%>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "teaching_asistant_score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10",:remote => true%>
|
||||
<% end%>
|
||||
</th>
|
||||
<% if @homework.homework_type == 2%>
|
||||
<th class="hworkList50">
|
||||
<%= link_to "系统",@show_all ? student_work_index_path(:homework => @homework.id,:order => "system_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml10",:remote => true%>
|
||||
<% if @show_all && @order == "system_score"%>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "system_score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10",:remote => true%>
|
||||
<% end%>
|
||||
</th>
|
||||
<% end%>
|
||||
</li>
|
||||
|
||||
<li class="hworkList50 hworkH30" >
|
||||
<%= link_to "教师",@show_all ? student_work_index_path(:homework => @homework.id,:order => "teacher_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml10" ,:remote => true%>
|
||||
<% if @show_all && @order == "teacher_score"%>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "teacher_score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10" ,:remote => true%>
|
||||
<% end%>
|
||||
</li>
|
||||
|
||||
<li class="hworkList50 hworkH30">
|
||||
<%= link_to "教辅",@show_all ? student_work_index_path(:homework => @homework.id,:order => "teaching_asistant_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml10",:remote => true%>
|
||||
<% if @show_all && @order == "teaching_asistant_score"%>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "teaching_asistant_score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10",:remote => true%>
|
||||
<% end%>
|
||||
</li>
|
||||
|
||||
<% if @homework.homework_type == 2%>
|
||||
<li class="hworkList50 hworkH30">
|
||||
<%= link_to "系统",@show_all ? student_work_index_path(:homework => @homework.id,:order => "system_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml10",:remote => true%>
|
||||
<% if @show_all && @order == "system_score"%>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "system_score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10",:remote => true%>
|
||||
<% end%>
|
||||
</li>
|
||||
<% if @homework.anonymous_comment == 0%>
|
||||
<th class="hworkList50">
|
||||
<%= link_to "匿评",@show_all ? student_work_index_path(:homework => @homework.id,:order => "student_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml10",:remote => true%>
|
||||
<% if @show_all && @order == "student_score"%>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "student_score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10",:remote => true%>
|
||||
<% end%>
|
||||
</th>
|
||||
<% end %>
|
||||
<th class="hworkList50">
|
||||
<%= link_to "成绩",@show_all ? student_work_index_path(:homework => @homework.id,:order => "score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml10",:remote => true%>
|
||||
<% if @show_all && @order == "score"%>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10",:remote => true%>
|
||||
<% end%>
|
||||
</th>
|
||||
</tr>
|
||||
<% @stundet_works.each_with_index do |student_work, i|%>
|
||||
<%= render :partial => "evaluation_un_work", :locals => {:student_work => student_work, :index => i}%>
|
||||
<tr>
|
||||
<td colspan="12">
|
||||
<div id="about_hwork_<%= student_work.id%>">
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<% end%>
|
||||
|
||||
<% if @homework.anonymous_comment == 0%>
|
||||
<li class="hworkList50 hworkH30">
|
||||
<%= link_to "匿评",@show_all ? student_work_index_path(:homework => @homework.id,:order => "student_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml10",:remote => true%>
|
||||
<% if @show_all && @order == "student_score"%>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "student_score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10",:remote => true%>
|
||||
<% end%>
|
||||
</li>
|
||||
<% end %>
|
||||
|
||||
<li class="hworkList50 hworkH30">
|
||||
<%= link_to "成绩",@show_all ? student_work_index_path(:homework => @homework.id,:order => "score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml10",:remote => true%>
|
||||
<% if @show_all && @order == "score"%>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10",:remote => true%>
|
||||
<% end%>
|
||||
</li>
|
||||
</ul>
|
||||
</table>
|
|
@ -0,0 +1,73 @@
|
|||
<ul class="hworkUl">
|
||||
<li class="hworkList30 hworkH30 ml5 mr5"><span class="c_dark f14 fb fl">序号</span></li>
|
||||
<li class="hworkList50"> </li>
|
||||
<li class="<%= @homework.homework_type == 2 ? 'hworkList80 mr10' : 'hworkList130 mr10'%> hworkH30">
|
||||
<span class="c_dark f14 fb fl <%#= @homework.homework_type == 2 ? 'mr90 ml50' : 'mr150 ml50'%>">作品名称</span>
|
||||
</li>
|
||||
<% if @homework.homework_type != 3 %>
|
||||
<!--<span class="c_dark f14 fb fl mr50">姓名</span>-->
|
||||
<li class="<%=@homework.anonymous_comment == 1 ? 'hworkList100' : 'hworkList60'%> hworkH30 mr10">
|
||||
<%= 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 #{@homework.anonymous_comment == 1 ? 'ml35' : 'ml18'}" ,: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%>
|
||||
</li>
|
||||
<li class="<%=@homework.anonymous_comment == 1 ? 'hworkList90' : 'hworkList80'%> hworkH30 mr10">
|
||||
<!--<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 ml30" ,: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%>
|
||||
</li>
|
||||
<% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1 %>
|
||||
<li class="hworkList160 hworkH30">
|
||||
<span class="c_dark f14 fb">关联项目</span>
|
||||
</li>
|
||||
<% end %>
|
||||
|
||||
<li class="hworkList130 hworkH30">
|
||||
<%= link_to "时间",@show_all ? student_work_index_path(:homework => @homework.id,:order => "created_at", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml50" ,:remote => true%>
|
||||
<% if @show_all && @order == "created_at"%>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "created_at", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10",:remote => true%>
|
||||
<% end%>
|
||||
</li>
|
||||
|
||||
<li class="hworkList50 hworkH30" >
|
||||
<%= link_to "教师",@show_all ? student_work_index_path(:homework => @homework.id,:order => "teacher_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml10" ,:remote => true%>
|
||||
<% if @show_all && @order == "teacher_score"%>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "teacher_score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10" ,:remote => true%>
|
||||
<% end%>
|
||||
</li>
|
||||
|
||||
<li class="hworkList50 hworkH30">
|
||||
<%= link_to "教辅",@show_all ? student_work_index_path(:homework => @homework.id,:order => "teaching_asistant_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml10",:remote => true%>
|
||||
<% if @show_all && @order == "teaching_asistant_score"%>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "teaching_asistant_score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10",:remote => true%>
|
||||
<% end%>
|
||||
</li>
|
||||
|
||||
<% if @homework.homework_type == 2%>
|
||||
<li class="hworkList50 hworkH30">
|
||||
<%= link_to "系统",@show_all ? student_work_index_path(:homework => @homework.id,:order => "system_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml10",:remote => true%>
|
||||
<% if @show_all && @order == "system_score"%>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "system_score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10",:remote => true%>
|
||||
<% end%>
|
||||
</li>
|
||||
<% end%>
|
||||
|
||||
<% if @homework.anonymous_comment == 0%>
|
||||
<li class="hworkList50 hworkH30">
|
||||
<%= link_to "匿评",@show_all ? student_work_index_path(:homework => @homework.id,:order => "student_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml10",:remote => true%>
|
||||
<% if @show_all && @order == "student_score"%>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "student_score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10",:remote => true%>
|
||||
<% end%>
|
||||
</li>
|
||||
<% end %>
|
||||
|
||||
<li class="hworkList50 hworkH30">
|
||||
<%= link_to "成绩",@show_all ? student_work_index_path(:homework => @homework.id,:order => "score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml10",:remote => true%>
|
||||
<% if @show_all && @order == "score"%>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10",:remote => true%>
|
||||
<% end%>
|
||||
</li>
|
||||
</ul>
|
|
@ -1,60 +1,58 @@
|
|||
<!-- 匿评作品列表,显示某一个作品的信息 -->
|
||||
<a name="<%= student_work.id%>"></a>
|
||||
<ul class="hworkListRow" id="student_work_<%= student_work.id%>">
|
||||
<li class="hworkList30 ml5 mr5" id="work_num_<%=student_work.id %>"><%=index + 1 %></li>
|
||||
<li class="hworkPortrait mt15 mr10">
|
||||
<tr class="hworkListRow" id="student_work_<%= student_work.id%>">
|
||||
<td class="hworkList30 pl5 pr5" id="work_num_<%=student_work.id %>"><%=index + 1 %></td>
|
||||
<td class="hworkPortrait pr10 float-none">
|
||||
<%= link_to(image_tag(url_to_avatar(student_work.user),:width =>"40",:height => "40",:style => "display:block;"),user_activities_path(student_work.user)) %>
|
||||
</li>
|
||||
<div class="student_work_<%= student_work.id%>">
|
||||
<li class="hworkName mt12 pr10 <%= @homework.homework_type == 2 ? '' : 'width130'%>" style="cursor: pointer;" onclick="show_student_work('<%= student_work_path(student_work)%>');">
|
||||
</td>
|
||||
<td class="hworkName float-none pr10 student_work_<%= student_work.id%> <%= @homework.homework_type == 2 ? '' : 'width130'%>" style="cursor: pointer;" onclick="show_student_work('<%= student_work_path(student_work)%>');">
|
||||
<% student_work_name = student_work.name.nil? || student_work.name.empty? ? student_work.user.show_name + '的作品' : student_work.name%>
|
||||
<div>
|
||||
<%= link_to student_work_name,"javascript:void(0)" ,:title => student_work_name, :class => "linkGrey f14 StudentName break_word #{@homework.homework_type == 2 ? '' : 'width165'}"%>
|
||||
</div>
|
||||
</li>
|
||||
</td>
|
||||
<% if @homework.homework_type != 3 %>
|
||||
<li class="<%=@homework.anonymous_comment == 1 ? 'hworkStName100' : 'hworkStName'%> pr10" title="<%= student_work.user.show_name%>" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor:pointer;">
|
||||
<td class="<%=@homework.anonymous_comment == 1 ? 'hworkStName100' : 'hworkStName'%> pr10 student_work_<%= student_work.id%>" title="<%= student_work.user.show_name%>" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor:pointer;">
|
||||
<%= student_work.user.show_name%>
|
||||
</li>
|
||||
<li class="<%=@homework.anonymous_comment == 1 ? 'hworkStID90' : 'hworkStID'%> pr10" title="<%= student_work.user.user_extensions.nil? ? "--" : student_work.user.user_extensions.student_id%>" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor:pointer;">
|
||||
<%= student_work.user.user_extensions.nil? ? "--" : student_work.user.user_extensions.student_id%>
|
||||
</li>
|
||||
</td>
|
||||
<td class="<%=@homework.anonymous_comment == 1 ? 'hworkStID90' : 'hworkStID'%> pr10 float-none student_work_<%= student_work.id%>" title="<%= student_work.user.user_extensions.nil? ? "--" : student_work.user.user_extensions.student_id%>" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor:pointer;">
|
||||
<span style="width:90px; float:left;" class="hidden"><%= student_work.user.user_extensions.nil? ? "--" : student_work.user.user_extensions.student_id%></span>
|
||||
</td>
|
||||
<% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1 %>
|
||||
<% if student_work.project.is_public || User.current.member_of?(student_work.project) || User.current.admin? %>
|
||||
<li class="hworkPrName" title="项目名称">
|
||||
<td class="hworkPrName student_work_<%= student_work.id%>" title="项目名称">
|
||||
<%= link_to( student_work.project.name, project_path(student_work.project.id))%>
|
||||
</li>
|
||||
</td>
|
||||
<% else %>
|
||||
<li class="hworkPrName" title="该项目是私有的">
|
||||
<td class="hworkPrName student_work_<%= student_work.id%>" title="该项目是私有的">
|
||||
<%= student_work.project.name %>
|
||||
</li>
|
||||
</td>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
<li class="hworkList130 c_grey student_work_<%= student_work.id%>" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;">
|
||||
<td class="hworkList130 c_grey student_work_<%= student_work.id%>" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;">
|
||||
<% if student_work.created_at && @homework.end_time%>
|
||||
<%= Time.parse(format_time(student_work.created_at)).strftime("%m-%d %H:%M")%>
|
||||
<% if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(format_time(student_work.created_at)).strftime("%Y-%m-%d") %>
|
||||
<span class="c_red">[迟交]</span>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</li>
|
||||
<li class="hworkList50 <%= score_color student_work.teacher_score%>">
|
||||
</td>
|
||||
<td class="hworkList50 <%= score_color student_work.teacher_score%>">
|
||||
<%= student_work.teacher_score.nil? ? "--" : format("%.1f",student_work.teacher_score)%>
|
||||
</li>
|
||||
<li class="hworkList50 <%= score_color student_work.teaching_asistant_score%>">
|
||||
</td>
|
||||
<td class="hworkList50 <%= score_color student_work.teaching_asistant_score%>">
|
||||
<%= student_work.teaching_asistant_score.nil? ? "--" : format("%.1f",student_work.teaching_asistant_score)%>
|
||||
</li>
|
||||
</td>
|
||||
|
||||
<% if @homework.homework_type == 2%>
|
||||
<!-- 系统评分 -->
|
||||
<li class="hworkList50 <%= score_color student_work.system_score%>">
|
||||
<td class="hworkList50 <%= score_color student_work.system_score%>">
|
||||
<%= student_work.system_score.nil? ? "--" : format("%.1f",student_work.system_score)%>
|
||||
</li>
|
||||
</td>
|
||||
<% end%>
|
||||
|
||||
<% if @homework.anonymous_comment == 0%>
|
||||
<li class="hworkList50 <%= score_color student_work.student_score%> student_score_info">
|
||||
<td class="hworkList50 <%= score_color student_work.student_score%> student_score_info">
|
||||
<% if student_work.student_score.nil? %>
|
||||
<span title="该作品未被匿评">未参与</span>
|
||||
<% else %>
|
||||
|
@ -71,7 +69,7 @@
|
|||
<span class="c_red"> <%= format("%.1f",student_work.student_score)%> </span>分。
|
||||
</div>
|
||||
<% end%>
|
||||
</li>
|
||||
</td>
|
||||
<% end %>
|
||||
<!-- 成绩 -->
|
||||
<% if student_work.homework_common && student_work.homework_common.teacher_priority == 1 && student_work.teacher_score %>
|
||||
|
@ -79,7 +77,7 @@
|
|||
<% else %>
|
||||
<% score = student_work.respond_to?("score") ? student_work.score : (student_work.final_score || 0) - student_work.absence_penalty - student_work.late_penalty%>
|
||||
<% end %>
|
||||
<li class="hworkList50 <%= score_color score%> student_final_scor_info">
|
||||
<td class="hworkList50 <%= score_color score%> student_final_scor_info">
|
||||
<%= score.nil? ? "--" : format("%.1f",score<0 ? 0 : score)%>
|
||||
<% unless score.nil?%>
|
||||
<div class="infoNi none width180">
|
||||
|
@ -97,9 +95,9 @@
|
|||
<span class="c_red"> <%= format("%.1f",score<0 ? 0 : score)%> </span>分。
|
||||
</div>
|
||||
<% end%>
|
||||
</li>
|
||||
<li class="hworkTip" style="display: none" id="work_click_<%= student_work.id%>"><em></em><span></span><font class="fontGrey2">点击查看详情</font></li>
|
||||
</ul>
|
||||
</td>
|
||||
<td class="hworkTip" style="display: none" id="work_click_<%= student_work.id%>"><em></em><span></span><font class="fontGrey2">点击查看详情</font></td>
|
||||
</tr>
|
||||
<script type="text/javascript">
|
||||
$(".student_work_<%= student_work.id%>").mouseenter(function(){
|
||||
if($("#about_hwork_<%= student_work.id%>").html().trim() == "") {
|
||||
|
|
|
@ -0,0 +1,101 @@
|
|||
<a name="<%= student_work.id%>"></a>
|
||||
<ul class="hworkListRow" id="student_work_<%= student_work.id%>">
|
||||
<li class="hworkList30 ml5 mr5" id="work_num_<%=student_work.id %>"><%=index + 1 %></li>
|
||||
<li class="hworkPortrait mt15 mr10">
|
||||
<%= link_to(image_tag(url_to_avatar(student_work.user),:width =>"40",:height => "40",:style => "display:block;"),user_activities_path(student_work.user)) %>
|
||||
</li>
|
||||
<div class="student_work_<%= student_work.id%>">
|
||||
<li class="hworkName mt12 pr10 <%= @homework.homework_type == 2 ? '' : 'width130'%>" style="cursor: pointer;" onclick="show_student_work('<%= student_work_path(student_work)%>');">
|
||||
<% student_work_name = student_work.name.nil? || student_work.name.empty? ? student_work.user.show_name + '的作品' : student_work.name%>
|
||||
<div>
|
||||
<%= link_to student_work_name,"javascript:void(0)" ,:title => student_work_name, :class => "linkGrey f14 StudentName break_word #{@homework.homework_type == 2 ? '' : 'width165'}"%>
|
||||
</div>
|
||||
</li>
|
||||
<% if @homework.homework_type != 3 %>
|
||||
<li class="<%=@homework.anonymous_comment == 1 ? 'hworkStName100' : 'hworkStName'%> pr10" title="<%= student_work.user.show_name%>" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor:pointer;">
|
||||
<%= student_work.user.show_name%>
|
||||
</li>
|
||||
<li class="<%=@homework.anonymous_comment == 1 ? 'hworkStID90' : 'hworkStID'%> pr10" title="<%= student_work.user.user_extensions.nil? ? "--" : student_work.user.user_extensions.student_id%>" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor:pointer;">
|
||||
<%= student_work.user.user_extensions.nil? ? "--" : student_work.user.user_extensions.student_id%>
|
||||
</li>
|
||||
<% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1 %>
|
||||
<% if student_work.project.is_public || User.current.member_of?(student_work.project) || User.current.admin? %>
|
||||
<li class="hworkPrName" title="项目名称">
|
||||
<%= link_to( student_work.project.name, project_path(student_work.project.id))%>
|
||||
</li>
|
||||
<% else %>
|
||||
<li class="hworkPrName" title="该项目是私有的">
|
||||
<%= student_work.project.name %>
|
||||
</li>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
<li class="hworkList130 c_grey student_work_<%= student_work.id%>" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;">
|
||||
<% if student_work.created_at && @homework.end_time%>
|
||||
<%= Time.parse(format_time(student_work.created_at)).strftime("%m-%d %H:%M")%>
|
||||
<% if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(format_time(student_work.created_at)).strftime("%Y-%m-%d") %>
|
||||
<span class="c_red">[迟交]</span>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</li>
|
||||
<li class="hworkList50 <%= score_color student_work.teacher_score%>">
|
||||
<%= student_work.teacher_score.nil? ? "--" : format("%.1f",student_work.teacher_score)%>
|
||||
</li>
|
||||
<li class="hworkList50 <%= score_color student_work.teaching_asistant_score%>">
|
||||
<%= student_work.teaching_asistant_score.nil? ? "--" : format("%.1f",student_work.teaching_asistant_score)%>
|
||||
</li>
|
||||
|
||||
<% if @homework.homework_type == 2%>
|
||||
<!-- 系统评分 -->
|
||||
<li class="hworkList50 <%= score_color student_work.system_score%>">
|
||||
<%= student_work.system_score.nil? ? "--" : format("%.1f",student_work.system_score)%>
|
||||
</li>
|
||||
<% end%>
|
||||
|
||||
<% if @homework.anonymous_comment == 0%>
|
||||
<li class="hworkList50 <%= score_color student_work.student_score%> student_score_info">
|
||||
<% if student_work.student_score.nil? %>
|
||||
<span title="该作品未被匿评">未参与</span>
|
||||
<% else %>
|
||||
<%=format("%.1f",student_work.student_score) %>
|
||||
<% end %>
|
||||
<% unless student_work.student_score.nil?%>
|
||||
<span class="linkBlue">
|
||||
(<%= student_work.student_works_scores.where(:reviewer_role => 3).group_by(&:user_id).count%>)
|
||||
</span>
|
||||
<div class="infoNi none">
|
||||
现共有
|
||||
<span class="c_red"> <%= student_work.student_works_scores.where(:reviewer_role => 3).group_by(&:user_id).count%> </span>
|
||||
名学生进行了匿评,平均分为
|
||||
<span class="c_red"> <%= format("%.1f",student_work.student_score)%> </span>分。
|
||||
</div>
|
||||
<% end%>
|
||||
</li>
|
||||
<% end %>
|
||||
<!-- 成绩 -->
|
||||
<% if student_work.homework_common && student_work.homework_common.teacher_priority == 1 && student_work.teacher_score %>
|
||||
<% score = student_work.respond_to?("score") ? student_work.score : student_work.teacher_score %>
|
||||
<% else %>
|
||||
<% score = student_work.respond_to?("score") ? student_work.score : (student_work.final_score || 0) - student_work.absence_penalty - student_work.late_penalty%>
|
||||
<% end %>
|
||||
<li class="hworkList50 <%= score_color score%> student_final_scor_info">
|
||||
<%= score.nil? ? "--" : format("%.1f",score<0 ? 0 : score)%>
|
||||
<% unless score.nil?%>
|
||||
<div class="infoNi none width180">
|
||||
作品最终评分为
|
||||
<span class="c_red"> <%= student_work.final_score%> </span>分。
|
||||
迟交扣分
|
||||
<span class="c_red">
|
||||
<%= student_work.homework_common && student_work.homework_common.teacher_priority == 1 && student_work.teacher_score ? 0 : student_work.late_penalty %>
|
||||
</span>分,
|
||||
缺评扣分
|
||||
<span class="c_red">
|
||||
<%= student_work.homework_common && student_work.homework_common.teacher_priority == 1 && student_work.teacher_score ? 0 : student_work.absence_penalty%>
|
||||
</span>分,
|
||||
最终成绩为
|
||||
<span class="c_red"> <%= format("%.1f",score<0 ? 0 : score)%> </span>分。
|
||||
</div>
|
||||
<% end%>
|
||||
</li>
|
||||
<li class="hworkTip" style="display: none" id="work_click_<%= student_work.id%>"><em></em><span></span><font class="fontGrey2">点击查看详情</font></li>
|
||||
</ul>
|
|
@ -1,5 +1,5 @@
|
|||
<!-- 匿评作品列表,显示某一个作品的信息 -->
|
||||
<ul class="hworkListRow" id="student_work_<%= student_work.id%>">
|
||||
<tr class="hworkListRow" id="student_work_<%= student_work.id%>">
|
||||
<% if @homework.homework_type != 3 %>
|
||||
<% is_my_work = student_work.user == User.current%>
|
||||
<% else %>
|
||||
|
@ -8,81 +8,78 @@
|
|||
<% end %>
|
||||
|
||||
<% if is_my_work%>
|
||||
<li class="hworkList30 ml5 mr5" id="work_num_<%=student_work.id %>"><%=index + 1 %></li>
|
||||
<li class="hworkPortrait mt15 mr10">
|
||||
<td class="hworkList30 pl5 pr5" id="work_num_<%=student_work.id %>"><%=index + 1 %></td>
|
||||
<td class="hworkPortrait pr10 float-none">
|
||||
<%= image_tag(url_to_avatar(student_work.user),width:"40", height: "40", style: "display:block;") %>
|
||||
</li>
|
||||
<li class="hworkName mt12 pr10 w250 student_work_<%= student_work.id%>">
|
||||
</td>
|
||||
<td class="hworkName pr10 w250 float-none student_work_<%= student_work.id%>">
|
||||
<div>
|
||||
<% student_work_name = student_work.name.nil? || student_work.name.empty? ? student_work.user.show_name + '的作品' : student_work.name%>
|
||||
<%= link_to student_work_name, student_work_path(student_work),:remote => true,:title => student_work_name, :class => "linkGrey f14 StudentName break_word w250"%>
|
||||
</div>
|
||||
</li>
|
||||
<div class="student_work_<%= student_work.id%>">
|
||||
</td>
|
||||
<% if @homework.homework_type != 3 %>
|
||||
<li class="hworkStName w80" title="<%= student_work.user.show_name%>" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;">
|
||||
<td class="hworkStName float-none w80 student_work_<%= student_work.id%>" title="<%= student_work.user.show_name%>" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;">
|
||||
<%= student_work.user.show_name%>
|
||||
</li>
|
||||
<li class="hworkStID" title="<%= student_work.user.user_extensions.nil? ? "--" : student_work.user.user_extensions.student_id%>" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;">
|
||||
</td>
|
||||
<td class="hworkStID float-none student_work_<%= student_work.id%>" title="<%= student_work.user.user_extensions.nil? ? "--" : student_work.user.user_extensions.student_id%>" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;">
|
||||
<%= student_work.user.user_extensions.nil? ? "--" : student_work.user.user_extensions.student_id%>
|
||||
</li>
|
||||
</td>
|
||||
<% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1 %>
|
||||
<% if student_work.project.is_public || User.current.member_of?(student_work.project) || User.current.admin? %>
|
||||
<li class="hworkPrName mr10 mt12" title="项目名称">
|
||||
<% if student_work.project.is_public || User.current.member_of?(student_work.project) || User.current.admin? %>
|
||||
<td class="hworkPrName float-none mr10 student_work_<%= student_work.id%>" title="项目名称">
|
||||
<%= link_to( student_work.project.name, project_path(student_work.project.id))%>
|
||||
</li>
|
||||
<% else %>
|
||||
<li class="hworkPrName mr10 mt12" title="该项目是私有的">
|
||||
</td>
|
||||
<% else %>
|
||||
<td class="hworkPrName float-none mr10 student_work_<%= student_work.id%>" title="该项目是私有的">
|
||||
<%= student_work.project.name %>
|
||||
</li>
|
||||
<% end %>
|
||||
</td>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
<% else%>
|
||||
<li class="hworkList30 ml5 mr5" id="work_num_<%=student_work.id %>"><%=index + 1 %></li>
|
||||
<li class="hworkPortrait mt15 mr10">
|
||||
<td class="hworkList30 pl5 pr5" id="work_num_<%=student_work.id %>"><%=index + 1 %></td>
|
||||
<td class="hworkPortrait float-none pr10">
|
||||
<%= image_tag(url_to_avatar(""),width:"40", height: "40", style: "display:block;") %>
|
||||
</li>
|
||||
<li class="hworkName mt12 pr10 w250 student_work_<%= student_work.id%>">
|
||||
</td>
|
||||
<td class="hworkName float-none pr10 w250 student_work_<%= student_work.id%>">
|
||||
<div>
|
||||
<%= link_to "匿名的作品", student_work_path(student_work),:remote => true,:title => student_work_name, :class => "linkGrey f14 StudentName break_word w250"%>
|
||||
</div>
|
||||
</li>
|
||||
<% if @homework.homework_type != 3 %>
|
||||
<li class="hworkStName w80" title="姓名" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;">
|
||||
</td>
|
||||
<% if @homework.homework_type != 3 %>
|
||||
<td class="hworkStName float-none w80" title="姓名" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;">
|
||||
匿名
|
||||
</li>
|
||||
<li class="hworkStID" title="学号">
|
||||
</td>
|
||||
<td class="hworkStID float-none" title="学号">
|
||||
--
|
||||
</li>
|
||||
<% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1 %>
|
||||
<li class="hworkPrName mr10" title="项目名称" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;">
|
||||
</td>
|
||||
<% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1 %>
|
||||
<td class="hworkPrName mr10 float-none" title="项目名称" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;">
|
||||
匿名
|
||||
</li>
|
||||
<% end %>
|
||||
</td>
|
||||
<% end %>
|
||||
<% end%>
|
||||
|
||||
<li class="hworkList130 pl10 c_grey student_work_<%= student_work.id%>" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;">
|
||||
<td class="hworkList130 pl10 c_grey student_work_<%= student_work.id%>" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;">
|
||||
<%= Time.parse(format_time(student_work.created_at)).strftime("%m-%d %H:%M")%>
|
||||
<% if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(format_time(student_work.created_at)).strftime("%Y-%m-%d") %>
|
||||
<span class="c_red">[迟交]</span>
|
||||
<% end %>
|
||||
</li>
|
||||
</td>
|
||||
|
||||
<!-- 成绩 -->
|
||||
<% if @homework.homework_type == 2%>
|
||||
<!-- 系统评分 -->
|
||||
<li class="hworkList50 <%= score_color student_work.system_score%>">
|
||||
<td class="hworkList50 <%= score_color student_work.system_score%>">
|
||||
<%= student_work.system_score.nil? ? "--" : format("%.1f",student_work.system_score)%>
|
||||
</li>
|
||||
</td>
|
||||
<% end%>
|
||||
|
||||
<% my_score = student_work_score(student_work,User.current) %>
|
||||
<li class="hworkList50 <%= my_score.nil? ? 'c_grey' : score_color(my_score.score)%> mr10 ml10">
|
||||
<td class="hworkList50 <%= my_score.nil? ? 'c_grey' : score_color(my_score.score)%> mr10 ml10">
|
||||
<%= my_score.nil? ? "--" : format("%.1f",my_score.score)%>
|
||||
</li>
|
||||
<li class="hworkTip" style="display: none" id="work_click_<%= student_work.id%>"><em></em><span></span><font class="fontGrey2">点击查看详情</font></li>
|
||||
</ul>
|
||||
</td>
|
||||
<td class="hworkTip" style="display: none" id="work_click_<%= student_work.id%>"><em></em><span></span><font class="fontGrey2">点击查看详情</font></td>
|
||||
</tr>
|
||||
<script type="text/javascript">
|
||||
$(".student_work_<%= student_work.id%>").mouseenter(function(){
|
||||
$("#work_click_<%= student_work.id%>").show();
|
||||
|
|
|
@ -0,0 +1,84 @@
|
|||
<ul class="hworkListRow" id="student_work_<%= student_work.id%>">
|
||||
<% if @homework.homework_type != 3 %>
|
||||
<% is_my_work = student_work.user == User.current%>
|
||||
<% else %>
|
||||
<% pro = @homework.student_work_projects.where(:user_id => User.current.id).first %>
|
||||
<% is_my_work = pro && pro.student_work_id == student_work.id%>
|
||||
<% end %>
|
||||
|
||||
<% if is_my_work%>
|
||||
<li class="hworkList30 ml5 mr5" id="work_num_<%=student_work.id %>"><%=index + 1 %></li>
|
||||
<li class="hworkPortrait mt15 mr10">
|
||||
<%= image_tag(url_to_avatar(student_work.user),width:"40", height: "40", style: "display:block;") %>
|
||||
</li>
|
||||
<li class="hworkName mt12 pr10 w250 student_work_<%= student_work.id%>">
|
||||
<div>
|
||||
<% student_work_name = student_work.name.nil? || student_work.name.empty? ? student_work.user.show_name + '的作品' : student_work.name%>
|
||||
<%= link_to student_work_name, student_work_path(student_work),:remote => true,:title => student_work_name, :class => "linkGrey f14 StudentName break_word w250"%>
|
||||
</div>
|
||||
</li>
|
||||
<div class="student_work_<%= student_work.id%>">
|
||||
<% if @homework.homework_type != 3 %>
|
||||
<li class="hworkStName w80" title="<%= student_work.user.show_name%>" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;">
|
||||
<%= student_work.user.show_name%>
|
||||
</li>
|
||||
<li class="hworkStID" title="<%= student_work.user.user_extensions.nil? ? "--" : student_work.user.user_extensions.student_id%>" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;">
|
||||
<%= student_work.user.user_extensions.nil? ? "--" : student_work.user.user_extensions.student_id%>
|
||||
</li>
|
||||
<% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1 %>
|
||||
<% if student_work.project.is_public || User.current.member_of?(student_work.project) || User.current.admin? %>
|
||||
<li class="hworkPrName mr10 mt12" title="项目名称">
|
||||
<%= link_to( student_work.project.name, project_path(student_work.project.id))%>
|
||||
</li>
|
||||
<% else %>
|
||||
<li class="hworkPrName mr10 mt12" title="该项目是私有的">
|
||||
<%= student_work.project.name %>
|
||||
</li>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
<% else%>
|
||||
<li class="hworkList30 ml5 mr5" id="work_num_<%=student_work.id %>"><%=index + 1 %></li>
|
||||
<li class="hworkPortrait mt15 mr10">
|
||||
<%= image_tag(url_to_avatar(""),width:"40", height: "40", style: "display:block;") %>
|
||||
</li>
|
||||
<li class="hworkName mt12 pr10 w250 student_work_<%= student_work.id%>">
|
||||
<div>
|
||||
<%= link_to "匿名的作品", student_work_path(student_work),:remote => true,:title => student_work_name, :class => "linkGrey f14 StudentName break_word w250"%>
|
||||
</div>
|
||||
</li>
|
||||
<% if @homework.homework_type != 3 %>
|
||||
<li class="hworkStName w80" title="姓名" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;">
|
||||
匿名
|
||||
</li>
|
||||
<li class="hworkStID" title="学号">
|
||||
--
|
||||
</li>
|
||||
<% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1 %>
|
||||
<li class="hworkPrName mr10" title="项目名称" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;">
|
||||
匿名
|
||||
</li>
|
||||
<% end %>
|
||||
<% end%>
|
||||
|
||||
<li class="hworkList130 pl10 c_grey student_work_<%= student_work.id%>" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;">
|
||||
<%= Time.parse(format_time(student_work.created_at)).strftime("%m-%d %H:%M")%>
|
||||
<% if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(format_time(student_work.created_at)).strftime("%Y-%m-%d") %>
|
||||
<span class="c_red">[迟交]</span>
|
||||
<% end %>
|
||||
</li>
|
||||
|
||||
<!-- 成绩 -->
|
||||
<% if @homework.homework_type == 2%>
|
||||
<!-- 系统评分 -->
|
||||
<li class="hworkList50 <%= score_color student_work.system_score%>">
|
||||
<%= student_work.system_score.nil? ? "--" : format("%.1f",student_work.system_score)%>
|
||||
</li>
|
||||
<% end%>
|
||||
|
||||
<% my_score = student_work_score(student_work,User.current) %>
|
||||
<li class="hworkList50 <%= my_score.nil? ? 'c_grey' : score_color(my_score.score)%> mr10 ml10">
|
||||
<%= my_score.nil? ? "--" : format("%.1f",my_score.score)%>
|
||||
</li>
|
||||
<li class="hworkTip" style="display: none" id="work_click_<%= student_work.id%>"><em></em><span></span><font class="fontGrey2">点击查看详情</font></li>
|
||||
</ul>
|
|
@ -1,123 +1,122 @@
|
|||
|
||||
<div class="show_hwork_arrow"></div>
|
||||
<div class="showHwork">
|
||||
<ul>
|
||||
<li class="fl" >
|
||||
<span class="tit_fb">上交时间:</span>
|
||||
<%=format_time work.created_at %>
|
||||
</li>
|
||||
|
||||
<% if work.user == User.current && Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d") %>
|
||||
<!-- 我的作业 && 匿评作业 && 未开启匿评,显示编辑和删除按钮 -->
|
||||
<li class="fr" >
|
||||
<%= link_to("", student_work_path(work),:method => 'delete', :confirm => l(:text_are_you_sure), :class => "pic_del") %>
|
||||
<div class="show_hwork_arrow"></div>
|
||||
<div class="showHwork">
|
||||
<ul>
|
||||
<li class="fl" >
|
||||
<span class="tit_fb">上交时间:</span>
|
||||
<%=format_time work.created_at %>
|
||||
</li>
|
||||
<li class="fr" >
|
||||
<%= link_to "",new_student_work_path(:homework => @homework.id),:class => "pic_edit"%>
|
||||
</li>
|
||||
<% end%>
|
||||
<% if @homework.homework_detail_manual.comment_status == 3 && work.user != User.current%>
|
||||
<!-- 匿评结束阶段,显示点赞按钮 -->
|
||||
<li class="fr" id="student_work_praise_<%= work.id%>">
|
||||
<%= render :partial => 'student_work_praise',:locals => {:work => work} %>
|
||||
</li>
|
||||
<% end%>
|
||||
<div class="cl"></div>
|
||||
|
||||
<li >
|
||||
<span class="tit_fb ">编程代码:</span>
|
||||
<div class="showHworkP break_word"><pre id="work-src_<%= work.id%>" style="display: none;"><%= work.description if work.description%></pre><div class="fontGrey2 font_cus" id="work-code_<%= work.id%>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<% if work.user == User.current && Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d") %>
|
||||
<!-- 我的作业 && 匿评作业 && 未开启匿评,显示编辑和删除按钮 -->
|
||||
<li class="fr" >
|
||||
<%= link_to("", student_work_path(work),:method => 'delete', :confirm => l(:text_are_you_sure), :class => "pic_del") %>
|
||||
</li>
|
||||
<li class="fr" >
|
||||
<%= link_to "",new_student_work_path(:homework => @homework.id),:class => "pic_edit"%>
|
||||
</li>
|
||||
<% end%>
|
||||
<% if @homework.homework_detail_manual.comment_status == 3 && work.user != User.current%>
|
||||
<!-- 匿评结束阶段,显示点赞按钮 -->
|
||||
<li class="fr" id="student_work_praise_<%= work.id%>">
|
||||
<%= render :partial => 'student_work_praise',:locals => {:work => work} %>
|
||||
</li>
|
||||
<% end%>
|
||||
<div class="cl"></div>
|
||||
|
||||
<li class="mt10 fl">
|
||||
<span class="tit_fb ">
|
||||
测试结果:
|
||||
</span>
|
||||
<div class="show_hwork_p break_word">
|
||||
<% work.student_work_tests.each_with_index do |test, index| %>
|
||||
<div class="ProResultTop">
|
||||
<p class="c_blue fl">
|
||||
第<%= work.student_work_tests.count - index%>次测试
|
||||
</p>
|
||||
<span class="fr c_grey">
|
||||
<%= test.created_at.to_s(:db) %>
|
||||
</span>
|
||||
<div class="cl"></div>
|
||||
<li >
|
||||
<span class="tit_fb ">编程代码:</span>
|
||||
<div class="showHworkP break_word"><pre id="work-src_<%= work.id%>" style="display: none;"><%= work.description if work.description%></pre><div class="fontGrey2 font_cus" id="work-code_<%= work.id%>">
|
||||
</div>
|
||||
<% if test.status.to_i == -2 %>
|
||||
<div class="ProResultCon ">
|
||||
<%= test.results.first %>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="ProResultTable " >
|
||||
<ul class="ProResultUl " >
|
||||
|
||||
<% test.results.reverse.each_with_index do |x, i| %>
|
||||
<% unless x.nil? %>
|
||||
<li >
|
||||
<span class="w60 T_C">测试<%=test.results.size-i%></span>
|
||||
<% if x["status"].to_i != 0 %>
|
||||
<% if x["status"].to_i == 2 %>
|
||||
<span class="w60 c_red">超时!</span>
|
||||
<% else %>
|
||||
<span class="w60 c_red">测试错误!</span>
|
||||
<% end %>
|
||||
<span class="w60">您的输出:</span>
|
||||
<span class="width120"><pre style="white-space: pre-wrap; margin-right: 15px;"><%=x["result"].force_encoding("UTF-8")%> </pre></span>
|
||||
<span class="w60">正确输出:</span>
|
||||
|
||||
<span class="width120"><pre style="white-space: pre-wrap; margin-right: 15px;"><%=x["output"].force_encoding("UTF-8")%></pre></span>
|
||||
<span class="w50">耗时:</span>
|
||||
<span class="w80"><pre><%=x["time_used"]==0?1:x["time_used"]%>毫秒</pre></span>
|
||||
<div class="cl"></div>
|
||||
<% else %>
|
||||
<span class="w60 c_green">测试正确!</span>
|
||||
<span style="width:360px;"> </span>
|
||||
<span class="w50">耗时:</span>
|
||||
<span class="w80"><pre><%=x["time_used"]==0?1:x["time_used"]%>毫秒</pre></span>
|
||||
<div class="cl"></div>
|
||||
<% end %>
|
||||
</li>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li >
|
||||
<% if @is_teacher || (@homework.homework_detail_manual.comment_status == 2 && work.user != User.current )%>
|
||||
<!-- 老师 || 开启匿评状态 && 不是当前用户自己的作品 -->
|
||||
<div id="add_student_score_<%= work.id%>" class="mt10 evaluation">
|
||||
<%= render :partial => 'add_score',:locals => {:work => work,:score => score}%>
|
||||
</div>
|
||||
<% end%>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
|
||||
<li class="mt10 fl">
|
||||
<span class="tit_fb ">
|
||||
测试结果:
|
||||
</span>
|
||||
<div class="show_hwork_p break_word">
|
||||
<% work.student_work_tests.each_with_index do |test, index| %>
|
||||
<div class="ProResultTop">
|
||||
<p class="c_blue fl">
|
||||
第<%= work.student_work_tests.count - index%>次测试
|
||||
</p>
|
||||
<span class="fr c_grey">
|
||||
<%= test.created_at.to_s(:db) %>
|
||||
</span>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% if test.status.to_i == -2 %>
|
||||
<div class="ProResultCon ">
|
||||
<%= test.results.first %>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="ProResultTable " >
|
||||
<ul class="ProResultUl " >
|
||||
|
||||
<% test.results.reverse.each_with_index do |x, i| %>
|
||||
<% unless x.nil? %>
|
||||
<li >
|
||||
<span class="w60 T_C">测试<%=test.results.size-i%></span>
|
||||
<% if x["status"].to_i != 0 %>
|
||||
<% if x["status"].to_i == 2 %>
|
||||
<span class="w60 c_red">超时!</span>
|
||||
<% else %>
|
||||
<span class="w60 c_red">测试错误!</span>
|
||||
<% end %>
|
||||
<span class="w60">您的输出:</span>
|
||||
<span class="width120"><pre style="white-space: pre-wrap; margin-right: 15px;"><%=x["result"].force_encoding("UTF-8")%> </pre></span>
|
||||
<span class="w60">正确输出:</span>
|
||||
|
||||
<span class="width120"><pre style="white-space: pre-wrap; margin-right: 15px;"><%=x["output"].force_encoding("UTF-8")%></pre></span>
|
||||
<span class="w50">耗时:</span>
|
||||
<span class="w80"><pre><%=x["time_used"]==0?1:x["time_used"]%>毫秒</pre></span>
|
||||
<div class="cl"></div>
|
||||
<% else %>
|
||||
<span class="w60 c_green">测试正确!</span>
|
||||
<span style="width:360px;"> </span>
|
||||
<span class="w50">耗时:</span>
|
||||
<span class="w80"><pre><%=x["time_used"]==0?1:x["time_used"]%>毫秒</pre></span>
|
||||
<div class="cl"></div>
|
||||
<% end %>
|
||||
</li>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li >
|
||||
<% if @is_teacher || (@homework.homework_detail_manual.comment_status == 2 && work.user != User.current )%>
|
||||
<!-- 老师 || 开启匿评状态 && 不是当前用户自己的作品 -->
|
||||
<div id="add_student_score_<%= work.id%>" class="mt10 evaluation">
|
||||
<%= render :partial => 'add_score',:locals => {:work => work,:score => score}%>
|
||||
</div>
|
||||
<% end%>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div id="revise_attachment">
|
||||
<%= render :partial => 'student_work/revise_attachment', :locals => {:work => work} %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div id="revise_attachment">
|
||||
<%= render :partial => 'student_work/revise_attachment', :locals => {:work => work} %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
||||
<div class="ping_box fl" id="score_list_<%= work.id%>" style="<%= work.student_works_scores.empty? ? 'padding:0px;' : ''%>">
|
||||
<%student_work_scores.each do |student_score|%>
|
||||
<div id="work_score_<%= student_score.id%>">
|
||||
<%= render :partial => 'student_work_score',:locals => {:score => student_score,:is_last => student_score == student_work_scores.last}%>
|
||||
</div>
|
||||
<% end%>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<!---ping_box end--->
|
||||
<a href="javascript:void(0);" class="linkBlue mt5 mb5" style="margin-left:auto; margin-right: auto; display:block; width: 24px;" onclick="$('#about_hwork_<%= work.id%>').html('');">收起</a>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="ping_box fl" id="score_list_<%= work.id%>" style="<%= work.student_works_scores.empty? ? 'padding:0px;' : ''%>">
|
||||
<%student_work_scores.each do |student_score|%>
|
||||
<div id="work_score_<%= student_score.id%>">
|
||||
<%= render :partial => 'student_work_score',:locals => {:score => student_score,:is_last => student_score == student_work_scores.last}%>
|
||||
</div>
|
||||
<% end%>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<!---ping_box end--->
|
||||
<a href="javascript:void(0);" class="linkBlue mt5 mb5" style="margin-left:auto; margin-right: auto; display:block; width: 24px;" onclick="$('#about_hwork_<%= work.id%>').html('');">收起</a>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
<% if defined?(is_focus) && is_focus.to_i == 1 %>
|
||||
|
|
|
@ -1,109 +1,109 @@
|
|||
<div class="show_hwork_arrow"></div>
|
||||
<div class="showHwork">
|
||||
<% is_teacher = User.current.allowed_to?(:as_teacher, @homework.course) || User.current.admin? %>
|
||||
<% if @homework.homework_type != 3 %>
|
||||
<% is_my_work = work.user == User.current%>
|
||||
<% else %>
|
||||
<% pro = @homework.student_work_projects.where(:user_id => User.current.id).first %>
|
||||
<% is_my_work = pro && pro.student_work_id == work.id%>
|
||||
<% end %>
|
||||
<ul>
|
||||
<li class="fl" >
|
||||
<span class="tit_fb">上交时间:</span>
|
||||
<%=format_time work.created_at %>
|
||||
</li>
|
||||
<div class="show_hwork_arrow"></div>
|
||||
<div class="showHwork">
|
||||
<% is_teacher = User.current.allowed_to?(:as_teacher, @homework.course) || User.current.admin? %>
|
||||
<% if @homework.homework_type != 3 %>
|
||||
<% is_my_work = work.user == User.current%>
|
||||
<% else %>
|
||||
<% pro = @homework.student_work_projects.where(:user_id => User.current.id).first %>
|
||||
<% is_my_work = pro && pro.student_work_id == work.id%>
|
||||
<% end %>
|
||||
<ul>
|
||||
<li class="fl" >
|
||||
<span class="tit_fb">上交时间:</span>
|
||||
<%=format_time work.created_at %>
|
||||
</li>
|
||||
|
||||
<% if work.user == User.current && Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d") %>
|
||||
<!-- 我的作业 && 匿评作业 && 未开启匿评,显示编辑和删除按钮 -->
|
||||
<li class="fr" >
|
||||
<%= link_to("", student_work_path(work),:method => 'delete', :confirm => l(:text_are_you_sure), :class => "pic_del",:title=>"删除") %>
|
||||
</li>
|
||||
<li class="fr mr5" >
|
||||
<%= link_to "",edit_student_work_path(work),:class => "pic_edit",:title => "修改"%>
|
||||
</li>
|
||||
<% end%>
|
||||
<% if @homework.homework_detail_manual.comment_status == 3 && !is_my_work %>
|
||||
<!-- 匿评结束阶段,显示点赞按钮 -->
|
||||
<li class="fr" id="student_work_praise_<%= work.id%>">
|
||||
<%= render :partial => 'student_work_praise',:locals => {:work => work} %>
|
||||
</li>
|
||||
<% end%>
|
||||
<% if work.user == User.current && Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d") %>
|
||||
<!-- 我的作业 && 匿评作业 && 未开启匿评,显示编辑和删除按钮 -->
|
||||
<li class="fr" >
|
||||
<%= link_to("", student_work_path(work),:method => 'delete', :confirm => l(:text_are_you_sure), :class => "pic_del",:title=>"删除") %>
|
||||
</li>
|
||||
<li class="fr mr5" >
|
||||
<%= link_to "",edit_student_work_path(work),:class => "pic_edit",:title => "修改"%>
|
||||
</li>
|
||||
<% end%>
|
||||
<% if @homework.homework_detail_manual.comment_status == 3 && !is_my_work %>
|
||||
<!-- 匿评结束阶段,显示点赞按钮 -->
|
||||
<li class="fr" id="student_work_praise_<%= work.id%>">
|
||||
<%= render :partial => 'student_work_praise',:locals => {:work => work} %>
|
||||
</li>
|
||||
<% end%>
|
||||
<div class="cl"></div>
|
||||
|
||||
<!--<li ><span class="tit_fb"> 参与人员:</span>程梦雯 王强</li>-->
|
||||
|
||||
<% if @homework.homework_type == 3 && work.student_work_projects && (@homework.homework_detail_manual.comment_status != 2 || is_my_work || is_teacher ) %>
|
||||
<div class="cl"></div>
|
||||
<li>
|
||||
<span class="tit_fb"> 参与人员:</span>
|
||||
<%= link_to(work.user.show_name+"(组长)", user_path(work.user.id), :class => "linkBlue" )%>
|
||||
<% members = work.student_work_projects.where("is_leader = 0") %>
|
||||
<% members.each do |member| if !members.empty? %>
|
||||
、<%=link_to((User.find member.user_id).show_name, user_path(member.user.id), :class => "linkBlue" ) %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</li>
|
||||
<% if @homework.homework_detail_group.base_on_project == 1 %>
|
||||
<li>
|
||||
<span class="tit_fb"> 关联项目:</span>
|
||||
<% if work.project.is_public || User.current.member_of?(work.project) || User.current.admin? %>
|
||||
<%= link_to( work.project.name, project_path(work.project.id), :class => "linkBlue" )%>
|
||||
<% else %>
|
||||
<span title ="该项目是私有的"><%=work.project.name %></span>
|
||||
<% end %>
|
||||
<%#= link_to( work.project.name, project_path(work.project.id), :class => "linkBlue" )%>
|
||||
<span class="ml5">(综合评分:<font class="c_red"><%=work.project.project_score.score.to_i %></font>)</span>
|
||||
</li>
|
||||
<% end %>
|
||||
<% end%>
|
||||
|
||||
<li >
|
||||
<span class="tit_fb ">内容:</span>
|
||||
<div class="showHworkP break_word upload_img" id="student_work_img_<%=work.id %>">
|
||||
<%= work.description.html_safe if work.description%>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<li >
|
||||
<span class="tit_fb"> 附件:</span>
|
||||
<% com_attachments = work.attachments.where("attachtype IS NULL OR attachtype <> 7") %>
|
||||
<% if com_attachments.empty?%>
|
||||
<span style="color: #999999">尚未提交附件</span>
|
||||
<% else%>
|
||||
<div class="fl" style="width: 90%;">
|
||||
<%= render :partial => 'work_attachments_status', :locals => {:attachments => com_attachments, :status => @homework.homework_detail_manual.comment_status} %>
|
||||
</div>
|
||||
<% end%>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<li >
|
||||
<% if @is_teacher || (@homework.homework_detail_manual.comment_status == 2 && !is_my_work)%>
|
||||
<!-- 老师 || 开启匿评状态 && 不是当前用户自己的作品 -->
|
||||
<div id="add_student_score_<%= work.id%>" class="mt10 evaluation">
|
||||
<%= render :partial => 'add_score',:locals => {:work => work,:score => score}%>
|
||||
</div>
|
||||
<% end%>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div id="revise_attachment">
|
||||
<%= render :partial => 'student_work/revise_attachment', :locals => {:work => work} %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
||||
<!--<li ><span class="tit_fb"> 参与人员:</span>程梦雯 王强</li>-->
|
||||
|
||||
<% if @homework.homework_type == 3 && work.student_work_projects && (@homework.homework_detail_manual.comment_status != 2 || is_my_work || is_teacher ) %>
|
||||
<div class="cl"></div>
|
||||
<li>
|
||||
<span class="tit_fb"> 参与人员:</span>
|
||||
<%= link_to(work.user.show_name+"(组长)", user_path(work.user.id), :class => "linkBlue" )%>
|
||||
<% members = work.student_work_projects.where("is_leader = 0") %>
|
||||
<% members.each do |member| if !members.empty? %>
|
||||
、<%=link_to((User.find member.user_id).show_name, user_path(member.user.id), :class => "linkBlue" ) %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</li>
|
||||
<% if @homework.homework_detail_group.base_on_project == 1 %>
|
||||
<li>
|
||||
<span class="tit_fb"> 关联项目:</span>
|
||||
<% if work.project.is_public || User.current.member_of?(work.project) || User.current.admin? %>
|
||||
<%= link_to( work.project.name, project_path(work.project.id), :class => "linkBlue" )%>
|
||||
<% else %>
|
||||
<span title ="该项目是私有的"><%=work.project.name %></span>
|
||||
<% end %>
|
||||
<%#= link_to( work.project.name, project_path(work.project.id), :class => "linkBlue" )%>
|
||||
<span class="ml5">(综合评分:<font class="c_red"><%=work.project.project_score.score.to_i %></font>)</span>
|
||||
</li>
|
||||
<% end %>
|
||||
<% end%>
|
||||
|
||||
<li >
|
||||
<span class="tit_fb ">内容:</span>
|
||||
<div class="showHworkP break_word upload_img" id="student_work_img_<%=work.id %>">
|
||||
<%= work.description.html_safe if work.description%>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<li >
|
||||
<span class="tit_fb"> 附件:</span>
|
||||
<% com_attachments = work.attachments.where("attachtype IS NULL OR attachtype <> 7") %>
|
||||
<% if com_attachments.empty?%>
|
||||
<span style="color: #999999">尚未提交附件</span>
|
||||
<% else%>
|
||||
<div class="fl" style="width: 90%;">
|
||||
<%= render :partial => 'work_attachments_status', :locals => {:attachments => com_attachments, :status => @homework.homework_detail_manual.comment_status} %>
|
||||
<div class="ping_box fl" id="score_list_<%= work.id%>" style="<%= work.student_works_scores.empty? ? 'padding:0px;' : ''%>">
|
||||
<%student_work_scores.each do |student_score|%>
|
||||
<div id="work_score_<%= student_score.id%>">
|
||||
<%= render :partial => 'student_work_score',:locals => {:score => student_score,:is_last => student_score == student_work_scores.last}%>
|
||||
</div>
|
||||
<% end%>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<li >
|
||||
<% if @is_teacher || (@homework.homework_detail_manual.comment_status == 2 && !is_my_work)%>
|
||||
<!-- 老师 || 开启匿评状态 && 不是当前用户自己的作品 -->
|
||||
<div id="add_student_score_<%= work.id%>" class="mt10 evaluation">
|
||||
<%= render :partial => 'add_score',:locals => {:work => work,:score => score}%>
|
||||
</div>
|
||||
<% end%>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div id="revise_attachment">
|
||||
<%= render :partial => 'student_work/revise_attachment', :locals => {:work => work} %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<!---ping_box end--->
|
||||
<a href="javascript:void(0);" class="linkBlue mt5 mb5" style="margin-left:auto; margin-right: auto; display:block; width: 24px;" onclick="$('#about_hwork_<%= work.id%>').html('');">收起</a>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
||||
<div class="ping_box fl" id="score_list_<%= work.id%>" style="<%= work.student_works_scores.empty? ? 'padding:0px;' : ''%>">
|
||||
<%student_work_scores.each do |student_score|%>
|
||||
<div id="work_score_<%= student_score.id%>">
|
||||
<%= render :partial => 'student_work_score',:locals => {:score => student_score,:is_last => student_score == student_work_scores.last}%>
|
||||
</div>
|
||||
<% end%>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<!---ping_box end--->
|
||||
<a href="javascript:void(0);" class="linkBlue mt5 mb5" style="margin-left:auto; margin-right: auto; display:block; width: 24px;" onclick="$('#about_hwork_<%= work.id%>').html('');">收起</a>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
showNormalImage('student_work_img_<%=work.id %>');
|
||||
|
|
|
@ -37,17 +37,6 @@
|
|||
</div>
|
||||
<div class="cl"></div>
|
||||
|
||||
<% @stundet_works.each_with_index do |student_work, i|%>
|
||||
<% if @is_evaluation%>
|
||||
<%= render :partial => "evaluation_work", :locals => {:student_work => student_work, :index => i}%>
|
||||
<% else%>
|
||||
<%= render :partial => "evaluation_un_work", :locals => {:student_work => student_work, :index => i}%>
|
||||
<% end%>
|
||||
<div class="cl"></div>
|
||||
<div id="about_hwork_<%= student_work.id%>">
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<% end%>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
<% if !@is_evaluation && (!@is_teacher || params[:show_work_id].present?) || @message_student_work_id %>
|
||||
|
|
|
@ -69,16 +69,16 @@
|
|||
<ul class="menu_r">
|
||||
<li>
|
||||
<a href="javascript:void(0);" class="parent">
|
||||
<% @homework_commons.each_with_index do |homework_common,index |%>
|
||||
<% @all_homework_commons.each_with_index do |homework_common,index |%>
|
||||
<% if homework_common.id == @homework.id %>
|
||||
<%="作业 #{@homework_commons.count - index}" %>
|
||||
<%="作业 #{@all_homework_commons.count - index}" %>
|
||||
<% end %>
|
||||
<% end%>
|
||||
</a>
|
||||
<ul>
|
||||
<% @homework_commons.each_with_index do |homework_common,index |%>
|
||||
<% @all_homework_commons.each_with_index do |homework_common,index |%>
|
||||
<li class="pr10">
|
||||
<%= link_to "作业#{@homework_commons.count - index}:#{homework_common.name}",student_work_index_path(:homework => homework_common.id)%>
|
||||
<%= link_to "作业#{@all_homework_commons.count - index}:#{homework_common.name}",student_work_index_path(:homework => homework_common.id)%>
|
||||
<%#= link_to "第#{@homework_commons.count - index}次作业",student_work_index_path(:homework => homework_common.id)%>
|
||||
</li>
|
||||
<% end%>
|
||||
|
@ -170,13 +170,15 @@
|
|||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="mt5">
|
||||
<% if @homework.homework_detail_manual && @homework.homework_detail_manual.comment_status < 2 %>
|
||||
<div class="fontGrey2 db fl">提交截止时间:<%= @homework.end_time %> 23:59</div>
|
||||
<% elsif @homework.homework_detail_manual && @homework.homework_detail_manual.comment_status >= 2 && @homework.anonymous_comment == 0 %>
|
||||
<div class="fontGrey2 db fl">匿评截止时间:<%= @homework.homework_detail_manual.evaluation_end %> 23:59</div>
|
||||
<% end %>
|
||||
<% if @homework.homework_detail_manual.comment_status == 0 %>
|
||||
<div class="fontGrey2 db fl ml10">发布时间:<%= @homework.publish_time %> 00:00</div>
|
||||
<% if @homework.end_time && @homework.publish_time %>
|
||||
<% if @homework.homework_detail_manual && @homework.homework_detail_manual.comment_status < 2 %>
|
||||
<div class="fontGrey2 db fl">提交截止时间:<%= @homework.end_time %> 23:59</div>
|
||||
<% elsif @homework.homework_detail_manual && @homework.homework_detail_manual.comment_status >= 2 && @homework.anonymous_comment == 0 %>
|
||||
<div class="fontGrey2 db fl">匿评截止时间:<%= @homework.homework_detail_manual.evaluation_end %> 23:59</div>
|
||||
<% end %>
|
||||
<% if @homework.homework_detail_manual.comment_status == 0 %>
|
||||
<div class="fontGrey2 db fl ml10">发布时间:<%= @homework.publish_time %> 00:00</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% if @homework.homework_detail_manual%>
|
||||
<% if @homework.homework_detail_manual.comment_status == 1%>
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
<div>
|
||||
<div class="ni_con">
|
||||
<p class="mt30">
|
||||
<% if state == 2 %>
|
||||
请求已发送至<%= attachment.author.show_name %>,希望他同意与你分享:)
|
||||
<% elsif state == 3 %>
|
||||
您已发送过分享请求,请勿重复发送。
|
||||
<% end %>
|
||||
</p>
|
||||
<div class="ni_btn">
|
||||
<a href="javascript:" class="tijiao" onclick="hideModal();" style="margin-bottom: 10px; margin-left: 60px; color: #fff;" >
|
||||
确 定
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -0,0 +1,28 @@
|
|||
<div>
|
||||
<div class="ni_con">
|
||||
<%= form_tag(apply_for_resource_user_path(:id => User.current.id, :attachment_id => attachment.id), :multipart => true, :remote => true, :name=>"apply_for_homework_form", :id=>'apply_for_homework_form') do %>
|
||||
<h2>申请分享</h2>
|
||||
<p style="color: #000;">
|
||||
申请说明(必选):
|
||||
<textarea type="text" name="content" id="apply_content" placeholder="请附言,以增加分享的成功机率。" class="apply_content mt10" style="outline:none;"></textarea>
|
||||
</p>
|
||||
<span class="c_red ml5 f12" style="display: none" id="apply_content_notice">为增加分享的成功机率,请务必填写申请说明。</span>
|
||||
<div class="ni_btn">
|
||||
<a href="javascript:" class="tijiao" onclick="submit_apply_resource();" style="margin-bottom: 20px; margin-left: 60px; color: #fff">
|
||||
确 定
|
||||
</a>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<script type="application/javascript">
|
||||
var first_click_apply = true;
|
||||
function submit_apply_resource(){
|
||||
if($.trim($("#apply_content").val()) == ""){
|
||||
$("#apply_content_notice").show();
|
||||
} else if(first_click_apply) {
|
||||
first_click_apply = false;
|
||||
$('#apply_for_homework_form').submit();
|
||||
}
|
||||
}
|
||||
</script>
|
|
@ -0,0 +1,38 @@
|
|||
<li class="homepageNewsPortrait fl">
|
||||
<div class="navHomepageLogo fl">
|
||||
<%= link_to image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30"), user_path(ma.course_message.user) %>
|
||||
</div>
|
||||
</li>
|
||||
<li class="homepageNewsPubType fl">
|
||||
<%= link_to ma.course_message.user.show_name, user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher" %>
|
||||
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">申请引用资源:</span>
|
||||
</li>
|
||||
<li class="<%=(ma.apply_result == 0 || ma.apply_result.nil?) ? 'homepageHomeworkContent2' : 'homepageHomeworkContent' %> fl">
|
||||
<% content = ma.course_message.content.nil? ? '' : ':'+ ma.course_message.content.to_s %>
|
||||
<% show_content = ma.course_message.user.show_name + "申请引用资源\""+"#{ma.course_message.find_attachment(ma.course_message.attachment_id).try(:filename)}"+"\"#{content}" %>
|
||||
<% if ma.course_message.container_type == "Course" %>
|
||||
<%= link_to show_content, course_files_path(ma.course_message.container_id), :title => show_content, :class => " #{ma.viewed == 0 ? "newsBlack" : "newsGrey "}" %>
|
||||
<% elsif ma.course_message.container_type == "Project" %>
|
||||
<%= link_to show_content, project_files_path(ma.course_message.container_id), :title => show_content, :class => " #{ma.viewed == 0 ? "newsBlack" : "newsGrey "}" %>
|
||||
<% elsif ma.course_message.container_type == "OrgSubfield" %>
|
||||
<%= link_to show_content, org_subfield_files_path(ma.course_message.container_id), :title => show_content, :class => " #{ma.viewed == 0 ? "newsBlack" : "newsGrey "}" %>
|
||||
<% else %>
|
||||
<a title="<%= show_content %>" class = "<%= ma.viewed == 0 ? "newsBlack" : "newsGrey "%>">
|
||||
<%= show_content %>
|
||||
</a>
|
||||
<% end %>
|
||||
</li>
|
||||
|
||||
<li class="<%=(ma.apply_result == 0 || ma.apply_result.nil?) ? 'homepageHomeworkContentWarn2' : 'homepageHomeworkContentWarn' %> fl">
|
||||
<span id="deal_info_<%= ma.id %>">
|
||||
<% if ma.apply_result == 0 || ma.apply_result.nil? %>
|
||||
<%= link_to '同意', deal_with_apply_resource_user_path(User.current, :agree => 'Y', :msg_id => ma.id, :apply_user_id => ma.course_message.apply_user_id), :remote => 'true' %> |
|
||||
<%= link_to '拒绝', deal_with_apply_resource_user_path(User.current, :agree => 'N', :msg_id => ma.id, :apply_user_id => ma.course_message.apply_user_id), :remote => 'true' %>
|
||||
<% elsif ma.apply_result == 1 %>
|
||||
您已经同意了该申请
|
||||
<% elsif ma.apply_result == 2 %>
|
||||
您已经拒绝了该申请
|
||||
<%end %>
|
||||
</span>
|
||||
</li>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
|
@ -0,0 +1,34 @@
|
|||
<ul class="homepageNewsList fl">
|
||||
<li class="homepageNewsPortrait fl">
|
||||
<% owner = User.find(ma.course_message.apply_user_id) %>
|
||||
<div class="navHomepageLogo fl">
|
||||
<%= link_to image_tag(url_to_avatar(owner), :width => "30", :height => "30", class: "mt3"), user_path(owner) %>
|
||||
</div>
|
||||
</li>
|
||||
<li class="homepageNewsPubType fl">
|
||||
<%= link_to owner.show_name, user_path(owner), :class => "newsBlue homepageNewsPublisher" %>
|
||||
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>"><%= ma.apply_result == 2 ? '同意' : '拒绝'%>引用资源:</span>
|
||||
</li>
|
||||
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
||||
<% link_str = ma.apply_result == 2 ?
|
||||
'您申请引用资源"'+ ma.course_message.find_attachment(ma.course_message.attachment_id).try(:filename) + '"的申请已通过'
|
||||
:
|
||||
'您申请引用资源"'+ ma.course_message.find_attachment(ma.course_message.attachment_id).try(:filename) + '"的申请被婉拒' %>
|
||||
<% if ma.course_message.container_type == "Course" %>
|
||||
<%= link_to link_str, course_files_path(ma.course_message.container_id), :title => link_str, :class => " #{ma.viewed == 0 ? "newsBlack" : "newsGrey "}" %>
|
||||
<% elsif ma.course_message.container_type == "Project" %>
|
||||
<%= link_to link_str, project_files_path(ma.course_message.container_id), :title => link_str, :class => " #{ma.viewed == 0 ? "newsBlack" : "newsGrey "}" %>
|
||||
<% elsif ma.course_message.container_type == "OrgSubfield" %>
|
||||
<%= link_to link_str, org_subfield_files_path(ma.course_message.container_id), :title => link_str, :class => " #{ma.viewed == 0 ? "newsBlack" : "newsGrey "}" %>
|
||||
<% else %>
|
||||
<a title="<%= link_str %>" class = "<%= ma.viewed == 0 ? "newsBlack" : "newsGrey "%>">
|
||||
<%= link_str %>
|
||||
</a>
|
||||
<% end %>
|
||||
|
||||
|
||||
<%= link_to link_str, user_resource_user_path(User.current, :type => 2), :title => link_str,:class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey "}" %>
|
||||
</a>
|
||||
</li>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||
</ul>
|
|
@ -6,11 +6,38 @@
|
|||
<% attachments.each do |attach| %>
|
||||
<ul class="resource-list" onmouseover="if($('#contextMenu').css('display') != 'block')$(this).children().css('background-color', '#e1e1e1')" onmouseout=" if($('#contextMenu').css('display') == 'none')$(this).children().css('background-color', 'white')">
|
||||
<li class="resource-list-checkbox fl">
|
||||
<input name="checkbox1[]" type="checkbox" data-has-history="<%= attach.attachment_histories.count == 0 ? 'N' : 'Y' %>" data-deleteble="<%= User.current.id ==attach.author_id ? 'Y' : 'N' %>" onclick="checkAllBox($(this));" value="<%= attach.id%>" class="resourcesCheckbox" />
|
||||
<% if attach.is_public == 0 && (@type == "6" || @type == "2") && attach.author != User.current && attach.get_apply_resource_status(attach.id, attach.author_id) != 2 %>
|
||||
<input name="checkbox1[]" type="checkbox" disabled="disabled" data-has-history="<%= attach.attachment_histories.count == 0 ? 'N' : 'Y' %>" data-deleteble="<%= User.current.id ==attach.author_id ? 'Y' : 'N' %>" onclick="checkAllBox($(this));" value="<%= attach.id%>" class="resourcesCheckbox" />
|
||||
<% else %>
|
||||
<input name="checkbox1[]" type="checkbox" data-has-history="<%= attach.attachment_histories.count == 0 ? 'N' : 'Y' %>" data-deleteble="<%= User.current.id ==attach.author_id ? 'Y' : 'N' %>" onclick="checkAllBox($(this));" value="<%= attach.id%>" class="resourcesCheckbox" />
|
||||
<% end %>
|
||||
<!--<input name="checkbox2" type="checkbox" value="" class="resourcesCheckbox" />-->
|
||||
</li>
|
||||
<li class="resource-list-name fl hidden">
|
||||
<%= link_to truncate(attach.filename, :length => 30), download_named_attachment_path(attach.id, attach.filename), :title => attach.filename, :class => 'resourcesBlack' %>
|
||||
<li class="resource-list-name fl">
|
||||
<% if attach.is_public == 0 && attach.get_apply_resource_status(attach.id, attach.author_id) != 2 %>
|
||||
<a href="" style="cursor: default" class = "resourcesBlack resource-list-middle hidden mw280" title="<%= attach.filename %>"><%= attach.filename %> </a>
|
||||
<% else %>
|
||||
<%= link_to truncate(attach.filename, :length => 30), download_named_attachment_path(attach.id, attach.filename), :title => attach.filename, :class => 'resourcesBlack resource-list-middle hidden mw280' %>
|
||||
<% end %>
|
||||
<% if attach.is_public == 0 && (@type == "6" || @type == "2") && attach.author != User.current %>
|
||||
<img src="/images/locked.png" alt="私有" title="私有" class="resource-list-middle" height="16" width="16">
|
||||
<% end %>
|
||||
</li>
|
||||
<li class="resource-list-apply fr" id="resource_apply_status_<%=attach.id %>">
|
||||
<% if attach.is_public == 0 && (@type == "6" || @type == "2") && attach.author != User.current && !attach_show_allow(attach) %>
|
||||
<% ah = attach.get_status_by_attach(User.current.id) %>
|
||||
<% if ah.nil? %>
|
||||
<%= link_to("请求分享", apply_resource_user_path(User.current.id, :attachment_id => attach.id), :class => 'green_btn_share c_white', :remote => true) %>
|
||||
<% elsif ah == 1 %>
|
||||
等待回复
|
||||
<% elsif ah == 2 %>
|
||||
可引用
|
||||
<% elsif ah == 3 %>
|
||||
已拒绝
|
||||
<% end %>
|
||||
<% else %>
|
||||
--
|
||||
<% end %>
|
||||
</li>
|
||||
<li class="resource-list-time fr"><%= format_date(attach.created_on) %></li>
|
||||
<li class="resource-list-quote fr"><%= attach.quotes.nil? ? 0 : attach.quotes %></li>
|
||||
|
@ -20,6 +47,8 @@
|
|||
<li class="resource-list-uploader fr hidden"><%=User.find(attach.author_id).realname.blank? ? User.find(attach.author_id).nickname : User.find(attach.author_id).realname %></li>
|
||||
<li class="resource-list-type fr"><%= get_resource_type(attach.container_type)%></li>
|
||||
<li class="resource-list-from fr hidden" title="<%= get_resource_origin(attach) %>"><%= get_resource_origin(attach) %></li>
|
||||
<li style="display: none"><%= attach.is_public %></li>
|
||||
<li style="display: none"><%= attach.get_apply_resource_status(attach.id, attach.author_id) %></li>
|
||||
<li style="display: none"><%= attach.id %></li>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
||||
|
@ -68,19 +97,27 @@
|
|||
document.oncontextmenu = function() {return true;}
|
||||
line.children().css("background-color",'white');
|
||||
id = line.children().last().html();
|
||||
if (lastSendType === '2'){ //如果已经发送过一次了,那么就应该沿用上次发送的类型。
|
||||
$.ajax({
|
||||
type: 'get',
|
||||
url: '<%= search_user_project_user_path(User.current.id) %>' + "?send_id=" + id + "&type=<%= @type %>",
|
||||
data:{send_type:'file'}
|
||||
});
|
||||
is_public = line.children().eq(11).html();
|
||||
user_id = line.children().eq(6).html();
|
||||
apply_status = line.children().eq(12).html();
|
||||
if(is_public == 0 && user_id != '<%= User.current.id %>' && apply_status != 2){
|
||||
alert('您无权发送私有资源')
|
||||
}else{
|
||||
$.ajax({
|
||||
type: 'get',
|
||||
url: '<%= search_user_course_user_path(User.current.id)%>' + "?send_id=" + id + "&type=<%= @type %>",
|
||||
data:{send_type:'file'}
|
||||
});
|
||||
if (lastSendType === '2'){ //如果已经发送过一次了,那么就应该沿用上次发送的类型。
|
||||
$.ajax({
|
||||
type: 'get',
|
||||
url: '<%= search_user_project_user_path(User.current.id) %>' + "?send_id=" + id + "&type=<%= @type %>",
|
||||
data:{send_type:'file'}
|
||||
});
|
||||
}else{
|
||||
$.ajax({
|
||||
type: 'get',
|
||||
url: '<%= search_user_course_user_path(User.current.id)%>' + "?send_id=" + id + "&type=<%= @type %>",
|
||||
data:{send_type:'file'}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function batch_send(){
|
||||
|
@ -176,7 +213,7 @@
|
|||
}
|
||||
line.children().css("background-color", 'white');
|
||||
id = line.children().last().html();
|
||||
user_id = line.children().eq(5).html();
|
||||
user_id = line.children().eq(6).html();
|
||||
if(line.children().first().children().data('hasHistory') == 'Y'){
|
||||
alert('该资源存在历史版本,不能删除');
|
||||
return;
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
<% if @type != "2" %>
|
||||
<div class="resourcesUploadBox mt10" ><a href="javascript:void(0);" onclick="show_upload();" class="uploadBoxIcon">上传资源</a></div>
|
||||
<% end %>
|
|
@ -234,6 +234,18 @@
|
|||
<%= render :partial => 'apply_homework_course_message', :locals => {:ma => ma} %>
|
||||
</ul>
|
||||
<% end %>
|
||||
<!--资源申请-->
|
||||
<% if ma.course_message_type == "ApplyResource" && ma.status == 0 %>
|
||||
<ul class="homepageNewsList fl" id="apply_resource_message_<%=ma.id %>">
|
||||
<%= render :partial => 'apply_resource_course_message', :locals => {:ma => ma} %>
|
||||
</ul>
|
||||
<% end %>
|
||||
<!--资源申请回复-->
|
||||
<% if ma.course_message_type == "ApplyResource" && ma.status == 1 %>
|
||||
<ul class="homepageNewsList fl" id="apply_resource_message_<%=ma.id %>">
|
||||
<%= render :partial => 'apply_resource_course_message_reply', :locals => {:ma => ma} %>
|
||||
</ul>
|
||||
<% end %>
|
||||
<% if ma.course_message_type == "HomeworkCommon" && ma.status == 6 %>
|
||||
<ul class="homepageNewsList fl">
|
||||
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><div class="navHomepageLogo fl"><%= image_tag(url_to_avatar(User.find(ma.apply_user_id)), width: "30px", height: "30px", class: "mt3") %></div></a></li>
|
||||
|
@ -395,9 +407,9 @@
|
|||
<li class="homepageNewsPubType fl"><%= link_to ma.course_message.user, user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
|
||||
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">
|
||||
<% if ma.course_message.m_parent_id.nil? %>
|
||||
回复了您的作业:
|
||||
回复了您的<span class="fontBlue2" title="作业:<%=ma.course_message.jour.name %>">作业</span>:
|
||||
<% else %>
|
||||
回复了您:
|
||||
在<span class="fontBlue2" title="作业:<%=ma.course_message.jour.name %>">作业</span>中回复了您:
|
||||
<% end %>
|
||||
</span>
|
||||
</li>
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
<div id="users_setting">
|
||||
<div class="resourcesUploadBox mt10"><a href="javascript:void(0);" onclick="show_upload();" class="uploadBoxIcon">上传资源</a></div>
|
||||
<div id="upload_private_resource">
|
||||
<%= render :partial => "show_new_upload", :locals => {:type => @type, :status => @status} %>
|
||||
</div>
|
||||
<div id="search_div">
|
||||
<%= render :partial => 'users/resource_search_form',:locals => {:user => @user, :type => @type, :order => @order, :sort => @score, :status => @status} %>
|
||||
</div>
|
||||
|
@ -212,7 +214,7 @@
|
|||
document.oncontextmenu = function() {return true;}
|
||||
line.children().css("background-color",'white');
|
||||
id = line.children().last().html();
|
||||
user_id = line.children().eq(5).html();
|
||||
user_id = line.children().eq(6).html();
|
||||
if(user_id === '<%= User.current.id %>') {
|
||||
res_name = line.children().eq(1).children().attr('title');
|
||||
res_link = line.children().eq(1).html();
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<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-apply fr">操作</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" %>
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
<%#= 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" %>
|
||||
<% unless (@type == "6" || @type == "2") %>
|
||||
<li>
|
||||
<a href="<%= resource_search_user_path(:id => @user.id, :type => @type, :status => 4, :search => @switch_search) %>" id="resource_type_file" class="resourcesTypeAtt resourcesGrey" data-method="get" data-remote="true">附件 </a>
|
||||
<%#= link_to '附件' ,user_resource_user_path(:id=>@user.id,:type=>4), id="resource_type_file", :remote=>true,:method => 'get',:class=>'resourcesTypeAtt resourcesGrey' %>
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
<% if @flag == true%>
|
||||
$("#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})%>');
|
||||
$("#pages").html('<%= pagination_links_full @atta_pages, @atta_count, :per_page_links => false, :remote => @is_remote, :flag => true, :path => @path %>');
|
||||
$("#user_resource_type_filter").html('<%= escape_javascript( render :partial => 'user_resource_type_filter' , :locals => {:user => @user, :type => @type, :status => @status}) %>');
|
||||
$("#upload_private_resource").html('<%= escape_javascript( render :partial => 'show_new_upload' , :locals => {:user => @user, :type => @type, :status => @status}) %>');
|
||||
$("#res_count").html(0);
|
||||
$("#checkboxAll").attr('checked',false);
|
||||
$("#res_all_count").html(<%= @atta_count%>);
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
<% if @flag == true%>
|
||||
$("#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})%>');
|
||||
$("#pages").html('<%= pagination_links_full @atta_pages, @atta_count, :per_page_links => false, :remote => @is_remote, :flag => true, :path => @path %>');
|
||||
$("#user_resource_type_filter").html('<%= escape_javascript( render :partial => 'user_resource_type_filter' , :locals => {:user => @user, :type => @type, :status => @status}) %>');
|
||||
$("#upload_private_resource").html('<%= escape_javascript( render :partial => 'show_new_upload' , :locals => {:user => @user, :type => @type, :status => @status}) %>');
|
||||
$("#res_count").html(0);
|
||||
$("#checkboxAll").attr('checked',false);
|
||||
$("#res_all_count").html(<%= @atta_count%>);
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
<% if @state == 1 %>
|
||||
hideModal();
|
||||
alert("您还未登录,请先登录");
|
||||
<% elsif @state == 2 %>
|
||||
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/apply_for_resource', :locals => {:attachment => @attachment, :state => @state}) %>');
|
||||
showModal('ajax-modal', '500px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
|
||||
"<a href='javascript:' onclick='hideModal();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
$('#ajax-modal').parent().css("top","30%").css("left","37%").css("position","fixed").css("border","3px solid #269ac9");
|
||||
$("#resource_apply_status_<%= @attachment.id %>").html("等待回复");
|
||||
<% elsif @state == 3 %>
|
||||
hideModal();
|
||||
alert("您已申请过该资源");
|
||||
<% end %>
|
|
@ -0,0 +1,10 @@
|
|||
<% if @state == 1 %>
|
||||
alert("您还未登录");
|
||||
<% elsif @state == 2 %>
|
||||
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/apply_resource', :locals => {:attachment => @attachment}) %>');
|
||||
showModal('ajax-modal', '500px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
|
||||
"<a href='javascript:' onclick='hideModal();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
$('#ajax-modal').parent().css("top","30%").css("left","37%").css("position","fixed").css("border","3px solid #269ac9");
|
||||
<% end %>
|
|
@ -0,0 +1 @@
|
|||
$("#apply_resource_message_<%= @msg.id %>").html('<%= escape_javascript(render :partial => 'users/apply_resource_course_message', :locals => {:ma => @msg}) %>');
|
|
@ -55,7 +55,10 @@
|
|||
<li class="fl resource-switch">
|
||||
<a href="<%= user_resource_user_path(@user, :type => '1', :status => 6) %>" class="resource-tab" id="my_resource_list" data-remote="true">我的资源</a>
|
||||
</li>
|
||||
<li class="fl w770 border-bottom h34"> </li>
|
||||
<li class="fl resource-switch">
|
||||
<a href="<%= user_resource_user_path(@user, :type => '2', :status => 6) %>" class="resource-tab" id="private_resource_list" data-remote="true">私有资源</a>
|
||||
</li>
|
||||
<li class="fl w680 border-bottom h34"> </li>
|
||||
<li class="fr resource-banner-li border-bottom h34">
|
||||
<div id="user_resource_type_filter">
|
||||
<%= render :partial => 'user_resource_type_filter' %>
|
||||
|
|
|
@ -2,6 +2,7 @@ $("#search_div").html('<%= escape_javascript( render :partial => 'resource_searc
|
|||
$("#resource_tip_list").html('<%= escape_javascript( render :partial => 'users/user_resource_tip_list', :locals => {:user => @user, :type => @type, :status => @status}) %>');
|
||||
$("#resources_list").html('<%= escape_javascript( render :partial => 'resources_list' , :locals => { :attachments => @attachments}) %>');
|
||||
$("#user_resource_type_filter").html('<%= escape_javascript( render :partial => 'user_resource_type_filter' , :locals => {:user => @user, :type => @type, :status => @status}) %>');
|
||||
$("#upload_private_resource").html('<%= escape_javascript( render :partial => 'show_new_upload' , :locals => {:user => @user, :type => @type, :status => @status}) %>');
|
||||
$("#pages").html('<%= pagination_links_full @atta_pages, @atta_count, :per_page_links => false, :remote => @is_remote, :flag => true %>');
|
||||
$("#res_count").html(0);
|
||||
$("#checkboxAll").attr('checked',false);
|
||||
|
|
|
@ -2137,6 +2137,7 @@ zh:
|
|||
label_notice_comment_template: 您的课程通知有新回复了
|
||||
label_news_comment_template: 您的项目新闻有新回复了
|
||||
label_homework_comment_template: 您的作业有新回复了
|
||||
label_new_second_comment_template: 您有新回复了
|
||||
label_new_journals_template: 您有新留言了
|
||||
label_journals_comment_template: 您的留言有新回复了
|
||||
label_blog_comment_template: 您的博客有新回复了
|
||||
|
|
|
@ -561,6 +561,7 @@ RedmineApp::Application.routes.draw do
|
|||
match 'apply_homework', :to => 'users#apply_homework', :via => :get
|
||||
match 'user_homeworks', :to => 'users#user_homeworks', :via => :get
|
||||
match 'student_homeworks', :to => 'users#student_homeworks', :via => :get
|
||||
get 'apply_resource'
|
||||
get 'user_import_homeworks'
|
||||
get 'user_search_homeworks'
|
||||
get 'choose_user_course'
|
||||
|
@ -622,6 +623,7 @@ RedmineApp::Application.routes.draw do
|
|||
post 'import_resources_to_homework'
|
||||
get 'dealwith_apply_request'
|
||||
get 'dealwith_apply_homework'
|
||||
get 'deal_with_apply_resource'
|
||||
get 'store_selected_resource'
|
||||
get 'user_organizations'
|
||||
get 'search_user_orgs'
|
||||
|
@ -630,6 +632,7 @@ RedmineApp::Application.routes.draw do
|
|||
get 'user_ref_homework_search'
|
||||
get 'show_homework_detail'
|
||||
post 'apply_for_homework'
|
||||
post 'apply_for_resource'
|
||||
# end
|
||||
end
|
||||
#resources :blogs
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
class CreateApplyResources < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :apply_resources do |t|
|
||||
t.integer :status
|
||||
t.integer :user_id
|
||||
t.integer :attachment_id
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
|
@ -0,0 +1,6 @@
|
|||
class AddColumnToApplyResource < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :apply_resources, :container_id, :integer
|
||||
add_column :apply_resources, :container_type, :string
|
||||
end
|
||||
end
|
|
@ -0,0 +1,6 @@
|
|||
class AddColumnContentToApplyResource < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :apply_resources, :content, :text
|
||||
add_column :apply_resources, :apply_user_id, :integer
|
||||
end
|
||||
end
|
21
db/schema.rb
21
db/schema.rb
|
@ -11,12 +11,7 @@
|
|||
#
|
||||
# It's strongly recommended to check this file into your version control system.
|
||||
|
||||
<<<<<<< HEAD
|
||||
|
||||
ActiveRecord::Schema.define(:version => 20160513120002) do
|
||||
=======
|
||||
ActiveRecord::Schema.define(:version => 20160513021204) do
|
||||
>>>>>>> weixin_guange
|
||||
ActiveRecord::Schema.define(:version => 20160519070718) do
|
||||
|
||||
create_table "activities", :force => true do |t|
|
||||
t.integer "act_id", :null => false
|
||||
|
@ -455,15 +450,15 @@ ActiveRecord::Schema.define(:version => 20160513021204) do
|
|||
create_table "course_contributor_scores", :force => true do |t|
|
||||
t.integer "course_id"
|
||||
t.integer "user_id"
|
||||
t.integer "message_num"
|
||||
t.integer "message_reply_num"
|
||||
t.integer "news_reply_num"
|
||||
t.integer "resource_num"
|
||||
t.integer "journal_num"
|
||||
t.integer "journal_reply_num"
|
||||
t.integer "message_num", :default => 0
|
||||
t.integer "message_reply_num", :default => 0
|
||||
t.integer "news_reply_num", :default => 0
|
||||
t.integer "resource_num", :default => 0
|
||||
t.integer "journal_num", :default => 0
|
||||
t.integer "journal_reply_num", :default => 0
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
t.integer "total_score"
|
||||
t.integer "total_score", :default => 0
|
||||
t.integer "homework_journal_num", :default => 0
|
||||
t.integer "news_num", :default => 0
|
||||
end
|
||||
|
|
|
@ -101,6 +101,10 @@ a.hworkSearchIcon:hover {background:url(../images/nav_icon.png) -49px -1px no-re
|
|||
.mt16{margin-top: 16px;}
|
||||
.pr10{padding-right: 10px;}
|
||||
|
||||
/*20160520作品列表table*/
|
||||
.hwork-table-wrap {width:720px; border-collapse:collapse; vertical-align:middle;}
|
||||
.hwork-table-wrap th {font-size:14px; color:#2d2d2d;}
|
||||
|
||||
/*作业信息*/
|
||||
.mt-2 {margin-top:-2px;}
|
||||
.homeworkInfo {background:#F6F6F6; padding:10px; margin-bottom:10px;}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
/*新个人主页框架css*/
|
||||
.navContainer {width:100%; background-color:#269ac9;}
|
||||
.navContainer {width:100%; background-color:#3b94d6;}
|
||||
.homepageContentContainer {width:100%; margin:0 auto; background-color:#eaebed;}
|
||||
.homepageContent {width:1000px; background-color:#eaebed; margin:0 auto;}
|
||||
.navHomepage {width:1000px; height:54px; background-color:#269ac9; margin:0 auto;}
|
||||
.navHomepage {width:1000px; height:54px; background-color:#3b94d6; margin:0 auto;}
|
||||
.navHomepageLogo {width:60px; height:54px; line-height:54px; vertical-align:middle; margin-left:2px; margin-right:30px;}
|
||||
.navHomepageMenu {margin-right:20px;display:inline-block;height:54px; line-height:54px; vertical-align:middle;}
|
||||
.navHomepageMenu:hover {background-color:#297fb8;}
|
||||
|
|
|
@ -537,10 +537,10 @@ a.uploadIcon {background:url(images/resource_icon_list.png) 8px -60px no-repeat;
|
|||
|
||||
|
||||
/*新个人主页框架css*/
|
||||
.navContainer {width:100%; margin:0 auto; background-color:#269ac9;}
|
||||
.navContainer {width:100%; margin:0 auto; background-color:#3b94d6;}
|
||||
.homepageContentContainer {width:100%; margin:0 auto; background-color:#eaebed;}
|
||||
.homepageContent {width:1000px; background-color:#eaebed; margin:0 auto;}
|
||||
.navHomepage {width:1000px; height:54px; background-color:#269ac9; margin:0 auto;}
|
||||
.navHomepage {width:1000px; height:54px; background-color:#3b94d6; margin:0 auto;}
|
||||
.navHomepageLogo {width:60px; height:54px; line-height:54px; vertical-align:middle; margin-left:2px; margin-right:30px;}
|
||||
.navHomepageMenu {margin-right:20px;display:inline-block;height:54px; line-height:54px; vertical-align:middle;}
|
||||
.navHomepageMenu:hover {background-color:#297fb8;}
|
||||
|
|
|
@ -109,7 +109,7 @@ ul.wlist{ float:right; border-bottom:none; height:30px; margin-top:20px; }
|
|||
.shareDP {width:415px; height:auto; border:3px solid #269ac9; padding-left:16px; padding-bottom:16px; background-color:#ffffff; position:absolute; z-index:1000;}
|
||||
.shareArrow {background:url(../images/arrowList.png) -90px -108px no-repeat; display:inline-block; width:5px; height:10px; margin-right:3px;}
|
||||
.sectionWrap {float:left; max-height:150px; margin-bottom:10px; overflow:auto; overflow-x:hidden; width:220px; min-height:150px; padding-top:5px;}
|
||||
.columnWrap {float:left; max-height:148px; margin-bottom:10px; overflow:auto; overflow-x:hidden; width:178px; background-color:#fffff; min-height:148px; padding-top:5px; border:1px solid #f1f1f1;}
|
||||
.columnWrap {float:left; max-height:148px; margin-bottom:10px; overflow:auto; overflow-x:hidden; width:178px; background-color:#ffffff; min-height:148px; padding-top:5px; border:1px solid #f1f1f1;}
|
||||
.columnWrap li {padding-left:10px; color:#585858;}
|
||||
.columnWrap span {width:150px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; display:inline-block;}
|
||||
.sectionRow:hover {background-color:#cccccc; cursor:pointer;}
|
||||
|
|
|
@ -48,6 +48,7 @@ h4{ font-size:14px; color:#3b3b3b;}
|
|||
.fr{float:right;display:inline;}
|
||||
.f_l{ float:left;}
|
||||
.f_r{ float:right;}
|
||||
.float-none {float:none !important;}
|
||||
.clearfix:after{clear:both;content:".";display:block;font-size:0;height:0;line-height:0;visibility:hidden}
|
||||
.clearfix{clear:both;zoom:1}
|
||||
.break_word{ word-break:break-all; word-wrap: break-word;}
|
||||
|
@ -136,6 +137,8 @@ h4{ font-size:14px; color:#3b3b3b;}
|
|||
.pl10 {padding-left:10px;}
|
||||
.pl15{ padding-left:15px;}
|
||||
.pl5{ padding-left:5px;}
|
||||
.pr5 {padding-right:5px;}
|
||||
.pr10 {padding-right:10px;}
|
||||
.pt5{ padding-top:5px;}
|
||||
.pt10{ padding-top:10px;}
|
||||
.pb5{ padding-bottom: 5px;}
|
||||
|
@ -185,6 +188,7 @@ h4{ font-size:14px; color:#3b3b3b;}
|
|||
.h150{ height:150px;}
|
||||
.p10 {padding-left:10px; padding-right:10px;}
|
||||
.mw220 {max-width: 220px !important;}
|
||||
.mw280 {max-width:280px !important;;}
|
||||
.mw360 {max-width: 360px !important;}
|
||||
.mw380 {max-width: 380px !important;}
|
||||
.mw400 {max-width: 400px !important;}
|
||||
|
@ -315,6 +319,7 @@ a:hover.orange_n_btn{background:#d63502;}
|
|||
.bgreen_n_btn{background:#1abc9c; padding:2px 10px; color:#fff;}
|
||||
a.bgreen_n_btn{background:#1abc9c; padding:2px 10px; color:#fff;}
|
||||
a:hover.bgreen_n_btn{background:#08a384;}
|
||||
.green_btn_share{ background:#28be6c; padding:2px 5px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;}
|
||||
|
||||
.nolink_btn{ background:#BCBCBC; color: #fff; padding:2px 5px;}
|
||||
.more_btn{-moz-border-radius:3px; -webkit-border-radius:3px; border:1px solid #9DCEFF; color:#9DCEFF; border-radius:3px; padding:0px 3px;}
|
||||
|
@ -502,10 +507,10 @@ a.uploadIcon {background:url(../images/resource_icon_list.png) 8px -60px no-repe
|
|||
|
||||
|
||||
/*新个人主页框架css*/
|
||||
.navContainer {width:100%; margin:0 auto; background-color:#269ac9;}
|
||||
.navContainer {width:100%; margin:0 auto; background-color:#3b94d6;}
|
||||
.homepageContentContainer {width:100%; margin:0 auto; background-color:#eaebed;}
|
||||
.homepageContent {width:1000px; background-color:#eaebed; margin:0 auto;}
|
||||
.navHomepage {width:1000px; height:54px; background-color:#269ac9; margin:0 auto;}
|
||||
.navHomepage {width:1000px; height:54px; background-color:#3b94d6; margin:0 auto;}
|
||||
.navHomepageLogo {width:60px; height:54px; line-height:54px; vertical-align:middle; margin-left:2px; margin-right:30px;}
|
||||
.navHomepageMenu {margin-right:20px; display:inline-block;height:54px; line-height:54px; vertical-align:middle;}
|
||||
.navHomepageMenu:hover {background-color:#297fb8;}
|
||||
|
@ -1071,30 +1076,6 @@ a.choose-active {background-color:#269ac9; color:#ffffff;}
|
|||
.whiteSettingIcon {background:url(../images/hwork_icon.png) -5px -302px no-repeat; width:20px; height:20px;}
|
||||
.whiteSettingIcon:hover {background:url(../images/homepage_icon.png) -93px -44px no-repeat;}
|
||||
|
||||
/*20160226新资源库*/
|
||||
.resource-wrapper {width:980px; padding:10px; border:1px solid #ddd; background-color:#fff; float:left;}
|
||||
.resource-list-tab {width:980px; height:40px; background-color:#f6f6f6; border-bottom:1px solid #eaeaea; font-size:14px; color:#7a7a7a;}
|
||||
.resource-list-checkbox {width:20px; height:40px; line-height:40px; text-align:center; vertical-align:middle;}
|
||||
.resource-checkbox {margin-top:14px; width:12px; height:12px;}
|
||||
.resource-list-name {width:380px; height:40px; line-height:40px; text-align:left;}
|
||||
.resource-list-from {width:150px; height:40px; line-height:40px; text-align:center;}
|
||||
.resource-list-size {width:60px; height:40px; line-height:40px; text-align:center;}
|
||||
.resource-list-type {width:80px; height:40px; line-height:40px; text-align:center;}
|
||||
.resource-list-uploader {width:80px; height:40px; line-height:40px; text-align:center;}
|
||||
.resource-list-time {width:70px; height:40px; line-height:40px; text-align:center;}
|
||||
.resource-list-quote {width:60px; height:40px; line-height:40px; text-align:center;}
|
||||
.resource-list-download {width:60px; height:40px; line-height:40px; text-align:center;}
|
||||
.resource-list {width:980px; height:39px; background-color:#ffffff; border-bottom:1px dashed #eaeaea; color:#9a9a9a; font-size:12px; margin-left:auto; margin-right:auto; cursor:pointer;}
|
||||
.resource-list:hover {background-color:#e1e1e1;}
|
||||
.resource-list-option {width:980px; height:40px; line-height:40px; vertical-align:middle; margin-left:auto; margin-right:auto; background-color:#f6f6f6;}
|
||||
.resource-check-all {width:20px; height:40px; line-height:40px; text-align:center; vertical-align:middle; float:left;}
|
||||
.border-bottom {border-bottom:1px solid #ddd;}
|
||||
.h34 {height:34px;}
|
||||
.resource-tab {font-size:16px; color:#4d4d4d; width:70px; padding:5px 10px; display:inline-block; text-align:left; border-bottom:1px solid #ddd;}
|
||||
a.resource-tab-active {color:#fff; background-color:#269ac9; border-bottom:1px solid #269ac9;}
|
||||
.inactive-text {color:#888888 !important;}
|
||||
.inactive-border {border:1px solid #888888 !important;}
|
||||
|
||||
/*导入资源样式*/
|
||||
.popupWrap {border:3px solid #269ac9; padding:15px; background-color:#ffffff; position:relative; z-index:1000;}
|
||||
.resoure-list {width:705px;}
|
||||
|
@ -1121,11 +1102,11 @@ a.resource-tab-active {color:#fff; background-color:#269ac9; border-bottom:1px s
|
|||
.course-search {border: 1px solid #dddddd; height: 25px; width: 200px;outline: none;}
|
||||
|
||||
/*20160226新资源库*/
|
||||
.resource-wrapper {width:980px; background-color:#fff; float:left;}
|
||||
.resource-wrapper {width:980px; padding:10px; border:1px solid #ddd; background-color:#fff; float:left;}
|
||||
.resource-list-tab {width:980px; height:40px; background-color:#f6f6f6; border-bottom:1px solid #eaeaea; font-size:14px; color:#7a7a7a;}
|
||||
.resource-list-checkbox {width:20px; height:40px; line-height:40px; text-align:center; vertical-align:middle;}
|
||||
.resource-checkbox {margin-top:14px; width:12px; height:12px;}
|
||||
.resource-list-name {width:380px; height:40px; line-height:40px; text-align:left;}
|
||||
.resource-list-name {width:310px; height:40px; line-height:40px; text-align:left;}
|
||||
.resource-list-from {width:150px; height:40px; line-height:40px; text-align:center;}
|
||||
.resource-list-size {width:80px; height:40px; line-height:40px; text-align:center;}
|
||||
.resource-list-type {width:80px; height:40px; line-height:40px; text-align:center;}
|
||||
|
@ -1133,6 +1114,8 @@ a.resource-tab-active {color:#fff; background-color:#269ac9; border-bottom:1px s
|
|||
.resource-list-time {width:70px; height:40px; line-height:40px; text-align:center;}
|
||||
.resource-list-quote {width:60px; height:40px; line-height:40px; text-align:center;}
|
||||
.resource-list-download {width:60px; height:40px; line-height:40px; text-align:center;}
|
||||
.resource-list-apply {width:70px; height:40px; line-height:40px; text-align:center;}
|
||||
.resource-list-middle {line-height:40px; vertical-align:middle; display:inline-block;}
|
||||
.resource-list {width:980px; height:39px; background-color:#ffffff; border-bottom:1px dashed #eaeaea; color:#9a9a9a; font-size:12px; margin-left:auto; margin-right:auto; cursor:pointer;}
|
||||
.resource-list:hover {background-color:#e1e1e1;}
|
||||
.resource-list-option {width:980px; height:40px; line-height:40px; vertical-align:middle; margin-left:auto; margin-right:auto; background-color:#f6f6f6;}
|
||||
|
@ -1141,6 +1124,8 @@ a.resource-tab-active {color:#fff; background-color:#269ac9; border-bottom:1px s
|
|||
.h34 {height:34px;}
|
||||
.resource-tab {font-size:16px; color:#4d4d4d; width:70px; padding:5px 10px; display:inline-block; text-align:left; border-bottom:1px solid #ddd;}
|
||||
a.resource-tab-active {color:#fff; background-color:#269ac9; border-bottom:1px solid #269ac9;}
|
||||
.inactive-text {color:#888888 !important;}
|
||||
.inactive-border {border:1px solid #888888 !important;}
|
||||
|
||||
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;}
|
||||
|
@ -1152,3 +1137,6 @@ a.st_down{ display: block; width:8px; float:left; height:13px; background:url(..
|
|||
|
||||
.likeText{color: #7f7f7f}
|
||||
.likeNum{color: #7f7f7f}
|
||||
|
||||
/*弹框*/
|
||||
.apply_content{ border:1px solid #ddd;line-height: 16px; height:80px;width:420px; background:#fff; margin-bottom:10px;}
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
FactoryGirl.define do
|
||||
factory :apply_resource do
|
||||
status 1
|
||||
user_id 1
|
||||
attachment_id 1
|
||||
end
|
||||
|
||||
end
|
|
@ -0,0 +1,5 @@
|
|||
require 'rails_helper'
|
||||
|
||||
RSpec.describe ApplyResource, :type => :model do
|
||||
pending "add some examples to (or delete) #{__FILE__}"
|
||||
end
|
Loading…
Reference in New Issue