Merge branch 'develop' into hjq_new_course

This commit is contained in:
huang 2016-03-17 16:38:00 +08:00
commit 1f2cd38c3d
100 changed files with 5044 additions and 4277 deletions

View File

@ -91,8 +91,12 @@ class BlogCommentsController < ApplicationController
def edit def edit
@article = BlogComment.find(params[:id]) @article = BlogComment.find(params[:id])
respond_to do |format| if User.current.admin? || User.current.id == @article.author_id
format.html {render :layout=>'new_base_user'} respond_to do |format|
format.html { render :layout => 'new_base_user' }
end
else
render_403
end end
end end

View File

@ -902,10 +902,7 @@ class CoursesController < ApplicationController
end end
def feedback def feedback
@course.journals_for_messages.each do |messages| CourseMessage.where("user_id = ? and course_id = ?", User.current, @course.id).update_all(:viewed => true)
query = messages.course_messages.where("user_id = ?", User.current.id)
query.update_all(:viewed => true);
end
if (User.current.admin? || @course.is_public == 1 || (@course.is_public == 0 && User.current.member_of_course?(@course))) if (User.current.admin? || @course.is_public == 1 || (@course.is_public == 0 && User.current.member_of_course?(@course)))
page = params[:page] page = params[:page]

View File

@ -1,378 +1,380 @@
class HomeworkCommonController < ApplicationController class HomeworkCommonController < ApplicationController
require 'net/http' require 'net/http'
require 'json' require 'json'
require "base64" require "base64"
layout "base_courses" layout "base_courses"
include StudentWorkHelper include StudentWorkHelper
before_filter :find_course, :only => [:index,:new,:create] before_filter :find_course, :only => [:index,:new,:create]
before_filter :find_homework, :only => [:edit,:update,:alert_anonymous_comment,:start_anonymous_comment,:stop_anonymous_comment,:destroy,:start_evaluation_set,:set_evaluation_attr,:score_rule_set,:alert_forbidden_anonymous_comment,:alert_open_student_works,:open_student_works] before_filter :find_homework, :only => [:edit,:update,:alert_anonymous_comment,:start_anonymous_comment,:stop_anonymous_comment,:destroy,:start_evaluation_set,:set_evaluation_attr,:score_rule_set,:alert_forbidden_anonymous_comment,:alert_open_student_works,:open_student_works]
before_filter :teacher_of_course, :only => [:new, :create, :edit, :update, :destroy, :start_anonymous_comment, :stop_anonymous_comment, :alert_anonymous_comment,:start_evaluation_set,:set_evaluation_attr,:score_rule_set,:alert_forbidden_anonymous_comment,:alert_open_student_works,:open_student_works] before_filter :teacher_of_course, :only => [:new, :create, :edit, :update, :destroy, :start_anonymous_comment, :stop_anonymous_comment, :alert_anonymous_comment,:start_evaluation_set,:set_evaluation_attr,:score_rule_set,:alert_forbidden_anonymous_comment,:alert_open_student_works,:open_student_works]
before_filter :member_of_course, :only => [:index] before_filter :member_of_course, :only => [:index]
def index def index
@new_homework = HomeworkCommon.new @new_homework = HomeworkCommon.new
@new_homework.homework_detail_manual = HomeworkDetailManual.new @new_homework.homework_detail_manual = HomeworkDetailManual.new
@new_homework.course = @course @new_homework.course = @course
@page = params[:page] ? params[:page].to_i + 1 : 0 @page = params[:page] ? params[:page].to_i + 1 : 0
@is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,@course)) @is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,@course))
if @is_teacher if @is_teacher
@homeworks = @course.homework_commons.order("updated_at desc").limit(10).offset(@page * 10) @homeworks = @course.homework_commons.order("updated_at desc").limit(10).offset(@page * 10)
else else
@homeworks = @course.homework_commons.where("publish_time <= '#{Date.today}'").order("updated_at desc").limit(10).offset(@page * 10) @homeworks = @course.homework_commons.where("publish_time <= '#{Date.today}'").order("updated_at desc").limit(10).offset(@page * 10)
end end
@is_student = User.current.logged? && (User.current.admin? || (User.current.member_of_course?(@course) && !@is_teacher)) @is_student = User.current.logged? && (User.current.admin? || (User.current.member_of_course?(@course) && !@is_teacher))
@is_new = params[:is_new] @is_new = params[:is_new]
#设置at已读 #设置at已读
@homeworks.each do |homework| @homeworks.each do |homework|
homework.journals_for_messages.each do |j| homework.journals_for_messages.each do |j|
User.current.at_messages.unviewed('JournalsForMessage', j.id).each {|x| x.viewed!} User.current.at_messages.unviewed('JournalsForMessage', j.id).each {|x| x.viewed!}
end end
end end
respond_to do |format| respond_to do |format|
format.js format.js
format.html format.html
end end
end end
#新建作业,在个人作业列表创建作业 #新建作业,在个人作业列表创建作业
def new def new
render_404 render_404
end end
#新建作业,在个人作业列表创建作业 #新建作业,在个人作业列表创建作业
def create def create
redirect_to user_homeworks_user_path(User.current.id) redirect_to user_homeworks_user_path(User.current.id)
end end
def edit def edit
@user = User.current @user = User.current
@is_in_course = params[:is_in_course].to_i @is_in_course = params[:is_in_course].to_i
@course_activity = params[:course_activity].to_i @course_activity = params[:course_activity].to_i
respond_to do |format| respond_to do |format|
format.html{render :layout => 'new_base_user'} format.html{render :layout => 'new_base_user'}
end end
end end
def update def update
if params[:homework_common] if params[:homework_common]
@homework.name = params[:homework_common][:name] @homework.name = params[:homework_common][:name]
@homework.description = params[:homework_common][:description] @homework.description = params[:homework_common][:description]
if params[:homework_common][:publish_time] == "" if params[:homework_common][:publish_time] == ""
@homework.publish_time = Date.today @homework.publish_time = Date.today
else else
@homework.publish_time = params[:homework_common][:publish_time] @homework.publish_time = params[:homework_common][:publish_time]
end end
@homework.end_time = params[:homework_common][:end_time] || Time.now @homework.end_time = params[:homework_common][:end_time] || Time.now
@homework.course_id = params[:course_id] @homework.course_id = params[:course_id]
@homework.anonymous_comment = params[:homework_common][:anonymous_comment] ? params[:homework_common][:anonymous_comment] : 0 @homework.anonymous_comment = params[:homework_common][:anonymous_comment] ? params[:homework_common][:anonymous_comment] : 0
homework_detail_manual = @homework.homework_detail_manual || HomeworkDetailManual.new homework_detail_manual = @homework.homework_detail_manual || HomeworkDetailManual.new
if @homework.publish_time <= Date.today && homework_detail_manual.comment_status == 0 if @homework.publish_time <= Date.today && homework_detail_manual.comment_status == 0
homework_detail_manual.comment_status = 1 homework_detail_manual.comment_status = 1
end end
homework_detail_manual.evaluation_start = params[:evaluation_start].blank? ? @homework.end_time + 7 : params[:evaluation_start] eval_start = homework_detail_manual.evaluation_start
homework_detail_manual.evaluation_end = params[:evaluation_end].blank? ? homework_detail_manual.evaluation_start + 7 : params[:evaluation_end] if eval_start <= @homework.end_time && homework_detail_manual.comment_status <= 1
homework_detail_manual.evaluation_start = @homework.end_time + 7
@homework.save_attachments(params[:attachments]) homework_detail_manual.evaluation_end = homework_detail_manual.evaluation_start + 7
render_attachment_warning_if_needed(@homework) end
@homework.save_attachments(params[:attachments])
#编程作业相关属性 render_attachment_warning_if_needed(@homework)
if @homework.homework_type == 2
@homework.homework_detail_programing ||= HomeworkDetailPrograming.new #编程作业相关属性
@homework_detail_programing = @homework.homework_detail_programing if @homework.homework_type == 2
@homework_detail_programing.language = params[:language_type].to_i @homework.homework_detail_programing ||= HomeworkDetailPrograming.new
@homework_detail_programing = @homework.homework_detail_programing
@homework.homework_tests.delete_all @homework_detail_programing.language = params[:language_type].to_i
inputs = params[:program][:input]
if Array === inputs @homework.homework_tests.delete_all
inputs.each_with_index do |val, i| inputs = params[:program][:input]
@homework.homework_tests << HomeworkTest.new( if Array === inputs
input: val, inputs.each_with_index do |val, i|
output: params[:program][:output][i] @homework.homework_tests << HomeworkTest.new(
) input: val,
end output: params[:program][:output][i]
end )
end end
end
#分组作业 end
if @homework.homework_type == 3
@homework.homework_detail_group ||= HomeworkDetailGroup.new #分组作业
@homework_detail_group = @homework.homework_detail_group if @homework.homework_type == 3
@homework_detail_group.min_num = params[:min_num].to_i @homework.homework_detail_group ||= HomeworkDetailGroup.new
@homework_detail_group.max_num = params[:max_num].to_i @homework_detail_group = @homework.homework_detail_group
@homework_detail_group.base_on_project = params[:base_on_project].to_i @homework_detail_group.min_num = params[:min_num].to_i
end @homework_detail_group.max_num = params[:max_num].to_i
@homework_detail_group.base_on_project = params[:base_on_project].to_i
if @homework.save end
@homework_detail_manual.save if @homework_detail_manual
@homework_detail_programing.save if @homework_detail_programing if @homework.save
@homework_detail_group.save if @homework_detail_group @homework_detail_manual.save if @homework_detail_manual
@homework_detail_programing.save if @homework_detail_programing
if params[:is_in_course] == "1" @homework_detail_group.save if @homework_detail_group
redirect_to homework_common_index_path(:course => @course.id)
elsif params[:is_in_course] == "0" if params[:is_in_course] == "1"
redirect_to user_homeworks_user_path(User.current.id) redirect_to homework_common_index_path(:course => @course.id)
elsif params[:is_in_course] == "-1" && params[:course_activity] == "0" elsif params[:is_in_course] == "0"
redirect_to user_path(User.current.id) redirect_to user_homeworks_user_path(User.current.id)
elsif params[:is_in_course] == "-1" && params[:course_activity] == "1" elsif params[:is_in_course] == "-1" && params[:course_activity] == "0"
redirect_to course_path(@course.id) redirect_to user_path(User.current.id)
end elsif params[:is_in_course] == "-1" && params[:course_activity] == "1"
end redirect_to course_path(@course.id)
end end
end end
end
def destroy end
if @homework.destroy
respond_to do |format| def destroy
format.html { if @homework.destroy
if params[:is_in_course] == "1" respond_to do |format|
redirect_to homework_common_index_path(:course => @course.id) format.html {
elsif params[:is_in_course] == "0" if params[:is_in_course] == "1"
redirect_to user_homeworks_user_path(User.current.id) redirect_to homework_common_index_path(:course => @course.id)
elsif params[:is_in_course] == "-1" && params[:course_activity] == "0" elsif params[:is_in_course] == "0"
redirect_to user_path(User.current.id) redirect_to user_homeworks_user_path(User.current.id)
elsif params[:is_in_course] == "-1" && params[:course_activity] == "1" elsif params[:is_in_course] == "-1" && params[:course_activity] == "0"
redirect_to course_path(@course.id) redirect_to user_path(User.current.id)
end elsif params[:is_in_course] == "-1" && params[:course_activity] == "1"
} redirect_to course_path(@course.id)
end end
end }
end end
end
#开启匿评 end
#statue 1:启动成功2启动失败作业总数大于等于2份时才能启动匿评3:已开启匿评,请务重复开启,4:没有开启匿评的权限
def start_anonymous_comment #开启匿评
@statue = 4 and return unless User.current.admin? || User.current.allowed_to?(:as_teacher,@course) #statue 1:启动成功2启动失败作业总数大于等于2份时才能启动匿评3:已开启匿评,请务重复开启,4:没有开启匿评的权限
@statue = 5 and return if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d") def start_anonymous_comment
if @homework_detail_manual.comment_status == 1 @statue = 4 and return unless User.current.admin? || User.current.allowed_to?(:as_teacher,@course)
student_works = @homework.student_works @statue = 5 and return if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d")
if student_works && student_works.size >= 2 if @homework_detail_manual.comment_status == 1
if @homework.homework_type == 3 student_works = @homework.student_works
student_work_projects = @homework.student_work_projects.where("student_work_id is not null") if student_works && student_works.size >= 2
student_work_projects.each_with_index do |pro_work, pro_index| if @homework.homework_type == 3
n = @homework_detail_manual.evaluation_num student_work_projects = @homework.student_work_projects.where("student_work_id is not null")
n = n < student_works.size ? n : student_works.size - 1 student_work_projects.each_with_index do |pro_work, pro_index|
work_index = -1 n = @homework_detail_manual.evaluation_num
student_works.each_with_index do |stu_work, stu_index| n = n < student_works.size ? n : student_works.size - 1
if stu_work.id.to_i == pro_work.student_work_id.to_i work_index = -1
work_index = stu_index student_works.each_with_index do |stu_work, stu_index|
end if stu_work.id.to_i == pro_work.student_work_id.to_i
end work_index = stu_index
assigned_homeworks = get_assigned_homeworks(student_works, n, work_index) end
assigned_homeworks.each do |h| end
student_works_evaluation_distributions = StudentWorksEvaluationDistribution.new(user_id: pro_work.user_id, student_work_id: h.id) assigned_homeworks = get_assigned_homeworks(student_works, n, work_index)
student_works_evaluation_distributions.save assigned_homeworks.each do |h|
end student_works_evaluation_distributions = StudentWorksEvaluationDistribution.new(user_id: pro_work.user_id, student_work_id: h.id)
end student_works_evaluation_distributions.save
else end
student_works.each_with_index do |work, index| end
user = work.user else
n = @homework_detail_manual.evaluation_num student_works.each_with_index do |work, index|
n = n < student_works.size ? n : student_works.size - 1 user = work.user
assigned_homeworks = get_assigned_homeworks(student_works, n, index) n = @homework_detail_manual.evaluation_num
assigned_homeworks.each do |h| n = n < student_works.size ? n : student_works.size - 1
student_works_evaluation_distributions = StudentWorksEvaluationDistribution.new(user_id: user.id, student_work_id: h.id) assigned_homeworks = get_assigned_homeworks(student_works, n, index)
student_works_evaluation_distributions.save assigned_homeworks.each do |h|
end student_works_evaluation_distributions = StudentWorksEvaluationDistribution.new(user_id: user.id, student_work_id: h.id)
end student_works_evaluation_distributions.save
end end
@homework_detail_manual.update_column('comment_status', 2) end
@homework_detail_manual.update_column('evaluation_start', Date.today) end
@statue = 1 @homework_detail_manual.update_column('comment_status', 2)
# 匿评开启消息邮件通知 @homework_detail_manual.update_column('evaluation_start', Date.today)
send_message_anonymous_comment(@homework, m_status = 2) @statue = 1
Mailer.send_mail_anonymous_comment_open(@homework).deliver # 匿评开启消息邮件通知
else send_message_anonymous_comment(@homework, m_status = 2)
@statue = 2 Mailer.send_mail_anonymous_comment_open(@homework).deliver
else
end @statue = 2
else
@statue = 3 end
end else
@user_activity_id = params[:user_activity_id].to_i @statue = 3
@is_in_course = params[:is_in_course].to_i end
@course_activity = params[:course_activity].to_i @user_activity_id = params[:user_activity_id].to_i
end @is_in_course = params[:is_in_course].to_i
@course_activity = params[:course_activity].to_i
#关闭匿评 end
def stop_anonymous_comment
@homework_detail_manual.update_column('comment_status', 3) #关闭匿评
@homework_detail_manual.update_column('evaluation_end', Date.today) def stop_anonymous_comment
#计算缺评扣分 @homework_detail_manual.update_column('comment_status', 3)
work_ids = "(" + @homework.student_works.map(&:id).join(",") + ")" @homework_detail_manual.update_column('evaluation_end', Date.today)
@homework.student_works.each do |student_work| #计算缺评扣分
absence_penalty_count = student_work.user.student_works_evaluation_distributions.where("student_work_id IN #{work_ids}").count - student_work.user.student_works_scores.where("student_work_id IN #{work_ids}").count work_ids = "(" + @homework.student_works.map(&:id).join(",") + ")"
student_work.absence_penalty = absence_penalty_count > 0 ? absence_penalty_count * @homework_detail_manual.absence_penalty : 0 @homework.student_works.each do |student_work|
student_work.save absence_penalty_count = student_work.user.student_works_evaluation_distributions.where("student_work_id IN #{work_ids}").count - student_work.user.student_works_scores.where("student_work_id IN #{work_ids}").count
end student_work.absence_penalty = absence_penalty_count > 0 ? absence_penalty_count * @homework_detail_manual.absence_penalty : 0
# 匿评关闭消息邮件通知 student_work.save
send_message_anonymous_comment(@homework, m_status = 3) end
Mailer.send_mail_anonymous_comment_close(@homework).deliver # 匿评关闭消息邮件通知
@user_activity_id = params[:user_activity_id].to_i send_message_anonymous_comment(@homework, m_status = 3)
@is_in_course = params[:is_in_course].to_i Mailer.send_mail_anonymous_comment_close(@homework).deliver
@course_activity = params[:course_activity].to_i @user_activity_id = params[:user_activity_id].to_i
respond_to do |format| @is_in_course = params[:is_in_course].to_i
format.js @course_activity = params[:course_activity].to_i
end respond_to do |format|
end format.js
end
# 开启/关闭匿评消息通知 end
def send_message_anonymous_comment(homework, m_status )
# status 标记匿评状态 1为关闭 0为开启 # 开启/关闭匿评消息通知
course = homework.course def send_message_anonymous_comment(homework, m_status )
course.members.each do |m| # status 标记匿评状态 1为关闭 0为开启
@homework.course_messages << CourseMessage.new(:user_id => m.user_id, :course_id => course.id, :viewed => false, :status => m_status) course = homework.course
end course.members.each do |m|
end @homework.course_messages << CourseMessage.new(:user_id => m.user_id, :course_id => course.id, :viewed => false, :status => m_status)
#提示 end
def alert_anonymous_comment end
@cur_size = 0 #提示
@totle_size = 0 def alert_anonymous_comment
if @homework_detail_manual.comment_status == 1 @cur_size = 0
@totle_size = @course.student.count @totle_size = 0
@cur_size = @homework.student_works.size if @homework_detail_manual.comment_status == 1
elsif @homework_detail_manual.comment_status == 2 @totle_size = @course.student.count
@homework.student_works.map { |work| @totle_size += work.student_works_evaluation_distributions.count} @cur_size = @homework.student_works.size
@cur_size = 0 elsif @homework_detail_manual.comment_status == 2
@homework.student_works.map { |work| @cur_size += work.student_works_scores.where(:reviewer_role => 3).count} @homework.student_works.map { |work| @totle_size += work.student_works_evaluation_distributions.count}
end @cur_size = 0
@percent = format("%.2f",(@cur_size.to_f / ( @totle_size == 0 ? 1 : @totle_size)) * 100) @homework.student_works.map { |work| @cur_size += work.student_works_scores.where(:reviewer_role => 3).count}
@user_activity_id = params[:user_activity_id].to_i end
@is_in_course = params[:is_in_course].to_i @percent = format("%.2f",(@cur_size.to_f / ( @totle_size == 0 ? 1 : @totle_size)) * 100)
@course_activity = params[:course_activity].to_i @user_activity_id = params[:user_activity_id].to_i
respond_to do |format| @is_in_course = params[:is_in_course].to_i
format.js @course_activity = params[:course_activity].to_i
end respond_to do |format|
end format.js
end
def alert_forbidden_anonymous_comment end
if params[:user_activity_id]
@user_activity_id = params[:user_activity_id] def alert_forbidden_anonymous_comment
else if params[:user_activity_id]
@user_activity_id = -1 @user_activity_id = params[:user_activity_id]
end else
@is_in_course = params[:is_in_course] if params[:is_in_course] @user_activity_id = -1
@course_activity = params[:course_activity] if params[:course_Activity] end
respond_to do |format| @is_in_course = params[:is_in_course] if params[:is_in_course]
format.js @course_activity = params[:course_activity] if params[:course_Activity]
end respond_to do |format|
end format.js
end
def open_student_works end
if @homework.is_open == 0
@homework.update_attribute(:is_open, 1) def open_student_works
else if @homework.is_open == 0
@homework.update_attribute(:is_open, 0) @homework.update_attribute(:is_open, 1)
end else
@user_activity_id = params[:user_activity_id] @homework.update_attribute(:is_open, 0)
@is_in_course = params[:is_in_course] if params[:is_in_course] end
@course_activity = params[:course_activity] if params[:course_Activity] @user_activity_id = params[:user_activity_id]
end @is_in_course = params[:is_in_course] if params[:is_in_course]
@course_activity = params[:course_activity] if params[:course_Activity]
def alert_open_student_works end
if params[:user_activity_id]
@user_activity_id = params[:user_activity_id] def alert_open_student_works
else if params[:user_activity_id]
@user_activity_id = -1 @user_activity_id = params[:user_activity_id]
end else
@is_in_course = params[:is_in_course] if params[:is_in_course] @user_activity_id = -1
@course_activity = params[:course_activity] if params[:course_Activity] end
respond_to do |format| @is_in_course = params[:is_in_course] if params[:is_in_course]
format.js @course_activity = params[:course_activity] if params[:course_Activity]
end respond_to do |format|
end format.js
end
def programing_test end
test = {language:params[:language],src:Base64.encode64(params[:src]),input:[params[:input]],output:[params[:output]]}
@index = params[:index] def programing_test
uri = URI('http://192.168.80.21:8080/api/realtime.json') test = {language:params[:language],src:Base64.encode64(params[:src]),input:[params[:input]],output:[params[:output]]}
body = test.to_json @index = params[:index]
res = Net::HTTP.new(uri.host, uri.port).start do |client| uri = URI('http://192.168.80.21:8080/api/realtime.json')
request = Net::HTTP::Post.new(uri.path) body = test.to_json
request.body = body res = Net::HTTP.new(uri.host, uri.port).start do |client|
request["Content-Type"] = "application/json" request = Net::HTTP::Post.new(uri.path)
client.request(request) request.body = body
end request["Content-Type"] = "application/json"
result = JSON.parse(res.body) client.request(request)
@err_msg = result["compile_error_msg"] end
result["results"].each do |re| result = JSON.parse(res.body)
@result = re["status"] @err_msg = result["compile_error_msg"]
end result["results"].each do |re|
end @result = re["status"]
end
#启动匿评参数设置 end
def start_evaluation_set
if params[:user_activity_id] #启动匿评参数设置
@user_activity_id = params[:user_activity_id] def start_evaluation_set
else if params[:user_activity_id]
@user_activity_id = -1 @user_activity_id = params[:user_activity_id]
end else
@is_in_course = params[:is_in_course] @user_activity_id = -1
@course_activity = params[:course_activity].to_i end
end @is_in_course = params[:is_in_course]
@course_activity = params[:course_activity].to_i
#设置匿评参数 end
def set_evaluation_attr
if @homework_detail_manual #设置匿评参数
unless params[:evaluation_start].to_s == @homework_detail_manual.evaluation_start.to_s def set_evaluation_attr
@homework_detail_manual.evaluation_start = params[:evaluation_start] if @homework_detail_manual
end unless params[:evaluation_start].to_s == @homework_detail_manual.evaluation_start.to_s
@homework_detail_manual.evaluation_start = params[:evaluation_start]
unless @homework_detail_manual.evaluation_end.to_s == params[:evaluation_end].to_s end
@homework_detail_manual.evaluation_end = params[:evaluation_end]
end unless @homework_detail_manual.evaluation_end.to_s == params[:evaluation_end].to_s
@homework_detail_manual.evaluation_end = params[:evaluation_end]
@homework_detail_manual.evaluation_num = params[:evaluation_num] end
@homework_detail_manual.save
@user_activity_id = params[:user_activity_id].to_i @homework_detail_manual.evaluation_num = params[:evaluation_num]
@is_in_course = params[:is_in_course].to_i @homework_detail_manual.save
@course_activity = params[:course_activity].to_i @user_activity_id = params[:user_activity_id].to_i
end @is_in_course = params[:is_in_course].to_i
end @course_activity = params[:course_activity].to_i
end
#评分设置 end
def score_rule_set
if params[:user_activity_id] #评分设置
@user_activity_id = params[:user_activity_id] def score_rule_set
else if params[:user_activity_id]
@user_activity_id = -1 @user_activity_id = params[:user_activity_id]
end else
@is_in_course = params[:is_in_course] @user_activity_id = -1
@course_activity = params[:course_activity].to_i end
end @is_in_course = params[:is_in_course]
@course_activity = params[:course_activity].to_i
private end
#获取课程
def find_course private
@course = Course.find params[:course] #获取课程
rescue def find_course
render_404 @course = Course.find params[:course]
end rescue
#获取作业 render_404
def find_homework end
@homework = HomeworkCommon.find params[:id] #获取作业
@homework_detail_manual = @homework.homework_detail_manual def find_homework
@homework_detail_programing = @homework.homework_detail_programing @homework = HomeworkCommon.find params[:id]
@homework_detail_group = @homework.homework_detail_group @homework_detail_manual = @homework.homework_detail_manual
@course = @homework.course @homework_detail_programing = @homework.homework_detail_programing
rescue @homework_detail_group = @homework.homework_detail_group
render_404 @course = @homework.course
end rescue
#是不是课程的老师 render_404
def teacher_of_course end
render_403 unless User.current.allowed_to?(:as_teacher,@course) || User.current.admin? #是不是课程的老师
end def teacher_of_course
render_403 unless User.current.allowed_to?(:as_teacher,@course) || User.current.admin?
#当前用户是不是课程的成员 end
def member_of_course
render_403 unless @course.is_public==1 || User.current.member_of_course?(@course) || User.current.admin? #当前用户是不是课程的成员
end def member_of_course
render_403 unless @course.is_public==1 || User.current.member_of_course?(@course) || User.current.admin?
def get_assigned_homeworks(student_works, n, index) end
student_works += student_works
student_works[index + 1 .. index + n] def get_assigned_homeworks(student_works, n, index)
end student_works += student_works
end student_works[index + 1 .. index + n]
end
end

View File

@ -118,6 +118,9 @@ class IssuesController < ApplicationController
end end
def show def show
# 打开编辑内容
@is_edit = true unless params[:edit].nil?
# 当前用户查看指派给他的缺陷消息,则设置消息为已读 # 当前用户查看指派给他的缺陷消息,则设置消息为已读
query = ForgeMessage.where("forge_message_type =? and user_id =? and forge_message_id =?", "Issue", User.current, @issue).first query = ForgeMessage.where("forge_message_type =? and user_id =? and forge_message_id =?", "Issue", User.current, @issue).first
query.update_attribute(:viewed, true) unless query.nil? query.update_attribute(:viewed, true) unless query.nil?
@ -387,6 +390,9 @@ class IssuesController < ApplicationController
end end
def destroy def destroy
# 增加删除页面类型,如果是个人主页,则返回该主页,项目动态则返回项目动态页眉
page_classify = params[:page_classify] unless params[:page_classify].nil?
page_id = params[:page_id] unless params[:page_id].nil?
@hours = TimeEntry.sum(:hours, :conditions => ['issue_id IN (?)', @issues]).to_f @hours = TimeEntry.sum(:hours, :conditions => ['issue_id IN (?)', @issues]).to_f
if @hours > 0 if @hours > 0
case params[:todo] case params[:todo]
@ -415,7 +421,11 @@ class IssuesController < ApplicationController
end end
end end
respond_to do |format| respond_to do |format|
format.html { redirect_back_or_default _project_issues_path(@project) } if page_classify
format.html { redirect_back_or_default _project_issues_path(@project, page_classify, page_id) }
else
format.html { redirect_back_or_default _project_issues_path(@project) }
end
format.api { render_api_ok } format.api { render_api_ok }
end end
end end

View File

@ -1,6 +1,6 @@
class OrgDocumentCommentsController < ApplicationController class OrgDocumentCommentsController < ApplicationController
before_filter :find_organization, :only => [:new, :create, :show, :index] before_filter :find_organization, :only => [:new, :create, :show, :index]
helper :attachments helper :attachments,:organizations
layout 'base_org' layout 'base_org'
def new def new

View File

@ -5,9 +5,8 @@ class OrgSubfieldsController < ApplicationController
def create def create
if OrgSubfield.where("organization_id=#{params[:organization_id]} and name=?",params[:name]).count == 0 if OrgSubfield.where("organization_id=#{params[:organization_id]} and name=?",params[:name]).count == 0
@res = true @res = true
@subfield = OrgSubfield.create(:name => params[:name])
@organization = Organization.find(params[:organization_id]) @organization = Organization.find(params[:organization_id])
@organization.org_subfields << @subfield @subfield = OrgSubfield.create(:name => params[:name], :organization_id => params[:organization_id],:priority => @organization.org_subfields.order("priority").last.priority + 1)
if !params[:sub_dir].blank? if !params[:sub_dir].blank?
sql = "select subfield_subdomain_dirs.* from subfield_subdomain_dirs, org_subfields where subfield_subdomain_dirs.org_subfield_id = org_subfields.id "+ sql = "select subfield_subdomain_dirs.* from subfield_subdomain_dirs, org_subfields where subfield_subdomain_dirs.org_subfield_id = org_subfields.id "+
"and org_subfields.organization_id=#{@organization.id} and subfield_subdomain_dirs.name='#{params[:sub_dir]}'" "and org_subfields.organization_id=#{@organization.id} and subfield_subdomain_dirs.name='#{params[:sub_dir]}'"
@ -15,7 +14,7 @@ class OrgSubfieldsController < ApplicationController
SubfieldSubdomainDir.create(:org_subfield_id => @subfield.id, :name => params[:sub_dir]) SubfieldSubdomainDir.create(:org_subfield_id => @subfield.id, :name => params[:sub_dir])
end end
end end
@subfield.update_attributes(:priority => @subfield.id, :field_type => params[:field_type]) @subfield.update_attributes(:field_type => params[:field_type])
else else
@res = false @res = false
end end
@ -125,6 +124,12 @@ class OrgSubfieldsController < ApplicationController
end end
end end
def update_priority
@org_subfield = OrgSubfield.find(params[:id])
@org_subfield.update_attribute(:priority, params[:priority].to_i)
@organization = @org_subfield.organization
end
def show_attachments obj def show_attachments obj
@attachments = [] @attachments = []
obj.each do |container| obj.each do |container|

View File

@ -317,7 +317,7 @@ class OrganizationsController < ApplicationController
@organization = Organization.find(params[:id]) @organization = Organization.find(params[:id])
admins = User.where("admin=1") admins = User.where("admin=1")
admins.each do |admin| admins.each do |admin|
OrgMessage.create(:user_id => admin.id, :organization_id => @organization.id, :message_type => 'ApplySubdomain', :message_id => @organization.id, :sender_id => User.current.id, :viewed => 0, :content => params[:domain]) OrgMessage.create(:user_id => admin.id, :organization_id => @organization.id, :message_type => 'ApplySubdomain', :message_id => @organization.id, :sender_id => User.current.id, :viewed => 0, :content => params[:domain].downcase)
end end
end end

View File

@ -300,66 +300,27 @@ class ProjectsController < ApplicationController
end end
# 统计访问量 # 统计访问量
@project.update_attribute(:visits, @project.visits.to_i + 1) @project.update_attribute(:visits, @project.visits.to_i + 1)
=begin
cond = @project.project_condition(Setting.display_subprojects_issues?)
has = {
"show_issues" => true ,
"show_files" => true,
"show_documents" => true,
"show_messages" => true,
"show_news" => true,
"show_bids" => true,
"show_contests" => true,
"show_wiki_edits"=>true,
"show_journals_for_messages" => true
}
# 读取项目默认展示的动态时间天数
@days = Setting.activity_days_default.to_i
@date_to ||= Date.today + 1
# 时间跨度不能太大,不然很慢,所以删掉了-1.years
@date_from = @date_to - @days
@with_subprojects = params[:with_subprojects].nil? ? Setting.display_subprojects_issues? : (params[:with_subprojects] == '1')
=end
@author = params[:user_id].blank? ? nil : User.active.find(params[:user_id]) @author = params[:user_id].blank? ? nil : User.active.find(params[:user_id])
# 决定显示所用用户或单个用户活动
=begin
@activity = Redmine::Activity::Fetcher.new(User.current,
:project => @project,
:with_subprojects => @with_subprojects,
:author => @author)
@activity.scope_select {|t| !has["show_#{t}"].nil?}
=end
@page = params[:page] ? params[:page].to_i + 1 : 0 @page = params[:page] ? params[:page].to_i + 1 : 0
# 根据私密性,取出符合条件的所有数据 # 根据私密性,取出符合条件的所有数据
if User.current.member_of?(@project) || User.current.admin? if User.current.member_of?(@project) || User.current.admin?
case params[:type] case params[:type]
when nil when nil
@events_pages = ForgeActivity.where("project_id = ? and forge_act_type in ('Issue', 'Message','News', 'ProjectCreateInfo')",@project).order("updated_at desc").limit(10).offset(@page * 10) @events_pages = ForgeActivity.where("project_id = ? and forge_act_type in ('Issue', 'Message','News', 'ProjectCreateInfo', 'Attachment')",@project).order("updated_at desc").limit(10).offset(@page * 10)
when 'issue' when 'issue'
@events_pages = ForgeActivity.where("project_id = ? and forge_act_type = 'Issue'",@project).order("updated_at desc").limit(10).offset(@page * 10) @events_pages = ForgeActivity.where("project_id = ? and forge_act_type = 'Issue'",@project).order("updated_at desc").limit(10).offset(@page * 10)
when 'news' when 'news'
@events_pages = ForgeActivity.where("project_id = ? and forge_act_type = 'News'",@project).order("updated_at desc").limit(10).offset(@page * 10) @events_pages = ForgeActivity.where("project_id = ? and forge_act_type = 'News'",@project).order("updated_at desc").limit(10).offset(@page * 10)
when 'message' when 'message'
@events_pages = ForgeActivity.where("project_id = ? and forge_act_type = 'Message'",@project).order("updated_at desc").limit(10).offset(@page * 10) @events_pages = ForgeActivity.where("project_id = ? and forge_act_type = 'Message'",@project).order("updated_at desc").limit(10).offset(@page * 10)
when 'attachment'
@events_pages = ForgeActivity.where("project_id = ? and forge_act_type = 'Attachment'",@project).order("updated_at desc").limit(10).offset(@page * 10)
end end
#events = @activity.events(@date_from, @date_to)
else else
@events_pages = ForgeActivity.includes(:project).where("forge_activities.project_id = ? and projects.is_public @events_pages = ForgeActivity.includes(:project).where("forge_activities.project_id = ? and projects.is_public
= ? and forge_act_type != ? ",@project,1, "Document").order("created_at desc") = ? and forge_act_type != ? ",@project,1, "Document").order("created_at desc")
.page(params['page'|| 1]).per(10); .page(params['page'|| 1]).per(10);
# @events = @activity.events(@date_from, @date_to, :is_public => 1)
end end
=begin
@events_pages = Paginator.new events.count, 10, params['page']
# 总的数据中取出某一页
events = events.slice(@events_pages.offset,10)
# 按天分组
@events_by_day = events.group_by {|event| User.current.time_to_date(event.event_datetime)}
=end
boards = @project.boards.includes(:last_message => :author).all boards = @project.boards.includes(:last_message => :author).all
@topic_count = @project.boards.count @topic_count = @project.boards.count
# 根据对应的请求,返回对应的数据 # 根据对应的请求,返回对应的数据

View File

@ -388,12 +388,12 @@ class UsersController < ApplicationController
@homeworks = HomeworkCommon.where("user_id = #{@user.id} and publish_time <= '#{Date.today}'").order("#{@order} #{@b_sort}") @homeworks = HomeworkCommon.where("user_id = #{@user.id} and publish_time <= '#{Date.today}'").order("#{@order} #{@b_sort}")
end end
@type = params[:type] @type = params[:type]
@limit = 15 @limit = 25
@is_remote = true @is_remote = true
@hw_count = @homeworks.count @hw_count = @homeworks.count
@hw_pages = Paginator.new @hw_count, @limit, params['page'] || 1 @hw_pages = Paginator.new @hw_count, @limit, params['page'] || 1
@offset ||= @hw_pages.offset @offset ||= @hw_pages.offset
@homeworks = paginateHelper @homeworks,15 @homeworks = paginateHelper @homeworks,25
respond_to do |format| respond_to do |format|
format.js format.js
format.html {render :layout => 'static_base'} format.html {render :layout => 'static_base'}
@ -547,13 +547,13 @@ class UsersController < ApplicationController
end end
@type = params[:type] @type = params[:type]
@property = params[:property] @property = params[:property]
@limit = 15 @is_import = params[:is_import]
@limit = params[:is_import].to_i == 1 ? 15 : 25
@is_remote = true @is_remote = true
@hw_count = @homeworks.count @hw_count = @homeworks.count
@hw_pages = Paginator.new @hw_count, @limit, params['page'] || 1 @hw_pages = Paginator.new @hw_count, @limit, params['page'] || 1
@offset ||= @hw_pages.offset @offset ||= @hw_pages.offset
@homeworks = paginateHelper @homeworks,15 @homeworks = paginateHelper @homeworks,@limit
@is_import = params[:is_import]
respond_to do |format| respond_to do |format|
format.js format.js
end end
@ -573,6 +573,7 @@ class UsersController < ApplicationController
@r_sort = @b_sort == "desc" ? "asc" : "desc" @r_sort = @b_sort == "desc" ? "asc" : "desc"
@user = User.current @user = User.current
search = params[:name].to_s.strip.downcase search = params[:name].to_s.strip.downcase
type_ids = params[:property] ? "(" + params[:property] + ")" : "(1, 2, 3)"
if(params[:type].blank? || params[:type] == "1") #全部 if(params[:type].blank? || params[:type] == "1") #全部
visible_course = Course.where("is_public = 1 && is_delete = 0") visible_course = Course.where("is_public = 1 && is_delete = 0")
visible_course_ids = visible_course.empty? ? "(-1)" : "(" + visible_course.map{|course| course.id}.join(",") + ")" visible_course_ids = visible_course.empty? ? "(-1)" : "(" + visible_course.map{|course| course.id}.join(",") + ")"
@ -580,24 +581,40 @@ class UsersController < ApplicationController
all_user_ids = all_homeworks.map{|hw| hw.user_id} all_user_ids = all_homeworks.map{|hw| hw.user_id}
user_str_ids = search_user_by_name all_user_ids, search user_str_ids = search_user_by_name all_user_ids, search
user_ids = user_str_ids.empty? ? "(-1)" : "(" + user_str_ids.join(",") + ")" user_ids = user_str_ids.empty? ? "(-1)" : "(" + user_str_ids.join(",") + ")"
@homeworks = HomeworkCommon.where("course_id in #{visible_course_ids} and publish_time <= '#{Date.today}' and (name like '%#{search}%' or user_id in #{user_ids})").order("#{@order} #{@b_sort}") if @order == "course_name"
sql = "SELECT homework_commons.* FROM homework_commons INNER JOIN courses ON homework_commons.course_id = courses.id where homework_type in #{type_ids} and course_id in #{visible_course_ids} and publish_time <= '#{Date.today}' and (homework_commons.name like '%#{search}%' or homework_commons.user_id in #{user_ids}) order by CONVERT (courses.name USING gbk) COLLATE gbk_chinese_ci #{@b_sort}"
@homeworks = HomeworkCommon.find_by_sql(sql)
elsif @order == "user_name"
@homeworks = HomeworkCommon.where("course_id in #{visible_course_ids} and publish_time <= '#{Date.today}' and homework_type in #{type_ids} and (name like '%#{search}%' or user_id in #{user_ids})").joins(:user).order("CONVERT (lastname USING gbk) COLLATE gbk_chinese_ci #{@b_sort}, CONVERT (firstname USING gbk) COLLATE gbk_chinese_ci #{@b_sort},login #{@b_sort}")
else
@homeworks = HomeworkCommon.where("course_id in #{visible_course_ids} and publish_time <= '#{Date.today}' and homework_type in #{type_ids} and (name like '%#{search}%' or user_id in #{user_ids})").order("#{@order} #{@b_sort}")
end
elsif params[:type] == "2" #课程资源 elsif params[:type] == "2" #课程资源
@homeworks = HomeworkCommon.where("user_id = #{@user.id} and publish_time <= '#{Date.today}' and (name like '%#{search}%')").order("#{@order} #{@b_sort}") if @order == "course_name"
sql = "SELECT homework_commons.* FROM homework_commons INNER JOIN courses ON homework_commons.course_id = courses.id where homework_commons.user_id = #{@user.id} and homework_type in #{type_ids} and publish_time <= '#{Date.today}' and (homework_commons.name like '%#{search}%') order by CONVERT (courses.name USING gbk) COLLATE gbk_chinese_ci #{@b_sort}"
@homeworks = HomeworkCommon.find_by_sql(sql)
elsif @order == "user_name"
@homeworks = HomeworkCommon.where("user_id = #{@user.id} and publish_time <= '#{Date.today}' and (name like '%#{search}%') and homework_type in #{type_ids}").joins(:user).order("CONVERT (lastname USING gbk) COLLATE gbk_chinese_ci #{@b_sort}, CONVERT (firstname USING gbk) COLLATE gbk_chinese_ci #{@b_sort},login #{@b_sort}")
else
@homeworks = HomeworkCommon.where("user_id = #{@user.id} and publish_time <= '#{Date.today}' and (name like '%#{search}%') and homework_type in #{type_ids}").order("#{@order} #{@b_sort}")
end
end end
=begin
if params[:property] && params[:property] == "1" if params[:property] && params[:property] == "1"
@homeworks = @homeworks.where("homework_type = 1").reorder("#{@order} #{@b_sort}") @homeworks = @homeworks.where("homework_type = 1")
elsif params[:property] && params[:property] == "2" elsif params[:property] && params[:property] == "2"
@homeworks = @homeworks.where("homework_type = 2").reorder("#{@order} #{@b_sort}") @homeworks = @homeworks.where("homework_type = 2")
elsif params[:property] && params[:property] == "3" elsif params[:property] && params[:property] == "3"
@homeworks = @homeworks.where("homework_type = 3").reorder("#{@order} #{@b_sort}") @homeworks = @homeworks.where("homework_type = 3")
end end
=end
@type = params[:type] @type = params[:type]
@limit = 15 @limit = params[:is_import].to_i == 1 ? 15 : 25
@is_remote = true @is_remote = true
@hw_count = @homeworks.count @hw_count = @homeworks.count
@hw_pages = Paginator.new @hw_count, @limit, params['page'] || 1 @hw_pages = Paginator.new @hw_count, @limit, params['page'] || 1
@offset ||= @hw_pages.offset @offset ||= @hw_pages.offset
@homeworks = paginateHelper @homeworks,15 @homeworks = paginateHelper @homeworks,@limit
@is_import = params[:is_import] @is_import = params[:is_import]
@property = params[:property] @property = params[:property]
@search = search @search = search

View File

@ -1044,9 +1044,9 @@ module ApplicationHelper
elsif @organization elsif @organization
title << @organization.name title << @organization.name
elsif @user elsif @user
title << @user.login title << @user.try(:realname)
else else
title << User.current.login title << User.current.try(:realname)
end end
if first_page.nil? || first_page.web_title.nil? if first_page.nil? || first_page.web_title.nil?
title << Setting.app_title unless Setting.app_title == title.last title << Setting.app_title unless Setting.app_title == title.last
@ -2069,7 +2069,7 @@ module ApplicationHelper
candown = User.current.member_of?(project) || (project.is_public && attachment_history.is_public == 1) candown = User.current.member_of?(project) || (project.is_public && attachment_history.is_public == 1)
elsif attachment_history.container_type == "OrgSubfield" elsif attachment_history.container_type == "OrgSubfield"
org = OrgSubfield.find(attachment_history.container_id) org = OrgSubfield.find(attachment_history.container_id)
candown = User.current.member_of_org?(org) || (org.organization.is_public && attachment_history.is_public == 1) candown = User.current.member_of_org?(org) || (org.organization.is_public && attachment_history.is_public == 1 && (User.current.logged? || org.organization.allow_guest_download?))
end end
end end
@ -2943,41 +2943,86 @@ int main(int argc, char** argv){
end end
def user_url_in_org(user_id) def user_url_in_org(user_id)
if Rails.env.development? Setting.protocol + "://" + Setting.host_name + "/users/" + user_id.to_s
return "http://localhost:3000/users/" + user_id.to_s end
elsif Rails.env.test?
return "https://www.test.forge.trustie.net/users/" + user_id.to_s def project_issues_url_in_org(project_id)
else Setting.protocol + "://" + Setting.host_name + "/projects/" + project_id.to_s + "/issues"
return "https://www.trustie.net/users/" + user_id.to_s end
end
def issue_url_in_org(id)
Setting.protocol + "://" + Setting.host_name + "/issues/" + id.to_s
end
def project_boards_url_in_org(id)
Setting.protocol + "://" + Setting.host_name + "/projects/" + id.to_s + "/boards"
end
def board_message_url_in_org(board_id, message_id)
Setting.protocol + "://" + Setting.host_name + "/boards/" + board_id.to_s + "/topics/" + message_id.to_s
end
def project_url_in_org(id)
Setting.protocol + "://" + Setting.host_name + "/projects/" + id.to_s
end
def homework_common_index_url_in_org(course_id)
Setting.protocol + "://" + Setting.host_name + "/homework_common?course=" + course_id.to_s
end
def student_work_index_url_in_org(homework_id)
Setting.protocol + "://" + Setting.host_name + "/student_work?homework=" + homework_id.to_s
end
def course_url_in_org(course_id)
Setting.protocol + "://" + Setting.host_name + "/courses/" + course_id.to_s
end
def user_watchlist_url_in_org(id)
Setting.protocol + "://" + Setting.host_name + "/users/" + id.to_s + "/user_watchlist"
end
def user_fanslist_url_in_org(id)
Setting.protocol + "://" + Setting.host_name + "/users/" + id.to_s + "/user_fanslist"
end
def user_blogs_url_in_org(user_id)
Setting.protocol + "://" + Setting.host_name + "/users/" + user_id.to_s + "/blogs"
end
def feedback_url_in_org(user_id)
Setting.protocol + "://" + Setting.host_name + "/users/" + user_id.to_s + "/user_newfeedback"
end
def user_activities_url_in_org(user_id)
Setting.protocol + "://" + Setting.host_name + "/users/" + user_id.to_s + "/user_activities"
end
def course_news_index_url_in_org(course_id)
Setting.protocol + "://" + Setting.host_name + "/courses/" + course_id.to_s + "/news"
end
def news_url_in_org(news_id)
Setting.protocol + "://" + Setting.host_name + "/news/" + news_id.to_s
end
def course_boards_url_in_org(course_id)
Setting.protocol + "://" + Setting.host_name + "/courses/" + course_id.to_s + "/boards"
end end
def logout_url_without_domain def logout_url_without_domain
if Rails.env.development? Setting.protocol + "://" + Setting.host_name + "/logout"
return "http://localhost:3000/logout"
elsif Rails.env.test?
return "https://test.forge.trustie.net/logout"
else
return "https://www.trustie.net/logout"
end
end end
def signin_url_without_domain def signin_url_without_domain
if Rails.env.development? Setting.protocol + "://" + Setting.host_name + "/login?login=true"
return "http://localhost:3000/login?login=true"
elsif Rails.env.test?
return "https://test.forge.trustie.net/login?login=true"
else
return "https://www.trustie.net/login?login=true"
end
end end
def register_url_without_domain def register_url_without_domain
if Rails.env.development? Setting.protocol + "://" + Setting.host_name + "/login?login=false"
return "http://localhost:3000/login?login=false"
elsif Rails.env.test?
return "https://test.forge.trustie.net/login?login=false"
else
return "https://www.trustie.net/login?login=false"
end
end end
#判断是否为默认的组织栏目
def is_default_field? field
(field.name == 'activity' || field.name == 'course' || field.name == 'project') && field.field_type == 'default'
end

View File

@ -22,10 +22,18 @@ module RoutesHelper
# Returns the path to project issues or to the cross-project # Returns the path to project issues or to the cross-project
# issue list if project is nil # issue list if project is nil
def _project_issues_path(project, *args) def _project_issues_path(project, *args)
if project if args[0].to_s.include? '_page'
project_issues_path(project, *args) if args[0].to_s == "user_page"
user_activities_path(args[1].to_i)
else
project_path(project)
end
else else
issues_path(*args) if project
project_issues_path(project, *args)
else
issues_path(*args)
end
end end
end end

View File

@ -5,7 +5,7 @@ class CourseActivity < ActiveRecord::Base
belongs_to :course belongs_to :course
belongs_to :user belongs_to :user
has_many :user_acts, :class_name => 'UserAcivity',:as =>:act has_many :user_acts, :class_name => 'UserAcivity',:as =>:act
after_save :add_user_activity, :add_course_activity after_save :add_user_activity, :add_org_activity
after_create :add_course_lead after_create :add_course_lead
before_destroy :destroy_user_activity, :destroy_org_activity before_destroy :destroy_user_activity, :destroy_org_activity
@ -31,14 +31,16 @@ class CourseActivity < ActiveRecord::Base
end end
end end
def add_course_activity def add_org_activity
org_activity = OrgActivity.where("org_act_type = '#{self.course_act_type.to_s}' and org_act_id = '#{self.course_act_id}'").first org_activity = OrgActivity.where("org_act_type = '#{self.course_act_type.to_s}' and org_act_id = '#{self.course_act_id}'").first
if org_activity if org_activity
org_activity.updated_at = self.updated_at
org_activity.save org_activity.save
else else
if self.course_act_type == 'Message' && !self.course_act.parent_id.nil? if self.course_act_type == 'Message' && !self.course_act.parent_id.nil?
org_activity = OrgActivity.where("org_act_type = 'Message' and org_act_id = #{self.course_act.parent.id}").first org_activity = OrgActivity.where("org_act_type = 'Message' and org_act_id = #{self.course_act.parent.id}").first
org_activity.created_at = self.created_at org_activity.created_at = self.created_at
org_activity.updated_at = self.updated_at
org_activity.save org_activity.save
else else
OrgActivity.create(:user_id => self.user_id, OrgActivity.create(:user_id => self.user_id,
@ -66,12 +68,13 @@ class CourseActivity < ActiveRecord::Base
# 导语要放置在课程创建信息之后 # 导语要放置在课程创建信息之后
# 导语 # 导语
def add_course_lead def add_course_lead
if self.course_act_type == "Course" if self.course_act_type == "Course" and Message.where("id=12440").any?
lead_message = Message.find(12440) lead_message = Message.find(12440)
name = lead_message.subject name = lead_message.subject
content = lead_message.content content = lead_message.content
# message的status状态为0为正常为1表示创建课程时发送的message # message的status状态为0为正常为1表示创建课程时发送的message
message = Message.create(:subject => name, :content => content, :board_id => self.course.boards.first.id, :author_id => self.course.tea_id , :sticky => true, :status => true ) # author_id 默认为课程使者创建
message = Message.create(:subject => name, :content => content, :board_id => self.course.boards.first.id, :author_id => 1 , :sticky => true, :status => true )
# 更新的目的是为了排序,因为该条动态的时间可能与课程创建的动态创建时间一直 # 更新的目的是为了排序,因为该条动态的时间可能与课程创建的动态创建时间一直
message.course_acts.first.update_attribute(:updated_at, message.course_acts.first.updated_at + 1) if message.course_acts.first message.course_acts.first.update_attribute(:updated_at, message.course_acts.first.updated_at + 1) if message.course_acts.first
end end

View File

@ -48,7 +48,7 @@ class ForgeActivity < ActiveRecord::Base
def add_org_activity def add_org_activity
org_activity = OrgActivity.where("org_act_type = '#{self.forge_act_type.to_s}' and org_act_id = #{self.forge_act_id}").first org_activity = OrgActivity.where("org_act_type = '#{self.forge_act_type.to_s}' and org_act_id = #{self.forge_act_id}").first
if org_activity if org_activity
org_activity.created_at = self.created_at org_activity.updated_at = self.updated_at
org_activity.save org_activity.save
else else
if self.forge_act_type == 'Message' && !self.forge_act.parent_id.nil? if self.forge_act_type == 'Message' && !self.forge_act.parent_id.nil?

View File

@ -9,6 +9,7 @@ class OrgSubfield < ActiveRecord::Base
has_many :news, :dependent => :destroy has_many :news, :dependent => :destroy
acts_as_attachable acts_as_attachable
after_create :create_board_sync after_create :create_board_sync
after_destroy :update_priority
# 创建资源栏目讨论区 # 创建资源栏目讨论区
def create_board_sync def create_board_sync
@board = self.boards.build @board = self.boards.build
@ -25,4 +26,11 @@ class OrgSubfield < ActiveRecord::Base
def project def project
end end
def update_priority
OrgSubfield.where("organization_id=? and priority>?", self.organization_id, self.priority).each do |field|
field.decrement(:priority)
field.save
end
end
end end

View File

@ -16,8 +16,8 @@ class Organization < ActiveRecord::Base
end end
def add_default_subfields def add_default_subfields
OrgSubfield.create(:organization_id => self.id, :name => 'activity', :field_type => 'default') OrgSubfield.create(:organization_id => self.id, :name => 'activity', :field_type => 'default', :priority => 1)
OrgSubfield.create(:organization_id => self.id, :name => 'course', :field_type => 'default') OrgSubfield.create(:organization_id => self.id, :name => 'course', :field_type => 'default', :priority => 2)
OrgSubfield.create(:organization_id => self.id, :name => 'project', :field_type => 'default') OrgSubfield.create(:organization_id => self.id, :name => 'project', :field_type => 'default', :priority => 3)
end end
end end

View File

@ -116,7 +116,7 @@ class User < Principal
has_one :preference, :dependent => :destroy, :class_name => 'UserPreference' has_one :preference, :dependent => :destroy, :class_name => 'UserPreference'
has_one :rss_token, :class_name => 'Token', :conditions => "action='feeds'" has_one :rss_token, :class_name => 'Token', :conditions => "action='feeds'"
has_one :blog, :class_name => 'Blog', :foreign_key => "author_id" has_one :blog, :class_name => 'Blog', :foreign_key => "author_id"
has_many :org_document_comments, :dependent =>:destroy has_many :org_document_comments, :dependent =>:destroy, :foreign_key => "creator_id"
has_one :api_token, :class_name => 'Token', :conditions => "action='api'" has_one :api_token, :class_name => 'Token', :conditions => "action='api'"
belongs_to :auth_source belongs_to :auth_source
has_many :org_members has_many :org_members
@ -822,6 +822,9 @@ class User < Principal
end end
def member_of_org?(org) def member_of_org?(org)
if !self.logged?
return false
end
OrgMember.where("user_id =? and organization_id =?", self.id, org.id).count > 0 OrgMember.where("user_id =? and organization_id =?", self.id, org.id).count > 0
end end
@ -1064,6 +1067,16 @@ class User < Principal
anonymous_user anonymous_user
end end
# refactor User model find function,
# return anonymous user when can not find user id = user_id
def self.find (*args, &block)
begin
super
rescue
self.anonymous
end
# super
end
# Salts all existing unsalted passwords # Salts all existing unsalted passwords
# It changes password storage scheme from SHA1(password) to SHA1(salt + SHA1(password)) # It changes password storage scheme from SHA1(password) to SHA1(salt + SHA1(password))
# This method is used in the SaltPasswords migration and is to be kept as is # This method is used in the SaltPasswords migration and is to be kept as is

View File

@ -1,6 +1,5 @@
<% if User.current.logged? && User.current.id == @user.id %>
<%= form_for @article, :url =>{:controller=>'blog_comments',:action => 'update',:user_id=>@user.id , :blog_id => @article.id, :is_homepage => params[:is_homepage],:in_act => params[:in_act]},:method=>'PUT', <%= form_for @article, :url =>{:controller=>'blog_comments',:action => 'update',:user_id=>@user.id , :blog_id => @article.id, :is_homepage => params[:is_homepage],:in_act => params[:in_act]},:method=>'PUT',
:html => {:nhname=>'form',:multipart => true, :id => 'message-form'} do |f| %> :html => {:nhname=>'form',:multipart => true, :id => 'message-form'} do |f| %>
<%= render :partial => 'blog_comments/edit', :locals => {:f => f, :article => @article, :edit_mode => true, :user => @user} %> <%= render :partial => 'blog_comments/edit', :locals => {:f => f, :article => @article, :edit_mode => true, :user => @user} %>
<% end %> <% end %>
<% end %>

View File

@ -38,7 +38,7 @@
<%= link_to image_tag(url_to_avatar(@article.author),:width=>50,:height => 50,:alt=>'图像' ),user_path(@article.author) %> <%= link_to image_tag(url_to_avatar(@article.author),:width=>50,:height => 50,:alt=>'图像' ),user_path(@article.author) %>
</div> </div>
<div class="postThemeWrap"> <div class="postThemeWrap">
<% if @article.author.id == User.current.id%> <% if @article.author.id == User.current.id || User.current.admin? %>
<div class="homepagePostSetting" id="message_setting_<%= @article.id%>" style="display: none"> <div class="homepagePostSetting" id="message_setting_<%= @article.id%>" style="display: none">
<ul> <ul>
<li class="homepagePostSettingIcon"> <li class="homepagePostSettingIcon">
@ -48,7 +48,7 @@
l(:button_edit), l(:button_edit),
{:action => 'edit', :id => @article.id,:in_act => params[:in_act]}, {:action => 'edit', :id => @article.id,:in_act => params[:in_act]},
:class => 'postOptionLink' :class => 'postOptionLink'
) if User.current && User.current.id == @article.author.id %> ) if User.current.admin? || User.current.id == @article.author.id %>
</li> </li>
<li> <li>
<%= link_to( <%= link_to(
@ -57,7 +57,7 @@
:method => :delete, :method => :delete,
:data => {:confirm => l(:text_are_you_sure)}, :data => {:confirm => l(:text_are_you_sure)},
:class => 'postOptionLink' :class => 'postOptionLink'
) if User.current && User.current.id == @article.author.id %> ) if User.current.admin? || User.current.id == @article.author.id %>
</li> </li>
<li> <li>
<% if @article.id == @article.blog.homepage_id %> <% if @article.id == @article.blog.homepage_id %>

View File

@ -4,7 +4,7 @@
<%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id,:host=>Setting.host_user), :alt => "用户头像" %> <%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id,:host=>Setting.host_user), :alt => "用户头像" %>
</div> </div>
<div class="homepagePostDes"> <div class="homepagePostDes">
<% if activity.author.id == User.current.id%> <% if activity.author.id == User.current.id || User.current.admin? %>
<div class="homepagePostSetting" id="message_setting_<%= activity.id%>" style="display: none"> <div class="homepagePostSetting" id="message_setting_<%= activity.id%>" style="display: none">
<ul> <ul>
<li class="homepagePostSettingIcon"> <li class="homepagePostSettingIcon">
@ -14,7 +14,7 @@
l(:button_edit), l(:button_edit),
{:controller => 'blog_comments',:action => 'edit',:user_id=>activity.author_id,:blog_id=>activity.blog_id, :id => activity.id}, {:controller => 'blog_comments',:action => 'edit',:user_id=>activity.author_id,:blog_id=>activity.blog_id, :id => activity.id},
:class => 'postOptionLink' :class => 'postOptionLink'
) if User.current && User.current.id == activity.author.id %> ) if User.current.admin? || User.current.id == activity.author.id %>
</li> </li>
<li> <li>
<%= link_to( <%= link_to(
@ -23,7 +23,7 @@
:method => :delete, :method => :delete,
:data => {:confirm => l(:text_are_you_sure)}, :data => {:confirm => l(:text_are_you_sure)},
:class => 'postOptionLink' :class => 'postOptionLink'
) if User.current && User.current.id == activity.author.id %> ) if User.current.admin? || User.current.id == activity.author.id %>
</li> </li>
<li> <li>
<% if activity.id == activity.blog.homepage_id %> <% if activity.id == activity.blog.homepage_id %>

View File

@ -43,6 +43,8 @@
<%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>user_activity_id, :content=>activity.content} %> <%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>user_activity_id, :content=>activity.content} %>
<div class="cl"></div> <div class="cl"></div>
<div id="intro_content_show_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
<div id="intro_content_hide_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>

View File

@ -1,7 +1,123 @@
<%= content_for(:header_tags) do %> <%= content_for(:header_tags) do %>
<%= import_ke(enable_at: true, prettify: false) %> <%= import_ke(enable_at: true, prettify: false, init_activity: false) %>
<% end %> <% end %>
<script type="text/javascript">
function nh_check_field(params){
var result=true;
if(!regexTopicSubject()) {
result=false;
return result;
}
if(params.content!=undefined){
if(params.content.isEmpty()){
result=false;
}
if(params.content.html()!=params.textarea.html() || params.issubmit==true){
params.textarea.html(params.content.html());
params.content.sync();
if(params.content.isEmpty())
{
params.contentmsg.text("描述不能为空");
params.contentmsg.css('color','#ff0000');
}
else if(params.content.html().length >=20000){
params.contentmsg.text("描述最多20000个汉字(或40000个英文字符)");
params.contentmsg.css('color','#ff0000');
result=false;
}
else
{
params.contentmsg.text("填写正确");
params.contentmsg.css('color','#008000');
}
}
}
return result;
}
function init_homework_form(params){
params.form.submit(function(){
params.textarea.html(params.editor.html());
params.editor.sync();
var flag = false;
if(params.form.attr('data-remote') != undefined ){
flag = true
}
var is_checked = false;
is_checked = nh_check_field({
issubmit:true,
content:params.editor,
contentmsg:params.contentmsg,
textarea:params.textarea
});
if(is_checked){
if(flag){
return true;
}else{
$(this)[0].submit();
return false;
}
}
return false;
});
}
function init_homework_editor(params){
params.textarea.removeAttr('placeholder');
var editor = params.kindutil.create(params.textarea, {
resizeType : 1,minWidth:"1px",width:"100%",minHeight:"30px",height:"30px",
items : ['code','emoticons','fontname',
'forecolor', 'hilitecolor', 'bold', '|', 'justifyleft', 'justifycenter', 'insertorderedlist','insertunorderedlist', '|',
'formatblock', 'fontsize', '|','indent', 'outdent',
'|','imagedirectupload','table', 'media', 'preview',"more"
],
afterChange:function(){//按键事件
var edit = this.edit;
var body = edit.doc.body;
//paramsHeight = params.kindutil.removeUnit(this.height);
edit.iframe.height(150);
this.resize(null, Math.max((params.kindutil.IE ? body.scrollHeight : body.offsetHeight) + 33, 150));
},
afterCreate:function(){
//init
var edit = this.edit;
var body = edit.doc.body;
edit.iframe[0].scroll = 'no';
body.style.overflowY = 'hidden';
//reset height
var edit = this.edit;
var body = edit.doc.body;
edit.html(params.textarea.innerHTML);
//paramsHeight = params.kindutil.removeUnit(this.height);
edit.iframe.height(150);
this.resize(null, Math.max((params.kindutil.IE ? body.scrollHeight : body.offsetHeight) , 150));
elocalStorage(message_content_editor,'topic_course_<%=course.id %>');
}
}).loadPlugin('paste');
return editor;
}
KindEditor.ready(function(K){
$("div[nhname='topic_form']").each(function(){
var params = {};
params.kindutil = K;
params.div_form = $(this);
params.form = $("form",params.div_form);
if(params.form==undefined || params.form.length==0){
return;
}
params.textarea = $("textarea[nhname='topic_textarea']",params.div_form);
params.contentmsg = $("#message_content_span");
params.submit_btn = $("#new_message_submit_btn");
if(params.textarea.data('init') == undefined) {
params.editor = init_homework_editor(params);
message_content_editor = params.editor;
init_homework_form(params);
params.submit_btn.click(function () {
params.form.submit();
});
params.textarea.data('init', 1);
}
});
});
</script>
<%= error_messages_for 'message' %> <%= error_messages_for 'message' %>
<div class="resources mt10"> <div class="resources mt10">
<div id="new_course_topic"> <div id="new_course_topic">
@ -25,7 +141,7 @@
<%= text_area :quote,:quote,:style => 'display:none' %> <%= text_area :quote,:quote,:style => 'display:none' %>
<%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %> <%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %>
<%= f.kindeditor :content, :editor_id => 'message_content_editor', <%#= f.kindeditor :content, :editor_id => 'message_content_editor',
:owner_id => topic.nil? ? 0: topic.id, :owner_id => topic.nil? ? 0: topic.id,
:owner_type => OwnerTypeHelper::MESSAGE, :owner_type => OwnerTypeHelper::MESSAGE,
:width => '100%', :width => '100%',
@ -37,8 +153,11 @@
:maxlength => 5000 }, :maxlength => 5000 },
at_id: topic.id, at_type: topic.class.to_s at_id: topic.id, at_type: topic.class.to_s
%> %>
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='topic_textarea' name="message[content]"><%=topic.content %></textarea>
<div class="cl"></div> <div class="cl"></div>
<p id="message_content_span"></p> <p id="message_content_span"></p>
<p id="e_tip" class="c_grey"></p>
<p id="e_tips" class="c_grey"></p>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<div class="mt10"> <div class="mt10">
@ -49,11 +168,11 @@
<div class="cl"></div> <div class="cl"></div>
<div class="mt5"> <div class="mt5">
<%if !edit_mode %> <%if !edit_mode %>
<a href="javascript:void(0);" class="BlueCirBtnMini fr" onclick="submit_topic();">确定</a> <a href="javascript:void(0);" class="BlueCirBtnMini fr" id="new_message_submit_btn">确定</a>
<span class="fr mr10 mt3">或</span> <span class="fr mr10 mt3">或</span>
<a href="javascript:void(0);" class="fr mr10 mt3" onclick="reset_topic();">取消</a> <a href="javascript:void(0);" class="fr mr10 mt3" onclick="reset_topic();">取消</a>
<% else %> <% else %>
<a href="javascript:void(0);" class="BlueCirBtnMini fr" onclick="submit_topic();">确定</a> <a href="javascript:void(0);" class="BlueCirBtnMini fr" id="new_message_submit_btn" onclick="submit_topic();">确定</a>
<span class="fr mr10 mt3">或</span> <span class="fr mr10 mt3">或</span>
<%= link_to "取消",board_message_url(topic.board, topic.root, :r => (topic.parent_id && topic.id)), :class => "fr mr10 mt3"%> <%= link_to "取消",board_message_url(topic.board, topic.root, :r => (topic.parent_id && topic.id)), :class => "fr mr10 mt3"%>
<% end %> <% end %>

View File

@ -25,11 +25,13 @@
课程问答区 课程问答区
</div> </div>
</div> </div>
<div nhname="topic_form">
<% if User.current.logged? %> <% if User.current.logged? %>
<%= labelled_form_for @message, :url =>{:controller=>'messages',:action => 'new', :board_id => @board.id, :is_board => 'true'}, <%= labelled_form_for @message, :url =>{:controller=>'messages',:action => 'new', :board_id => @board.id, :is_board => 'true'},
:html => {:nhname=>'form',:multipart => true, :id => 'message-form'} do |f| %> :html => {:nhname=>'form',:multipart => true, :id => 'message-form'} do |f| %>
<%= render :partial => 'course_new', :locals => {:f => f, :topic => @message, :edit_mode => false, :course => @board.course} %> <%= render :partial => 'course_new', :locals => {:f => f, :topic => @message, :edit_mode => false, :course => @board.course} %>
<% end %> <% end %>
<% end %> <% end %>
</div>
<%= render :partial=> 'course_show_detail',:locals =>{:topics => @topics, :page => 0} %> <%= render :partial=> 'course_show_detail',:locals =>{:topics => @topics, :page => 0} %>
</div> </div>

View File

@ -9,10 +9,10 @@
} }
<% else %> <% else %>
<% if @course.is_public? %> <% if @course.is_public? %>
$("#set_course_public_<%= @course.id %>").text("设为私有");
$("#show_course_<%= @course.id %>").attr("title","公开课程:<%= @course.name %><%= @course.time.to_s+ @course.term %>"); $("#show_course_<%= @course.id %>").attr("title","公开课程:<%= @course.name %><%= @course.time.to_s+ @course.term %>");
<% else %> <% else %>
$("#set_course_public_<%= @course.id %>").text("设为公开");
$("#show_course_<%= @course.id %>").attr("title","私有课程:<%= @course.name %><%= @course.time.to_s+ @course.term %>"); $("#show_course_<%= @course.id %>").attr("title","私有课程:<%= @course.name %><%= @course.time.to_s+ @course.term %>");
<% end %> <% end %>
$("#set_course_public_<%= @course.id %>").replaceWith('<%= escape_javascript(link_to @course.is_public == 0 ? "设为公开" : "设为私有", {:controller => "courses", :action => "private_or_public", :id => @course,:user_page => true},
:id => "set_course_public_#{@course.id.to_s}",:remote=>true,:confirm=>"您确定要设置为"+(@course.is_public == 0 ? "公开" : "私有")+"吗") %>');
<% end %> <% end %>

View File

@ -11,7 +11,7 @@
<div class="homepagePostTitle break_word mt-4"> <div class="homepagePostTitle break_word mt-4">
<%# 如果有历史版本则提供历史版本下载 %> <%# 如果有历史版本则提供历史版本下载 %>
<% if file.attachment_histories.count == 0 %> <% if file.attachment_histories.count == 0 %>
<%= link_to truncate(file.filename,length: 35, omission: '...'), <%= link_to file.is_public? ? truncate(file.filename, length: 45) : truncate(file.filename,length: 35, omission: '...'),
download_named_attachment_path(file.id, file.filename), download_named_attachment_path(file.id, file.filename),
:title => file.filename+"\n"+file.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;",:class => "linkGrey3 f_14" %> :title => file.filename+"\n"+file.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;",:class => "linkGrey3 f_14" %>
<% else %> <% else %>

View File

@ -41,9 +41,10 @@
<%= text_field_tag 'name', params[:name], name: "name", :class => 'researchBox fl',:style=>"padding: 0px"%> <%= text_field_tag 'name', params[:name], name: "name", :class => 'researchBox fl',:style=>"padding: 0px"%>
<%= submit_tag "栏目内搜索", :class => "blueBtn mr5 fl",:style => 'width:72px;',:name => "inorg_subfield",:id => "inorg_subfield", :onmouseover => "presscss('inorg_subfield')",:onmouseout =>"buttoncss()" %> <%= submit_tag "栏目内搜索", :class => "blueBtn mr5 fl",:style => 'width:72px;',:name => "inorg_subfield",:id => "inorg_subfield", :onmouseover => "presscss('inorg_subfield')",:onmouseout =>"buttoncss()" %>
<%#= submit_tag "全站搜索", :class => "blueBtn mr5 fl",:name => "insite",:id => "insite",:onmouseover => "presscss('insite')",:onmouseout =>"buttoncss()" %> <%#= submit_tag "全站搜索", :class => "blueBtn mr5 fl",:name => "insite",:id => "insite",:onmouseover => "presscss('insite')",:onmouseout =>"buttoncss()" %>
<input class="blueBtn fr mr5" value="上传资源" onclick="org_upload_files(<%= org_subfield.id %>);"> <% if User.current.member_of_org?(org_subfield.organization) %>
<%= link_to("导入资源", import_resources_user_path(User.current, :type => 6, :subfield_file_id => @org_subfield.id), :class => "blue-btn fr mr5", :remote => true) %> <input class="blueBtn fr mr5" value="上传资源" onclick="org_upload_files(<%= org_subfield.id %>);">
<%#= link_to "上传资源",subfield_upload_file_org_subfield_files_path(@org_subfield.id, :in_org => 1),:method => "post",:class=>"blueBtn fr mr5",:remote => true %> <%= link_to("导入资源", import_resources_user_path(User.current, :type => 6, :subfield_file_id => @org_subfield.id), :class => "blue-btn fr mr5", :remote => true) %>
<% end %>
<% end %> <% end %>
</div><!---re_top end--> </div><!---re_top end-->
<div class="cl"></div> <div class="cl"></div>

View File

@ -9,6 +9,9 @@
$(function(){ $(function(){
$("#RSide").removeAttr("id"); $("#RSide").removeAttr("id");
$("#Container").css("width","1000px"); $("#Container").css("width","1000px");
if(<%= @is_edit %>) {
issueEditShow();
}
}); });
</script> </script>
<div class="homepageRight mt0 ml10" > <div class="homepageRight mt0 ml10" >

View File

@ -1,7 +1,7 @@
<% courses.each do |course|%> <% courses.each do |course|%>
<%# pro = Project.find course.course_id %> <%# pro = Project.find course.course_id %>
<li class="homepageLeftMenuCoursesLine" style="position:relative;"> <li class="homepageLeftMenuCoursesLine" style="position:relative;">
<%= link_to course.name, course_path(course.id,:host=>Setting.host_name), :class => "coursesLineGrey hidden", :title => course.name%> <%= link_to course.name, course_url_in_org(course.id), :class => "coursesLineGrey hidden", :title => course.name%>
<!--<div class="homepagePostSetting mt5 mr10">--> <!--<div class="homepagePostSetting mt5 mr10">-->
<!--<ul>--> <!--<ul>-->
<!--<li class="menuSetting">--> <!--<li class="menuSetting">-->

View File

@ -1,7 +1,7 @@
<% projects.each do |project|%> <% projects.each do |project|%>
<%# pro = Project.find project.project_id %> <%# pro = Project.find project.project_id %>
<li class="homepageLeftMenuCoursesLine" style="position:relative;"> <li class="homepageLeftMenuCoursesLine" style="position:relative;">
<%= link_to project.name, project_path(project.id,:host=>Setting.host_name), :class => "coursesLineGrey hidden", :title => project.name%> <%= link_to project.name, project_url_in_org(project.id), :class => "coursesLineGrey hidden", :title => project.name%>
<!--<div class="homepagePostSetting mt5 mr10">--> <!--<div class="homepagePostSetting mt5 mr10">-->
<!--<ul>--> <!--<ul>-->
<!--<li class="menuSetting">--> <!--<li class="menuSetting">-->

View File

@ -1,7 +1,7 @@
<% courses.each do |course|%> <% courses.each do |course|%>
<li class="homepageLeftMenuCoursesLine pr"> <li class="homepageLeftMenuCoursesLine pr">
<% is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,course)) %> <% is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,course)) %>
<%= link_to course.name, course_path(course.id,:host=>Setting.host_course), :class => "coursesLineGrey hidden #{course_endTime_timeout?(course) ? 'c_dark_grey' : ''}", <%= link_to course.name+"("+current_time_and_term_short(course)+")", course_path(course.id,:host=>Setting.host_course), :class => "coursesLineGrey hidden #{course_endTime_timeout?(course) ? 'c_dark_grey' : ''}",
:id => "show_course_#{course.id}", :target => '_blank', :title => (course.is_public? ? "公开课程:":"私有课程:")+course.name+""+current_time_and_term(course)+""%> :id => "show_course_#{course.id}", :target => '_blank', :title => (course.is_public? ? "公开课程:":"私有课程:")+course.name+""+current_time_and_term(course)+""%>
<% count = ShieldActivity.where("container_type='User' and container_id=#{user.id} and shield_type='Course' and shield_id=#{course.id}").count %> <% count = ShieldActivity.where("container_type='User' and container_id=#{user.id} and shield_type='Course' and shield_id=#{course.id}").count %>
<ul class="<%= count > 0 ? 'shild shildP':'subNavArrow'%>"> <ul class="<%= count > 0 ? 'shild shildP':'subNavArrow'%>">

View File

@ -227,6 +227,7 @@
</ul> </ul>
<% end %> <% end %>
<% if @course.description && !@course.description.blank? %>
<div class="project_intro"> <div class="project_intro">
<div id="course_description" class="course_description"> <div id="course_description" class="course_description">
<h4 ><%= l(:label_course_brief_introduction)%></h4> <h4 ><%= l(:label_course_brief_introduction)%></h4>
@ -241,6 +242,7 @@
</span> </span>
</div> </div>
</div><!--项目简介 end--> </div><!--项目简介 end-->
<% end %>
<div class="project_Label"> <div class="project_Label">
<h4 class="mb5" ><%= l(:label_tag)%></h4> <h4 class="mb5" ><%= l(:label_tag)%></h4>
<div class="tag_h" > <div class="tag_h" >

View File

@ -44,14 +44,14 @@
</li> </li>
<% if User.current.logged? %> <% if User.current.logged? %>
<li class="navOrgMenu fr" id="orgUser" style="cursor:pointer;"> <li class="navOrgMenu fr" id="orgUser" style="cursor:pointer;">
<%= link_to image_tag(url_to_avatar(User.current),:width => '23',:height => '23'), request.local? ? user_path(User.current):("https://www.trustie.net/users/" + User.current.id.to_s),:alt => '用户头像', :target => '_blank',:style=>'border-radius:3px; vertical-align:top; margin-top:3px; display:inline-block; margin-right:3px;' %> <%= link_to image_tag(url_to_avatar(User.current),:width => '23',:height => '23'), user_url_in_org(User.current.id),:alt => '用户头像', :target => '_blank',:style=>'border-radius:3px; vertical-align:top; margin-top:3px; display:inline-block; margin-right:3px;' %>
<%= link_to User.current, (request.local? || request.subdomain.blank?) ? user_path(User.current):("https://www.trustie.net/users/" + User.current.id.to_s),:id => "orgUserName",:class => 'fontGrey2 f14 mr5',:target => '_blank' %> <%= link_to User.current, user_url_in_org(User.current.id),:id => "orgUserName",:class => 'fontGrey2 f14 mr5',:target => '_blank' %>
<%= link_to "退出",logout_url_without_domain, :class =>"menuGrey", :method => 'post', :rel => "nofollow" %> <%= link_to "退出",logout_url_without_domain, :class =>"menuGrey", :method => 'post', :rel => "nofollow" %>
</li> </li>
<!--<li class="navOrgMenu fr"><%#=link_to User.current, user_path(User.current), :class => "linkGrey8 f14" %></li>--> <!--<li class="navOrgMenu fr"><%#=link_to User.current, user_path(User.current), :class => "linkGrey8 f14" %></li>-->
<% else %> <% else %>
<li class="navOrgMenu fr"><a href="<%= (request.local? || request.subdomain.blank?) ? signin_path(:login=>true):'https://www.trustie.net/login?login=true' %>" class="linkGrey8 f14">登录</a></li> <li class="navOrgMenu fr"><a href="<%= signin_url_without_domain %>" class="linkGrey8 f14">登录</a></li>
<li class="navOrgMenu fr"><a href="<%= (request.local? || request.subdomain.blank?) ? signin_path(:login=>false):'https://www.trustie.net/login?login=false' %>" class="linkGrey8 f14 mr15">注册</a></li> <li class="navOrgMenu fr"><a href="<%= register_url_without_domain %>" class="linkGrey8 f14 mr15">注册</a></li>
<% end %> <% end %>
</ul> </ul>
<!--<div class="navHomepageProfile"> <!--<div class="navHomepageProfile">

View File

@ -193,7 +193,7 @@
<% end%> <% end%>
<% end%> <% end%>
</div> </div>
<% courses = @user.courses.visible.where("is_delete =?", 0).select("courses.*,(SELECT MAX(created_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS a").order("a desc").limit(5) %> <% courses = @user.courses.visible.where("is_delete =?", 0).select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS a").order("a desc").limit(5) %>
<div class="homepageLeftMenuCourses <%= courses.empty? ? 'none' : ''%>" id="homepageLeftMenuCourses"> <div class="homepageLeftMenuCourses <%= courses.empty? ? 'none' : ''%>" id="homepageLeftMenuCourses">
<ul> <ul>
<%= render :partial => 'layouts/user_courses', :locals => {:courses => courses,:user => @user, :page => 0} %> <%= render :partial => 'layouts/user_courses', :locals => {:courses => courses,:user => @user, :page => 0} %>

View File

@ -34,11 +34,7 @@
<div class="postRightContainer ml10" onmouseover="$('#message_setting_<%= @topic.id%>').show();" onmouseout="$('#message_setting_<%= @topic.id%>').hide();"> <div class="postRightContainer ml10" onmouseover="$('#message_setting_<%= @topic.id%>').show();" onmouseout="$('#message_setting_<%= @topic.id%>').hide();">
<div class="postThemeContainer"> <div class="postThemeContainer">
<div class="postDetailPortrait"> <div class="postDetailPortrait">
<% if @topic.status == 1 %> <%= link_to image_tag(url_to_avatar(@topic.author), :width => 50, :height => 50,:alt=>'图像' ), user_path(@topic.author) %>
<%= image_tag("/images/trustie_logo1.png", width: "50px", height: "50px") %>
<% else %>
<%= link_to image_tag(url_to_avatar(@topic.author), :width => 50, :height => 50,:alt=>'图像' ), user_path(@topic.author) %>
<% end %>
</div> </div>
<div class="postThemeWrap"> <div class="postThemeWrap">
<% if User.current.logged? %> <% if User.current.logged? %>
@ -74,16 +70,11 @@
<a href="javascript:void(0);" class="f14 linkGrey4 fb" style="overflow:hidden;">主题: <%= @topic.subject%></a> <a href="javascript:void(0);" class="f14 linkGrey4 fb" style="overflow:hidden;">主题: <%= @topic.subject%></a>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<div class="postDetailCreater"> <div class="postDetailCreater">
<% if @topic.status == 1 %> <% if @topic.try(:author).try(:realname) == ' ' %>
<span class="fontBlue2">确实团队</span> <%= link_to @topic.try(:author), user_path(@topic.author,:host=>Setting.host_user), :class => "linkBlue2", :target=> "_blank" %>
<% else %> <% else %>
<% if @topic.try(:author).try(:realname) == ' ' %> <%= link_to @topic.try(:author).try(:realname), user_path(@topic.author,:host=>Setting.host_user), :class => "linkBlue2", :target=> "_blank" %>
<%= link_to @topic.try(:author), user_path(@topic.author,:host=>Setting.host_user), :class => "linkBlue2", :target=> "_blank" %>
<% else %>
<%= link_to @topic.try(:author).try(:realname), user_path(@topic.author,:host=>Setting.host_user), :class => "linkBlue2", :target=> "_blank" %>
<% end %>
<% end %> <% end %>
</div> </div>
<div class="postDetailDate mb5"><%= format_time( @topic.created_on)%></div> <div class="postDetailDate mb5"><%= format_time( @topic.created_on)%></div>

View File

@ -12,6 +12,7 @@
<% end %> <% end %>
<% elsif @message.course %> <% elsif @message.course %>
<div nhname="topic_form">
<%= form_for @message, { <%= form_for @message, {
:as => :message, :as => :message,
:url => {:action => 'edit',:is_course=>@is_course,:is_board=>@is_board}, :url => {:action => 'edit',:is_course=>@is_course,:is_board=>@is_board},
@ -22,7 +23,7 @@
<%= render :partial => 'boards/course_message_edit', <%= render :partial => 'boards/course_message_edit',
:locals => {:f => f, :edit_mode => true, :topic => @message, :course => @message.course} %> :locals => {:f => f, :edit_mode => true, :topic => @message, :course => @message.course} %>
<% end %> <% end %>
</div>
<% elsif @message.board.org_subfield %> <% elsif @message.board.org_subfield %>
<%= form_for @message, { <%= form_for @message, {
:as => :message, :as => :message,

View File

@ -50,6 +50,8 @@
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<p id="homework_course_id_span" class="c_red mt5"></p> <p id="homework_course_id_span" class="c_red mt5"></p>
<p id="e_tip" class="c_grey"></p>
<p id="e_tips" class="c_grey"></p>
<div class="cl"></div> <div class="cl"></div>
<div class="mt10"> <div class="mt10">
<div class="fl" id="topic_attachments"> <div class="fl" id="topic_attachments">

View File

@ -39,6 +39,8 @@
<div class="cl"></div> <div class="cl"></div>
<p id="homework_course_id_span" class="c_red mt5"></p> <p id="homework_course_id_span" class="c_red mt5"></p>
<p id="e_tip" class="c_grey"></p>
<p id="e_tips" class="c_grey"></p>
<div class="cl"></div> <div class="cl"></div>
<div class="mt10"> <div class="mt10">

View File

@ -46,6 +46,8 @@
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<p id="homework_course_id_span" class="c_red mt5"></p> <p id="homework_course_id_span" class="c_red mt5"></p>
<p id="e_tip" class="c_grey"></p>
<p id="e_tips" class="c_grey"></p>
<div class="cl"></div> <div class="cl"></div>
<div class="mt10"> <div class="mt10">
<div class="fl" id="topic_attachments"> <div class="fl" id="topic_attachments">

View File

@ -8,11 +8,11 @@
<div class="resources" id="organization_document_<%= @document.id %>"> <div class="resources" id="organization_document_<%= @document.id %>">
<div class="homepagePostBrief"> <div class="homepagePostBrief">
<div class="homepagePostPortrait"> <div class="homepagePostPortrait">
<%= link_to image_tag(url_to_avatar(User.find(@document.creator_id)), :width => 45, :heigth => 45), user_path(@document.creator_id) %> <%= link_to image_tag(url_to_avatar(User.find(@document.creator_id)), :width => 45, :heigth => 45), user_url_in_org(@document.creator_id) %>
</div> </div>
<div class="homepagePostDes"> <div class="homepagePostDes">
<div class="homepagePostTo"> <div class="homepagePostTo">
<%= link_to User.find(@document.creator_id), user_path(@document.creator.id), :class => "newsBlue mr15" %> <%= link_to User.find(@document.creator_id), user_url_in_org(@document.creator_id), :class => "newsBlue mr15" %>
TO&nbsp;&nbsp;<%= link_to @document.organization.name, organization_path(@document.organization), :class => "newsBlue" %> TO&nbsp;&nbsp;<%= link_to @document.organization.name, organization_path(@document.organization), :class => "newsBlue" %>
| |
<% if @document.organization.home_id == @document.id %> <% if @document.organization.home_id == @document.id %>
@ -89,10 +89,10 @@
<% user = User.find(reply.creator_id) %> <% user = User.find(reply.creator_id) %>
<div class="homepagePostReplyContainer" onmouseover="$('#reply_edit_menu_<%= reply.id%>').show();" onmouseout="$('#reply_edit_menu_<%= reply.id %>').hide();"> <div class="homepagePostReplyContainer" onmouseover="$('#reply_edit_menu_<%= reply.id%>').show();" onmouseout="$('#reply_edit_menu_<%= reply.id %>').hide();">
<div class="homepagePostReplyPortrait"> <div class="homepagePostReplyPortrait">
<%= link_to image_tag(url_to_avatar(user), :width => 33,:height => 33), user_path(user) %> <%= link_to image_tag(url_to_avatar(user), :width => 33,:height => 33), user_url_in_org(user.id) %>
</div> </div>
<div class="homepagePostReplyDes"> <div class="homepagePostReplyDes">
<%= link_to User.find(reply.creator_id).realname, user_path(reply.creator_id), :class => "newsBlue mr10 f14" %> <%= link_to User.find(reply.creator_id).realname, user_url_in_org(reply.creator_id), :class => "newsBlue mr10 f14" %>
<div class="homepagePostReplyContent upload_img break_word" id="reply_message_description_<%= reply.id %>"> <div class="homepagePostReplyContent upload_img break_word" id="reply_message_description_<%= reply.id %>">
<%= reply.content.html_safe unless reply.content.nil? %> <%= reply.content.html_safe unless reply.content.nil? %>
</div> </div>

View File

@ -1,8 +1,7 @@
<% if @res %> <% if @res %>
$("#org_subfield_list").html(""); $("#org_subfield_list").html("");
$("#org_subfield_list").html("<%= escape_javascript(render :partial => 'organizations/subfield_list', $("#org_subfield_list").html("<%= escape_javascript(render :partial => 'organizations/subfield_list',
:locals => {:default_fields => @organization.org_subfields.where("field_type='default'"), :locals => {:subfields => @organization.org_subfields.order("priority") }) %>");
:subfields => @organization.org_subfields.where("field_type != 'default'") }) %>");
$("#sub_field_left_lists").html(""); $("#sub_field_left_lists").html("");
$("#sub_field_left_lists").html("<%= escape_javascript(render :partial => 'organizations/org_left_subfield_list', :locals => {:organization => @organization}) %>"); $("#sub_field_left_lists").html("<%= escape_javascript(render :partial => 'organizations/org_left_subfield_list', :locals => {:organization => @organization}) %>");
$("#subfield_name").val(""); $("#subfield_name").val("");

View File

@ -1,6 +1,5 @@
$("#org_subfield_list").html(""); $("#org_subfield_list").html("");
$("#org_subfield_list").html("<%= escape_javascript(render :partial => 'organizations/subfield_list', $("#org_subfield_list").html("<%= escape_javascript(render :partial => 'organizations/subfield_list',
:locals => {:default_fields => @organization.org_subfields.where("field_type='default'"), :locals => {:subfields => @organization.org_subfields.order("priority") }) %>");
:subfields => @organization.org_subfields.where("field_type != 'default'") }) %>");
$("#sub_field_left_lists").html(""); $("#sub_field_left_lists").html("");
$("#sub_field_left_lists").html("<%= escape_javascript(render :partial => 'organizations/org_left_subfield_list', :locals => {:organization => @organization}) %>"); $("#sub_field_left_lists").html("<%= escape_javascript(render :partial => 'organizations/org_left_subfield_list', :locals => {:organization => @organization}) %>");

View File

@ -0,0 +1,2 @@
$("#org_subfield_list").html("<%= escape_javascript(render :partial => 'organizations/subfield_list',:locals => {:subfields => @organization.org_subfields.order("priority")}) %>");
$("#sub_field_left_lists").html("<%= escape_javascript(render :partial => 'organizations/org_left_subfield_list', :locals => {:organization => @organization}) %>");

View File

@ -12,10 +12,10 @@
<%= link_to activity.try(:teacher).try(:realname), user_url_in_org(activity.tea_id), :class => "newsBlue mr15" %> <%= link_to activity.try(:teacher).try(:realname), user_url_in_org(activity.tea_id), :class => "newsBlue mr15" %>
<% end %> <% end %>
TO TO
<%= link_to activity.name.to_s+" | 课程", course_path(activity.id,:host=>Setting.host_course), :class => "newsBlue ml15" %> <%= link_to activity.name.to_s+" | 课程", course_url_in_org(activity.id), :class => "newsBlue ml15" %>
</div> </div>
<div class="homepagePostTitle break_word" > <div class="homepagePostTitle break_word" >
<%= link_to activity.name, course_path(activity.id,:host=>Setting.host_course), :class => "postGrey" %> <%= link_to activity.name, course_url_in_org(activity.id), :class => "postGrey" %>
</div> </div>
<div class="homepagePostDate"> <div class="homepagePostDate">
创建时间:<%= format_time(activity.created_at) %> 创建时间:<%= format_time(activity.created_at) %>

View File

@ -12,10 +12,10 @@
<% else %> <% else %>
<%= link_to activity.try(:user).try(:realname), user_url_in_org(activity.user_id), :class => "newsBlue mr15" %> <%= link_to activity.try(:user).try(:realname), user_url_in_org(activity.user_id), :class => "newsBlue mr15" %>
<% end %> TO <!--+"(课程名称)" --> <% end %> TO <!--+"(课程名称)" -->
<%= link_to activity.course.name.to_s+" | 课程作业", homework_common_index_path(:course => activity.course.id, :host=> Setting.host_course), :class => "newsBlue ml15"%> <%= link_to activity.course.name.to_s+" | 课程作业", homework_common_index_url_in_org(activity.course.id), :class => "newsBlue ml15"%>
</div> </div>
<div class="homepagePostTitle hidden m_w505 fl"> <!--+"(作业名称)"--> <div class="homepagePostTitle hidden m_w505 fl"> <!--+"(作业名称)"-->
<%= link_to activity.name.to_s, student_work_index_path(:homework => activity.id,:host=> Setting.host_course), :class => "postGrey"%> <%= link_to activity.name.to_s, student_work_index_url_in_org(activity.id), :class => "postGrey"%>
</div> </div>
<% if activity.homework_detail_manual%> <% if activity.homework_detail_manual%>
<% if activity.homework_detail_manual.comment_status == 1%> <% if activity.homework_detail_manual.comment_status == 1%>
@ -47,7 +47,7 @@
<% end%> <% end%>
<div class="cl"></div> <div class="cl"></div>
<% if activity.homework_type == 3 && activity.homework_detail_group.base_on_project == 1%> <% if activity.homework_type == 3 && activity.homework_detail_group.base_on_project == 1%>
<span class="c_red">系统提示:该作业要求各组长<%=link_to "创建项目", new_project_path(:host=>Setting.host_name),:class=>"linkBlue",:title=>"新建项目",:style=>"text-decoration:underline;"%>,组成员加入项目,然后由组长关联项目。谢谢配合!</span> <span class="c_red">系统提示:该作业要求各组长<%=link_to "创建项目", "https://www.trustie.net/projects/new",:class=>"c_red",:title=>"新建项目",:style=>"text-decoration:underline;"%>,组成员加入项目,然后由组长关联项目。谢谢配合!</span>
<% elsif activity.homework_type == 3 && activity.homework_detail_group.base_on_project == 0%> <% elsif activity.homework_type == 3 && activity.homework_detail_group.base_on_project == 0%>
<span class="c_red">系统提示:该作业要求各组长提交作品,提交作品时请添加组成员。谢谢配合!</span> <span class="c_red">系统提示:该作业要求各组长提交作品,提交作品时请添加组成员。谢谢配合!</span>
<% end %> <% end %>
@ -73,7 +73,7 @@
<% if activity.homework_type == 2 && is_teacher%> <% if activity.homework_type == 2 && is_teacher%>
<div class="homepagePostSubmit"> <div class="homepagePostSubmit">
<%= link_to "模拟答题", new_user_commit_homework_users_path(homework_id: activity.id, is_test: true), class: 'c_blue test-program-btn', title: '教师可以通过模拟答题设置作业的标准答案' %> <%= link_to "模拟答题", "https://www.trustie.net/new_user_commit_homework?homework_id="+activity.id.to_s + "&is_test=true", class: 'c_blue test-program-btn', title: '教师可以通过模拟答题设置作业的标准答案' %>
</div> </div>
<% end %> <% end %>
<% if activity.homework_type == 2%> <% if activity.homework_type == 2%>
@ -129,7 +129,7 @@
<% if activity.student_works.count != 0 %> <% if activity.student_works.count != 0 %>
<% sw = activity.student_works.reorder("created_at desc").first %> <% sw = activity.student_works.reorder("created_at desc").first %>
<div class="mt10 homepagePostDeadline mb10"> <div class="mt10 homepagePostDeadline mb10">
#&nbsp;<%=time_from_now sw.created_at %><%= link_to sw.user.show_name, user_activities_path(sw.user_id), :class => "newsBlue ml5 mr5"%>提交了作品 #&nbsp;<%=time_from_now sw.created_at %><%= link_to sw.user.show_name, user_activities_url_in_org(sw.user_id), :class => "newsBlue ml5 mr5"%>提交了作品
</div> </div>
<% end %> <% end %>
<div class="cl"></div> <div class="cl"></div>
@ -141,7 +141,7 @@
<% last_score = student_work_scores.first %> <% last_score = student_work_scores.first %>
<div> <div>
<p class="mb10 fontGrey2">#&nbsp;<%=time_from_now last_score.created_at %> <p class="mb10 fontGrey2">#&nbsp;<%=time_from_now last_score.created_at %>
<%= link_to last_score.user.show_name, user_activities_path(last_score.user_id), :class => "newsBlue ml5 mr5"%>评阅了作品,优秀排行: <%= link_to last_score.user.show_name, user_activities_url_in_org(last_score.user_id), :class => "newsBlue ml5 mr5"%>评阅了作品,优秀排行:
</p> </p>
</div> </div>
<% end %> <% end %>
@ -154,18 +154,8 @@
<% end %> <% end %>
<% student_works.each_with_index do |sw, i| %> <% student_works.each_with_index do |sw, i| %>
<div class="fl mr10 w100" style="text-align:center;"> <div class="fl mr10 w100" style="text-align:center;">
<a href="javascript:void(0);" class="linkBlue"> <a href="javascript:void(0);" class="linkBlue"><%= link_to image_tag(url_to_avatar(User.find sw.user_id), :width => "40", :height => "40"), student_work_index_path(:homework => activity.id), :alt => "学生头像" %>
<% if User.current.member_of_course?(activity.course) || User.current.admin? || activity.is_open == 1 %> <p class="w100 hidden"><%= link_to sw.user.show_name, student_work_index_url_in_org(activity.id)%></p>
<%= link_to image_tag(url_to_avatar(User.find sw.user_id), :width => "40", :height => "40"), student_work_index_path(:homework => activity.id), :alt => "学生头像" %>
<p class="w100 hidden">
<%= link_to sw.user.show_name, student_work_index_path(:homework => activity.id)%>
</p>
<% else %>
<%= image_tag(url_to_avatar(User.find sw.user_id), :width => "40", :height => "40", :title => '该作业的作品暂未公开') %>
<p class="w100 hidden">
<a href="javascript:void(0);" title="该作业的作品暂未公开"><%=sw.user.show_name %></a>
</p>
<% end %>
</a> </a>
<% score = sw.respond_to?("score") ? sw.score : (sw.final_score || 0) - sw.absence_penalty - sw.late_penalty %> <% score = sw.respond_to?("score") ? sw.score : (sw.final_score || 0) - sw.absence_penalty - sw.late_penalty %>
<p class="fontGrey2">分数:<span class="c_red"><%=format("%.1f",score.to_i<0 ? 0 : score.to_i) %>分</span></p> <p class="fontGrey2">分数:<span class="c_red"><%=format("%.1f",score.to_i<0 ? 0 : score.to_i) %>分</span></p>
@ -175,7 +165,7 @@
<% end %> <% end %>
<% end %> <% end %>
<% if student_works.count > 5 %> <% if student_works.count > 5 %>
<%= link_to "更多>>", student_work_index_path(:homework => activity.id),:class=>'linkGrey2 fl ml50',:style=>'margin-top:60px;'%> <%= link_to "更多>>", student_work_index_url_in_org(activity.id),:class=>'linkGrey2 fl ml50',:style=>'margin-top:60px;'%>
<% end %> <% end %>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
@ -187,7 +177,7 @@
<% sort_projects = project_sort_update projects %> <% sort_projects = project_sort_update projects %>
<div class="mt10 relatePWrap" id="relatePWrap_<%=user_activity_id %>"> <div class="mt10 relatePWrap" id="relatePWrap_<%=user_activity_id %>">
<div class="mr5 fontGrey2"> <div class="mr5 fontGrey2">
#&nbsp;<%=time_from_now sort_projects.first.updated_at %><%= link_to User.find(sort_projects.first.user_id).show_name, user_activities_path(sort_projects.first.user_id), :class => "newsBlue ml5 mr5"%>更新了项目,最近更新: #&nbsp;<%=time_from_now sort_projects.first.updated_at %><%= link_to User.find(sort_projects.first.user_id).show_name, user_activities_url_in_org(sort_projects.first.user_id), :class => "newsBlue ml5 mr5"%>更新了项目,最近更新:
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<% sort_projects.each_with_index do |pro, i| %> <% sort_projects.each_with_index do |pro, i| %>
@ -204,7 +194,7 @@
<div class="mr10 mb10 mt10 fl w100 fontGrey2" style="text-align: center;"> <div class="mr10 mb10 mt10 fl w100 fontGrey2" style="text-align: center;">
<% if project.is_public || User.current.member_of?(project) || User.current.admin? %> <% if project.is_public || User.current.member_of?(project) || User.current.admin? %>
<%= link_to image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius"),project_path(project.id,:host=>Setting.host_name),:id=>"project_img_"+project.id.to_s+"_"+activity.id.to_s,:alt =>"项目头像" %> <%= link_to image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius"),project_url_in_org(project.id),:id=>"project_img_"+project.id.to_s+"_"+activity.id.to_s,:alt =>"项目头像" %>
<% else %> <% else %>
<%= image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius",:id=>"project_img_"+project.id.to_s+"_"+activity.id.to_s,:alt =>"项目头像") %> <%= image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius",:id=>"project_img_"+project.id.to_s+"_"+activity.id.to_s,:alt =>"项目头像") %>
<% end %> <% end %>
@ -237,17 +227,17 @@
<li class="homepagePostSettingIcon"> <li class="homepagePostSettingIcon">
<ul class="homepagePostSettiongText"> <ul class="homepagePostSettiongText">
<li> <li>
<%= link_to l(:button_edit),edit_homework_common_path(activity,:is_in_course => -1,:course_activity=>course_activity), :class => "postOptionLink"%> <%= link_to l(:button_edit),Setting.protocol + "://" + Setting.host_name + "/homework_common/" + activity.id.to_s + "/edit?", :class => "postOptionLink"%>
</li> </li>
<li> <li>
<%= link_to(l(:label_bid_respond_delete), homework_common_path(activity,:is_in_course => -1,:course_activity=>course_activity),:method => 'delete', :confirm => l(:text_are_you_sure), :class => "postOptionLink") %> <%= link_to(l(:label_bid_respond_delete), Setting.protocol + "://" + Setting.host_name + "/homework_common/" + activity.id.to_s + "?is_in_course=-1&course_activity=" + course_activity.to_s,:method => 'delete', :confirm => l(:text_are_you_sure), :class => "postOptionLink") %>
</li> </li>
<li> <li>
<%= link_to("评分设置", score_rule_set_homework_common_path(activity,:user_activity_id => user_activity_id, :is_in_course => 0),:class => "postOptionLink", :remote => true) %> <%= link_to("评分设置", Setting.protocol + "://" + Setting.host_name + "/homework_common/" + activity.id.to_s + "/score_rule_set?is_in_course=0&user_activity_id=" + user_activity_id.to_s,:class => "postOptionLink", :remote => true) %>
</li> </li>
<% if activity.anonymous_comment == 0 %> <% if activity.anonymous_comment == 0 %>
<li> <li>
<%= link_to("匿评设置", start_evaluation_set_homework_common_path(activity),:class => "postOptionLink", :remote => true) if activity.homework_detail_manual.comment_status == 1%> <%= link_to("匿评设置", Setting.protocol + "://" + Setting.host_name + "/homework_common/" + activity.id.to_s + "/start_evaluation_set",:class => "postOptionLink", :remote => true) if activity.homework_detail_manual.comment_status == 1%>
</li> </li>
<li> <li>
<%= homework_anonymous_comment activity,-1,user_activity_id,course_activity %> <%= homework_anonymous_comment activity,-1,user_activity_id,course_activity %>
@ -255,17 +245,17 @@
<% end %> <% end %>
<% if activity.anonymous_comment == 0 && (comment_status == 0 || comment_status == 1)%> <% if activity.anonymous_comment == 0 && (comment_status == 0 || comment_status == 1)%>
<li> <li>
<%= link_to("禁用匿评", alert_forbidden_anonymous_comment_homework_common_path(activity,:user_activity_id => user_activity_id,:course_activity=>course_activity),:class => "postOptionLink", <%= link_to("禁用匿评", Setting.host_name + "/homework_common/" + activity.id.to_s + "/alert_forbidden_anonymous_comment?user_activity_id=" + user_activity_id.to_s + "&course_activity=" + course_activity.to_s,:class => "postOptionLink",
:title => "匿评是同学之间的双盲互评过程:每个同学将评阅系统分配给他/她的若干个作品",:remote => true)%> :title => "匿评是同学之间的双盲互评过程:每个同学将评阅系统分配给他/她的若干个作品",:remote => true)%>
</li> </li>
<% end %> <% end %>
<% if (activity.anonymous_comment == 1 && activity.is_open == 0) || (activity.anonymous_comment == 0 && comment_status == 3 && activity.is_open == 0) %> <% if (activity.anonymous_comment == 1 && activity.is_open == 0) || (activity.anonymous_comment == 0 && comment_status == 3 && activity.is_open == 0) %>
<li> <li>
<%= link_to("公开作品", alert_open_student_works_homework_common_path(activity,:user_activity_id => user_activity_id, :is_in_course => -1,:course_activity=>course_activity),:class => "postOptionLink", :remote => true)%> <%= link_to("公开作品", Setting.protocol + "://" + Setting.host_name + "/homework_common/" + activity.id.to_s + "/alert_open_student_works?is_in_course=-1&user_activity_id=" + user_activity_id.to_s + "&course_activity=" + course_activity.to_s,:class => "postOptionLink", :remote => true)%>
</li> </li>
<% elsif activity.is_open == 1 %> <% elsif activity.is_open == 1 %>
<li> <li>
<%= link_to("取消公开", alert_open_student_works_homework_common_path(activity,:user_activity_id => user_activity_id, :is_in_course => -1,:course_activity=>course_activity),:class => "postOptionLink", :remote => true)%> <%= link_to("取消公开", Setting.protocol + "://" + Setting.host_name + "/homework_common/" + activity.id.to_s + "/alert_open_student_works?is_in_course=-1&user_activity_id=" + user_activity_id.to_s + "&course_activity=" + course_activity.to_s,:class => "postOptionLink", :remote => true)%>
</li> </li>
<% end %> <% end %>
</ul> </ul>
@ -356,7 +346,7 @@
<%= hidden_field_tag 'course_activity',params[:course_activity],:value =>course_activity %> <%= hidden_field_tag 'course_activity',params[:course_activity],:value =>course_activity %>
<div nhname='toolbar_container_<%= user_activity_id%>'></div> <div nhname='toolbar_container_<%= user_activity_id%>'></div>
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="homework_message"></textarea> <textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="homework_message"></textarea>
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a> <a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
<div class="cl"></div> <div class="cl"></div>
<p nhname='contentmsg_<%= user_activity_id%>'></p> <p nhname='contentmsg_<%= user_activity_id%>'></p>
<% end%> <% end%>

View File

@ -12,13 +12,13 @@
<%= link_to activity.try(:author).try(:realname), user_url_in_org(activity.author_id), :class => "newsBlue mr15" %> <%= link_to activity.try(:author).try(:realname), user_url_in_org(activity.author_id), :class => "newsBlue mr15" %>
<% end %> <% end %>
TO TO
<%= link_to activity.course.name.to_s+" | 课程问答区", course_boards_path(activity.course,:host=> Setting.host_course), :class => "newsBlue ml15 mr5"%> <%= link_to activity.course.name.to_s+" | 课程问答区", course_boards_url_in_org(activity.course.id), :class => "newsBlue ml15 mr5"%>
</div> </div>
<div class="homepagePostTitle hidden m_w530 fl"> <div class="homepagePostTitle hidden m_w530 fl">
<% if activity.parent_id.nil? %> <!--+"(帖子标题)"--> <% if activity.parent_id.nil? %> <!--+"(帖子标题)"-->
<%= link_to activity.subject.to_s.html_safe, board_message_path(activity.board_id, activity), :class=> "postGrey" %> <%= link_to activity.subject.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :class=> "postGrey" %>
<% else %> <% else %>
<%= link_to activity.parent.subject.to_s.html_safe, board_message_path(activity.board_id, activity), :class=> "postGrey"%> <%= link_to activity.parent.subject.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :class=> "postGrey"%>
<% end %> <% end %>
</div> </div>
<% if activity.sticky == 1%> <% if activity.sticky == 1%>

View File

@ -1,123 +1,123 @@
<div class="resources mt10" id="user_activity_<%= user_activity_id%>"> <div class="resources mt10" id="user_activity_<%= user_activity_id%>">
<div class="homepagePostBrief"> <div class="homepagePostBrief">
<div class="homepagePostPortrait"> <div class="homepagePostPortrait">
<%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_url_in_org(activity.author_id), :alt => "用户头像" %> <%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_url_in_org(activity.author_id), :alt => "用户头像" %>
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %> <%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
</div> </div>
<div class="homepagePostDes"> <div class="homepagePostDes">
<div class="homepagePostTo break_word mt-4"> <div class="homepagePostTo break_word mt-4">
<% if @ctivity.try(:author).try(:realname) == ' ' %> <% if @ctivity.try(:author).try(:realname) == ' ' %>
<%= link_to activity.try(:author), user_url_in_org(activity.author_id), :class => "newsBlue mr15" %> <%= link_to activity.try(:author), user_url_in_org(activity.author_id), :class => "newsBlue mr15" %>
<% else %> <% else %>
<%= link_to activity.try(:author).try(:realname), user_url_in_org(activity.author_id), :class => "newsBlue mr15" %> <%= link_to activity.try(:author).try(:realname), user_url_in_org(activity.author_id), :class => "newsBlue mr15" %>
<% end %> TO <!--+"(课程名称)"--> <% end %> TO <!--+"(课程名称)"-->
<%= link_to activity.course.name.to_s+" | 课程通知", course_news_index_path(activity.course), :class => "newsBlue ml15" %> <%= link_to activity.course.name.to_s+" | 课程通知", course_news_index_url_in_org(activity.course.id), :class => "newsBlue ml15" %>
</div> </div>
<div class="homepagePostTitle break_word hidden fl m_w600"> <!--+"(通知标题)"--> <div class="homepagePostTitle break_word hidden fl m_w600"> <!--+"(通知标题)"-->
<%= link_to activity.title.to_s, news_path(activity), :class => "postGrey" %> <%= link_to activity.title.to_s, news_url_in_org(activity.id), :class => "postGrey" %>
</div> </div>
<% if activity.sticky == 1%> <% if activity.sticky == 1%>
<span class="sticky_btn_cir ml10">置顶</span> <span class="sticky_btn_cir ml10">置顶</span>
<% end%> <% end%>
<div class="cl"></div> <div class="cl"></div>
<div class="homepagePostDate fl"> <div class="homepagePostDate fl">
发布时间:<%= format_time(activity.created_on) %> 发布时间:<%= format_time(activity.created_on) %>
</div> </div>
<div class="homepagePostDate fl ml15"> <div class="homepagePostDate fl ml15">
更新时间:<%= format_time(CourseActivity.where("course_act_type='#{activity.class}' and course_act_id =#{activity.id}").first.updated_at) %> 更新时间:<%= format_time(CourseActivity.where("course_act_type='#{activity.class}' and course_act_id =#{activity.id}").first.updated_at) %>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>user_activity_id, :content=>activity.description} %> <%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>user_activity_id, :content=>activity.description} %>
<div class="cl"></div> <div class="cl"></div>
<div id="intro_content_show_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div> <div id="intro_content_show_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
<div id="intro_content_hide_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div> <div id="intro_content_hide_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
<div class="cl"></div> <div class="cl"></div>
<div class="mt10" style="font-weight:normal;"> <div class="mt10" style="font-weight:normal;">
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %> <%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %>
</div> </div>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<% count=activity.comments.count %> <% count=activity.comments.count %>
<div class="homepagePostReply"> <div class="homepagePostReply">
<div class="homepagePostReplyBanner"> <div class="homepagePostReplyBanner">
<div class="homepagePostReplyBannerCount">回复 <div class="homepagePostReplyBannerCount">回复
<sapn class="mr15"><%= count>0 ? "#{count}" : "" %></sapn><span style="color: #cecece;">▪</span> <sapn class="mr15"><%= count>0 ? "#{count}" : "" %></sapn><span style="color: #cecece;">▪</span>
<span id="praise_count_<%=user_activity_id %>"> <span id="praise_count_<%=user_activity_id %>">
<% if activity.author == User.current %> <% if activity.author == User.current %>
<span class="ml15 likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "#{get_praise_num(activity)}" : "" %></span></span> <span class="ml15 likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "#{get_praise_num(activity)}" : "" %></span></span>
<% else %> <% else %>
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
<% end %> <% end %>
</span> </span>
</div> </div>
<div class="homepagePostReplyBannerTime"><%#= format_date(activity.updated_on) %></div> <div class="homepagePostReplyBannerTime"><%#= format_date(activity.updated_on) %></div>
<%if count>3 %> <%if count>3 %>
<div class="homepagePostReplyBannerMore"> <div class="homepagePostReplyBannerMore">
<a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" > <a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >
展开更多 展开更多
</a> </a>
</div> </div>
<% end %> <% end %>
</div> </div>
<% replies_all_i = 0 %> <% replies_all_i = 0 %>
<% if count > 0 %> <% if count > 0 %>
<div class="" id="reply_div_<%= user_activity_id %>"> <div class="" id="reply_div_<%= user_activity_id %>">
<ul> <ul>
<% activity.comments.reorder("created_on desc").each do |comment| %> <% activity.comments.reorder("created_on desc").each do |comment| %>
<script type="text/javascript"> <script type="text/javascript">
$(function(){ $(function(){
showNormalImage('reply_content_<%= comment.id %>'); showNormalImage('reply_content_<%= comment.id %>');
}); });
</script> </script>
<% replies_all_i = replies_all_i + 1 %> <% replies_all_i = replies_all_i + 1 %>
<li class="homepagePostReplyContainer" nhname="reply_rec" style="display:<%= replies_all_i > 3 ? 'none' : '' %>"> <li class="homepagePostReplyContainer" nhname="reply_rec" style="display:<%= replies_all_i > 3 ? 'none' : '' %>">
<div class="homepagePostReplyPortrait"> <div class="homepagePostReplyPortrait">
<%= link_to image_tag(url_to_avatar(comment.author), :width => "33", :height => "33"), user_url_in_org(comment.author_id), :alt => "用户头像" %> <%= link_to image_tag(url_to_avatar(comment.author), :width => "33", :height => "33"), user_url_in_org(comment.author_id), :alt => "用户头像" %>
</div> </div>
<div class="homepagePostReplyDes"> <div class="homepagePostReplyDes">
<div class="homepagePostReplyPublisher mt-4"> <div class="homepagePostReplyPublisher mt-4">
<% if comment.try(:author).try(:realname) == ' ' %> <% if comment.try(:author).try(:realname) == ' ' %>
<%= link_to comment.try(:author), user_url_in_org(comment.author_id), :class => "newsBlue mr10 f14" %> <%= link_to comment.try(:author), user_url_in_org(comment.author_id), :class => "newsBlue mr10 f14" %>
<% else %> <% else %>
<%= link_to comment.try(:author).try(:realname), user_url_in_org(comment.author_id), :class => "newsBlue mr10 f14" %> <%= link_to comment.try(:author).try(:realname), user_url_in_org(comment.author_id), :class => "newsBlue mr10 f14" %>
<% end %> <% end %>
<%= format_time(comment.created_on) %> <%= format_time(comment.created_on) %>
<span id="reply_praise_count_<%=comment.id %>"> <span id="reply_praise_count_<%=comment.id %>">
<% if comment.author == User.current %> <% if comment.author == User.current %>
<span class="fr likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(comment) > 0 ? "#{get_praise_num(comment)}" : "" %></span></span> <span class="fr likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(comment) > 0 ? "#{get_praise_num(comment)}" : "" %></span></span>
<% else %> <% else %>
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
<% end %> <% end %>
</span> </span>
</div> </div>
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= comment.id %>"> <div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= comment.id %>">
<%= comment.comments.html_safe %></div> <%= comment.comments.html_safe %></div>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</li> </li>
<% end %> <% end %>
</ul> </ul>
</div> </div>
<% end %> <% end %>
<div class="homepagePostReplyContainer borderBottomNone minHeight48"> <div class="homepagePostReplyContainer borderBottomNone minHeight48">
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= user_activity_id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_url_in_org(activity.author_id), :alt => "用户头像" %></div> <div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= user_activity_id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_url_in_org(activity.author_id), :alt => "用户头像" %></div>
<div class="homepagePostReplyInputContainer mb10"> <div class="homepagePostReplyInputContainer mb10">
<div nhname='new_message_<%= user_activity_id%>' style="display:none;"> <div nhname='new_message_<%= user_activity_id%>' style="display:none;">
<%= form_for('new_form',:url => {:controller => 'comments', :action => 'create', :id => activity},:method => "post", :remote => true) do |f|%> <%= form_for('new_form',:url => {:controller => 'comments', :action => 'create', :id => activity},:method => "post", :remote => true) do |f|%>
<input type="hidden" name="user_activity_id" value="<%=user_activity_id%>"> <input type="hidden" name="user_activity_id" value="<%=user_activity_id%>">
<div nhname='toolbar_container_<%= user_activity_id%>'></div> <div nhname='toolbar_container_<%= user_activity_id%>'></div>
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="comment"></textarea> <textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="comment"></textarea>
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a> <a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
<div class="cl"></div> <div class="cl"></div>
<p nhname='contentmsg_<%= user_activity_id%>'></p> <p nhname='contentmsg_<%= user_activity_id%>'></p>
<% end%> <% end%>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
</div> </div>
</div> </div>

View File

@ -16,7 +16,7 @@
<%= link_to activity.try(:user).try(:realname), user_url_in_org(activity.user_id), :class => "newsBlue mr15" %> <%= link_to activity.try(:user).try(:realname), user_url_in_org(activity.user_id), :class => "newsBlue mr15" %>
<% end %> <% end %>
TO TO
<%= link_to Course.find(activity.polls_group_id).name.to_s+" | 问卷", poll_index_path(:polls_type => "Course", :polls_group_id => activity.polls_group_id), :class => "newsBlue ml15" %> <%= link_to Course.find(activity.polls_group_id).name.to_s+" | 问卷", Setting.protocol + "://" + Setting.host_name + "/poll?polls_type=Course&polls_group_id=" + activity.polls_group_id.to_s, :class => "newsBlue ml15" %>
<!--<a href="javascript:void(0);" class="newsBlue ml15">分布式计算环境(课程名称)</a>--> <!--<a href="javascript:void(0);" class="newsBlue ml15">分布式计算环境(课程名称)</a>-->
</div> </div>
<div class="homepagePostTitle break_word" > <div class="homepagePostTitle break_word" >

View File

@ -34,71 +34,76 @@
}) })
}) })
</script> </script>
<% org_activity_field = organization.org_subfields.where('field_type="default" and name="activity" and field_type="default"').first %>
<% org_course_field = organization.org_subfields.where('field_type="default" and name="course" and field_type="default"').first %>
<% org_project_field = organization.org_subfields.where('field_type="default" and name="project" and field_type="default"').first %>
<div class="homepageLeftMenuBlock" style="display:<%= is_hide_org_left(org_activity_field) ? 'block':'none' %>;" id="org_subfield_<%= org_activity_field.id %>">
<%= link_to "动态",organization_path(organization), :class => "homepageMenuText" %>
</div>
<div style="display:<%= is_hide_org_left(org_project_field) ? 'block':'none' %>;" id="org_subfield_<%= org_project_field.id %>">
<div class="homepageLeftMenuBlock">
<a href="javascript:void(0);" class="homepageMenuText" onclick="$('#homepageLeftMenuProjects').slideToggle();">项目</a>
<% if User.current.logged? and User.current.admin_of_org?(organization) %>
<%=link_to "", join_project_menu_organization_path(organization),:remote => true, :method => "post", :class => "homepageMenuSetting fr", :title => "关联项目"%>
<% end %>
</div>
<div class="homepageLeftMenuCourses" id="homepageLeftMenuProjects" style="display:<%= organization.projects.count == 0?'none':'' %>">
<ul >
<%= render :partial => 'layouts/org_projects',:locals=>{:projects=>organization.projects.reorder('created_at').uniq.limit(5),:org_id=>organization.id,:page=>1}%> <% organization.org_subfields.order("priority").each do |field| %>
</ul> <% if is_default_field?(field) %>
</div> <% case field.name %>
</div> <% when 'activity' %>
<div style="display:<%= is_hide_org_left(org_course_field) ? 'block':'none' %>;" id="org_subfield_<%= org_course_field.id %>"> <div class="homepageLeftMenuBlock" style="display:<%= field.hide == 0 ? 'block':'none' %>;" id="org_subfield_<%= field.id %>">
<div class="homepageLeftMenuBlock"> <%= link_to "动态",organization_path(organization), :class => "homepageMenuText" %>
<a href="javascript:void(0);" class="homepageMenuText" onclick="$('#homepageLeftMenuCourses').slideToggle();">课程</a> </div>
<% if User.current.logged? and User.current.admin_of_org?(organization) %> <% when 'course' %>
<%=link_to "", join_course_menu_organization_path(organization),:remote => true, :method => "post", :class => "homepageMenuSetting fr", :title => "关联课程"%> <div style="display:<%= field.hide == 0 ? 'block':'none' %>;" id="org_subfield_<%= field.id %>">
<% end %> <div class="homepageLeftMenuBlock">
</div> <a href="javascript:void(0);" class="homepageMenuText" onclick="$('#homepageLeftMenuCourses').slideToggle();">课程</a>
<div class="homepageLeftMenuCourses" id="homepageLeftMenuCourses" style="display:<%= organization.courses.count == 0 ?'none':'' %>"> <% if User.current.logged? and User.current.admin_of_org?(organization) %>
<ul > <%=link_to "", join_course_menu_organization_path(organization),:remote => true, :method => "post", :class => "homepageMenuSetting fr", :title => "关联课程"%>
<%= render :partial => 'layouts/org_courses',:locals=>{:courses=>organization.courses.reorder('created_at').uniq.limit(5),:org_id=>organization.id,:page=>1}%> <% end %>
</ul> </div>
</div> <div class="homepageLeftMenuCourses" id="homepageLeftMenuCourses" style="display:<%= organization.courses.count == 0 ?'none':'' %>">
</div> <ul >
<% organization.org_subfields.where("field_type != 'default'").each do |field| %> <%= render :partial => 'layouts/org_courses',:locals=>{:courses=>organization.courses.reorder('created_at').uniq.limit(5),:org_id=>organization.id,:page=>1}%>
<div class="homepageLeftMenuBlock" style="display:<%= field.hide == 0?'block':'none' %>;" id="org_subfield_<%= field.id %>"> </ul>
<% if field.field_type == "Post" %> </div>
<% if !field.subfield_subdomain_dir.nil? %> </div>
<% if !request.local? and Secdomain.where("sub_type=2 and pid=?", organization.id).count > 0 and Secdomain.where("sub_type=2 and pid=?", organization.id).map(&:subname).include?(request.subdomain) %> <% when 'project' %>
<%= link_to "#{field.name}", show_subfield_without_id_path(:sub_dir_name => field.subfield_subdomain_dir.name), :class => "homepageMenuText" %> <div style="display:<%= field.hide == 0 ? 'block':'none' %>;" id="org_subfield_<%= field.id %>">
<div class="homepageLeftMenuBlock">
<a href="javascript:void(0);" class="homepageMenuText" onclick="$('#homepageLeftMenuProjects').slideToggle();">项目</a>
<% if User.current.logged? and User.current.admin_of_org?(organization) %>
<%=link_to "", join_project_menu_organization_path(organization),:remote => true, :method => "post", :class => "homepageMenuSetting fr", :title => "关联项目"%>
<% end %>
</div>
<div class="homepageLeftMenuCourses" id="homepageLeftMenuProjects" style="display:<%= organization.projects.count == 0?'none':'' %>">
<ul>
<%= render :partial => 'layouts/org_projects',:locals=>{:projects=>organization.projects.reorder('created_at').uniq.limit(5),:org_id=>organization.id,:page=>1}%>
</ul>
</div>
</div>
<% end %>
<% else %>
<div class="homepageLeftMenuBlock" style="display:<%= field.hide == 0?'block':'none' %>;" id="org_subfield_<%= field.id %>">
<% if field.field_type == "Post" %>
<% if !field.subfield_subdomain_dir.nil? %>
<% if !request.local? and Secdomain.where("sub_type=2 and pid=?", organization.id).count > 0 and Secdomain.where("sub_type=2 and pid=?", organization.id).map(&:subname).include?(request.subdomain) %>
<%= link_to "#{field.name}", show_subfield_without_id_path(:sub_dir_name => field.subfield_subdomain_dir.name), :class => "homepageMenuText" %>
<% else %>
<%= link_to "#{field.name}", show_org_subfield_organization_path(:id => organization.id, :sub_dir_name => field.subfield_subdomain_dir.name), :class => "homepageMenuText" %>
<% end %>
<% else %> <% else %>
<%= link_to "#{field.name}", show_org_subfield_organization_path(:id => organization.id, :sub_dir_name => field.subfield_subdomain_dir.name), :class => "homepageMenuText" %> <%= link_to "#{field.name}", organization_path(organization, :org_subfield_id => field.id), :class => "homepageMenuText" %>
<% end %>
<% if User.current.member_of_org?organization %>
<%=link_to "", new_organization_org_document_comment_path(organization, :field_id => field.id), :method => "get", :class => "homepageMenuSetting fr", :title => "发布帖子"%>
<% end %> <% end %>
<% else %> <% else %>
<%= link_to "#{field.name}", organization_path(organization, :org_subfield_id => field.id), :class => "homepageMenuText" %> <% if !field.subfield_subdomain_dir.nil? %>
<% if !request.local? and Secdomain.where("sub_type=2 and pid=?", organization.id).count > 0 and Secdomain.where("sub_type=2 and pid=?", organization.id).map(&:subname).include?(request.subdomain) %>
<%= link_to "#{field.name}", show_subfield_without_id_path(:sub_dir_name => field.subfield_subdomain_dir.name), :class => "homepageMenuText" %>
<% else %>
<%= link_to "#{field.name}", show_org_subfield_organization_path(:id => organization.id, :sub_dir_name => field.subfield_subdomain_dir.name), :class => "homepageMenuText" %>
<% end %>
<% else %>
<%= link_to "#{field.name}", org_subfield_files_path(field), :class => "homepageMenuText" %>
<% end %>
<% if User.current.member_of_org?organization %>
<%= link_to "", subfield_upload_file_org_subfield_files_path(field.id, :in_org => 1),:method => "post", :remote => true, :class => "homepageMenuSetting fr", :title => "上传资源" %>
<!--<a class="homepageMenuSetting fr" title="上传资源" href="javascript:void(0);" onclick="org_subfield_files_upload(<%#= field.id %>);"> </a>-->
<% end %>
<!--<a href="javascript:void(0);" class="homepageMenuText"><%#= field.name %></a>-->
<% end %> <% end %>
<% if User.current.member_of_org?organization %> </div>
<%=link_to "", new_organization_org_document_comment_path(organization, :field_id => field.id), :method => "get", :class => "homepageMenuSetting fr", :title => "发布帖子"%> <div class="homepageLeftMenuCourses" id="homepageLeftMenuField_<%= field.id %>" style="display:none;">
<% end %> </div>
<% else %> <% end %>
<% if !field.subfield_subdomain_dir.nil? %>
<% if !request.local? and Secdomain.where("sub_type=2 and pid=?", organization.id).count > 0 and Secdomain.where("sub_type=2 and pid=?", organization.id).map(&:subname).include?(request.subdomain) %>
<%= link_to "#{field.name}", show_subfield_without_id_path(:sub_dir_name => field.subfield_subdomain_dir.name), :class => "homepageMenuText" %>
<% else %>
<%= link_to "#{field.name}", show_org_subfield_organization_path(:id => organization.id, :sub_dir_name => field.subfield_subdomain_dir.name), :class => "homepageMenuText" %>
<% end %>
<% else %>
<%= link_to "#{field.name}", org_subfield_files_path(field), :class => "homepageMenuText" %>
<% end %>
<% if User.current.member_of_org?organization %>
<%= link_to "", subfield_upload_file_org_subfield_files_path(field.id, :in_org => 1),:method => "post", :remote => true, :class => "homepageMenuSetting fr", :title => "上传资源" %>
<!--<a class="homepageMenuSetting fr" title="上传资源" href="javascript:void(0);" onclick="org_subfield_files_upload(<%#= field.id %>);"> </a>-->
<% end %>
<!--<a href="javascript:void(0);" class="homepageMenuText"><%#= field.name %></a>-->
<% end %>
</div>
<div class="homepageLeftMenuCourses" id="homepageLeftMenuField_<%= field.id %>" style="display:none;">
</div>
<% end %> <% end %>

View File

@ -14,7 +14,7 @@
<%= member.user.nil? ? '' : (image_tag(url_to_avatar(member.user), :width => 32, :height => 32)) %> <%= member.user.nil? ? '' : (image_tag(url_to_avatar(member.user), :width => 32, :height => 32)) %>
</a> </a>
<span class="fl ml10 c_grey"><%= l(:label_username)%></span> <span class="fl ml10 c_grey"><%= l(:label_username)%></span>
<%= link_to(member.user.show_name, user_path(member.user),:class => "ml5 c_blue02") %><br /> <%= link_to(member.user.show_name, user_url_in_org(member.user_id),:class => "ml5 c_blue02") %><br />
<span class="fl c_grey ml10">身份:<%= member.user.admin_of_org?(organization)?"组织管理员":"组织成员" %></span> <span class="fl c_grey ml10">身份:<%= member.user.admin_of_org?(organization)?"组织管理员":"组织成员" %></span>
<% if member.created_at %> <% if member.created_at %>
<span class="fr c_grey"><%= format_time(member.created_at) %></span> <span class="fr c_grey"><%= format_time(member.created_at) %></span>

View File

@ -1,141 +1,141 @@
<div class="resources mt10" id="user_activity_<%= user_activity_id%>"> <div class="resources mt10" id="user_activity_<%= user_activity_id%>">
<div class="homepagePostBrief"> <div class="homepagePostBrief">
<div class="homepagePostPortrait"> <div class="homepagePostPortrait">
<%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_url_in_org(activity.author_id), :alt => "用户头像" %> <%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_url_in_org(activity.author_id), :alt => "用户头像" %>
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %> <%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
</div> </div>
<div class="homepagePostDes"> <div class="homepagePostDes">
<div class="homepagePostTo break_word mt-4"> <div class="homepagePostTo break_word mt-4">
<% if activity.try(:author).try(:realname) == ' ' %> <% if activity.try(:author).try(:realname) == ' ' %>
<%= link_to activity.try(:author), user_url_in_org(activity.author_id), :class => "newsBlue mr15" %> <%= link_to activity.try(:author), user_url_in_org(activity.author_id), :class => "newsBlue mr15" %>
<% else %> <% else %>
<%= link_to activity.try(:author).try(:realname), user_url_in_org(activity.author_id), :class => "newsBlue mr15" %> <%= link_to activity.try(:author).try(:realname), user_url_in_org(activity.author_id), :class => "newsBlue mr15" %>
<% end %> TO <% end %> TO
<%= link_to activity.project.name.to_s+" | 项目问题", project_issues_path(activity.project), :class => "newsBlue ml15"%> <%= link_to activity.project.name.to_s+" | 项目问题", project_issues_url_in_org(activity.project.id), :class => "newsBlue ml15"%>
</div> </div>
<div class="homepagePostTitle break_word"> <div class="homepagePostTitle break_word">
<%= link_to activity.subject.to_s, issue_path(activity), :class => "postGrey" %> <%= link_to activity.subject.to_s, issue_url_in_org(activity.id), :class => "postGrey" %>
<span class='<%#= get_issue_priority(activity.priority_id)[0] %>'> <span class='<%#= get_issue_priority(activity.priority_id)[0] %>'>
<%#= get_issue_priority(activity.priority_id)[1] %> <%#= get_issue_priority(activity.priority_id)[1] %>
</span> </span>
</div> </div>
<div class="homepagePostSubmitContainer"> <div class="homepagePostSubmitContainer">
<div class="homepagePostAssignTo">指派给&nbsp;&nbsp; <div class="homepagePostAssignTo">指派给&nbsp;&nbsp;
<% unless activity.assigned_to_id.nil? %> <% unless activity.assigned_to_id.nil? %>
<% if activity.try(:assigned_to).try(:realname) == ' ' %> <% if activity.try(:assigned_to).try(:realname) == ' ' %>
<%= link_to activity.try(:assigned_to), user_url_in_org(activity.assigned_to_id), :class => "newsBlue mr15" %> <%= link_to activity.try(:assigned_to), user_url_in_org(activity.assigned_to_id), :class => "newsBlue mr15" %>
<% else %> <% else %>
<%= link_to activity.try(:assigned_to).try(:realname), user_url_in_org(activity.assigned_to_id), :class => "newsBlue mr15" %> <%= link_to activity.try(:assigned_to).try(:realname), user_url_in_org(activity.assigned_to_id), :class => "newsBlue mr15" %>
<% end %> <% end %>
<% end %> <% end %>
</div> </div>
<div class="homepagePostDeadline fl"> <div class="homepagePostDeadline fl">
发布时间: 发布时间:
<%=format_time(activity.created_on) %> <%=format_time(activity.created_on) %>
</div> </div>
<div class="homepagePostDate fl ml15"> <div class="homepagePostDate fl ml15">
更新时间:<%= format_time(ForgeActivity.where("forge_act_type='#{activity.class}' and forge_act_id =#{activity.id}").first.updated_at) %> 更新时间:<%= format_time(ForgeActivity.where("forge_act_type='#{activity.class}' and forge_act_id =#{activity.id}").first.updated_at) %>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>user_activity_id, :content=>activity.description} %> <%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>user_activity_id, :content=>activity.description} %>
<div class="cl"></div> <div class="cl"></div>
<div id="intro_content_show_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div> <div id="intro_content_show_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
<div id="intro_content_hide_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div> <div id="intro_content_hide_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
<div class="cl"></div> <div class="cl"></div>
<div class="mt10" style="font-weight:normal;"> <div class="mt10" style="font-weight:normal;">
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %> <%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %>
</div> </div>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<% count = activity.journals.count %> <% count = activity.journals.count %>
<div class="homepagePostReply"> <div class="homepagePostReply">
<div class="homepagePostReplyBanner"> <div class="homepagePostReplyBanner">
<div class="homepagePostReplyBannerCount">回复 <div class="homepagePostReplyBannerCount">回复
<sapn class="mr15"><%= count>0 ? "#{count}" : "" %></sapn><span style="color: #cecece;">▪</span> <sapn class="mr15"><%= count>0 ? "#{count}" : "" %></sapn><span style="color: #cecece;">▪</span>
<span id="praise_count_<%=user_activity_id %>"> <span id="praise_count_<%=user_activity_id %>">
<% if activity.author == User.current %> <% if activity.author == User.current %>
<span class="ml15 likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "#{get_praise_num(activity)}" : "" %></span></span> <span class="ml15 likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "#{get_praise_num(activity)}" : "" %></span></span>
<% else %> <% else %>
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
<% end %> <% end %>
</span> </span>
</div> </div>
<div class="homepagePostReplyBannerTime"><%#= format_date(activity.updated_on) %></div> <div class="homepagePostReplyBannerTime"><%#= format_date(activity.updated_on) %></div>
<% if count > 3 %> <% if count > 3 %>
<div class="homepagePostReplyBannerMore"> <div class="homepagePostReplyBannerMore">
<a id="reply_btn_<%= user_activity_id %>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help"> <a id="reply_btn_<%= user_activity_id %>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help">
展开更多 展开更多
</a> </a>
</div> </div>
<% end %> <% end %>
</div> </div>
<% replies_all_i = 0 %> <% replies_all_i = 0 %>
<% if count > 0 %> <% if count > 0 %>
<div class="" id="reply_div_<%= user_activity_id %>"> <div class="" id="reply_div_<%= user_activity_id %>">
<ul> <ul>
<% activity.journals.reorder("created_on desc").each do |reply| %> <% activity.journals.reorder("created_on desc").each do |reply| %>
<script type="text/javascript"> <script type="text/javascript">
$(function(){ $(function(){
showNormalImage('reply_content_<%= reply.id %>'); showNormalImage('reply_content_<%= reply.id %>');
}); });
</script> </script>
<% replies_all_i=replies_all_i + 1 %> <% replies_all_i=replies_all_i + 1 %>
<li class="homepagePostReplyContainer" nhname="reply_rec" style="display:<%= replies_all_i>3 ? 'none' : '' %>"> <li class="homepagePostReplyContainer" nhname="reply_rec" style="display:<%= replies_all_i>3 ? 'none' : '' %>">
<div class="homepagePostReplyPortrait"> <div class="homepagePostReplyPortrait">
<%= link_to image_tag(url_to_avatar(reply.user), :width => "33", :height => "33"), user_url_in_org(reply.user_id), :alt => "用户头像" %> <%= link_to image_tag(url_to_avatar(reply.user), :width => "33", :height => "33"), user_url_in_org(reply.user_id), :alt => "用户头像" %>
</div> </div>
<div class="homepagePostReplyDes"> <div class="homepagePostReplyDes">
<div class="homepagePostReplyPublisher mt-4"> <div class="homepagePostReplyPublisher mt-4">
<% if reply.try(:user).try(:realname) == ' ' %> <% if reply.try(:user).try(:realname) == ' ' %>
<%= link_to reply.try(:user), user_url_in_org(reply.user_id), :class => "newsBlue mr10 f14" %> <%= link_to reply.try(:user), user_url_in_org(reply.user_id), :class => "newsBlue mr10 f14" %>
<% else %> <% else %>
<%= link_to reply.try(:user).try(:realname), user_url_in_org(reply.user_id), :class => "newsBlue mr10 f14" %> <%= link_to reply.try(:user).try(:realname), user_url_in_org(reply.user_id), :class => "newsBlue mr10 f14" %>
<% end %> <% end %>
<%= format_time(reply.created_on) %> <%= format_time(reply.created_on) %>
<span id="reply_praise_count_<%=reply.id %>"> <span id="reply_praise_count_<%=reply.id %>">
<% if reply.user == User.current %> <% if reply.user == User.current %>
<span class="fr likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(reply) > 0 ? "#{get_praise_num(reply)}" : "" %></span></span> <span class="fr likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(reply) > 0 ? "#{get_praise_num(reply)}" : "" %></span></span>
<% else %> <% else %>
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
<% end %> <% end %>
</span> </span>
</div> </div>
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= reply.id %>"> <div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= reply.id %>">
<% if reply.details.any? %> <% if reply.details.any? %>
<% details_to_strings(reply.details).each do |string| %> <% details_to_strings(reply.details).each do |string| %>
<p><%= string %></p> <p><%= string %></p>
<% end %> <% end %>
<% end %> <% end %>
<P><%= reply.notes.nil? ? "" : reply.notes.html_safe %></P> <P><%= reply.notes.nil? ? "" : reply.notes.html_safe %></P>
</div> </div>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</li> </li>
<% end %> <% end %>
</ul> </ul>
</div> </div>
<% end %> <% end %>
<div class="homepagePostReplyContainer borderBottomNone minHeight48"> <div class="homepagePostReplyContainer borderBottomNone minHeight48">
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= user_activity_id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_url_in_org(activity.author_id), :alt => "用户头像" %></div> <div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= user_activity_id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_url_in_org(activity.author_id), :alt => "用户头像" %></div>
<div class="homepagePostReplyInputContainer mb10"> <div class="homepagePostReplyInputContainer mb10">
<div nhname='new_message_<%= user_activity_id%>' style="display:none;"> <div nhname='new_message_<%= user_activity_id%>' style="display:none;">
<%= form_for('new_form',:url => add_journal_in_org_issue_path(activity.id),:method => "post", :remote => true) do |f|%> <%= form_for('new_form',:url => add_journal_in_org_issue_path(activity.id),:method => "post", :remote => true) do |f|%>
<input type="hidden" name="user_activity_id" value="<%=user_activity_id%>"> <input type="hidden" name="user_activity_id" value="<%=user_activity_id%>">
<div nhname='toolbar_container_<%= user_activity_id%>'></div> <div nhname='toolbar_container_<%= user_activity_id%>'></div>
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="notes"></textarea> <textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="notes"></textarea>
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a> <a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
<div class="cl"></div> <div class="cl"></div>
<p nhname='contentmsg_<%= user_activity_id%>'></p> <p nhname='contentmsg_<%= user_activity_id%>'></p>
<% end%> <% end%>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
</div> </div>
</div> </div>

View File

@ -3,21 +3,21 @@
<div class="resources mt10"> <div class="resources mt10">
<div class="homepagePostBrief"> <div class="homepagePostBrief">
<div class="homepagePostPortrait"> <div class="homepagePostPortrait">
<%= link_to image_tag(url_to_avatar(user), :width => "50", :height => "50"), user_url_in_org(user), :alt => "用户头像" %> <%= link_to image_tag(url_to_avatar(user), :width => "50", :height => "50"), user_url_in_org(user.id), :alt => "用户头像" %>
<%= render :partial => 'users/show_detail_info', :locals => {:user => user} %> <%= render :partial => 'users/show_detail_info', :locals => {:user => user} %>
</div> </div>
<div class="homepagePostDes"> <div class="homepagePostDes">
<div class="homepagePostTo break_word mt-4"> <div class="homepagePostTo break_word mt-4">
<% if user.try(:realname) == ' ' %> <% if user.try(:realname) == ' ' %>
<%= link_to user, user_url_in_org(user), :class => "newsBlue mr15" %> <%= link_to user, user_url_in_org(user.id), :class => "newsBlue mr15" %>
<% else %> <% else %>
<%= link_to user.try(:realname), user_url_in_org(user), :class => "newsBlue mr15" %> <%= link_to user.try(:realname), user_url_in_org(user.id), :class => "newsBlue mr15" %>
<% end %> <% end %>
TO TO
<%= link_to project.to_s+" | 项目", project_path(project.id,:host=>Setting.host_course), :class => "newsBlue ml15" %> <%= link_to project.to_s+" | 项目", project_url_in_org(project.id), :class => "newsBlue ml15" %>
</div> </div>
<div class="homepagePostTitle break_word" > <div class="homepagePostTitle break_word" >
<%= link_to project.name, project_path(project.id,:host=>Setting.host_course), :class => "postGrey" %> <%= link_to project.name, project_url_in_org(project.id), :class => "postGrey" %>
</div> </div>
<div class="homepagePostDate"> <div class="homepagePostDate">
创建时间:<%= format_time(project.created_on) %> 创建时间:<%= format_time(project.created_on) %>

View File

@ -1,136 +1,135 @@
<div class="resources mt10" id="user_activity_<%= user_activity_id%>"> <div class="resources mt10" id="user_activity_<%= user_activity_id%>">
<div class="homepagePostBrief"> <div class="homepagePostBrief">
<div class="homepagePostPortrait"> <div class="homepagePostPortrait">
<%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_url_in_org(activity.author_id), :alt => "用户头像" %> <%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_url_in_org(activity.author_id), :alt => "用户头像" %>
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %> <%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
</div> </div>
<div class="homepagePostDes"> <div class="homepagePostDes">
<div class="homepagePostTo break_word mt-4"> <div class="homepagePostTo break_word mt-4">
<% if activity.try(:author).try(:realname) == ' ' %> <% if activity.try(:author).try(:realname) == ' ' %>
<%= link_to activity.try(:author), user_url_in_org(activity.author_id), :class => "newsBlue mr15" %> <%= link_to activity.try(:author), user_url_in_org(activity.author_id), :class => "newsBlue mr15" %>
<% else %> <% else %>
<%= link_to activity.try(:author).try(:realname), user_url_in_org(activity.author_id), :class => "newsBlue mr15" %> <%= link_to activity.try(:author).try(:realname), user_url_in_org(activity.author_id), :class => "newsBlue mr15" %>
<% end %> <% end %>
TO TO
<%= link_to activity.project.name.to_s+" | 项目讨论区",project_boards_path(activity.project), :class => "newsBlue ml15 mr5"%> <%= link_to activity.project.name.to_s+" | 项目讨论区",project_boards_url_in_org(activity.project.id), :class => "newsBlue ml15 mr5"%>
<!--<a href="javascript:void(0);" class="newsBlue ml15 mr5"><%= activity.project.name %>(项目讨论区)</a>--> <!--<a href="javascript:void(0);" class="newsBlue ml15 mr5"><%= activity.project.name %>(项目讨论区)</a>-->
</div> </div>
<div class="homepagePostTitle break_word"> <div class="homepagePostTitle break_word">
<% if activity.parent_id.nil? %> <% if activity.parent_id.nil? %>
<%= link_to activity.subject.to_s.html_safe, board_message_path(activity.board,activity), :class=> "postGrey" <%= link_to activity.subject.to_s.html_safe, board_message_url_in_org(activity.board.id,activity.id), :class=> "postGrey"
%> %>
<% else %> <% else %>
<%= link_to activity.parent.subject.to_s.html_safe, board_message_path(activity.board,activity), :class=> "postGrey" <%= link_to activity.parent.subject.to_s.html_safe, board_message_url_in_org(activity.board.id,activity.id), :class=> "postGrey" %>
%> <% end %>
<% end %> </div>
</div> <div class="homepagePostDate fl">
<div class="homepagePostDate fl"> 发帖时间:<%= format_time(activity.created_on) %>
发帖时间:<%= format_time(activity.created_on) %> </div>
</div> <div class="homepagePostDate fl ml15">
<div class="homepagePostDate fl ml15"> 更新时间:<%= format_time(ForgeActivity.where("forge_act_type='#{activity.class}' and forge_act_id =#{activity.id}").first.updated_at) %>
更新时间:<%= format_time(ForgeActivity.where("forge_act_type='#{activity.class}' and forge_act_id =#{activity.id}").first.updated_at) %> </div>
</div> <div class="cl"></div>
<div class="cl"></div> <% if activity.parent_id.nil? %>
<% if activity.parent_id.nil? %> <% content = activity.content%>
<% content = activity.content%> <% else %>
<% else %> <% content = activity.parent.content%>
<% content = activity.parent.content%> <% end %>
<% end %> <%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>user_activity_id, :content=>content} %>
<%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>user_activity_id, :content=>content} %> <div class="cl"></div>
<div class="cl"></div> <div id="intro_content_show_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
<div id="intro_content_show_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div> <div id="intro_content_hide_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
<div id="intro_content_hide_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div> <div class="cl"></div>
<div class="cl"></div> <div class="mt10" style="font-weight:normal;">
<div class="mt10" style="font-weight:normal;"> <%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %>
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %> </div>
</div> </div>
</div> <div class="cl"></div>
<div class="cl"></div> </div>
</div> <% count = 0 %>
<% count = 0 %> <% if activity.parent %>
<% if activity.parent %> <% count=activity.parent.children.count%>
<% count=activity.parent.children.count%> <% else %>
<% else %> <% count=activity.children.count%>
<% count=activity.children.count%> <% end %>
<% end %> <div class="homepagePostReply">
<div class="homepagePostReply"> <div class="homepagePostReplyBanner">
<div class="homepagePostReplyBanner"> <div class="homepagePostReplyBannerCount">回复
<div class="homepagePostReplyBannerCount">回复 <sapn class="mr15"><%= count>0 ? "#{count}" : "" %></sapn><span style="color: #cecece;">▪</span>
<sapn class="mr15"><%= count>0 ? "#{count}" : "" %></sapn><span style="color: #cecece;">▪</span> <span id="praise_count_<%=user_activity_id %>">
<span id="praise_count_<%=user_activity_id %>"> <% if activity.author == User.current %>
<% if activity.author == User.current %> <span class="ml15 likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "#{get_praise_num(activity)}" : "" %></span></span>
<span class="ml15 likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "#{get_praise_num(activity)}" : "" %></span></span> <% else %>
<% else %> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%> <% end %>
<% end %> </span>
</span> </div>
</div> <div class="homepagePostReplyBannerTime"><%#=format_date(activity.updated_on)%></div>
<div class="homepagePostReplyBannerTime"><%#=format_date(activity.updated_on)%></div> <%if count>3 %>
<%if count>3 %> <div class="homepagePostReplyBannerMore"><a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >展开更多</a></div>
<div class="homepagePostReplyBannerMore"><a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >展开更多</a></div> <% end %>
<% end %> </div>
</div>
<% activity= activity.parent_id.nil? ? activity : activity.parent %>
<% activity= activity.parent_id.nil? ? activity : activity.parent %> <% replies_all_i = 0 %>
<% replies_all_i = 0 %> <% if count > 0 %>
<% if count > 0 %> <div class="" id="reply_div_<%= user_activity_id %>">
<div class="" id="reply_div_<%= user_activity_id %>"> <ul>
<ul> <% activity.children.reorder("created_on desc").each do |reply| %>
<% activity.children.reorder("created_on desc").each do |reply| %> <script type="text/javascript">
<script type="text/javascript"> $(function(){
$(function(){ showNormalImage('reply_content_<%= reply.id %>');
showNormalImage('reply_content_<%= reply.id %>'); });
}); </script>
</script> <% replies_all_i=replies_all_i+1 %>
<% replies_all_i=replies_all_i+1 %> <li class="homepagePostReplyContainer" nhname="reply_rec" style="display:<%= replies_all_i>3 ? 'none' : '' %>">
<li class="homepagePostReplyContainer" nhname="reply_rec" style="display:<%= replies_all_i>3 ? 'none' : '' %>"> <div class="homepagePostReplyPortrait">
<div class="homepagePostReplyPortrait"> <%= link_to image_tag(url_to_avatar(reply.author), :width => "33", :height => "33"), user_url_in_org(reply.author_id), :alt => "用户头像" %>
<%= link_to image_tag(url_to_avatar(reply.author), :width => "33", :height => "33"), user_url_in_org(reply.author_id), :alt => "用户头像" %> </div>
</div> <div class="homepagePostReplyDes">
<div class="homepagePostReplyDes"> <div class="homepagePostReplyPublisher mt-4">
<div class="homepagePostReplyPublisher mt-4"> <% if reply.try(:author).try(:realname) == ' ' %>
<% if reply.try(:author).try(:realname) == ' ' %> <%= link_to reply.try(:author), user_url_in_org(reply.author_id), :class => "newsBlue mr10 f14" %>
<%= link_to reply.try(:author), user_url_in_org(reply.author_id), :class => "newsBlue mr10 f14" %> <% else %>
<% else %> <%= link_to reply.try(:author).try(:realname), user_url_in_org(reply.author_id), :class => "newsBlue mr10 f14" %>
<%= link_to reply.try(:author).try(:realname), user_url_in_org(reply.author_id), :class => "newsBlue mr10 f14" %> <% end %>
<% end %> <%= format_time(reply.created_on) %>
<%= format_time(reply.created_on) %> <span id="reply_praise_count_<%=reply.id %>">
<span id="reply_praise_count_<%=reply.id %>"> <% if reply.author == User.current %>
<% if reply.author == User.current %> <span class="fr likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(reply) > 0 ? "#{get_praise_num(reply)}" : "" %></span></span>
<span class="fr likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(reply) > 0 ? "#{get_praise_num(reply)}" : "" %></span></span> <% else %>
<% else %> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%> <% end %>
<% end %> </span>
</span> </div>
</div> <div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= reply.id %>">
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= reply.id %>"> <%= reply.content.html_safe %></div>
<%= reply.content.html_safe %></div> </div>
</div> <div class="cl"></div>
<div class="cl"></div> </li>
</li> <% end %>
<% end %> </ul>
</ul> </div>
</div> <% end %>
<% end %>
<div class="homepagePostReplyContainer borderBottomNone minHeight48">
<div class="homepagePostReplyContainer borderBottomNone minHeight48"> <div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= user_activity_id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_url_in_org(activity.author_id), :alt => "用户头像" %></div>
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= user_activity_id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_url_in_org(activity.author_id), :alt => "用户头像" %></div> <div class="homepagePostReplyInputContainer mb10">
<div class="homepagePostReplyInputContainer mb10"> <div nhname='new_message_<%= user_activity_id%>' style="display:none;">
<div nhname='new_message_<%= user_activity_id%>' style="display:none;"> <%= form_for('new_form',:url => {:controller=>'messages',:action => 'reply', :id => activity.id, :board_id => activity.board_id, :is_board => 'true'},:method => "post", :remote => true) do |f|%>
<%= form_for('new_form',:url => {:controller=>'messages',:action => 'reply', :id => activity.id, :board_id => activity.board_id, :is_board => 'true'},:method => "post", :remote => true) do |f|%> <input type="hidden" name="quote[quote]" value="">
<input type="hidden" name="quote[quote]" value=""> <input type="hidden" name="user_activity_id" value="<%=user_activity_id%>">
<input type="hidden" name="user_activity_id" value="<%=user_activity_id%>"> <div nhname='toolbar_container_<%= user_activity_id%>'></div>
<div nhname='toolbar_container_<%= user_activity_id%>'></div> <textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="reply[content]"></textarea>
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="reply[content]"></textarea> <a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a> <div class="cl"></div>
<div class="cl"></div> <p nhname='contentmsg_<%= user_activity_id%>'></p>
<p nhname='contentmsg_<%= user_activity_id%>'></p> <% end%>
<% end%> </div>
</div> <div class="cl"></div>
<div class="cl"></div> </div>
</div> <div class="cl"></div>
<div class="cl"></div> </div>
</div>
</div>
</div> </div>
</div>

View File

@ -1,152 +1,152 @@
<div class="resources mt10" id="organization_document_<%= document.id %>"> <div class="resources mt10" id="organization_document_<%= document.id %>">
<div class="homepagePostBrief"> <div class="homepagePostBrief">
<div class="homepagePostPortrait"> <div class="homepagePostPortrait">
<%= link_to image_tag(url_to_avatar(User.find(document.creator_id)), :width => 45, :heigth => 45), user_url_in_org(document.creator_id) %> <%= link_to image_tag(url_to_avatar(User.find(document.creator_id)), :width => 45, :heigth => 45), user_url_in_org(document.creator_id) %>
<%= render :partial => 'users/show_detail_info', :locals => {:user => User.find(document.creator_id)} %> <%= render :partial => 'users/show_detail_info', :locals => {:user => User.find(document.creator_id)} %>
</div> </div>
<div class="homepagePostDes"> <div class="homepagePostDes">
<div class="homepagePostTo"> <div class="homepagePostTo">
<%= link_to User.find(document.creator_id), user_url_in_org(document.creator.id), :class => "newsBlue mr15" %> <%= link_to User.find(document.creator_id), user_url_in_org(document.creator.id), :class => "newsBlue mr15" %>
TO&nbsp;&nbsp;<%= link_to document.organization.name, organization_path(document.organization), :class => "newsBlue" %> TO&nbsp;&nbsp;<%= link_to document.organization.name, organization_path(document.organization), :class => "newsBlue" %>
| |
<span style="color:#269ac9;"><%= document.org_subfield_id.nil? ? "组织文章" :"#{OrgSubfield.find(document.org_subfield_id).name}" %></span> <span style="color:#269ac9;"><%= document.org_subfield_id.nil? ? "组织文章" :"#{OrgSubfield.find(document.org_subfield_id).name}" %></span>
</div> </div>
<div class="homepagePostTitle postGrey"><%= link_to document.title, org_document_comment_path(:id => document.id, :organization_id => document.organization.id) %></div> <div class="homepagePostTitle postGrey"><%= link_to document.title, org_document_comment_path(:id => document.id, :organization_id => document.organization.id) %></div>
<div class="homepagePostDate fl"> <div class="homepagePostDate fl">
发布时间:<%= format_activity_day(document.created_at) %> <%= format_time(document.created_at, false) %> 发布时间:<%= format_activity_day(document.created_at) %> <%= format_time(document.created_at, false) %>
</div> </div>
<div class="homepagePostDate fl ml15"> <div class="homepagePostDate fl ml15">
更新时间:<%= format_time(OrgActivity.where("org_act_type='#{document.class}' and org_act_id =#{document.id}").first.updated_at) %> 更新时间:<%= format_time(OrgActivity.where("org_act_type='#{document.class}' and org_act_id =#{document.id}").first.updated_at) %>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<% unless document.content.blank? %> <% unless document.content.blank? %>
<%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>document.id, :content=>document.content} %> <%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>document.id, :content=>document.content} %>
<% end %> <% end %>
<div class="cl"></div> <div class="cl"></div>
<div id="intro_content_show_<%= document.id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div> <div id="intro_content_show_<%= document.id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
<div id="intro_content_hide_<%= document.id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div> <div id="intro_content_hide_<%= document.id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
<div class="cl"></div> <div class="cl"></div>
<div class="mt10" style="font-weight:normal;"> <div class="mt10" style="font-weight:normal;">
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => document} %> <%= render :partial=>"attachments/activity_attach", :locals=>{:activity => document} %>
</div> </div>
<!-- <%# if defined?(home_id) %> <!-- <%# if defined?(home_id) %>
<div style="float:right;">最后编辑:<%#= User.find() %></div> <div style="float:right;">最后编辑:<%#= User.find() %></div>
<%# end %>--> <%# end %>-->
<% if User.current.admin? || User.current.admin_of_org?(Organization.find(document.organization_id)) || User.current.id == document.creator_id %> <% if User.current.admin? || User.current.admin_of_org?(Organization.find(document.organization_id)) || User.current.id == document.creator_id %>
<div class="homepagePostSetting"> <div class="homepagePostSetting">
<ul> <ul>
<li class="homepagePostSettingIcon"> <li class="homepagePostSettingIcon">
<ul class="homepagePostSettiongText"> <ul class="homepagePostSettiongText">
<li> <li>
<%= form_for('new_form', :url => {:controller => 'organizations', :action => 'set_homepage', :id => document.organization_id, :home_id => document.id, :show_homepage => 1}, :method => "put", :remote => true) do |f| %> <%= form_for('new_form', :url => {:controller => 'organizations', :action => 'set_homepage', :id => document.organization_id, :home_id => document.id, :show_homepage => 1}, :method => "put", :remote => true) do |f| %>
<a href="javascript:void(0);" class="postOptionLink" onclick="$(this).parent().submit();">设为首页</a> <a href="javascript:void(0);" class="postOptionLink" onclick="$(this).parent().submit();">设为首页</a>
<% end %> <% end %>
</li> </li>
<li> <li>
<%= link_to "编辑文章", edit_org_document_comment_path(:id => document.id, :organization_id => document.organization_id, :flag => flag, :org_subfield_id => params[:org_subfield_id] ), :class => "postOptionLink" %> <%= link_to "编辑文章", edit_org_document_comment_path(:id => document.id, :organization_id => document.organization_id, :flag => flag, :org_subfield_id => params[:org_subfield_id] ), :class => "postOptionLink" %>
</li> </li>
<li> <li>
<%= link_to "删除文章", org_document_comment_path(:id => document.id, :organization_id => document.organization_id), :method => 'delete', <%= link_to "删除文章", org_document_comment_path(:id => document.id, :organization_id => document.organization_id), :method => 'delete',
:data => {:confirm => l(:text_are_you_sure)}, :data => {:confirm => l(:text_are_you_sure)},
:remote => true, :class => 'postOptionLink' %> :remote => true, :class => 'postOptionLink' %>
</li> </li>
</ul> </ul>
</li> </li>
</ul> </ul>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<% end %> <% end %>
</div> </div>
</div> </div>
<% comments_for_doc = document.children.reorder("created_at desc") %> <% comments_for_doc = document.children.reorder("created_at desc") %>
<% count = document.children.count() %> <% count = document.children.count() %>
<div class="homepagePostReply fl" style="background-color: #f1f1f1;" id="<%= document.id %>"> <div class="homepagePostReply fl" style="background-color: #f1f1f1;" id="<%= document.id %>">
<div class="homepagePostReplyBanner"> <div class="homepagePostReplyBanner">
<div class="homepagePostReplyBannerCount">回复 <div class="homepagePostReplyBannerCount">回复
<sapn class="mr15"><%= count>0 ? "#{count}" : "" %></sapn><span style="color: #cecece;">▪</span> <sapn class="mr15"><%= count>0 ? "#{count}" : "" %></sapn><span style="color: #cecece;">▪</span>
<span id="praise_count_<%=document.id %>"> <span id="praise_count_<%=document.id %>">
<% if document.creator_id.to_i == User.current.id.to_i %> <% if document.creator_id.to_i == User.current.id.to_i %>
<span class="ml15 likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(document) > 0 ? "#{get_praise_num(document)}" : "" %></span></span> <span class="ml15 likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(document) > 0 ? "#{get_praise_num(document)}" : "" %></span></span>
<% else %> <% else %>
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>document, :user_activity_id=>document.id,:type=>"activity"}%> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>document, :user_activity_id=>document.id,:type=>"activity"}%>
<% end %> <% end %>
</span> </span>
</div> </div>
<% if count > 3 %> <% if count > 3 %>
<div class="homepagePostReplyBannerMore"> <div class="homepagePostReplyBannerMore">
<a id="reply_btn_<%= document.id %>" onclick="expand_reply('#reply_div_<%= document.id %> li','#reply_btn_<%=document.id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help"> <a id="reply_btn_<%= document.id %>" onclick="expand_reply('#reply_div_<%= document.id %> li','#reply_btn_<%=document.id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help">
展开更多 展开更多
</a> </a>
</div> </div>
<% end %> <% end %>
</div> </div>
<div class="homepagePostReplyContainer" id="reply_div_<%= document.id %>" style="display:<%= count == 0 ? 'none' : 'block' %>"> <div class="homepagePostReplyContainer" id="reply_div_<%= document.id %>" style="display:<%= count == 0 ? 'none' : 'block' %>">
<ul> <ul>
<% reply_id = 0 %> <% reply_id = 0 %>
<% comments_for_doc.each do |comment| %> <% comments_for_doc.each do |comment| %>
<% reply_id += 1 %> <% reply_id += 1 %>
<li style="display:<%= reply_id > 3 ? 'none' : '' %>"> <li style="display:<%= reply_id > 3 ? 'none' : '' %>">
<div class="homepagePostReplyPortrait"><%= link_to image_tag(url_to_avatar(User.find(comment.creator_id)), :width => 33, :height => 33, :alt => "用户头像"), user_url_in_org(comment.creator_id) %></div> <div class="homepagePostReplyPortrait"><%= link_to image_tag(url_to_avatar(User.find(comment.creator_id)), :width => 33, :height => 33, :alt => "用户头像"), user_url_in_org(comment.creator_id) %></div>
<div class="homepagePostReplyDes"> <div class="homepagePostReplyDes">
<div class="homepagePostReplyPublisher"> <div class="homepagePostReplyPublisher">
<%= link_to User.find(comment.creator_id), user_url_in_org(comment.creator_id), :class => "newsBlue mr10 f14" %> <%= link_to User.find(comment.creator_id), user_url_in_org(comment.creator_id), :class => "newsBlue mr10 f14" %>
<%= format_activity_day(comment.created_at) %> <%= format_time(comment.created_at, false) %> <%= format_activity_day(comment.created_at) %> <%= format_time(comment.created_at, false) %>
<span id="reply_praise_count_<%=comment.id %>"> <span id="reply_praise_count_<%=comment.id %>">
<% if comment.creator_id.to_i == User.current.id.to_i %> <% if comment.creator_id.to_i == User.current.id.to_i %>
<span class="fr likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(comment) > 0 ? "#{get_praise_num(comment)}" : "" %></span></span> <span class="fr likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(comment) > 0 ? "#{get_praise_num(comment)}" : "" %></span></span>
<% else %> <% else %>
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
<% end %> <% end %>
</span> </span>
</div> </div>
<% unless comment.content.blank? %> <% unless comment.content.blank? %>
<div class="homepagePostReplyContent"><%= comment.content.html_safe %></div> <div class="homepagePostReplyContent"><%= comment.content.html_safe %></div>
<% end %> <% end %>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</li> </li>
<% end %> <% end %>
</ul> </ul>
</div> </div>
<div class="homepagePostReplyContainer borderBottomNone minHeight48"> <div class="homepagePostReplyContainer borderBottomNone minHeight48">
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= act.id %>"> <div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= act.id %>">
<%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33", :alt => "用户头像"), user_url_in_org(User.current) %> <%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33", :alt => "用户头像"), user_url_in_org(User.current.id) %>
</div> </div>
<div class="homepagePostReplyInputContainer"> <div class="homepagePostReplyInputContainer">
<div nhname='new_message_<%= act.id %>' style="display:none;"> <div nhname='new_message_<%= act.id %>' style="display:none;">
<%= form_for('new_form', :url => add_reply_org_document_comment_path(:id => document.id, :act_id => act.id, :flag => flag), :method => "post", :remote => true) do |f| %> <%= form_for('new_form', :url => add_reply_org_document_comment_path(:id => document.id, :act_id => act.id, :flag => flag), :method => "post", :remote => true) do |f| %>
<input type="hidden" name="org_activity_id" value="<%= act.id %>"/> <input type="hidden" name="org_activity_id" value="<%= act.id %>"/>
<div nhname='toolbar_container_<%= act.id %>'></div> <div nhname='toolbar_container_<%= act.id %>'></div>
<textarea placeholder="有问题或建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= act.id %>' name="org_content"></textarea> <textarea placeholder="有问题或建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= act.id %>' name="org_content"></textarea>
<a id="new_message_submit_btn_<%= act.id %>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;line-height:18px;">发送</a> <a id="new_message_submit_btn_<%= act.id %>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;line-height:18px;">发送</a>
<div class="cl"></div> <div class="cl"></div>
<p nhname='contentmsg_<%= act.id %>'></p> <p nhname='contentmsg_<%= act.id %>'></p>
<% end %> <% end %>
</div> </div>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
function expand_reply(container, btnid) { function expand_reply(container, btnid) {
var target = $(container); var target = $(container);
var btn = $(btnid); var btn = $(btnid);
if (btn.data('init') == '0') { if (btn.data('init') == '0') {
btn.data('init', 1); btn.data('init', 1);
btn.html('收起回复'); btn.html('收起回复');
target.show(); target.show();
} else { } else {
btn.data('init', 0); btn.data('init', 0);
btn.html('展开更多'); btn.html('展开更多');
target.hide(); target.hide();
target.eq(0).show(); target.eq(0).show();
target.eq(1).show(); target.eq(1).show();
target.eq(2).show(); target.eq(2).show();
} }
} }
</script> </script>

View File

@ -1,4 +1,5 @@
<ul class="orgListRow"> <ul class="orgListRow">
<li class="orgOrder fb">顺序</li>
<li class="orgListUser fb">已有栏目</li> <li class="orgListUser fb">已有栏目</li>
<li class="orgListStatus fb">状态</li> <li class="orgListStatus fb">状态</li>
<li class="orgListStatus fb">类型</li> <li class="orgListStatus fb">类型</li>
@ -6,48 +7,64 @@
<div class="cl"></div> <div class="cl"></div>
</ul> </ul>
<% default_fields.each do |field| %>
<% name = get_default_name(field) %>
<ul class="orgListRow">
<li class="orgListUser"><%= name %></li>
<li class="orgListStatus">默认</li>
<li class="orgListStatus">默认</li>
<a href="javascript:void(0);" class="linkBlue fr mr10" onclick="hide($(this),'<%= field.id %>');" id="hide_<%= field.id %>"><%= field.hide==0?"设为隐藏":"设为可见" %></a>
<div class="cl"></div>
</ul>
<% end %>
<% subfields.each do |field| %> <% subfields.each do |field| %>
<ul class="orgListRow"> <% if is_default_field?(field) %>
<li class="orgListUser"> <% name = get_default_name(field) %>
<div id="subfield_show_<%= field.id %>"><%= field.name %></div> <ul class="orgListRow">
<div id="subfield_edit_<%= field.id %>" style="display:none;"> <li class="orgOrder">
<input type="text" name="name" onblur="update_subfield('#subfield_show_<%= field.id %>','#subfield_edit_<%= field.id %>','<%= field.id %>',$(this).val());" value="<%= field.name %>" style="width:70px;"/> <div id="show_priority_<%= field.id %>" ondblclick="edit_priority('#show_priority_<%= field.id %>','#edit_priority_<%= field.id %>');" style="cursor:pointer;background-color:#fffce6;color: #0d90c3;" title="双击可编辑">
</div> <%= field.priority %>
</li>
<li class="orgListStatus">新增</li>
<li class="orgListStatus"><%= field.field_type == "Post" ? "帖子" : "资源" %></li>
<li class="orgListUser hidden">
<% if Secdomain.where("sub_type=2 and pid=?", @organization.id).count > 0 %>
<div id="sub_dir_show_<%= field.id %>" ondblclick="edit_dir('#sub_dir_show_<%= field.id %>','#sub_dir_edit_<%= field.id %>');" style="cursor:pointer;background-color:#fffce6;color: #0d90c3;" title="双击可编辑">
<%= field.subfield_subdomain_dir.nil? ? '未设置': field.subfield_subdomain_dir.name %>
</div> </div>
<% else %> <div id="edit_priority_<%= field.id %>" style="display:none;width:30px;">
<div id="sub_dir_show_<%= field.id %>" > <input type="text" onblur="update_priority('#show_priority_<%= field.id %>','#edit_priority_<%= field.id %>','<%= field.id %>',$(this).val());" style="width:20px;" value="<%= field.priority %>"/>
<%= field.subfield_subdomain_dir.nil? ? '未设置': field.subfield_subdomain_dir.name %>
</div> </div>
<% end %> </li>
<div id="sub_dir_edit_<%= field.id %>" style="display:none;"> <li class="orgListUser"><%= name %></li>
<input type="text" name="name" onblur="update_sub_dir('#sub_dir_show_<%= field.id %>','#sub_dir_edit_<%= field.id %>','<%= field.id %>',$(this).val());" value="<%= field.subfield_subdomain_dir.nil? ? '': field.subfield_subdomain_dir.name %>" style="width:70px;"/> <li class="orgListStatus">默认</li>
</div> <li class="orgListStatus">默认</li>
</li> <a href="javascript:void(0);" class="linkBlue fr mr10" onclick="hide($(this),'<%= field.id %>');" id="hide_<%= field.id %>"><%= field.hide==0?"设为隐藏":"设为可见" %></a>
<%#= link_to "隐藏", hide_org_subfield_organizations_path(field), :method => 'post', :remote => true, :id => "hide_#{field.id}", :class => "linkBlue fr mr5" %> <div class="cl"></div>
<a href="javascript:void(0);" class="linkBlue fr mr10" onclick="hide($(this),'<%= field.id %>');" id="hide_<%= field.id %>"><%= field.hide==0?"设为隐藏":"设为可见" %></a> </ul>
<%= link_to "删除", org_subfield_path(field), :method => 'delete', :remote => true, :confirm => "您确定删除吗?", :class => "linkBlue fr mr10" %> <% else %>
<a href="javascript:void(0);" class="linkBlue fr mr10" onclick="edit('#subfield_show_<%= field.id %>','#subfield_edit_<%= field.id %>');">编辑</a> <ul class="orgListRow">
<li class="orgOrder">
<div id="show_priority_<%= field.id %>" ondblclick="edit_priority('#show_priority_<%= field.id %>','#edit_priority_<%= field.id %>');" style="cursor:pointer;background-color:#fffce6;color: #0d90c3;" title="双击可编辑">
<%= field.priority %>
</div>
<div id="edit_priority_<%= field.id %>" style="display:none;width:30px;">
<input type="text" onblur="update_priority('#show_priority_<%= field.id %>','#edit_priority_<%= field.id %>','<%= field.id %>',$(this).val());" style="width:20px;" value="<%= field.priority %>"/>
</div>
</li>
<li class="orgListUser">
<div id="subfield_show_<%= field.id %>"><%= field.name %></div>
<div id="subfield_edit_<%= field.id %>" style="display:none;">
<input type="text" name="name" onblur="update_subfield('#subfield_show_<%= field.id %>','#subfield_edit_<%= field.id %>','<%= field.id %>',$(this).val());" value="<%= field.name %>" style="width:70px;"/>
</div>
</li>
<li class="orgListStatus">新增</li>
<li class="orgListStatus"><%= field.field_type == "Post" ? "帖子" : "资源" %></li>
<li class="orgListUser hidden">
<% if Secdomain.where("sub_type=2 and pid=?", @organization.id).count > 0 %>
<div id="sub_dir_show_<%= field.id %>" ondblclick="edit_dir('#sub_dir_show_<%= field.id %>','#sub_dir_edit_<%= field.id %>');" style="cursor:pointer;background-color:#fffce6;color: #0d90c3;" title="双击可编辑">
<%= field.subfield_subdomain_dir.nil? ? '未设置': field.subfield_subdomain_dir.name %>
</div>
<% else %>
<div id="sub_dir_show_<%= field.id %>" >
<%= field.subfield_subdomain_dir.nil? ? '未设置': field.subfield_subdomain_dir.name %>
</div>
<% end %>
<div id="sub_dir_edit_<%= field.id %>" style="display:none;">
<input type="text" name="name" onblur="update_sub_dir('#sub_dir_show_<%= field.id %>','#sub_dir_edit_<%= field.id %>','<%= field.id %>',$(this).val());" value="<%= field.subfield_subdomain_dir.nil? ? '': field.subfield_subdomain_dir.name %>" style="width:70px;"/>
</div>
</li>
<%#= link_to "隐藏", hide_org_subfield_organizations_path(field), :method => 'post', :remote => true, :id => "hide_#{field.id}", :class => "linkBlue fr mr5" %>
<a href="javascript:void(0);" class="linkBlue fr mr10" onclick="hide($(this),'<%= field.id %>');" id="hide_<%= field.id %>"><%= field.hide==0?"设为隐藏":"设为可见" %></a>
<%= link_to "删除", org_subfield_path(field), :method => 'delete', :remote => true, :confirm => "您确定删除吗?", :class => "linkBlue fr mr10" %>
<a href="javascript:void(0);" class="linkBlue fr mr10" onclick="edit('#subfield_show_<%= field.id %>','#subfield_edit_<%= field.id %>');">编辑</a>
<div class="cl"></div> <div class="cl"></div>
</ul> </ul>
<% end %>
<% end %> <% end %>
<script> <script>
@ -96,6 +113,35 @@
$(show_id).show(); $(show_id).show();
$(edit_id).hide(); $(edit_id).hide();
} }
function edit_priority(show_id, edit_id){
$(show_id).toggle();
$(edit_id).toggle();
$(edit_id).find("input").focus();
$(edit_id).find("input").on('keypress',function(e){
if (e.keyCode == 13){
this.blur();
}
});
}
function update_priority(show_id, edit_id, field_id, input_value){
var re = /^[0-9]*[1-9]*[0-9]$/
if(re.test(input_value) && $(show_id).html().trim() != input_value.trim() && input_value.trim() != ''){
if(confirm("确定修改为" + input_value + "?")){
$.ajax({
url: "/org_subfields/" + field_id + "/update_priority?priority=" + input_value,
type: 'put'
});
}
}
else
{
$(edit_id).find("input").val($(show_id).html().trim());
}
$(show_id).show();
$(edit_id).hide();
}
function hide(content, id){ function hide(content, id){
if (content.text() == '设为隐藏') if (content.text() == '设为隐藏')
$.ajax({ $.ajax({

View File

@ -70,7 +70,7 @@
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<div class="orgRow mb10 mt5"><span style="margin-left:38px;" >公开&nbsp;: </span> <div class="orgRow mb10 mt5"><span style="margin-left:38px;" >公开&nbsp;: </span>
<input type="checkbox" id="is_public" onblur="disable_down($(this), $('#allow_download'),$('#allow_down_hint'));" name="organization[is_public]" <%= @organization.is_public ? 'checked': ''%> class="ml3" /> <input type="checkbox" id="is_public" onclick="disable_down($(this), $('#allow_download'),$('#allow_down_hint'));" name="organization[is_public]" <%= @organization.is_public ? 'checked': ''%> class="ml3" />
</div> </div>
<div class="orgRow mb10 mt5"><span style="margin-left:10px;">下载支持&nbsp;: </span> <div class="orgRow mb10 mt5"><span style="margin-left:10px;">下载支持&nbsp;: </span>
<input id="allow_download" type="checkbox" style="margin-top:5px;" <%= @organization.is_public? ? "":"DISABLED" %> name="organization[allow_guest_download]" <%= @organization.allow_guest_download ? 'checked': ''%> class="ml3" /> <input id="allow_download" type="checkbox" style="margin-top:5px;" <%= @organization.is_public? ? "":"DISABLED" %> name="organization[allow_guest_download]" <%= @organization.allow_guest_download ? 'checked': ''%> class="ml3" />
@ -119,8 +119,7 @@
</div> </div>
<div class="undis ml15 mr15" id="orgContent_3"> <div class="undis ml15 mr15" id="orgContent_3">
<div class="orgMemberList" id="org_subfield_list"> <div class="orgMemberList" id="org_subfield_list">
<%= render :partial => 'organizations/subfield_list', :locals => {:default_fields => @organization.org_subfields.where("field_type='default'"), <%= render :partial => 'organizations/subfield_list', :locals => {:subfields => @organization.org_subfields.order("priority")} %>
:subfields => @organization.org_subfields.where("field_type != 'default'") } %>
</div> </div>
<div class="fr orgMemContainer"> <div class="fr orgMemContainer">
<div class="fr"> <div class="fr">

View File

@ -66,7 +66,7 @@
<%= render :partial => 'projects/project_create', :locals => {:activity => activity, :user_activity_id => activity.id} %> <%= render :partial => 'projects/project_create', :locals => {:activity => activity, :user_activity_id => activity.id} %>
<!--缺陷动态--> <!--缺陷动态-->
<% when "Issue" %> <% when "Issue" %>
<%= render :partial => 'users/project_issue', :locals => {:activity => activity.forge_act, :user_activity_id => activity.id} %> <%= render :partial => 'users/project_issue', :locals => {:activity => activity.forge_act, :user_activity_id => activity.id, :project_id => activity.project_id} %>
<!--message --> <!--message -->
<% when "Message" %> <% when "Message" %>
@ -78,7 +78,7 @@
<% end %> <% end %>
<!--Attachment --> <!--Attachment -->
<% when "Attachment" %> <% when "Attachment" %>
<%= render :partial => 'users/course_attachment', :locals => {:activity => activity.forge_act, :user_activity_id => activity.id } %> <%= render :partial => 'users/project_attachment', :locals => {:activity => activity.forge_act, :user_activity_id => activity.id } %>
<!--<div class="problem_main">--> <!--<div class="problem_main">-->
<!--<a class="problem_pic fl"><%#= image_tag(url_to_avatar(activity.user), :width => "42", :height => "42") %></a>--> <!--<a class="problem_pic fl"><%#= image_tag(url_to_avatar(activity.user), :width => "42", :height => "42") %></a>-->

View File

@ -1,7 +1,7 @@
<% if @project.is_public? %> <% if @project.is_public? %>
$("#set_project_public_<%= @project.id %>").text("设为私有");
$("#show_project_<%= @project.id %>").attr("title","公开项目:<%= @project.name %>"); $("#show_project_<%= @project.id %>").attr("title","公开项目:<%= @project.name %>");
<% else %> <% else %>
$("#set_project_public_<%= @project.id %>").text("设为公开");
$("#show_project_<%= @project.id %>").attr("title","私有项目:<%= @project.name %>"); $("#show_project_<%= @project.id %>").attr("title","私有项目:<%= @project.name %>");
<% end %> <% end %>
$("#set_project_public_<%= @project.id %>").replaceWith('<%= escape_javascript(link_to @project.is_public? ? "设为私有" : "设为公开", {:controller => "projects", :action => "set_public_or_private", :id => @project.id,:user_page => true},
:id => "set_project_public_"+ @project.id.to_s,:method => "post",:remote=>true,:confirm=>"您确定要设置为"+(@project.is_public? ? "私有" : "公开")+"吗") %>');

View File

@ -25,7 +25,7 @@
<li > <li >
<span class="tit_fb ">编程代码:</span> <span class="tit_fb ">编程代码:</span>
<div class="showHworkP break_word"><pre id="work-src" style="display: none;"><%= work.description if work.description%></pre><div class="fontGrey2 font_cus" id="work-code_<%= work.id%>"> <div class="showHworkP break_word"><pre id="work-src_<%= work.id%>" style="display: none;"><%= work.description if work.description%></pre><div class="fontGrey2 font_cus" id="work-code_<%= work.id%>">
</div> </div>
</div> </div>
<div class="cl"></div> <div class="cl"></div>

View File

@ -59,8 +59,8 @@
<li > <li >
<span class="tit_fb ">内容:</span> <span class="tit_fb ">内容:</span>
<div class="showHworkP break_word"> <div class="showHworkP break_word upload_img" id="student_work_img_<%=work.id %>">
<%= text_format(work.description) if work.description%> <%= work.description.html_safe if work.description%>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</li> </li>
@ -105,6 +105,9 @@
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
$(function(){
showNormalImage('student_work_img_<%=work.id %>');
});
function show_upload(){ function show_upload(){
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'student_work/upload_attachment' ,:locals => {:work=>work})%>'); $("#ajax-modal").html('<%= escape_javascript( render :partial => 'student_work/upload_attachment' ,:locals => {:work=>work})%>');
showModal('ajax-modal', '452px'); showModal('ajax-modal', '452px');

View File

@ -71,7 +71,7 @@
indentUnit: 2, indentUnit: 2,
matchBrackets: true, matchBrackets: true,
readOnly: true, readOnly: true,
value: $("#work-src").text() value: $("#work-src_<%= work.id%>").text()
}); });
<% elsif @homework.homework_type == 1 %> <% elsif @homework.homework_type == 1 %>
$("#about_hwork_<%= work.id%>").html("<%= escape_javascript(render :partial => 'show',:locals => {:work => work, :score =>student_work_score(work,User.current),:student_work_scores => work.student_works_scores.order("updated_at desc")}) %>"); $("#about_hwork_<%= work.id%>").html("<%= escape_javascript(render :partial => 'show',:locals => {:work => work, :score =>student_work_score(work,User.current),:student_work_scores => work.student_works_scores.order("updated_at desc")}) %>");

View File

@ -4,9 +4,11 @@
<p class="f14 mt5"> <p class="f14 mt5">
<span class="fb">作品名称:</span><%=@student_work.name%> <span class="fb">作品名称:</span><%=@student_work.name%>
</p> </p>
<p class="f14 mt5"> <div class="f14 mt5" style="max-width: 425px; color:#808181">
<span class="fb">作品描述:</span><%=@student_work.description%> <div class="fb fl dis">作品描述:</div>
</p> <div class="upload_img fl" style="max-width: 350px;"><%=@student_work.description.html_safe %></div>
<div class="cl"></div>
</div>
<p class="mt5"> <p class="mt5">
<span class="fl fb mr30">附</span><span class="fb fl">件:</span> <span class="fl fb mr30">附</span><span class="fb fl">件:</span>
<% if @student_work.attachments.empty? %> <% if @student_work.attachments.empty? %>

View File

@ -4,9 +4,11 @@
<p class="f14 mt5"> <p class="f14 mt5">
<span class="fb">作品名称:</span><%=@student_work.name%> <span class="fb">作品名称:</span><%=@student_work.name%>
</p> </p>
<p class="f14 mt5"> <div class="f14 mt5" style="max-width: 425px; color:#808181">
<span class="fb">作品描述:</span><%=@student_work.description%> <div class="fb fl dis">作品描述:</div>
</p> <div class="upload_img fl" style="max-width: 350px;"><%=@student_work.description.html_safe %></div>
<div class="cl"></div>
</div>
<p class="mt5"> <p class="mt5">
<span class="fl fb mr30">附</span><span class="fb fl">件:</span> <span class="fl fb mr30">附</span><span class="fb fl">件:</span>
<% if @student_work.attachments.empty? %> <% if @student_work.attachments.empty? %>

View File

@ -1,3 +1,7 @@
<% content_for :header_tags do %>
<%= import_ke(enable_at: true, prettify: false, init_activity: false) %>
<%= javascript_include_tag 'homework','baiduTemplate' %>
<% end %>
<div class="homepageRightBanner mb10"> <div class="homepageRightBanner mb10">
<div class="NewsBannerName">编辑作品</div> <div class="NewsBannerName">编辑作品</div>
</div> </div>
@ -25,7 +29,7 @@
</div><!----HomeWorkBox end--> </div><!----HomeWorkBox end-->
<div class="cl"></div> <div class="cl"></div>
<div class="HomeWorkCon mt15"> <div class="HomeWorkCon mt15" nhname='student_work_form'>
<%= labelled_form_for @work,:html => { :multipart => true },:remote=>true do |f|%> <%= labelled_form_for @work,:html => { :multipart => true },:remote=>true do |f|%>
<div class=" c_red mb10"> <div class=" c_red mb10">
提示:作品名称和描述中不要出现真实的姓名信息 提示:作品名称和描述中不要出现真实的姓名信息
@ -46,13 +50,16 @@
<p id="student_work_name_span" class="c_red mb10"></p> <p id="student_work_name_span" class="c_red mb10"></p>
</div> </div>
<div class="mt10"> <div class="mt10">
<textarea name="student_work[description]" id="student_work_description" placeholder="请输入作品描述" class="InputBox W700 H150" maxlength="6000" onkeyup="regexStudentWorkDescription();"><%= @work.description%></textarea> <textarea placeholder="请输入作品描述" style="display: none" nhname='student_work_textarea' name="student_work[description]"><%= @work.description%></textarea>
<script> <!--<textarea name="student_work[description]" id="student_work_description" placeholder="请输入作品描述" class="InputBox W700 H150" maxlength="6000" onkeyup="regexStudentWorkDescription();"><%#= @work.description%></textarea>-->
<!--<script>
var text = document.getElementById("student_work_description"); var text = document.getElementById("student_work_description");
autoTextarea(text);// 调用 autoTextarea(text);// 调用
</script> </script>-->
<div class="cl"></div> <div class="cl"></div>
<p id="student_work_description_textarea" class="c_red mb10"></p> <p id="student_work_description_textarea" class="c_red mb10"></p>
<p id="e_tip" class="c_grey"></p>
<p id="e_tips" class="c_grey"></p>
</div> </div>
<div id="homework_attachments"> <div id="homework_attachments">
@ -66,7 +73,7 @@
<% end %> <% end %>
<div class="mt5"> <div class="mt5">
<a href="javascript:void(0);" class="BlueCirBtnMini fr" onclick="popupRegex();edit_student_work(<%= @work.id%>);">确定</a> <a href="javascript:void(0);" class="BlueCirBtnMini fr" id="new_message_submit_btn">确定</a>
<span class="fr mr10 mt3">或</span> <span class="fr mr10 mt3">或</span>
<%= link_to "取消", student_work_index_path(:homework => @homework), :class => "fr mr10 mt3"%> <%= link_to "取消", student_work_index_path(:homework => @homework), :class => "fr mr10 mt3"%>
</div> </div>
@ -96,23 +103,130 @@
} }
function popupRegex(){ function popupRegex(){
if(regexStudentWorkName()&&regexStudentWorkDescription()) if($("#group_member_ids").length > 0) {
{ if(regexStudentWorkMember(parseInt($.trim($("#min_num_member").html())),parseInt($.trim($("#max_num_member").html())))) {
if($("#group_member_ids").length > 0) {
if(regexStudentWorkMember(parseInt($.trim($("#min_num_member").html())),parseInt($.trim($("#max_num_member").html())))) {
$('#ajax-modal').html("<div><p align='center' style='margin-top: 35px'>作品信息完整性校验中,请稍等...</p></div>");
showModal('ajax-modal', '500px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9");
$('#ajax-modal').parent().addClass("anonymos");
}
} else {
$('#ajax-modal').html("<div><p align='center' style='margin-top: 35px'>作品信息完整性校验中,请稍等...</p></div>"); $('#ajax-modal').html("<div><p align='center' style='margin-top: 35px'>作品信息完整性校验中,请稍等...</p></div>");
showModal('ajax-modal', '500px'); showModal('ajax-modal', '500px');
$('#ajax-modal').siblings().remove(); $('#ajax-modal').siblings().remove();
$('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9"); $('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9");
$('#ajax-modal').parent().addClass("anonymos"); $('#ajax-modal').parent().addClass("anonymos");
} }
} else {
$('#ajax-modal').html("<div><p align='center' style='margin-top: 35px'>作品信息完整性校验中,请稍等...</p></div>");
showModal('ajax-modal', '500px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9");
$('#ajax-modal').parent().addClass("anonymos");
} }
} }
function nh_check_field(params){
var result=true;
if(!regexStudentWorkName()) {
result=false;
return result;
}
if(params.content!=undefined){
if(params.content.isEmpty()){
result=false;
}
if(params.content.html()!=params.textarea.html() || params.issubmit==true){
params.textarea.html(params.content.html());
params.content.sync();
if(params.content.isEmpty()){
params.contentmsg.html('作品描述不能为空');
}else{
params.contentmsg.html('');
}
}
}
return result;
}
function init_homework_form(params){
params.form.submit(function(){
params.textarea.html(params.editor.html());
params.editor.sync();
var flag = false;
if(params.form.attr('data-remote') != undefined ){
flag = true
}
var is_checked = nh_check_field({
issubmit:true,
content:params.editor,
contentmsg:params.contentmsg,
textarea:params.textarea
});
if(is_checked){
if(flag){
popupRegex();
return true;
}else{
$(this)[0].submit();
$("#ajax-indicator").hide();
return false;
}
}
return false;
});
}
function init_homework_editor(params){
params.textarea.removeAttr('placeholder');
var editor = params.kindutil.create(params.textarea, {
resizeType : 1,minWidth:"1px",width:"100%",minHeight:"30px",height:"30px",
items : ['code','emoticons','fontname',
'forecolor', 'hilitecolor', 'bold', '|', 'justifyleft', 'justifycenter', 'insertorderedlist','insertunorderedlist', '|',
'formatblock', 'fontsize', '|','indent', 'outdent',
'|','imagedirectupload','table', 'media', 'preview',"more"
],
afterChange:function(){//按键事件
var edit = this.edit;
var body = edit.doc.body;
//paramsHeight = params.kindutil.removeUnit(this.height);
edit.iframe.height(150);
this.resize(null, Math.max((params.kindutil.IE ? body.scrollHeight : body.offsetHeight) + 33, 150));
},
afterCreate:function(){
//init
var edit = this.edit;
var body = edit.doc.body;
edit.iframe[0].scroll = 'no';
body.style.overflowY = 'hidden';
//reset height
var edit = this.edit;
var body = edit.doc.body;
edit.html(params.textarea.innerHTML);
//paramsHeight = params.kindutil.removeUnit(this.height);
edit.iframe.height(150);
this.resize(null, Math.max((params.kindutil.IE ? body.scrollHeight : body.offsetHeight) , 150));
elocalStorage(editor2,'student_work_<%=@work.id %>');
}
}).loadPlugin('paste');
return editor;
}
KindEditor.ready(function(K){
$("div[nhname='student_work_form']").each(function(){
var params = {};
params.kindutil = K;
params.div_form = $(this);
params.form = $("form",params.div_form);
if(params.form==undefined || params.form.length==0){
return;
}
params.textarea = $("textarea[nhname='student_work_textarea']",params.div_form);
params.contentmsg = $("#student_work_description_textarea");
params.submit_btn = $("#new_message_submit_btn");
if(params.textarea.data('init') == undefined) {
params.editor = init_homework_editor(params);
editor2 = params.editor;
init_homework_form(params);
params.submit_btn.click(function () {
params.form.submit();
$("#ajax-indicator").hide();
});
params.textarea.data('init', 1);
}
});
});
</script> </script>

View File

@ -172,7 +172,7 @@
<div class="mt5"> <div class="mt5">
<% if @homework.homework_detail_manual && @homework.homework_detail_manual.comment_status < 2 %> <% if @homework.homework_detail_manual && @homework.homework_detail_manual.comment_status < 2 %>
<div class="fontGrey2 db fl">提交截止时间:<%= @homework.end_time %>&nbsp;23:59</div> <div class="fontGrey2 db fl">提交截止时间:<%= @homework.end_time %>&nbsp;23:59</div>
<% elsif @homework.homework_detail_manual && @homework.homework_detail_manual.comment_status >= 2 %> <% 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 %>&nbsp;23:59</div> <div class="fontGrey2 db fl">匿评截止时间:<%= @homework.homework_detail_manual.evaluation_end %>&nbsp;23:59</div>
<% end %> <% end %>
<% if @homework.homework_detail_manual.comment_status == 0 %> <% if @homework.homework_detail_manual.comment_status == 0 %>

View File

@ -1,4 +1,9 @@
<!-- 此界面只用来新建匿评作业作品 --> <!-- 此界面只用来新建匿评作业作品 -->
<% content_for :header_tags do %>
<%= import_ke(enable_at: true, prettify: false, init_activity: false) %>
<%= javascript_include_tag 'homework','baiduTemplate' %>
<% end %>
<script type="text/javascript"> <script type="text/javascript">
<%if @homework.homework_detail_manual.comment_status != 1%> <%if @homework.homework_detail_manual.comment_status != 1%>
$(function(){ $(function(){
@ -57,26 +62,136 @@
} }
// 作品校验 // 作品校验
function popupRegex(){ function popupRegex(){
if(regexStudentWorkName()&&regexStudentWorkDescription()) if($("#group_member_ids").length > 0) {
{ if(regexStudentWorkMember(parseInt($.trim($("#min_num_member").html())),parseInt($.trim($("#max_num_member").html())))) {
if($("#group_member_ids").length > 0) {
if(regexStudentWorkMember(parseInt($.trim($("#min_num_member").html())),parseInt($.trim($("#max_num_member").html())))) {
$('#ajax-modal').html("<div><p align='center' style='margin-top: 35px'>作品信息完整性校验中,请稍等...</p></div>");
showModal('ajax-modal', '500px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9");
$('#ajax-modal').parent().addClass("anonymos");
}
} else {
$('#ajax-modal').html("<div><p align='center' style='margin-top: 35px'>作品信息完整性校验中,请稍等...</p></div>"); $('#ajax-modal').html("<div><p align='center' style='margin-top: 35px'>作品信息完整性校验中,请稍等...</p></div>");
showModal('ajax-modal', '500px'); showModal('ajax-modal', '500px');
$('#ajax-modal').siblings().remove(); $('#ajax-modal').siblings().remove();
$('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9"); $('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9");
$('#ajax-modal').parent().addClass("anonymos"); $('#ajax-modal').parent().addClass("anonymos");
} }
} else {
$('#ajax-modal').html("<div><p align='center' style='margin-top: 35px'>作品信息完整性校验中,请稍等...</p></div>");
showModal('ajax-modal', '500px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9");
$('#ajax-modal').parent().addClass("anonymos");
} }
} }
var KE = {
MDU: "1234455",//当前文章标识符
};
function nh_check_field(params){
var result=true;
if(!regexStudentWorkName()) {
result=false;
return result;
}
if(params.content!=undefined){
if(params.content.isEmpty()){
result=false;
}
if(params.content.html()!=params.textarea.html() || params.issubmit==true){
params.textarea.html(params.content.html());
params.content.sync();
if(params.content.isEmpty()){
params.contentmsg.html('作品描述不能为空');
}else{
params.contentmsg.html('');
}
}
}
return result;
}
function init_homework_form(params){
params.form.submit(function(){
params.textarea.html(params.editor.html());
params.editor.sync();
var flag = false;
if(params.form.attr('data-remote') != undefined ){
flag = true
}
var is_checked = nh_check_field({
issubmit:true,
content:params.editor,
contentmsg:params.contentmsg,
textarea:params.textarea
});
if(is_checked){
if(flag){
popupRegex();
return true;
}else{
$(this)[0].submit();
$("#ajax-indicator").hide();
return false;
}
}
return false;
});
}
function init_homework_editor(params){
params.textarea.removeAttr('placeholder');
var editor = params.kindutil.create(params.textarea, {
resizeType : 1,minWidth:"1px",width:"100%",minHeight:"30px",height:"30px",
items : ['code','emoticons','fontname',
'forecolor', 'hilitecolor', 'bold', '|', 'justifyleft', 'justifycenter', 'insertorderedlist','insertunorderedlist', '|',
'formatblock', 'fontsize', '|','indent', 'outdent',
'|','imagedirectupload','table', 'media', 'preview',"more"
],
afterChange:function(){//按键事件
var edit = this.edit;
var body = edit.doc.body;
//paramsHeight = params.kindutil.removeUnit(this.height);
edit.iframe.height(150);
this.resize(null, Math.max((params.kindutil.IE ? body.scrollHeight : body.offsetHeight) + 33, 150));
},
afterCreate:function(){
//init
var edit = this.edit;
var body = edit.doc.body;
edit.iframe[0].scroll = 'no';
body.style.overflowY = 'hidden';
//reset height
var edit = this.edit;
var body = edit.doc.body;
edit.html(params.textarea.innerHTML);
//paramsHeight = params.kindutil.removeUnit(this.height);
edit.iframe.height(150);
this.resize(null, Math.max((params.kindutil.IE ? body.scrollHeight : body.offsetHeight) , 150));
elocalStorage(editor2,'student_work_<%=@homework.id %>');
}
}).loadPlugin('paste');
return editor;
}
KindEditor.ready(function(K){
$("div[nhname='student_work_form']").each(function(){
var params = {};
params.kindutil = K;
params.div_form = $(this);
params.form = $("form",params.div_form);
if(params.form==undefined || params.form.length==0){
return;
}
params.textarea = $("textarea[nhname='student_work_textarea']",params.div_form);
params.contentmsg = $("#student_work_description_textarea");
params.submit_btn = $("#new_message_submit_btn");
if(params.textarea.data('init') == undefined) {
params.editor = init_homework_editor(params);
editor2 = params.editor;
init_homework_form(params);
params.submit_btn.click(function () {
params.form.submit();
$("#ajax-indicator").hide();
});
params.textarea.data('init', 1);
}
});
});
</script> </script>
<div class="homepageRightBanner mb10"> <div class="homepageRightBanner mb10">
@ -110,7 +225,7 @@
</div><!----HomeWorkBox end--> </div><!----HomeWorkBox end-->
<div class="cl"></div> <div class="cl"></div>
<div class="HomeWorkCon mt15"> <div class="HomeWorkCon mt15" nhname='student_work_form'>
<%= form_for(@student_work, <%= form_for(@student_work,
:html => { :multipart => true }, :html => { :multipart => true },
:url => {:controller => 'student_work', :url => {:controller => 'student_work',
@ -127,18 +242,21 @@
<%=hidden_field_tag 'group_member_ids', params[:group_member_ids], :value=>User.current.id %> <%=hidden_field_tag 'group_member_ids', params[:group_member_ids], :value=>User.current.id %>
<% end %> <% end %>
<div> <div>
<%= f.text_field "name", :required => true, :size => 60, :class => "InputBox W700", :maxlength => 200, :placeholder => "请输入作品名称", :onkeyup => "regexStudentWorkName();" %> <%= f.text_field "name", :required => true, :size => 60, :class => "InputBox W700", :maxlength => 200, :placeholder => "请输入作品名称",:value=>"#{@homework.name}的作品提交", :onkeyup => "regexStudentWorkName();" %>
<div class="cl"></div> <div class="cl"></div>
<p id="student_work_name_span" class="c_red mb10"></p> <p id="student_work_name_span" class="c_red mb10"></p>
</div> </div>
<div class="mt10"> <div class="mt10">
<%= f.text_area "description", :class => "InputBox W700 H150", :placeholder => "请输入作品描述", :onkeyup => "regexStudentWorkDescription();"%> <textarea placeholder="请输入作品描述" style="display: none" nhname='student_work_textarea' name="student_work[description]"></textarea>
<script> <%#= f.text_area "description", :class => "InputBox W700 H150", :placeholder => "请输入作品描述", :onkeyup => "regexStudentWorkDescription();"%>
<!--<script>
var text = document.getElementById("student_work_description"); var text = document.getElementById("student_work_description");
autoTextarea(text);// 调用 autoTextarea(text);// 调用
</script> </script>-->
<div class="cl"></div> <div class="cl"></div>
<p id="student_work_description_textarea" class="c_red mb10"></p> <p id="student_work_description_textarea" class="c_red mb10"></p>
<p id="e_tip" class="c_grey"></p>
<p id="e_tips" class="c_grey"></p>
</div> </div>
<div id="homework_attachments"> <div id="homework_attachments">
@ -167,9 +285,9 @@
</div>--> </div>-->
<div class="mt5"> <div class="mt5">
<a href="javascript:void(0);" class="BlueCirBtnMini fr" onclick="popupRegex();new_student_work();">提交</a> <a href="javascript:void(0);" class="BlueCirBtnMini fr" id="new_message_submit_btn">提交</a>
<span class="fr mr10 mt3">或</span> <span class="fr mr10 mt3">或</span>
<%= link_to "取消", delete_work_student_work_index_path(:homework =>@homework.id), :class => "fr mr10 mt3"%> <%= link_to "取消", delete_work_student_work_index_path(:homework =>@homework.id),:id => 'new_message_cancel_btn', :class => "fr mr10 mt3"%>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<% end%> <% end%>

View File

@ -1,36 +1,36 @@
if($("#about_hwork_<%= @work.id%>").children().length > 0){ if($("#about_hwork_<%= @work.id%>").children().length > 0){
$("#about_hwork_<%= @work.id%>").html(""); $("#about_hwork_<%= @work.id%>").html("");
} }
else{ else{
<% if @homework.homework_type == 2%> <% if @homework.homework_type == 2%>
$("#about_hwork_<%= @work.id%>").html("<%= escape_javascript(render :partial => 'programing_work_show',:locals => {:work =>@work,:score =>@score,:student_work_scores => @student_work_scores}) %>"); $("#about_hwork_<%= @work.id%>").html("<%= escape_javascript(render :partial => 'programing_work_show',:locals => {:work =>@work,:score =>@score,:student_work_scores => @student_work_scores}) %>");
var program_name = "text/x-csrc"; var program_name = "text/x-csrc";
var language = <%= @homework.language %>; var language = <%= @homework.language %>;
if (language == 1) { if (language == 1) {
program_name = 'text/x-csrc'; program_name = 'text/x-csrc';
} else if(language==2){ } else if(language==2){
program_name = 'text/x-c++src'; program_name = 'text/x-c++src';
}else if(language==3){ }else if(language==3){
program_name = 'text/x-cython'; program_name = 'text/x-cython';
} else if(language==4){ } else if(language==4){
program_name = 'text/x-java'; program_name = 'text/x-java';
} }
var editor = CodeMirror(document.getElementById("work-code_<%= @work.id%>"), { var editor = CodeMirror(document.getElementById("work-code_<%= @work.id%>"), {
mode: {name: program_name, mode: {name: program_name,
version: 2, version: 2,
singleLineStringErrors: false}, singleLineStringErrors: false},
lineNumbers: true, lineNumbers: true,
indentUnit: 2, indentUnit: 2,
matchBrackets: true, matchBrackets: true,
readOnly: true, readOnly: true,
value: $("#work-src").text() value: $("#work-src_<%= @work.id%>").text()
} }
); );
<% else%> <% else%>
$("#about_hwork_<%= @work.id%>").html("<%= escape_javascript(render :partial => 'show',:locals => {:work =>@work,:score =>@score,:student_work_scores => @student_work_scores}) %>"); $("#about_hwork_<%= @work.id%>").html("<%= escape_javascript(render :partial => 'show',:locals => {:work =>@work,:score =>@score,:student_work_scores => @student_work_scores}) %>");
<% end%> <% end%>
$('#score_<%= @work.id%>').peSlider({range: 'min'}); $('#score_<%= @work.id%>').peSlider({range: 'min'});
} }

View File

@ -1,23 +1,15 @@
<div class="resources mt10" id="user_activity_<%= user_activity_id%>" onmouseover="$('#message_setting_<%= user_activity_id%>').show();" onmouseout="$('#message_setting_<%= user_activity_id%>').hide();"> <div class="resources mt10" id="user_activity_<%= user_activity_id%>" onmouseover="$('#message_setting_<%= user_activity_id%>').show();" onmouseout="$('#message_setting_<%= user_activity_id%>').hide();">
<div class="homepagePostBrief"> <div class="homepagePostBrief">
<div class="homepagePostPortrait"> <div class="homepagePostPortrait">
<% if activity.status == 1 %> <%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id,:host=>Setting.host_user), :alt => "用户头像" %>
<%= image_tag("/images/trustie_logo1.png", width: "50px", height: "50px") %> <%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
<% else %>
<%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id,:host=>Setting.host_user), :alt => "用户头像" %>
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
<% end %>
</div> </div>
<div class="homepagePostDes"> <div class="homepagePostDes">
<div class="homepagePostTo break_word mt-4"> <div class="homepagePostTo break_word mt-4">
<% if activity.status == 1 %> <% if activity.try(:author).try(:realname) == ' ' %>
<span class="fontBlue2">确实团队</span> <%= link_to activity.try(:author), user_path(activity.author_id,:host=>Setting.host_user), :class => "newsBlue mr15" %>
<% else %> <% else %>
<% if activity.try(:author).try(:realname) == ' ' %> <%= link_to activity.try(:author).try(:realname), user_path(activity.author_id,:host=>Setting.host_user), :class => "newsBlue mr15" %>
<%= link_to activity.try(:author), user_path(activity.author_id,:host=>Setting.host_user), :class => "newsBlue mr15" %>
<% else %>
<%= link_to activity.try(:author).try(:realname), user_path(activity.author_id,:host=>Setting.host_user), :class => "newsBlue mr15" %>
<% end %>
<% end %> <% end %>
TO TO
<%= link_to activity.course.name.to_s+" | 课程问答区", course_boards_path(activity.course,:host=> Setting.host_course), :class => "newsBlue ml15 mr5"%> <%= link_to activity.course.name.to_s+" | 课程问答区", course_boards_path(activity.course,:host=> Setting.host_course), :class => "newsBlue ml15 mr5"%>

View File

@ -1,7 +1,17 @@
<div class="subject-pop-info">题目信息</div> <div class="subject-pop-info">题目信息</div>
<div class="subject-pop-wrap"> <div class="subject-pop-wrap">
<% if homework.nil? %> <% if homework.nil? %>
<span class="c_red" id="homework_notice_span">请先在左侧选择作业</span> <span id="homework_notice_span">本题库遵循创作共用许可证<br/><br/>
教师给学生出题本质上是一种创作行为,题目的作者通常为此付出大量时间和精力。好的题目不仅能加深学生对知识点的理解,还能激发学生兴趣,提升学习效率。为此,本网站的题库许可证基于创作共用许可证( Creative Commons License )建立,其核心条款包括:<br/><br/>
1. 署名:必须提到原作者。<br/><br/>
2. 非商业用途:不得用于盈利性目的。<br/><br/>
3. 相同方式共享:允许修改原作品,但必须使用相同的许可证发布。<br/><br/>
对此许可证的支持或反对,请在网站中留言,我们不断完善,谢谢!</span>
<% else %> <% else %>
<div class="subject-pop-intro mb15">标题:<%=homework.name %><br /> <div class="subject-pop-intro mb15">标题:<%=homework.name %><br />
来源:<%=homework.course.name %><br /> 来源:<%=homework.course.name %><br />

View File

@ -2,7 +2,18 @@
<div class="subjectInfo">题目信息</div> <div class="subjectInfo">题目信息</div>
<div class="subject-content-wrapper"> <div class="subject-content-wrapper">
<% if homework.nil? %> <% if homework.nil? %>
<span class="c_red" id="homework_notice_span">请先在左侧选择作业</span> <span id="homework_notice_span"><span class="center db">本题库遵循创作共用许可证</span><br>
教师给学生出题本质上是一种创作行为,题目的作者通常为此付出大量时间和精力。好的题目不仅能加深学生对知识点的理解,还能激发学生兴趣,提升学习效率。为此,本网站的题库许可证基于创作共用许可证( Creative Commons License )建立,其核心条款包括:<br/><br/>
1. 署名:必须提到原作者。<br/><br/>
2. 非商业用途:不得用于盈利性目的。<br/><br/>
3. 相同方式共享:允许修改原作品,但必须使用相同的许可证发布。<br/><br/>
对此许可证的支持或反对,请在网站中留言,我们不断完善,谢谢!
</span>
<% else %> <% else %>
<div class="subjectIntro mb15">标题:<%=homework.name %><br /> <div class="subjectIntro mb15">标题:<%=homework.name %><br />
来源:<%=homework.course.name %><br /> 来源:<%=homework.course.name %><br />

View File

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

View File

@ -1,18 +1,32 @@
<div class="resources mt10"> <div class="resources mt10">
<div class="homepagePostBrief" onmouseover="$('#act-<%=user_activity.id %>').css('visibility','visible')" onmouseout="$('.homepagePostSetting').css('visibility','hidden')"> <div class="homepagePostBrief">
<div class="homepagePostPortrait"> <div class="homepagePostPortrait">
<a href="javascript:void(0);"><img src="images/homepageImage.jpg" width="50" height="50" alt="用户头像"/></a></div> <%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id), :alt => "用户头像" %>
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
</div>
<div class="homepagePostDes"> <div class="homepagePostDes">
<div class="homepagePostTo mt-4"><a href="javascript:void(0);" class="newsBlue mr15">尹教授</a> TO <div class="homepagePostTo break_word mt-4">
<a href="javascript:void(0);" class="newsBlue ml15">分布式计算环境(课程名称)</a></div> <% if activity.try(:author).try(:realname) == ' ' %>
<div class="homepagePostTitle"> <%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %>
<a href="javascript:void(0);" class="postGrey">ckeditor值设置的默认在光标聚焦控件后应自动消失的处理项目附件</a></div> <% else %>
<div class="homepagePostSubmitContainer"> <%= link_to activity.try(:author).try(:realname), user_path(activity.author_id), :class => "newsBlue mr15" %>
<div class="homepagePostSubmit"><a href="javascript:void(0);" class="c_blue">提交10</a></div> <% end %>
<div class="homepagePostDeadline">截止时间2015-08-20</div> TO
<%= link_to activity.project.name.to_s+" | 项目资源", project_files_path(activity.course), :class => "newsBlue ml15" %>
</div> </div>
<div class="homepagePostIntro">作业描述系统中有多个ckeditor且每个ckeditor的id未知怎么样做到当光标聚焦某个ckeditor的文本框中该编辑器的默认值应自动消失的处理网络拓扑图开发</div> <div class="homepagePostTitle break_word" >
<div class="homepagePostSetting" id="act-<%= user_activity.id %>" style="visibility: hidden"> <%= link_to activity.filename, project_files_path(activity.course), :class => "postGrey" %>
</div>
<div class="homepagePostSubmitContainer">
<div class="homepagePostDeadline mr15">
文件大小:
<%= number_to_human_size activity.filesize%>
</div>
<div class="homepagePostDeadline">上传时间:<%= format_time(activity.created_on) %></div>
</div>
<div class="homepagePostSetting" id="act-<%= user_activity_id %>" style="visibility: hidden">
<ul> <ul>
<li class="homepagePostSettingIcon"> <li class="homepagePostSettingIcon">
<ul class="homepagePostSettiongText"> <ul class="homepagePostSettiongText">

View File

@ -13,6 +13,29 @@
<% end %> TO <% end %> TO
<%= link_to activity.project.name.to_s+" | 项目问题", project_issues_path(activity.project), :class => "newsBlue ml15"%> <%= link_to activity.project.name.to_s+" | 项目问题", project_issues_path(activity.project), :class => "newsBlue ml15"%>
</div> </div>
<div class="homepagePostSetting">
<ul>
<li class="homepagePostSettingIcon">
<ul class="homepagePostSettiongText">
<li>
<%= link_to l(:button_edit), issue_path(activity.id, :edit => 'true'), :class => 'postOptionLink', :accesskey => accesskey(:edit) if activity.editable? && User.current.allowed_to?(:edit_issues, activity.project) %>
</li>
<li>
<% if !defined?(project_id) && !defined?(user_id) %>
<%= link_to l(:button_delete), issue_path(activity.id), :data => {:confirm => issues_destroy_confirmation_message(activity)}, :method => :delete, :class => 'postOptionLink' if User.current.allowed_to?(:delete_issues, activity.project) %>
<% elsif defined?(project_id) %>
<%= link_to l(:button_delete), issue_path(activity.id, :page_classify => "project_page", :page_id => project_id), :data => {:confirm => issues_destroy_confirmation_message(activity)}, :method => :delete, :class => 'postOptionLink' if User.current.allowed_to?(:delete_issues, activity.project) %>
<% elsif defined?(user_id) %>
<%= link_to l(:button_delete), issue_path(activity.id, :page_classify => "user_page", :page_id => user_id), :data => {:confirm => issues_destroy_confirmation_message(activity)}, :method => :delete, :class => 'postOptionLink' if User.current.allowed_to?(:delete_issues, activity.project) %>
<% end %>
</li>
<li>
<%= link_to l(:button_copy), project_copy_issue_path(activity.project, activity), :class => 'postOptionLink' if User.current.allowed_to?(:add_issues, activity.project) %>
</li>
</ul>
</li>
</ul>
</div>
<div class="homepagePostTitle break_word"> <div class="homepagePostTitle break_word">
<% case activity.tracker_id %> <% case activity.tracker_id %>
<% when 1%> <% when 1%>
@ -51,6 +74,10 @@
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>user_activity_id, :content=>activity.description} %> <%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>user_activity_id, :content=>activity.description} %>
<div id="intro_content_show_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
<div id="intro_content_hide_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
<div class="cl"></div>
<%# 局部刷新修改xissue属性 %> <%# 局部刷新修改xissue属性 %>
<% if User.current.member_of?(activity.project) %> <% if User.current.member_of?(activity.project) %>
<% unless params[:action] == "index" %> <% unless params[:action] == "index" %>
@ -59,10 +86,7 @@
</div> </div>
<% end %> <% end %>
<% end %> <% end %>
<div class="cl"></div> <div class="cl"></div>
<div id="intro_content_show_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
<div id="intro_content_hide_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
<div class="cl"></div>
<div class="mt10" style="font-weight:normal;"> <div class="mt10" style="font-weight:normal;">
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %> <%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %>
</div> </div>

View File

@ -1,6 +1,6 @@
<div class="userCard boxShadow" style="<%= User.current == user ? 'top:-153px;':'' %>"> <div class="userCard boxShadow" style="<%= User.current == user ? 'top:-153px;':'' %>">
<div class="userAvatarWrap fl"> <div class="userAvatarWrap fl">
<%= link_to image_tag(url_to_avatar(user), :width => "50", :height => "50"), user_url_in_org(user), :alt => "用户头像", :target => '_blank' %> <%= link_to image_tag(url_to_avatar(user), :width => "50", :height => "50"), user_url_in_org(user.id), :alt => "用户头像", :target => '_blank' %>
<%#= image_tag(url_to_avatar(user), :width => "50", :height => "50") %> <%#= image_tag(url_to_avatar(user), :width => "50", :height => "50") %>
<!--<img src="images/homepageImage.jpg" width="50" height="50" alt="个人头像" />--> <!--<img src="images/homepageImage.jpg" width="50" height="50" alt="个人头像" />-->
</div> </div>
@ -21,18 +21,18 @@
<div class="cl"></div> <div class="cl"></div>
<div> <div>
<div class="homepageImageBlock mb10"> <div class="homepageImageBlock mb10">
<div><%= link_to User.watched_by(user.id).count, {:controller=>"users", :action=>"user_watchlist",:id=>user.id}, :class => 'homepageImageNumber',:target => "_blank" %></div> <div><%= link_to User.watched_by(user.id).count, user_watchlist_url_in_org(user.id), :class => 'homepageImageNumber',:target => "_blank" %></div>
<div class="homepageImageText"><%= link_to '关注',{:controller=>"users", :action=>"user_watchlist",:id=>user.id},:target => "_blank" %></div> <div class="homepageImageText"><%= link_to '关注',user_watchlist_url_in_org(user.id),:target => "_blank" %></div>
</div> </div>
<div class="homepageVerDiv"></div> <div class="homepageVerDiv"></div>
<div class="homepageImageBlock"> <div class="homepageImageBlock">
<div><%= link_to user.watcher_users.count,{:controller=>"users", :action=>"user_fanslist",:id=>user.id}, :class => "homepageImageNumber fans_count_#{user.id}",:target => "_blank" %></div> <div><%= link_to user.watcher_users.count,user_fanslist_url_in_org(user.id), :class => "homepageImageNumber fans_count_#{user.id}",:target => "_blank" %></div>
<div class="homepageImageText"><%= link_to '粉丝', {:controller=>"users", :action=>"user_fanslist",:id=>user.id},:target => "_blank" %></div> <div class="homepageImageText"><%= link_to '粉丝', user_fanslist_url_in_org(user.id),:target => "_blank" %></div>
</div> </div>
<div class="homepageVerDiv"></div> <div class="homepageVerDiv"></div>
<div class="homepageImageBlock"> <div class="homepageImageBlock">
<div><%= link_to user.blog.blog_comments.where("#{BlogComment.table_name}.parent_id is null").count, user_blogs_path(user), :class => 'homepageImageNumber',:target => "_blank" %></div> <div><%= link_to user.blog.blog_comments.where("#{BlogComment.table_name}.parent_id is null").count, user_blogs_url_in_org(user.id), :class => 'homepageImageNumber',:target => "_blank" %></div>
<div class="homepageImageText"><%= link_to '博客', user_blogs_path(user),:target => "_blank" %></div> <div class="homepageImageText"><%= link_to '博客', user_blogs_url_in_org(user.id),:target => "_blank" %></div>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<% if User.current != user %> <% if User.current != user %>
@ -40,8 +40,8 @@
<%= render :partial => 'users/watch_btn_for_picture', :locals => {:user => user} %> <%= render :partial => 'users/watch_btn_for_picture', :locals => {:user => user} %>
</div> </div>
<!--<a href="javascript:void(0);" class="userFollow mr27 fl">添加关注</a> <a href="javascript:void(0);" class="userCancel mr27 fl" style="display:none;">取消关注</a>--> <!--<a href="javascript:void(0);" class="userFollow mr27 fl">添加关注</a> <a href="javascript:void(0);" class="userCancel mr27 fl" style="display:none;">取消关注</a>-->
<%= link_to "留言", feedback_path(user), :class => 'greyBtn fr', :target => "_blank" %> <%= link_to "留言", feedback_url_in_org(user.id), :class => 'greyBtn fr', :target => "_blank" %>
<%= link_to "私信", feedback_path(user), :class => 'greyBtn fr', :style => 'margin-right:20px;', :target => "_blank" %> <%= link_to "私信", feedback_url_in_org(user.id), :class => 'greyBtn fr', :style => 'margin-right:20px;', :target => "_blank" %>
<!--<a href="javascript:void(0);" class="greyBtn fl">私信</a><a href="javascript:void(0);" class="greyBtn fr">留言</a> --> <!--<a href="javascript:void(0);" class="greyBtn fl">私信</a><a href="javascript:void(0);" class="greyBtn fr">留言</a> -->
<% end %> <% end %>
</div> </div>

View File

@ -30,7 +30,7 @@
<a href="javascript:void(0);" class="sendSourceText" onclick="hideModal()">取消</a> <a href="javascript:void(0);" class="sendSourceText" onclick="hideModal()">取消</a>
</div> </div>
<div > <div >
<ul class="wlist" id="homewrok_ref_pages" style="margin-top: 5px;margin-right: 20px"> <ul class="wlist" id="homewrok_ref_pages" style="margin-top: 5px">
<%= pagination_links_full @hw_pages, @hw_count, :per_page_links => false, :remote => @is_remote, :flag => true%> <%= pagination_links_full @hw_pages, @hw_count, :per_page_links => false, :remote => @is_remote, :flag => true%>
</ul> </ul>
</div> </div>

View File

@ -89,7 +89,7 @@
<% if act %> <% if act %>
<% case user_activity.act_type.to_s %> <% case user_activity.act_type.to_s %>
<% when 'Issue' %> <% when 'Issue' %>
<%= render :partial => 'project_issue', :locals => {:activity => act,:user_activity_id =>user_activity.id} %> <%= render :partial => 'project_issue', :locals => {:activity => act,:user_activity_id =>user_activity.id, :user_id => user_id} %>
<% when 'Message' %> <% when 'Message' %>
<%= render :partial => 'project_message', :locals => {:activity => act,:user_activity_id =>user_activity.id,:is_course=>0,:is_board=>0} %> <%= render :partial => 'project_message', :locals => {:activity => act,:user_activity_id =>user_activity.id,:is_course=>0,:is_board=>0} %>
<% when 'ProjectCreateInfo'%> <% when 'ProjectCreateInfo'%>

View File

@ -8,15 +8,15 @@
<% if ma.at_message_type == "Message" && !ma.at_message.course.nil? %> <% if ma.at_message_type == "Message" && !ma.at_message.course.nil? %>
<%= link_to ma.subject.html_safe, course_boards_path(ma.at_message.course, <%= link_to ma.subject.html_safe, course_boards_path(ma.at_message.course,
:parent_id => ma.at_message.parent_id ? ma.at_message.parent_id : ma.at_message.id, :topic_id => ma.at_message.id), :parent_id => ma.at_message.parent_id ? ma.at_message.parent_id : ma.at_message.id, :topic_id => ma.at_message.id),
:class =>"#{ma.viewed? ? "newsGrey" : "newsBlack"}", :class =>"#{ma.viewed? ? "newsGrey" : "newsBlack"}" %>
:onmouseover =>"message_titile_show($(this),event)", <!--# :onmouseover =>"message_titile_show($(this),event)",-->
:onmouseout => "message_titile_hide($(this))" %> <!--:onmouseout => "message_titile_hide($(this))" %>-->
<% elsif ma.at_message_type == "Message" && !ma.at_message.project.nil? %> <% elsif ma.at_message_type == "Message" && !ma.at_message.project.nil? %>
<%= link_to ma.subject.html_safe, project_boards_path(ma.at_message.project, <%= link_to ma.subject.html_safe, project_boards_path(ma.at_message.project,
:parent_id => ma.at_message.parent_id ? ma.at_message.parent_id : ma.at_message.id, :topic_id => ma.at_message.id), :parent_id => ma.at_message.parent_id ? ma.at_message.parent_id : ma.at_message.id, :topic_id => ma.at_message.id),
:class =>"#{ma.viewed? ? "newsGrey" : "newsBlack"}", :class =>"#{ma.viewed? ? "newsGrey" : "newsBlack"}" %>
:onmouseover =>"message_titile_show($(this),event)", <!--# :onmouseover =>"message_titile_show($(this),event)",-->
:onmouseout => "message_titile_hide($(this))" %> <!--:onmouseout => "message_titile_hide($(this))" %>-->
<% else %> <% else %>
<%= link_to ma.subject.html_safe, ma.url, :class =>"#{ma.viewed? ? "newsGrey" : "newsBlack"}", :onmouseover =>"message_titile_show($(this),event)", :onmouseout => "message_titile_hide($(this))" %> <%= link_to ma.subject.html_safe, ma.url, :class =>"#{ma.viewed? ? "newsGrey" : "newsBlack"}", :onmouseover =>"message_titile_show($(this),event)", :onmouseout => "message_titile_hide($(this))" %>
<% end %> <% end %>

View File

@ -16,7 +16,6 @@
$("#GroupPopupBox a.group_save_btn").click(); $("#GroupPopupBox a.group_save_btn").click();
<% end %> <% end %>
}); });
var homework_description_editor;
function checked_val() { function checked_val() {
if ($("#anonymous_comment").is(":checked")) { if ($("#anonymous_comment").is(":checked")) {
$("#anonymous_comment").val(1); $("#anonymous_comment").val(1);
@ -106,7 +105,7 @@
//paramsHeight = params.kindutil.removeUnit(this.height); //paramsHeight = params.kindutil.removeUnit(this.height);
edit.iframe.height(150); edit.iframe.height(150);
this.resize(null, Math.max((params.kindutil.IE ? body.scrollHeight : body.offsetHeight) , 150)); this.resize(null, Math.max((params.kindutil.IE ? body.scrollHeight : body.offsetHeight) , 150));
elocalStorage(homework_description_editor,'homework_<%=User.current.id %>');
} }
}).loadPlugin('paste'); }).loadPlugin('paste');
return editor; return editor;
@ -150,7 +149,7 @@
<div class="cl"></div> <div class="cl"></div>
<div class=" mt10"> <div class=" mt10">
<%= link_to("导入作业", user_import_homeworks_user_path(User.current.id,:select_course => defined?(select_course)),:class => "BlueCirBtn fl mr10",:remote => true,:title=>"导入自己发布过的作业,或者共享题库中的作业") unless edit_mode%> <%= link_to("从题库选用", user_import_homeworks_user_path(User.current.id,:select_course => defined?(select_course)),:class => "BlueCirBtn fl mr10",:remote => true,:title=>"导入自己发布过的作业,或者共享题库中的作业") unless edit_mode%>
<% unless edit_mode %> <% unless edit_mode %>
<input type="hidden" name="quotes" id="ref_homework_id" value=""/> <input type="hidden" name="quotes" id="ref_homework_id" value=""/>
<% end %> <% end %>
@ -159,7 +158,7 @@
<% end %> <% end %>
<div class="calendar_div fl mr10"> <div class="calendar_div fl mr10">
<input type="text" name="homework_common[end_time]" id="homework_end_time" placeholder="截止日期" class="InputBox fl W120 calendar_input" readonly="readonly" value="<%= homework.end_time%>" > <input type="text" name="homework_common[end_time]" id="homework_end_time" placeholder="截止日期" class="InputBox fl W120 calendar_input" readonly="readonly" value="<%= homework.end_time%>" >
<% if homework.homework_detail_manual.comment_status.to_i < 3 %> <% if homework.homework_detail_manual.comment_status.to_i < 2 %>
<%= calendar_for('homework_end_time')%> <%= calendar_for('homework_end_time')%>
<% end %> <% end %>
</div> </div>
@ -199,6 +198,8 @@
<%= select_tag :course_id, options_for_select(get_as_teacher_courses(User.current), homework.course_id), {:class => "InputBox w709",:value => "请选择发布作业的课程"} %> <%= select_tag :course_id, options_for_select(get_as_teacher_courses(User.current), homework.course_id), {:class => "InputBox w709",:value => "请选择发布作业的课程"} %>
</div> </div>
<p id="homework_course_id_span" class="c_red mt5"></p> <p id="homework_course_id_span" class="c_red mt5"></p>
<p id="e_tip" class="c_grey"></p>
<p id="e_tips" class="c_grey"></p>
<div class="cl"></div> <div class="cl"></div>
<div id="homework_attachments"> <div id="homework_attachments">

File diff suppressed because it is too large Load Diff

View File

@ -10,9 +10,10 @@
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">申请加入项目:</span> <span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">申请加入项目:</span>
</li> </li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey"> <li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= link_to ma.project, settings_project_path(:id => ma.project, :tab => "members"), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}", <%= link_to ma.project, settings_project_path(:id => ma.project, :tab => "members"), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}" %>
:onmouseover => "message_titile_show($(this),event)", <!--:onmouseover => "message_titile_show($(this),event)",-->
:onmouseout => "message_titile_hide($(this))" %></a> <!--:onmouseout => "message_titile_hide($(this))" %>-->
</a>
</li> </li>
<div style="display: none" class="message_title_red system_message_style"> <div style="display: none" class="message_title_red system_message_style">
<%= ma.project %> <%= ma.project %>
@ -32,9 +33,10 @@
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">将您加入了项目:</span> <span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">将您加入了项目:</span>
</li> </li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey"> <li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= link_to ma.project, project_member_path(ma.project), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}", <%= link_to ma.project, project_member_path(ma.project), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}" %>
:onmouseover => "message_titile_show($(this),event)", <!--:onmouseover => "message_titile_show($(this),event)",-->
:onmouseout => "message_titile_hide($(this))" %></a> <!--:onmouseout => "message_titile_hide($(this))" %>-->
</a>
</li> </li>
<div style="display: none" class="message_title_red system_message_style"> <div style="display: none" class="message_title_red system_message_style">
<% if ma.project.is_public? || User.current.member_of?(ma.project) || User.current.admin? %> <% if ma.project.is_public? || User.current.member_of?(ma.project) || User.current.admin? %>
@ -67,9 +69,10 @@
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">将您移出了项目:</span> <span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">将您移出了项目:</span>
</li> </li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey"> <li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= link_to ma.project, member_project_path(ma.project), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}", <%= link_to ma.project, member_project_path(ma.project), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}" %>
:onmouseover => "message_titile_show($(this),event)", <!--:onmouseover => "message_titile_show($(this),event)",-->
:onmouseout => "message_titile_hide($(this))" %></a> <!--:onmouseout => "message_titile_hide($(this))" %>-->
</a>
</li> </li>
<div style="display: none" class="message_title_red system_message_style"> <div style="display: none" class="message_title_red system_message_style">
<% if ma.project.is_public? || User.current.member_of?(ma.project) || User.current.admin? %> <% if ma.project.is_public? || User.current.member_of?(ma.project) || User.current.admin? %>
@ -107,9 +110,9 @@
<li class="homepageHomeworkContent fl"> <li class="homepageHomeworkContent fl">
<% end %> <% end %>
<%= link_to ma.project, project_path(ma.project), <%= link_to ma.project, project_path(ma.project),
:class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}", :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}" %>
:onmouseover => "message_titile_show($(this),event)", <!--:onmouseover => "message_titile_show($(this),event)",-->
:onmouseout => "message_titile_hide($(this))" %> <!--:onmouseout => "message_titile_hide($(this))" %>-->
</li> </li>
<div style="display: none" class="message_title_red system_message_style"> <div style="display: none" class="message_title_red system_message_style">
<%= ma.project %> <%= ma.project %>
@ -136,9 +139,10 @@
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>"><%= ma.forge_message.tracker_id == 5 ? "发布的周报:":"指派给你的问题:"%></span> <span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>"><%= ma.forge_message.tracker_id == 5 ? "发布的周报:":"指派给你的问题:"%></span>
</li> </li>
<li class="homepageHomeworkContent fl"><a href="javascript:void(0);" class="newsGrey"> <li class="homepageHomeworkContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= link_to ma.forge_message.subject, issue_path(:id => ma.forge_message.id), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}", <%= link_to ma.forge_message.subject, issue_path(:id => ma.forge_message.id), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}" %>
:onmouseover => "message_titile_show($(this),event)", <!--:onmouseover => "message_titile_show($(this),event)",-->
:onmouseout => "message_titile_hide($(this))" %></a> <!--:onmouseout => "message_titile_hide($(this))" %>-->
</a>
</li> </li>
<div style="display: none" class="message_title_red system_message_style"> <div style="display: none" class="message_title_red system_message_style">
<p><strong>主题:</strong><%= ma.forge_message.subject %></p> <p><strong>主题:</strong><%= ma.forge_message.subject %></p>
@ -160,9 +164,10 @@
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>"><%= ma.forge_message.tracker_id == 5 ? "发布了周报:":"指派了问题给你:"%></span> <span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>"><%= ma.forge_message.tracker_id == 5 ? "发布了周报:":"指派了问题给你:"%></span>
</li> </li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey"> <li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= link_to ma.forge_message.subject, issue_path(:id => ma.forge_message.id), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}", <%= link_to ma.forge_message.subject, issue_path(:id => ma.forge_message.id), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}" %>
:onmouseover => "message_titile_show($(this),event)", <!--:onmouseover => "message_titile_show($(this),event)",-->
:onmouseout => "message_titile_hide($(this))" %></a> <!--:onmouseout => "message_titile_hide($(this))" %>-->
</a>
</li> </li>
<div style="display: none" class="message_title_red system_message_style"> <div style="display: none" class="message_title_red system_message_style">
<p><strong>主题:</strong><%= ma.forge_message.subject %></p> <p><strong>主题:</strong><%= ma.forge_message.subject %></p>
@ -187,9 +192,10 @@
</li> </li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey"> <li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= link_to ma.forge_message.journalized.subject, <%= link_to ma.forge_message.journalized.subject,
issue_path(:id => ma.forge_message.journalized_id), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}", issue_path(:id => ma.forge_message.journalized_id), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}" %>
:onmouseover =>"message_titile_show($(this),event)", <!--:onmouseover =>"message_titile_show($(this),event)",-->
:onmouseout => "message_titile_hide($(this))" %></a> <!--:onmouseout => "message_titile_hide($(this))" %>-->
</a>
</li> </li>
<div style="display: none" class="message_title_red system_message_style" > <div style="display: none" class="message_title_red system_message_style" >
<p><strong>问题标题:</strong><%= ma.forge_message.journalized.subject %></p> <p><strong>问题标题:</strong><%= ma.forge_message.journalized.subject %></p>
@ -208,9 +214,10 @@
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey"> <li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= link_to ma.forge_message.subject, project_boards_path(ma.forge_message.project, <%= link_to ma.forge_message.subject, project_boards_path(ma.forge_message.project,
:parent_id => ma.forge_message.parent_id ? ma.forge_message.parent_id : ma.forge_message.id, :parent_id => ma.forge_message.parent_id ? ma.forge_message.parent_id : ma.forge_message.id,
:topic_id => ma.forge_message.id), :class => "#{ma.viewed==0 ? "newsBlack" : "newsGrey"}", :topic_id => ma.forge_message.id), :class => "#{ma.viewed==0 ? "newsBlack" : "newsGrey"}" %>
:onmouseover => "message_titile_show($(this),event)", <!--:onmouseover => "message_titile_show($(this),event)",-->
:onmouseout => "message_titile_hide($(this))" %></a></li> <!--:onmouseout => "message_titile_hide($(this))" %>-->
</a></li>
<div style="display: none" class="message_title_red system_message_style"> <div style="display: none" class="message_title_red system_message_style">
<p><strong>主题:</strong><%= ma.forge_message.subject %></p> <p><strong>主题:</strong><%= ma.forge_message.subject %></p>
<% unless ma.forge_message.content.nil? %> <% unless ma.forge_message.content.nil? %>
@ -222,9 +229,10 @@
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey"> <li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= link_to ma.forge_message.subject, project_boards_path(ma.forge_message.project, <%= link_to ma.forge_message.subject, project_boards_path(ma.forge_message.project,
:parent_id => ma.forge_message.parent_id ? ma.forge_message.parent_id : ma.forge_message.id, :parent_id => ma.forge_message.parent_id ? ma.forge_message.parent_id : ma.forge_message.id,
:topic_id => ma.forge_message.id), :class => "#{ma.viewed==0 ? "newsBlack" : "newsGrey"}", :topic_id => ma.forge_message.id), :class => "#{ma.viewed==0 ? "newsBlack" : "newsGrey"}" %>
:onmouseover => "message_titile_show($(this),event)", <!--:onmouseover => "message_titile_show($(this),event)",-->
:onmouseout => "message_titile_hide($(this))" %></a></li> <!--:onmouseout => "message_titile_hide($(this))" %>-->
</a></li>
<div style="display: none" class="message_title_red system_message_style"> <div style="display: none" class="message_title_red system_message_style">
<p><strong>帖子主题:</strong><%= ma.forge_message.subject %></p> <p><strong>帖子主题:</strong><%= ma.forge_message.subject %></p>
<% unless ma.forge_message.content.nil? %> <% unless ma.forge_message.content.nil? %>
@ -247,9 +255,10 @@
</li> </li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey"> <li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= link_to ("#{ma.forge_message.title.html_safe}"), {:controller => 'news', :action => 'show', :id => ma.forge_message.id}, <%= link_to ("#{ma.forge_message.title.html_safe}"), {:controller => 'news', :action => 'show', :id => ma.forge_message.id},
:class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}", :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}" %>
:onmouseover => "message_titile_show($(this),event)", <!--:onmouseover => "message_titile_show($(this),event)",-->
:onmouseout => "message_titile_hide($(this))" %></a> <!--:onmouseout => "message_titile_hide($(this))" %>-->
</a>
</li> </li>
<div style="display: none" class="message_title_red system_message_style"> <div style="display: none" class="message_title_red system_message_style">
<p><strong>标题:</strong><%= ma.forge_message.title %></p> <p><strong>标题:</strong><%= ma.forge_message.title %></p>
@ -268,9 +277,9 @@
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">评论了新闻:</span></li> <span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">评论了新闻:</span></li>
<li class="homepageNewsContent fl"> <li class="homepageNewsContent fl">
<%= link_to "#{ma.forge_message.commented.title}", <%= link_to "#{ma.forge_message.commented.title}",
{:controller => 'news', :action => 'show', :id => ma.forge_message.commented.id },:class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}", {:controller => 'news', :action => 'show', :id => ma.forge_message.commented.id },:class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}" %>
:onmouseover => "message_titile_show($(this),event)", <!--:onmouseover => "message_titile_show($(this),event)",-->
:onmouseout => "message_titile_hide($(this))" %> <!--:onmouseout => "message_titile_hide($(this))" %>-->
</li> </li>
<div style="display: none" class="message_title_red system_message_style"> <div style="display: none" class="message_title_red system_message_style">
<p><strong>新闻标题:</strong><%= ma.forge_message.commented.title %></p> <p><strong>新闻标题:</strong><%= ma.forge_message.commented.title %></p>

View File

@ -10,9 +10,10 @@
</li> </li>
<% if ma.memo.parent_id.nil? %> <% if ma.memo.parent_id.nil? %>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey"> <li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= link_to ma.memo.subject, forum_memo_path(ma.memo.forum_id, ma.memo.parent_id ? ma.memo.parent_id: ma.memo.id), :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}", <%= link_to ma.memo.subject, forum_memo_path(ma.memo.forum_id, ma.memo.parent_id ? ma.memo.parent_id: ma.memo.id), :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}" %>
:onmouseover =>"message_titile_show($(this),event)", <!--:onmouseover =>"message_titile_show($(this),event)",-->
:onmouseout => "message_titile_hide($(this))" %></a> <!--:onmouseout => "message_titile_hide($(this))" %>-->
</a>
</li> </li>
<div style="display: none" class="message_title_red system_message_style"> <div style="display: none" class="message_title_red system_message_style">
<p><strong>标题:</strong><%= ma.memo.subject %></p> <p><strong>标题:</strong><%= ma.memo.subject %></p>
@ -23,9 +24,10 @@
</div> </div>
<% else %> <% else %>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey"> <li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= link_to ma.memo.content.html_safe, forum_memo_path(ma.memo.forum_id, ma.memo.parent_id ? ma.memo.parent_id: ma.memo.id), :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}", <%= link_to ma.memo.content.html_safe, forum_memo_path(ma.memo.forum_id, ma.memo.parent_id ? ma.memo.parent_id: ma.memo.id), :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}" %>
:onmouseover =>"message_titile_show($(this),event)", <!--:onmouseover =>"message_titile_show($(this),event)",-->
:onmouseout => "message_titile_hide($(this))" %></a> <!--:onmouseout => "message_titile_hide($(this))" %>-->
</a>
</li> </li>
<div style="display: none" class="message_title_red system_message_style"> <div style="display: none" class="message_title_red system_message_style">
<p><strong>标题:</strong><%= ma.memo.subject %></p> <p><strong>标题:</strong><%= ma.memo.subject %></p>

View File

@ -11,10 +11,9 @@
<li class="homepageSystenMessageContent fl"> <li class="homepageSystenMessageContent fl">
<%= link_to ma.subject.blank? ? (ma.content.nil? ? ma.description.html_safe : ma.content.html_safe) : ma.subject, user_system_messages_path(User.current), <%= link_to ma.subject.blank? ? (ma.content.nil? ? ma.description.html_safe : ma.content.html_safe) : ma.subject, user_system_messages_path(User.current),
:id => "content_link_#{ma.id}", :id => "content_link_#{ma.id}" %>
:onmouseover =>"message_titile_show($(this),event);", <!--:onmouseover =>"message_titile_show($(this),event);",-->
:onmouseout => "message_titile_hide($(this));" <!--:onmouseout => "message_titile_hide($(this));"-->
%>
</li> </li>
<div style="display:none;" class="message_title_red system_message_style"> <div style="display:none;" class="message_title_red system_message_style">
<% unless ma.subject.blank? %> <% unless ma.subject.blank? %>

View File

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

View File

@ -2,8 +2,8 @@
<%= link_to("编辑资料", my_account_path, :class => "fl UsersEditBtn") %> <%= link_to("编辑资料", my_account_path, :class => "fl UsersEditBtn") %>
<% else %> <% else %>
<%if(user.watched_by?(User.current))%> <%if(user.watched_by?(User.current))%>
<%= link_to "取消关注",watch_path(:object_type=> 'user',:object_id=>user.id,:target_id=>user.id),:class => "userFollow mr27 fl", :method => "delete",:remote => "true", :title => "取消关注"%> <%= link_to "取消关注",Setting.host_name + "/watch?object_type=user&object_id="+user.id.to_s + "&target_id="+user.id.to_s,:class => "userFollow mr27 fl", :method => "delete",:remote => "true", :title => "取消关注"%>
<% else %> <% else %>
<%= link_to "添加关注",watch_path(:object_type=> 'user',:object_id=>user.id,:target_id=>user.id),:class => "userFollow mr27 fl", :method => "post",:remote => "true", :title => "添加关注"%> <%= link_to "添加关注",Setting.host_name + "/watch?object_type=user&object_id="+user.id.to_s + "&target_id="+user.id.to_s,:class => "userFollow mr27 fl", :method => "post",:remote => "true", :title => "添加关注"%>
<% end %> <% end %>
<% end %> <% end %>

View File

@ -85,7 +85,7 @@
<span data-language=<%=@homework.language%> style="display-hidden" id="data-language"></span> <span data-language=<%=@homework.language%> style="display-hidden" id="data-language"></span>
</div> </div>
<div class="mt10"> <div class="mt10">
<%= f.text_area :name, id: 'program-title', class:"InputBox W700", placeholder:"请概括你的代码的功能" %> <%= f.text_area :name, id: 'program-title', class:"InputBox W700", placeholder:"请概括你的代码的功能", value:"#{@homework.name}的作品提交" %>
</div> </div>
<div class="mt10"> <div class="mt10">
<%= f.text_area :description, id: 'program-src', class:"InputBox W700 H150", placeholder:"请贴入你的代码", rows: 10 %> <%= f.text_area :description, id: 'program-src', class:"InputBox W700 H150", placeholder:"请贴入你的代码", rows: 10 %>

View File

@ -45,5 +45,4 @@
<% homepage = BlogComment.find(@user.blog.homepage_id) %> <% homepage = BlogComment.find(@user.blog.homepage_id) %>
<%= render :partial => 'blogs/homepage', :locals => {:activity => homepage, :user_activity_id => homepage.id} %> <%= render :partial => 'blogs/homepage', :locals => {:activity => homepage, :user_activity_id => homepage.id} %>
<% end %> <% end %>
<%= render :partial => 'users/user_activities', :locals => {:user_activities => @user_activities,:page => 0,:type => @type, :user_id => (@user.type == "AnonymousUser" ? User.current.id : @user.id)} %>
<%= render :partial => 'users/user_activities', :locals => {:user_activities => @user_activities,:page => 0,:type => @type} %>

View File

@ -33,7 +33,7 @@
<div class="homepageContentContainer"> <div class="homepageContentContainer">
<div class="homepageContent"> <div class="homepageContent">
<div class="resource-wrapper mt10"> <div class="resource-wrapper">
<ul class="resource-banner"> <ul class="resource-banner">
<li class="fl resource-switch"> <li class="fl resource-switch">
<a href="<%= user_homework_type_user_path(@user,:is_import => 0) %>" id="public_homeworks_choose" class="resource-tab resource-tab-active" data-remote="true">公共题库</a> <a href="<%= user_homework_type_user_path(@user,:is_import => 0) %>" id="public_homeworks_choose" class="resource-tab resource-tab-active" data-remote="true">公共题库</a>
@ -46,7 +46,7 @@
<ul class="resourcesSelect"> <ul class="resourcesSelect">
<li class="resourcesSelected"><a href="javascript:void(0);" class="resourcesIcon"></a> <li class="resourcesSelected"><a href="javascript:void(0);" class="resourcesIcon"></a>
<ul class="resourcesType"> <ul class="resourcesType">
<li> <a href="<%= user_homework_type_user_path(@user,:type => @type,:is_import => 0,:property => 0) %>" id="homework_type_all" class="resourcesTypeAll resourcesGrey" data-method="get" data-remote="true">全部</a> </li> <li> <a href="<%= user_homework_type_user_path(@user,:type => @type,:is_import => 0) %>" id="homework_type_all" class="resourcesTypeAll resourcesGrey" data-method="get" data-remote="true">全部</a> </li>
<li> <a href="<%= user_homework_type_user_path(@user,:type => @type,:is_import => 0,:property => 1) %>" id="homework_type_nor" class="homepagePostTypeAssignment postTypeGrey" data-method="get" data-remote="true">普通作业</a> </li> <li> <a href="<%= user_homework_type_user_path(@user,:type => @type,:is_import => 0,:property => 1) %>" id="homework_type_nor" class="homepagePostTypeAssignment postTypeGrey" data-method="get" data-remote="true">普通作业</a> </li>
<li> <a href="<%= user_homework_type_user_path(@user,:type => @type,:is_import => 0,:property => 2) %>" id="homework_type_pro" class="program-btn postTypeGrey" data-method="get" data-remote="true" style="white-space:nowrap;">编程作业</a> </li> <li> <a href="<%= user_homework_type_user_path(@user,:type => @type,:is_import => 0,:property => 2) %>" id="homework_type_pro" class="program-btn postTypeGrey" data-method="get" data-remote="true" style="white-space:nowrap;">编程作业</a> </li>
<li> <a href="<%= user_homework_type_user_path(@user,:type => @type,:is_import => 0,:property => 3) %>" id="homework_type_gro" class="group-btn resourcesGrey" data-method="get" data-remote="true">分组作业</a> </li> <li> <a href="<%= user_homework_type_user_path(@user,:type => @type,:is_import => 0,:property => 3) %>" id="homework_type_gro" class="group-btn resourcesGrey" data-method="get" data-remote="true">分组作业</a> </li>
@ -61,7 +61,7 @@
<%=render :partial=>'homework_repository_search', :locals=>{:type => @type,:is_import => 0,:property => @property} %> <%=render :partial=>'homework_repository_search', :locals=>{:type => @type,:is_import => 0,:property => @property} %>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<div class="w583 fl mr10 mt10" id="homework_repository_list"> <div class="w683 fl mr10 mt10" id="homework_repository_list">
<%=render :partial => 'homework_repository_list', :locals => {:homeworks => @homeworks,:type=>@type,:is_import => 0,:property => @property,:search=>''} %> <%=render :partial => 'homework_repository_list', :locals => {:homeworks => @homeworks,:type=>@type,:is_import => 0,:property => @property,:search=>''} %>
</div> </div>
<div id="homework_repository_detail"> <div id="homework_repository_detail">
@ -69,7 +69,7 @@
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<div> <div>
<ul class="wlist mt10" id="homework_pository_ref_pages" style="margin-top: 5px;margin-right: 395px"> <ul class="wlist mt10" id="homework_pository_ref_pages" style="margin-top: 5px;margin-right: 295px">
<%= pagination_links_full @hw_pages, @hw_count, :per_page_links => false, :remote => @is_remote, :flag => true%> <%= pagination_links_full @hw_pages, @hw_count, :per_page_links => false, :remote => @is_remote, :flag => true%>
</ul> </ul>
</div> </div>

View File

@ -1,31 +1,31 @@
<% unless all_results.nil? || all_results.empty?%> <% unless all_results.nil? || all_results.empty?%>
<% all_results.each do |item|%> <% all_results.each do |item|%>
<% case item.type %> <% case item.type %>
<% when 'user'%> <% when 'user'%>
<ul class="searchContent"> <ul class="searchContent">
<li class="fl"></li> <li class="fl"></li>
<li class="fl searchContentDes"> <li class="fl searchContentDes">
<ul class="fl"> <ul class="fl">
<li class="f16 mb5"><a href="<%= user_path(item.id)%>" class="fontGrey3 fl"> <li class="f16 mb5"><a href="<%= user_path(item.id)%>" class="fontGrey3 fl">
<%= item.try(:highlight).try(:login) ? item.highlight.login[0].html_safe : item.login %> <%= item.try(:highlight).try(:login) ? item.highlight.login[0].html_safe : item.login %>
<%if item.firstname.present? || item.lastname.present?%> <%if item.firstname.present? || item.lastname.present?%>
(<%= item.try(:highlight).try(:lastname) ? item.highlight.lastname[0].html_safe : item.lastname%> (<%= item.try(:highlight).try(:lastname) ? item.highlight.lastname[0].html_safe : item.lastname%>
<%= item.try(:highlight).try(:firstname) ? item.highlight.firstname[0].html_safe : item.firstname %>) <%= item.try(:highlight).try(:firstname) ? item.highlight.firstname[0].html_safe : item.firstname %>)
<%end %> <%end %>
</a> </a>
<div class="mt5 fl"><%= image_tag("search_icon_03.png", :width=>"8", :height=>"16" ,:class=>"fl") %><span class="searchTag"><%= get_user_identity(User.find(item.id).user_extensions.identity) %></span></div> <div class="mt5 fl"><%= image_tag("search_icon_03.png", :width=>"8", :height=>"16" ,:class=>"fl") %><span class="searchTag"><%= get_user_identity(User.find(item.id).user_extensions.identity) %></span></div>
<div class="cl"></div> <div class="cl"></div>
</li> </li>
<li class="fontGrey3 mb5"><%= User.find(item.id).user_extensions && User.find(item.id).user_extensions.brief_introduction.present? ? User.find(item.id).user_extensions.brief_introduction : '这位童鞋很懒,什么也没有留下~'%></li> <li class="fontGrey3 mb5"><%= User.find(item.id).user_extensions && User.find(item.id).user_extensions.brief_introduction.present? ? User.find(item.id).user_extensions.brief_introduction : '这位童鞋很懒,什么也没有留下~'%></li>
<li class="f12 fontGrey2"> <li class="f12 fontGrey2">
<span class="mr30">加入时间:<%= format_date( User.find(item.id).created_on)%></span><span class="mr30"> <span class="mr30">加入时间:<%= format_date( User.find(item.id).created_on)%></span><span class="mr30">
最后登陆时间:<%= format_date( User.find(item.id).last_login_on)%></span><span class="mr30"> 最后登陆时间:<%= format_date( User.find(item.id).last_login_on)%></span><span class="mr30">
<%= User.find(item.id).user_extensions.occupation.present? ? '单位:'+User.find(item.id).user_extensions.occupation : ''%></span></li> <%= User.find(item.id).user_extensions.occupation.present? ? '单位:'+User.find(item.id).user_extensions.occupation : ''%></span></li>
</ul>
</li>
<div class="cl"></div>
</ul> </ul>
</li> <% when 'course'%>
<div class="cl"></div>
</ul>
<% when 'course'%>
<ul class="searchContent"> <ul class="searchContent">
<li class="fl"> <li class="fl">
</li> </li>
@ -46,7 +46,7 @@
</li> </li>
<div class="cl"></div> <div class="cl"></div>
</ul> </ul>
<% when 'attachment'%> <% when 'attachment'%>
<ul class="searchContent"> <ul class="searchContent">
<li class="fl"> <li class="fl">
</li> </li>
@ -65,7 +65,7 @@
</li> </li>
<div class="cl"></div> <div class="cl"></div>
</ul> </ul>
<% when 'project'%> <% when 'project'%>
<ul class="searchContent"> <ul class="searchContent">
<li class="fl"> <li class="fl">
</li> </li>
@ -97,8 +97,8 @@
</li> </li>
<div class="cl"></div> <div class="cl"></div>
</ul> </ul>
<%end %> <%end %>
<% end %> <% end %>
<div class="pageRoll"> <div class="pageRoll">
<%= paginate all_results,:params => {:controller => 'welcome', :action => 'search',:search_type=>'all'}%> <%= paginate all_results,:params => {:controller => 'welcome', :action => 'search',:search_type=>'all'}%>
</div> </div>

View File

@ -111,6 +111,7 @@ RedmineApp::Application.routes.draw do
end end
member do member do
match 'update_sub_dir', :via => [:put] match 'update_sub_dir', :via => [:put]
match 'update_priority', :via => [:put]
end end
resource :boards resource :boards
end end

View File

@ -0,0 +1,24 @@
class SetPriorityForOrgSubfields < ActiveRecord::Migration
def up
Organization.all.each do |org|
org.transaction do
org.org_subfields.where("field_type='default'").each do|field|
case field.name
when 'activity'
field.update_attribute(:priority, 1)
when 'course'
field.update_attribute(:priority, 2)
when 'project'
field.update_attribute(:priority, 3)
end
end
org.org_subfields.where("field_type!='default'").each_with_index do |field, index|
field.update_attribute(:priority, index + 4)
end
end
end
end
def down
end
end

View File

@ -0,0 +1,8 @@
class UpdateCourseLead < ActiveRecord::Migration
def up
Message.where("status =? ", 1).update_all(:author_id => 1)
end
def down
end
end

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +1,4 @@
var editor2;
function init_des_editor(params){ function init_des_editor(params){
// var minHeight; //最小高度 // var minHeight; //最小高度
var paramsHeight = params.height; //设定的高度 var paramsHeight = params.height; //设定的高度
@ -32,7 +33,7 @@ function init_des_editor(params){
paramsHeight = paramsHeight == undefined ? params.kindutil.removeUnit(this.height) : paramsHeight; paramsHeight = paramsHeight == undefined ? params.kindutil.removeUnit(this.height) : paramsHeight;
edit.iframe.height(paramsHeight); edit.iframe.height(paramsHeight);
this.resize(null, Math.max((params.kindutil.IE ? body.scrollHeight : body.offsetHeight), paramsHeight)); this.resize(null, Math.max((params.kindutil.IE ? body.scrollHeight : body.offsetHeight), paramsHeight));
elocalStorage(editor2,'org_document');
} }
}).loadPlugin('paste'); }).loadPlugin('paste');
return editor; return editor;
@ -123,6 +124,7 @@ function init_des_data(){
params.width = width; params.width = width;
if (params.textarea.data('init') == undefined) { if (params.textarea.data('init') == undefined) {
params.editor = init_des_editor(params); params.editor = init_des_editor(params);
editor2 = params.editor;
init_form(params); init_form(params);
params.cancel_btn.click(function () { params.cancel_btn.click(function () {
nh_reset_form(params); nh_reset_form(params);

View File

@ -37,3 +37,120 @@ function regexTopicSubject() {
function reset_topic(){ function reset_topic(){
} }
(function(){
//提交匿评参数设置
function submit_set_evaluation_attr(end_time){
if(!regex_evaluation_start(end_time)){
$("#evaluation_start_time").focus();
}
else if(!regex_evaluation_end()){
$("#evaluation_end_time").focus();
}
else if(!regex_evaluation_num()){
$("#evaluation_num").focus();
}
else{
$('#popbox02 form').submit();
hideModal();
}
}
//验证匿评开启时间:大于截止时间,或者为空
function regex_evaluation_start(end_time){
var evaluation_start = $.trim($("#evaluation_start_time").val());
if(evaluation_start == ""){
$("#homework_evaluation_start_time").text("开启匿评日期不能为空");
return false;
}
var end_time = new Date(end_time);
var evaluation_start_time = new Date(evaluation_start);
if(evaluation_start_time > end_time){
$("#homework_evaluation_start_time").text("");
return true;
}else{
$("#homework_evaluation_start_time").text("开启匿评日期必须大于截止日期");
return false;
}
}
//验证匿评结束时间:大于匿评开启时间,或者为空。当匿评开启时间为空时,匿评结束时间必须为空
function regex_evaluation_end(){
var evaluation_start = $.trim($("#evaluation_start_time").val());
var evaluation_end = $.trim($("#evaluation_end_time").val());
if(evaluation_end == ""){
$("#homework_evaluation_end_time").text("关闭匿评日期不能为空");
return true;
}
var evaluation_start_time = new Date(evaluation_start);
var evaluation_end_time = new Date(evaluation_end);
if(evaluation_end_time >= evaluation_start_time){
$("#homework_evaluation_end_time").text("");
return true;
}else{
$("#homework_evaluation_end_time").text("关闭匿评日期不能小于开启匿评日期");
return false;
}
}
//验证匿评数量
function regex_evaluation_num(){
var evaluation_num = $.trim($("#evaluation_num").val());
var regex = /^\d+$/;
if(evaluation_num==""){
$("#evaluation_num_notice").text("匿评人数不能为空");
return false;
}
else if(regex.test(evaluation_num)){
if(evaluation_num > 0){
$("#evaluation_num_notice").html("");
return true;
}
else{
$("#evaluation_num_notice").text("匿评人数必须为大于0");
return false;
}
}
else{
$("#evaluation_num_notice").text("匿评人数只能为数字");
return false;
}
}
window.submit_set_evaluation_attr=submit_set_evaluation_attr;
})();
//处理迟交、缺评扣分
function check_late_penalty(id)
{
var obj = $("#" + id);
var regex = /^\d+$/;
if(regex.test(obj.val()))
{
if(obj.val() > 50)
{
obj.val("50");
}
}
else
{
obj.val("0");
}
}
//匿评弹框确定按钮
function clickOK(path)
{
clickCanel();
$.ajax({
type: "GET",
url: path,
data: 'text',
success: function (data) {
}
});
}
//匿评弹框取消按钮
function clickCanel(){hideModal("#popbox02");}

View File

@ -1,109 +1,109 @@
/* CSS Document */ /* CSS Document */
/* 2015-06-26 */ /* 2015-06-26 */
.navContainer h1,h2,h3,h4,h5,h6,hr,blockquote,dl,dt,dd,ul,ol,li,pre,form,fieldset,legend,button,input,textarea,th,td{ margin:0; padding:0;} .navContainer h1,h2,h3,h4,h5,h6,hr,blockquote,dl,dt,dd,ul,ol,li,pre,form,fieldset,legend,button,input,textarea,th,td{ margin:0; padding:0;}
.navContainer body,table,input,textarea,select,button { font-family: "微软雅黑","宋体"; font-size:12px;line-height:1.5;} .navContainer body,table,input,textarea,select,button { font-family: "微软雅黑","宋体"; font-size:12px;line-height:1.5;}
div,img,tr,td,table{ border:0;} div,img,tr,td,table{ border:0;}
table,tr,td{border:0;cellspacing:0; cellpadding:0;} table,tr,td{border:0;cellspacing:0; cellpadding:0;}
ol,ul,li{ list-style-type:none} ol,ul,li{ list-style-type:none}
a:link,a:visited{text-decoration:none;} a:link,a:visited{text-decoration:none;}
/*a:hover,a:active{color:#000;}*/ /*a:hover,a:active{color:#000;}*/
/*常用*/ /*常用*/
/*#RSide{ background:#fff;}*/ /*#RSide{ background:#fff;}*/
/*上传图片处理*/ /*上传图片处理*/
.navSearchTypeBox{margin-top: 32px;} .navSearchTypeBox{margin-top: 32px;}
#navHomepageSearch{margin-top: 11px;background-color: white;} #navHomepageSearch{margin-top: 11px;background-color: white;}
.upload_img img{max-width: 100%;} .upload_img img{max-width: 100%;}
blockquote img{max-width: 100%;} blockquote img{max-width: 100%;}
.hidden{overflow:hidden; white-space: nowrap; text-overflow:ellipsis;} .hidden{overflow:hidden; white-space: nowrap; text-overflow:ellipsis;}
.none{display: none;} .none{display: none;}
.rside_back{ width:670px; margin-left:10px; background:#fff; margin-bottom:10px;} .rside_back{ width:670px; margin-left:10px; background:#fff; margin-bottom:10px;}
.break_word{ word-break:break-all; word-wrap: break-word;} .break_word{ word-break:break-all; word-wrap: break-word;}
select,input,textarea{ border:1px solid #64bdd9; background:#fff; color:#000; padding-left:5px; } select,input,textarea{ border:1px solid #64bdd9; background:#fff; color:#000; padding-left:5px; }
.sub_btn{ cursor:pointer; -moz-border-radius:3px; -webkit-border-radius:3px; border:1px solid #707070; color:#000; border-radius:3px; padding:1px 10px; background:#dbdbdb;} .sub_btn{ cursor:pointer; -moz-border-radius:3px; -webkit-border-radius:3px; border:1px solid #707070; color:#000; border-radius:3px; padding:1px 10px; background:#dbdbdb;}
.sub_btn:hover{ background:#b5e2fa; color:#000; border:1px solid #3c7fb1;} .sub_btn:hover{ background:#b5e2fa; color:#000; border:1px solid #3c7fb1;}
/*table{ background:#fff;}*/ /*table{ background:#fff;}*/
.more{ font-weight:normal; color:#999; font-size:12px;} .more{ font-weight:normal; color:#999; font-size:12px;}
.no_line{ border-bottom:none;} .no_line{ border-bottom:none;}
.line{border-bottom:1px dashed #d4d4d4; padding-bottom:10px; margin-bottom:10px;} .line{border-bottom:1px dashed #d4d4d4; padding-bottom:10px; margin-bottom:10px;}
.no_border{ border:none;background:none;} .no_border{ border:none;background:none;}
.min_search{ width:150px; height:20px; border:1px solid #d0d0d0; color:#666; background:url(../images/public_icon.png) 135px -193px no-repeat; cursor:pointer;} .min_search{ width:150px; height:20px; border:1px solid #d0d0d0; color:#666; background:url(../images/public_icon.png) 135px -193px no-repeat; cursor:pointer;}
.db {display:block;} .db {display:block;}
/* font & color */ /* font & color */
.f12{font-size:12px; font-weight:normal;} .f12{font-size:12px; font-weight:normal;}
.f14{font-size:14px;} .f14{font-size:14px;}
.f16{font-size:16px;} .f16{font-size:16px;}
.f18{font-size:18px;} .f18{font-size:18px;}
.fb{font-weight:bold;} .fb{font-weight:bold;}
/* Float & Clear */ /* Float & Clear */
.cl{ clear:both; overflow:hidden; } .cl{ clear:both; overflow:hidden; }
.fl{float:left;display:inline;} .fl{float:left;display:inline;}
.fr{float:right;display:inline;} .fr{float:right;display:inline;}
.f_l{ float:left;} .f_l{ float:left;}
.f_r{ float:right;} .f_r{ float:right;}
.clearfix:after{clear:both;content:".";display:block;font-size:0;height:0;line-height:0;visibility:hidden} .clearfix:after{clear:both;content:".";display:block;font-size:0;height:0;line-height:0;visibility:hidden}
.clearfix{clear:both;zoom:1} .clearfix{clear:both;zoom:1}
.break_word{ word-break:break-all; word-wrap: break-word;} .break_word{ word-break:break-all; word-wrap: break-word;}
.white_space{white-space:nowrap;} .white_space{white-space:nowrap;}
a.c_white{ color:#fff !important;} a.c_white{ color:#fff !important;}
input.c_white { color:#fff !important;} input.c_white { color:#fff !important;}
/* Spacing */ /* Spacing */
.ml2{ margin-left:2px;} .ml2{ margin-left:2px;}
.ml3{ margin-left:3px;} .ml3{ margin-left:3px;}
.ml4{ margin-left:4px;} .ml4{ margin-left:4px;}
.ml5{ margin-left:5px;} .ml5{ margin-left:5px;}
.ml8{ margin-left:8px;} .ml8{ margin-left:8px;}
.ml10{ margin-left:10px;} .ml10{ margin-left:10px;}
.ml15{ margin-left:15px;} .ml15{ margin-left:15px;}
.ml20{ margin-left:20px;} .ml20{ margin-left:20px;}
.ml40{ margin-left:40px;} .ml40{ margin-left:40px;}
.ml45{ margin-left:45px;} .ml45{ margin-left:45px;}
.ml55{ margin-left:55px;} .ml55{ margin-left:55px;}
.ml30{ margin-left:30px;} .ml30{ margin-left:30px;}
.ml60{ margin-left:60px;} .ml60{ margin-left:60px;}
.ml80{ margin-left:80px;} .ml80{ margin-left:80px;}
.ml90{ margin-left:90px;} .ml90{ margin-left:90px;}
.ml100{ margin-left:100px;} .ml100{ margin-left:100px;}
.ml110{ margin-left:110px;} .ml110{ margin-left:110px;}
.ml150 { margin-left:150px;} .ml150 { margin-left:150px;}
.mr5{ margin-right:5px;} .mr5{ margin-right:5px;}
.mr45 {margin-right:45px;} .mr45 {margin-right:45px;}
.mr55{ margin-right:55px;} .mr55{ margin-right:55px;}
.mr10{ margin-right:10px;} .mr10{ margin-right:10px;}
.mr15 {margin-right:15px;} .mr15 {margin-right:15px;}
.mr20{ margin-right:20px;} .mr20{ margin-right:20px;}
.mr30{ margin-right:30px;} .mr30{ margin-right:30px;}
.mr40{ margin-right:40px;} .mr40{ margin-right:40px;}
.mw20{ margin: 0 20px;} .mw20{ margin: 0 20px;}
.mt3{ margin-top:3px;} .mt3{ margin-top:3px;}
.mt5{ margin-top:5px;} .mt5{ margin-top:5px;}
.mt8{ margin-top:8px;} .mt8{ margin-top:8px;}
.mt10{ margin-top:10px !important;} .mt10{ margin-top:10px !important;}
.mt15 {margin-top:15px;} .mt15 {margin-top:15px;}
.mb4{ margin-bottom:4px;} .mb4{ margin-bottom:4px;}
.mb5{ margin-bottom:5px;} .mb5{ margin-bottom:5px;}
.mb8 {margin-bottom:8px;} .mb8 {margin-bottom:8px;}
.mb10{ margin-bottom:10px !important;} .mb10{ margin-bottom:10px !important;}
.mb20{ margin-bottom:20px;} .mb20{ margin-bottom:20px;}
.pl15{ padding-left:15px;} .pl15{ padding-left:15px;}
.w20{ width:20px;} .w20{ width:20px;}
.w60{ width:60px;} .w60{ width:60px;}
.w70{ width:70px;} .w70{ width:70px;}
.w90{ width:90px;} .w90{ width:90px;}
.w210{ width:210px;} .w210{ width:210px;}
.w150{ width:150px;} .w150{ width:150px;}
.w280{ width:280px;} .w280{ width:280px;}
.w430{ width:470px;} .w430{ width:470px;}
.w520{ width:520px;} .w520{ width:520px;}
.w543{ width:543px;} .w543{ width:543px;}
.w557{ width:557px;} .w557{ width:557px;}
.w583{ width:583px;} .w683{ width:683px;}
.w350{ width:350px;} .w350{ width:350px;}
.w610{ width:610px;} .w610{ width:610px;}
.w600{ width:600px;} .w600{ width:600px;}
.h22{ height:22px;} .h22{ height:22px;}
.h26{ height:26px;} .h26{ height:26px;}
.h50{ height:50px;} .h50{ height:50px;}
.h70{ height:70px;} .h70{ height:70px;}
.h150{ height:150px;} .h150{ height:150px;}

View File

@ -1205,7 +1205,6 @@ a:hover.memberBtn{background: url(/images/course/hwork_icon.png) -80px -90px no-
.addMemberC li:hover {cursor:pointer; background-color:#cccccc;} .addMemberC li:hover {cursor:pointer; background-color:#cccccc;}
.addMemberCP {width:514px; height:auto; border:3px solid #269ac9; padding-left:16px; padding-bottom:16px; background-color:#ffffff; position:fixed !important;left:50%;top:50%;margin:-100px 0 0 -150px; -moz-border-radius:5px;} .addMemberCP {width:514px; height:auto; border:3px solid #269ac9; padding-left:16px; padding-bottom:16px; background-color:#ffffff; position:fixed !important;left:50%;top:50%;margin:-100px 0 0 -150px; -moz-border-radius:5px;}
.rightArrow {margin:50px 15px 0px 15px; float:left;} .rightArrow {margin:50px 15px 0px 15px; float:left;}
.relateText {font-size:16px; color:#269ac9; line-height:16px; padding-top:20px; display:inline-block; font-weight: bold;}
.maxHeight100 {max-height:100px; overflow-x:hidden; overflow-y:auto;} .maxHeight100 {max-height:100px; overflow-x:hidden; overflow-y:auto;}
.resubAtt {border-top:1px solid #dddddd; position:relative; margin-top:15px;} .resubAtt {border-top:1px solid #dddddd; position:relative; margin-top:15px;}
.resubTitle {position:absolute; top:-10px; left:5px; background-color:#ffffff; display:block; font-weight:bold; padding:0px 2px;} .resubTitle {position:absolute; top:-10px; left:5px; background-color:#ffffff; display:block; font-weight:bold; padding:0px 2px;}
@ -1267,7 +1266,7 @@ div.disable_link {background-color: #c1c1c1 !important;}
/*导入题库样式*/ /*导入题库样式*/
.popupWrap {border:3px solid #269ac9; padding:15px; background-color:#ffffff; position:relative; z-index:1000;} .popupWrap {border:3px solid #269ac9; padding:15px; background-color:#ffffff; position:relative; z-index:1000;}
.subjectList {width:585px;} .subjectList {width:585px;}
.subjectDetail {width:385px;} .subjectDetail {width:285px;}
a.subjectChoose {padding:8px 20px; background-color:#f1f1f1; color:#888888;} a.subjectChoose {padding:8px 20px; background-color:#f1f1f1; color:#888888;}
a.chooseActive {background-color:#269ac9; color:#ffffff;} a.chooseActive {background-color:#269ac9; color:#ffffff;}
.subjectBanner {width:585px; height:40px; background-color:#f1f1f1; border-top:1px solid #eaeaea; color:#7a7a7a; font-size:14px;} .subjectBanner {width:585px; height:40px; background-color:#f1f1f1; border-top:1px solid #eaeaea; color:#7a7a7a; font-size:14px;}
@ -1278,7 +1277,7 @@ a.chooseActive {background-color:#269ac9; color:#ffffff;}
.subjectRow {width:585px; height:40px; color:#7a7a7a; font-size:12px;} .subjectRow {width:585px; height:40px; color:#7a7a7a; font-size:12px;}
.subjectRow li {height:40px; line-height:40px; vertical-align:middle;} .subjectRow li {height:40px; line-height:40px; vertical-align:middle;}
.subjectSearch {border:1px solid #dddddd; height:32px; width:250px;} .subjectSearch {border:1px solid #dddddd; height:32px; width:250px;}
.subjectInfo {width:385px; background-color:#f1f1f1; border:1px solid #dddddd; height:32px; line-height:32px; vertical-align:middle; text-align:center; color:#7a7a7a;} .subjectInfo {width:285px; background-color:#f1f1f1; border:1px solid #dddddd; height:32px; line-height:32px; vertical-align:middle; text-align:center; color:#7a7a7a;}
.subjectWrap {border:1px solid #dddddd; border-top:none; padding:10px; width:365px; height:460px; overflow-y:auto;} .subjectWrap {border:1px solid #dddddd; border-top:none; padding:10px; width:365px; height:460px; overflow-y:auto;}
.subjectIntro {color:#585858; line-height:18px; font-size:12px;} .subjectIntro {color:#585858; line-height:18px; font-size:12px;}
.subjectContent {color:#888888; line-height:18px; font-size:12px;} .subjectContent {color:#888888; line-height:18px; font-size:12px;}

View File

@ -135,7 +135,7 @@ a.linkGrey6:hover {color:#ffffff !important;}
.w520{ width:520px;} .w520{ width:520px;}
.w543{ width:543px;} .w543{ width:543px;}
.w557{ width:557px;} .w557{ width:557px;}
.w583{ width:583px;} .w683{ width:683px;}
.w350{ width:350px;} .w350{ width:350px;}
.w610{ width:610px;} .w610{ width:610px;}
.w600{ width:600px;} .w600{ width:600px;}
@ -845,7 +845,7 @@ a.sortArrowActiveU {background:url(images/post_image_list.png) -17px -20px no-re
.postDetailTitle {width:580px; max-width:580px; margin-bottom:5px;} .postDetailTitle {width:580px; max-width:580px; margin-bottom:5px;}
.postDetailDes {width:580px; max-width:580px; margin-bottom:6px; color:#888888;display:block;overflow:hidden;word-break:keep-all;text-overflow:ellipsis;} .postDetailDes {width:580px; max-width:580px; margin-bottom:6px; color:#888888;display:block;overflow:hidden;word-break:keep-all;text-overflow:ellipsis;}
.postDetailDes p,div,em{word-break: break-all;word-wrap: break-word;} .postDetailDes p,div,em{word-break: break-all;word-wrap: break-word;}
.homepagePostIntro p,.homepagePostIntro div,.homepagePostIntro em, .homepagePostIntro span{text-align: justify; text-justify:inter-ideograph; word-break: normal !important; word-wrap: break-word !important; line-height: 23px !important;} .homepagePostIntro p,.homepagePostIntro div,.homepagePostIntro em, .homepagePostIntro span{text-align: justify; text-justify:inter-ideograph; word-break: normal !important; word-wrap: break-word !important; line-height: 18px !important;}
.postDetailCreater {color:#888888; font-size:12px; float:left; margin-right:25px;} .postDetailCreater {color:#888888; font-size:12px; float:left; margin-right:25px;}
.postDetailDate {color:#888888; font-size:12px; float:left;} .postDetailDate {color:#888888; font-size:12px; float:left;}
.postDetailReply { margin-top:28px; color:#888888; float:right;display: inline} .postDetailReply { margin-top:28px; color:#888888; float:right;display: inline}
@ -1440,50 +1440,50 @@ span.at a{color:#269ac9;text-decoration: none;}
/*导入题库样式*/ /*导入题库样式*/
.popup-wrapper {border:3px solid #269ac9; padding:15px; background-color:#ffffff; position:relative; z-index:1000;} .popup-wrapper {border:3px solid #269ac9; padding:15px; background-color:#ffffff; position:relative; z-index:1000;}
.subject-list {width:585px;} .subject-list {width:685px;}
.subject-detail {width:385px;} .subject-detail {width:285px;}
a.subject-choose {padding:8px 20px; background-color:#f1f1f1; color:#888888;} a.subject-choose {padding:8px 20px; background-color:#f1f1f1; color:#888888;}
a.choose-active {background-color:#269ac9; color:#ffffff;} a.choose-active {background-color:#269ac9; color:#ffffff;}
.subject-pop-banner {width:585px; height:40px; background-color:#f1f1f1; border-top:1px solid #eaeaea; color:#7a7a7a; font-size:14px;} .subject-pop-banner {width:685px; height:40px; background-color:#f1f1f1; border-top:1px solid #eaeaea; color:#7a7a7a; font-size:14px;}
.subject-pop-banner li {height:40px; line-height:40px; vertical-align:middle;} .subject-pop-banner li {height:40px; line-height:40px; vertical-align:middle;}
.subject-pop-name {width:200px; padding-left:10px; padding-right:10px;} .subject-pop-name {width:260px; padding-left:10px; padding-right:10px;}
.subject-pop-publisher {width:80px; text-align:center;} .subject-pop-publisher {width:80px; text-align:center;}
.subject-pop-date {width:75px; text-align:center;} .subject-pop-date {width:75px; text-align:center;}
.subject-pop-row {width:585px; height:30px; color:#7a7a7a; font-size:12px;} .subject-pop-row {width:685px; height:30px; color:#7a7a7a; font-size:12px;}
.subject-pop-row li {height:30px; line-height:30px; vertical-align:middle;} .subject-pop-row li {height:30px; line-height:30px; vertical-align:middle;}
.subject-pop-search {border:1px solid #dddddd; height:32px; width:250px;} .subject-pop-search {border:1px solid #dddddd; height:32px; width:250px;}
.subject-pop-info {width:385px; background-color:#f1f1f1; border:1px solid #dddddd; height:32px; line-height:32px; vertical-align:middle; text-align:center; color:#7a7a7a;} .subject-pop-info {width:285px; background-color:#f1f1f1; border:1px solid #dddddd; height:32px; line-height:32px; vertical-align:middle; text-align:center; color:#7a7a7a;}
.subject-pop-wrap {border:1px solid #dddddd; border-top:none; padding:10px; width:365px; height:475px; overflow-y:auto;} .subject-pop-wrap {border:1px solid #dddddd; border-top:none; padding:10px; width:265px; height:475px; overflow-y:auto;}
.subject-pop-intro {color:#585858; line-height:18px; font-size:12px;} .subject-pop-intro {color:#585858; line-height:18px; font-size:12px;}
.subject-pop-content {color:#888888; line-height:18px; font-size:12px;} .subject-pop-content {color:#888888; line-height:18px; font-size:12px;}
.popup-close {background:url(../images/resource_icon_list.png) 0px -40px no-repeat; width:20px; height:20px; display:inline-block; position: absolute; z-index: 1000; right:10px; top:5px;} .popup-close {background:url(../images/resource_icon_list.png) 0px -40px no-repeat; width:20px; height:20px; display:inline-block; position: absolute; z-index: 1000; right:10px; top:5px;}
.subject-pop-type {width:50px; text-align:center;} .subject-pop-type {width:50px; text-align:center;}
.subject-pop-count {width:60px; text-align:center;} .subject-pop-count {width:60px; text-align:center;}
.subject-pop-from {width:100px; text-align:center;} .subject-pop-from {width:140px; text-align:center;}
.subjectContent p,.subjectContent div,.subjectContent em, .subjectContent span{text-align: justify; text-justify:inter-ideograph; word-break: normal !important; word-wrap: break-word !important; line-height: 18px !important; color:#888888 !important; font-size:12px !important;} .subjectContent p,.subjectContent div,.subjectContent em, .subjectContent span{text-align: justify; text-justify:inter-ideograph; word-break: normal !important; word-wrap: break-word !important; line-height: 18px !important; color:#888888 !important; font-size:12px !important;}
.whiteSettingIcon {background:url(../images/hwork_icon.png) -5px -302px no-repeat; width:20px; height:20px;} .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;} .whiteSettingIcon:hover {background:url(../images/homepage_icon.png) -93px -44px no-repeat;}
/*20160301新题库样式*/ /*20160301新题库样式*/
.subject-list-banner {width:585px; height:34px; background-color:#f1f1f1; border-top:1px solid #eaeaea; color:#7a7a7a; font-size:14px;} .subject-list-banner {width:685px; height:40px; background-color:#f1f1f1; border-top:1px solid #eaeaea; color:#7a7a7a; font-size:14px;}
.subject-list-banner li {height:34px; line-height:34px; vertical-align:middle;} .subject-list-banner li {height:40px; line-height:40px; vertical-align:middle;}
.subject-list-name {width:200px; padding-left:10px; padding-right:10px;} .subject-list-name {width:260px; padding-left:10px; padding-right:10px;}
.subject-list-publisher {width:80px; text-align:center;} .subject-list-publisher {width:80px; text-align:center;}
.subject-list-date {width:70px; text-align:center;} .subject-list-date {width:70px; text-align:center;}
.subject-list-row {width:585px; height:30px; color:#7a7a7a; font-size:12px;} .subject-list-row {width:685px; height:40px; color:#7a7a7a; font-size:12px;}
.subject-list-row li {height:30px; line-height:30px; vertical-align:middle;} .subject-list-row li {height:40px; line-height:40px; vertical-align:middle;}
.subject-list-search {border:1px solid #dddddd; height:32px; width:250px;} .subject-list-search {border:1px solid #dddddd; height:32px; width:250px;}
.subject-list-info {width:385px; background-color:#f1f1f1; border:1px solid #dddddd; height:32px; line-height:32px; vertical-align:middle; text-align:center; color:#7a7a7a;} .subject-list-info {width:385px; background-color:#f1f1f1; border:1px solid #dddddd; height:32px; line-height:32px; vertical-align:middle; text-align:center; color:#7a7a7a;}
.subject-list-wrap {border:1px solid #dddddd; border-top:none; padding:10px; width:365px; height:460px; overflow-y:auto;} .subject-list-wrap {border:1px solid #dddddd; border-top:none; padding:10px; width:365px; height:460px; overflow-y:auto;}
.subject-content-wrapper {border:1px solid #dddddd; border-top:none; padding:10px; width:365px; height:430px; overflow-y:auto;} .subject-content-wrapper {border:1px solid #dddddd; border-top:none; padding:10px; width:265px; height:430px; overflow-y:auto;}
.subject-list-type {width:50px; text-align:center;} .subject-list-type {width:50px; text-align:center;}
.subject-list-count {width:60px; text-align:center;} .subject-list-count {width:60px; text-align:center;}
.subject-list-from {width:105px; text-align:center;} .subject-list-from {width:145px; text-align:center;}
/*视频播放默认图标*/ /*视频播放默认图标*/
.mediaIco{margin: 30px 0 30px 20px;} .mediaIco{margin: 30px 0 30px 20px;}
a.st_up{ display: block; width:8px; float:left; height:13px; background:url(../images/pic_up.png) 0 0 no-repeat; margin-top:5px; margin-left:3px;} a.st_up{ display: block; width:8px; float:left; height:13px; background:url(../images/pic_up.png) 0 0 no-repeat; margin-top:5px; margin-left:3px;}
a.st_down{ display: block; width:8px; float:left; height:13px; background:url(../images/pic_up.png) 0 -22px no-repeat; margin-top:5px; margin-left:3px;} a.st_down{ display: block; width:8px; float:left; height:13px; background:url(../images/pic_up.png) 0 -22px no-repeat; margin-top:5px; margin-left:3px;}
a.st_img { display:block;width:32px; height:32px; border:1px solid #CCC; padding:1px;} a.st_img { display:block;width:32px; height:32px; border:1px solid #CCC; padding:1px;}
a:hover.st_img { border:1px solid #1c9ec7; } a:hover.st_img { border:1px solid #1c9ec7; }

View File

@ -22,6 +22,7 @@ a.saveBtn:hover {background-color:#297fb8;}
.orgListRow {border-bottom:1px solid #e4e4e4; padding-bottom:5px;} .orgListRow {border-bottom:1px solid #e4e4e4; padding-bottom:5px;}
.orgListUser {width:85px; float:left;} .orgListUser {width:85px; float:left;}
.orgListRole {width:180px; float:left;} .orgListRole {width:180px; float:left;}
.orgOrder {width:30px; float:left;margin-right:10px;text-align:center;}
.orgMemContainer {width:228px;} .orgMemContainer {width:228px;}
.orgMemberAdd {float:right;} .orgMemberAdd {float:right;}
.orgAddSearch {border:1px solid #dddddd; outline:none; width:180px; height:22px; color:#9b9b9b;} .orgAddSearch {border:1px solid #dddddd; outline:none; width:180px; height:22px; color:#9b9b9b;}
@ -121,7 +122,7 @@ a.link_file_a2{ background:url(../images/pic_file.png) 0 -15px no-repeat; paddin
/*导入题库样式*/ /*导入题库样式*/
.popupWrap {border:3px solid #269ac9; padding:15px; background-color:#ffffff; position:relative; z-index:1000;} .popupWrap {border:3px solid #269ac9; padding:15px; background-color:#ffffff; position:relative; z-index:1000;}
.subjectList {width:585px;} .subjectList {width:585px;}
.subjectDetail {width:385px;} .subjectDetail {width:285px;}
a.subjectChoose {padding:8px 20px; background-color:#f1f1f1; color:#888888;} a.subjectChoose {padding:8px 20px; background-color:#f1f1f1; color:#888888;}
a.chooseActive {background-color:#269ac9; color:#ffffff;} a.chooseActive {background-color:#269ac9; color:#ffffff;}
.subjectBanner {width:585px; height:40px; background-color:#f1f1f1; border-top:1px solid #eaeaea; color:#7a7a7a; font-size:14px;} .subjectBanner {width:585px; height:40px; background-color:#f1f1f1; border-top:1px solid #eaeaea; color:#7a7a7a; font-size:14px;}
@ -132,7 +133,7 @@ a.chooseActive {background-color:#269ac9; color:#ffffff;}
.subjectRow {width:585px; height:40px; color:#7a7a7a; font-size:12px;} .subjectRow {width:585px; height:40px; color:#7a7a7a; font-size:12px;}
.subjectRow li {height:40px; line-height:40px; vertical-align:middle;} .subjectRow li {height:40px; line-height:40px; vertical-align:middle;}
.subjectSearch {border:1px solid #dddddd; height:32px; width:250px;} .subjectSearch {border:1px solid #dddddd; height:32px; width:250px;}
.subjectInfo {width:385px; background-color:#f1f1f1; border:1px solid #dddddd; height:32px; line-height:32px; vertical-align:middle; text-align:center; color:#7a7a7a;} .subjectInfo {width:285px; background-color:#f1f1f1; border:1px solid #dddddd; height:32px; line-height:32px; vertical-align:middle; text-align:center; color:#7a7a7a;}
.subjectWrap {border:1px solid #dddddd; border-top:none; padding:10px; width:365px; height:460px; overflow-y:auto;} .subjectWrap {border:1px solid #dddddd; border-top:none; padding:10px; width:365px; height:460px; overflow-y:auto;}
.subjectIntro {color:#585858; line-height:18px; font-size:12px;} .subjectIntro {color:#585858; line-height:18px; font-size:12px;}
.subjectContent {color:#888888; line-height:18px; font-size:12px;} .subjectContent {color:#888888; line-height:18px; font-size:12px;}

View File

@ -1182,7 +1182,7 @@ div.disable_link {background-color: #c1c1c1 !important;}
/*导入题库样式*/ /*导入题库样式*/
.popupWrap {border:3px solid #269ac9; padding:15px; background-color:#ffffff; position:relative; z-index:1000;} .popupWrap {border:3px solid #269ac9; padding:15px; background-color:#ffffff; position:relative; z-index:1000;}
.subjectList {width:585px;} .subjectList {width:585px;}
.subjectDetail {width:385px;} .subjectDetail {width:285px;}
a.subjectChoose {padding:8px 20px; background-color:#f1f1f1; color:#888888;} a.subjectChoose {padding:8px 20px; background-color:#f1f1f1; color:#888888;}
a.chooseActive {background-color:#269ac9; color:#ffffff;} a.chooseActive {background-color:#269ac9; color:#ffffff;}
.subjectBanner {width:585px; height:40px; background-color:#f1f1f1; border-top:1px solid #eaeaea; color:#7a7a7a; font-size:14px;} .subjectBanner {width:585px; height:40px; background-color:#f1f1f1; border-top:1px solid #eaeaea; color:#7a7a7a; font-size:14px;}
@ -1193,7 +1193,7 @@ a.chooseActive {background-color:#269ac9; color:#ffffff;}
.subjectRow {width:585px; height:40px; color:#7a7a7a; font-size:12px;} .subjectRow {width:585px; height:40px; color:#7a7a7a; font-size:12px;}
.subjectRow li {height:40px; line-height:40px; vertical-align:middle;} .subjectRow li {height:40px; line-height:40px; vertical-align:middle;}
.subjectSearch {border:1px solid #dddddd; height:32px; width:250px;} .subjectSearch {border:1px solid #dddddd; height:32px; width:250px;}
.subjectInfo {width:385px; background-color:#f1f1f1; border:1px solid #dddddd; height:32px; line-height:32px; vertical-align:middle; text-align:center; color:#7a7a7a;} .subjectInfo {width:285px; background-color:#f1f1f1; border:1px solid #dddddd; height:32px; line-height:32px; vertical-align:middle; text-align:center; color:#7a7a7a;}
.subjectWrap {border:1px solid #dddddd; border-top:none; padding:10px; width:365px; height:460px; overflow-y:auto;} .subjectWrap {border:1px solid #dddddd; border-top:none; padding:10px; width:365px; height:460px; overflow-y:auto;}
.subjectIntro {color:#585858; line-height:18px; font-size:12px;} .subjectIntro {color:#585858; line-height:18px; font-size:12px;}
.subjectContent {color:#888888; line-height:18px; font-size:12px;} .subjectContent {color:#888888; line-height:18px; font-size:12px;}

View File

@ -165,7 +165,7 @@ h4{ font-size:14px; color:#3b3b3b;}
.w543{ width:543px;} .w543{ width:543px;}
.w557{ width:557px;} .w557{ width:557px;}
.w576{ width:576px;} .w576{ width:576px;}
.w583{ width:583px;} .w683{ width:683px;}
.w350{ width:350px;} .w350{ width:350px;}
.w610{ width:610px;} .w610{ width:610px;}
.w600{ width:600px !important;} .w600{ width:600px !important;}
@ -1034,26 +1034,26 @@ a:hover.userCancel{border:1px solid #888888; }
/*导入题库样式*/ /*导入题库样式*/
.popup-wrapper {border:3px solid #269ac9; padding:15px; background-color:#ffffff; position:relative; z-index:1000;} .popup-wrapper {border:3px solid #269ac9; padding:15px; background-color:#ffffff; position:relative; z-index:1000;}
.subject-list {width:585px;} .subject-list {width:685px;}
.subject-detail {width:385px;} .subject-detail {width:285px;}
a.subject-choose {padding:8px 20px; background-color:#f1f1f1; color:#888888;} a.subject-choose {padding:8px 20px; background-color:#f1f1f1; color:#888888;}
a.choose-active {background-color:#269ac9; color:#ffffff;} a.choose-active {background-color:#269ac9; color:#ffffff;}
.subject-pop-banner {width:585px; height:40px; background-color:#f1f1f1; border-top:1px solid #eaeaea; color:#7a7a7a; font-size:14px;} .subject-pop-banner {width:685px; height:40px; background-color:#f1f1f1; border-top:1px solid #eaeaea; color:#7a7a7a; font-size:14px;}
.subject-pop-banner li {height:40px; line-height:40px; vertical-align:middle;} .subject-pop-banner li {height:40px; line-height:40px; vertical-align:middle;}
.subject-pop-name {width:200px; padding-left:10px; padding-right:10px;} .subject-pop-name {width:260px; padding-left:10px; padding-right:10px;}
.subject-pop-publisher {width:80px; text-align:center;} .subject-pop-publisher {width:80px; text-align:center;}
.subject-pop-date {width:75px; text-align:center;} .subject-pop-date {width:75px; text-align:center;}
.subject-pop-row {width:585px; height:30px; color:#7a7a7a; font-size:12px;} .subject-pop-row {width:685px; height:30px; color:#7a7a7a; font-size:12px;}
.subject-pop-row li {height:30px; line-height:30px; vertical-align:middle;} .subject-pop-row li {height:30px; line-height:30px; vertical-align:middle;}
.subject-pop-search {border:1px solid #dddddd; height:32px; width:250px;} .subject-pop-search {border:1px solid #dddddd; height:32px; width:250px;}
.subject-pop-info {width:385px; background-color:#f1f1f1; border:1px solid #dddddd; height:32px; line-height:32px; vertical-align:middle; text-align:center; color:#7a7a7a;} .subject-pop-info {width:285px; background-color:#f1f1f1; border:1px solid #dddddd; height:32px; line-height:32px; vertical-align:middle; text-align:center; color:#7a7a7a;}
.subject-pop-wrap {border:1px solid #dddddd; border-top:none; padding:10px; width:365px; height:475px; overflow-y:auto;} .subject-pop-wrap {border:1px solid #dddddd; border-top:none; padding:10px; width:265px; height:475px; overflow-y:auto;}
.subject-pop-intro {color:#585858; line-height:18px; font-size:12px;} .subject-pop-intro {color:#585858; line-height:18px; font-size:12px;}
.subject-pop-content {color:#888888; line-height:18px; font-size:12px;} .subject-pop-content {color:#888888; line-height:18px; font-size:12px;}
.popup-close {background:url(../images/resource_icon_list.png) 0px -40px no-repeat; width:20px; height:20px; display:inline-block; position: absolute; z-index: 1000; right:10px; top:5px;} .popup-close {background:url(../images/resource_icon_list.png) 0px -40px no-repeat; width:20px; height:20px; display:inline-block; position: absolute; z-index: 1000; right:10px; top:5px;}
.subject-pop-type {width:50px; text-align:center;} .subject-pop-type {width:50px; text-align:center;}
.subject-pop-count {width:60px; text-align:center;} .subject-pop-count {width:60px; text-align:center;}
.subject-pop-from {width:100px; text-align:center;} .subject-pop-from {width:140px; text-align:center;}
.subjectContent p,.subjectContent div,.subjectContent em, .subjectContent span{text-align: justify; text-justify:inter-ideograph; word-break: normal !important; word-wrap: break-word !important; line-height: 18px !important; color:#888888 !important; font-size:12px !important;} .subjectContent p,.subjectContent div,.subjectContent em, .subjectContent span{text-align: justify; text-justify:inter-ideograph; word-break: normal !important; word-wrap: break-word !important; line-height: 18px !important; color:#888888 !important; font-size:12px !important;}
.whiteSettingIcon {background:url(../images/hwork_icon.png) -5px -302px no-repeat; width:20px; height:20px;} .whiteSettingIcon {background:url(../images/hwork_icon.png) -5px -302px no-repeat; width:20px; height:20px;}
@ -1086,7 +1086,7 @@ a.resource-tab-active {color:#fff; background-color:#269ac9; border-bottom:1px s
/*导入资源样式*/ /*导入资源样式*/
.popupWrap {border:3px solid #269ac9; padding:15px; background-color:#ffffff; position:relative; z-index:1000;} .popupWrap {border:3px solid #269ac9; padding:15px; background-color:#ffffff; position:relative; z-index:1000;}
.resoure-list {width:705px;} .resoure-list {width:705px;}
.subjectDetail {width:385px;} .subjectDetail {width:285px;}
.resource-pop-banner {width:705px; height:40px; background-color:#f1f1f1; border-top:1px solid #eaeaea; color:#7a7a7a; font-size:14px;} .resource-pop-banner {width:705px; height:40px; background-color:#f1f1f1; border-top:1px solid #eaeaea; color:#7a7a7a; font-size:14px;}
.resource-pop-banner li {height:40px; line-height:40px; vertical-align:middle;} .resource-pop-banner li {height:40px; line-height:40px; vertical-align:middle;}
.resource-pop-name {width:270px; padding-left:10px; padding-right:10px;} .resource-pop-name {width:270px; padding-left:10px; padding-right:10px;}
@ -1095,7 +1095,7 @@ a.resource-tab-active {color:#fff; background-color:#269ac9; border-bottom:1px s
.resource-pop-row {width:705px; height:40px; color:#7a7a7a; font-size:12px;} .resource-pop-row {width:705px; height:40px; color:#7a7a7a; font-size:12px;}
.resource-pop-row li {height:40px; line-height:40px; vertical-align:middle;} .resource-pop-row li {height:40px; line-height:40px; vertical-align:middle;}
.subjectSearch {border:1px solid #dddddd; height:32px; width:250px;} .subjectSearch {border:1px solid #dddddd; height:32px; width:250px;}
.subjectInfo {width:385px; background-color:#f1f1f1; border:1px solid #dddddd; height:32px; line-height:32px; vertical-align:middle; text-align:center; color:#7a7a7a;} .subjectInfo {width:285px; background-color:#f1f1f1; border:1px solid #dddddd; height:32px; line-height:32px; vertical-align:middle; text-align:center; color:#7a7a7a;}
.subjectWrap {border:1px solid #dddddd; border-top:none; padding:10px; width:365px; height:460px; overflow-y:auto;} .subjectWrap {border:1px solid #dddddd; border-top:none; padding:10px; width:365px; height:460px; overflow-y:auto;}
.subjectIntro {color:#585858; line-height:18px; font-size:12px;} .subjectIntro {color:#585858; line-height:18px; font-size:12px;}
.subjectContent {color:#888888; line-height:18px; font-size:12px;} .subjectContent {color:#888888; line-height:18px; font-size:12px;}
@ -1136,4 +1136,4 @@ a.program-btn{background: url(../images/homepage_icon.png) -86px -393px no-repea
.mediaIco{margin: 30px 0 30px 20px;width: 200px;} .mediaIco{margin: 30px 0 30px 20px;width: 200px;}
/*排序样式*/ /*排序样式*/
a.st_up{ display: block; width:8px; float:left; height:13px; background:url(../images/pic_up.png) 0 0 no-repeat; margin-top:5px; margin-left:3px;} a.st_up{ display: block; width:8px; float:left; height:13px; background:url(../images/pic_up.png) 0 0 no-repeat; margin-top:5px; margin-left:3px;}
a.st_down{ display: block; width:8px; float:left; height:13px; background:url(../images/pic_up.png) 0 -22px no-repeat; margin-top:5px; margin-left:3px;} a.st_down{ display: block; width:8px; float:left; height:13px; background:url(../images/pic_up.png) 0 -22px no-repeat; margin-top:5px; margin-left:3px;}

File diff suppressed because it is too large Load Diff

View File

@ -50,4 +50,6 @@ a.resourcesTypeAll {background:url(images/homepage_icon.png) -180px -89px no-rep
.codeIcon {background:url(../images/hwork_icon.png) -78px -160px no-repeat; padding-left:23px;} .codeIcon {background:url(../images/hwork_icon.png) -78px -160px no-repeat; padding-left:23px;}
.othersIcon {background:url(../images/hwork_icon.png) -3px -210px no-repeat; padding-left:23px;} .othersIcon {background:url(../images/hwork_icon.png) -3px -210px no-repeat; padding-left:23px;}
.thesisIcon {background:url(../images/hwork_icon.png) -78px -212px no-repeat; padding-left:23px;} .thesisIcon {background:url(../images/hwork_icon.png) -78px -212px no-repeat; padding-left:23px;}
.softwareIcon {background:url(../images/hwork_icon.png) -5px -254px no-repeat; padding-left:23px;} .softwareIcon {background:url(../images/hwork_icon.png) -5px -254px no-repeat; padding-left:23px;}
.relateText {font-size:16px; color:#269ac9; line-height:16px; padding-top:20px; display:inline-block; font-weight: bold;}