Merge branch 'szzh' into develop

This commit is contained in:
sw 2015-07-17 17:39:21 +08:00
commit 191dc46032
90 changed files with 4018 additions and 1933 deletions

View File

@ -26,6 +26,7 @@ gem 'spreadsheet'
gem 'ruby-ole'
gem 'rails_kindeditor',path:'lib/rails_kindeditor'
#gem "rmagick", ">= 2.0.0"
gem 'binding_of_caller'
group :development do
gem 'grape-swagger'

View File

@ -3,6 +3,9 @@ module Mobile
module Apis
class Courses < Grape::API
resource :courses do
def self.get_service
CoursesService.new
end
desc "获取所有课程"
params do
optional :school_id, type: Integer, desc: '传入学校id,返回该学校课程列表'
@ -337,9 +340,56 @@ module Mobile
get ':course_id/student_works_list' do
cs = CoursesService.new
student_works = cs.student_work_list params,current_user
present :data,student_works.all,with:Mobile::Entities::StudentWork
present :data,student_works,with:Mobile::Entities::StudentWork
present :status,0
end
desc '讨论区信息'
params do
requires :token,type:String
requires :course_id,type:Integer,desc:'课程id'
optional :page,type:Integer,desc:'页码'
end
get ':course_id/board_message_list' do
cs = CoursesService.new
board_messages_list = cs.board_message_list params,current_user
present :data,board_messages_list.all,with:Mobile::Entities::Message
present :status,0
end
desc '讨论区某主题的回复列表'
params do
requires :token,type:String
requires :board_id,type:Integer,desc:'讨论区id'
requires :msg_id,type:Integer,desc:'讨论主题id'
optional :page,type:Integer,desc:'页码'
end
get ':board_id/board_message_reply_list' do
cs = Courses.get_service
board_messages_list = cs.board_message_reply_list params,current_user
present :data,board_messages_list.all,with:Mobile::Entities::Message
present :status,0
end
desc '讨论区回复'
params do
requires :token,type:String
requires :board_id,type:Integer,desc:'讨论区id'
requires :parent_id,type:Integer,desc:'本回复父id'
requires :subject,type:String,desc:'本回复主题'
requires :content,type:String,desc:'本回复内容'
requires :root_id,type:Integer,desc:'本回复根id'
requires :quote,type:String,desc:'本回复引用内容'
end
post ':board_id/board_message_reply' do
cs = Courses.get_service
board_messages = cs.board_message_reply params,current_user
present :data,board_messages,with:Mobile::Entities::Message
present :status,0
end
end
end

View File

@ -1,6 +1,8 @@
class HomeworkCommonController < ApplicationController
require 'net/http'
require 'json'
layout "base_courses"
before_filter :find_course, :only => [:index,:new,:create]
before_filter :find_course, :only => [:index,:new,:create,:next_step]
before_filter :find_homework, :only => [:edit,:update,:alert_anonymous_comment,:start_anonymous_comment,:stop_anonymous_comment,:destroy]
before_filter :teacher_of_course, :only => [:new, :create, :edit, :update, :destroy, :start_anonymous_comment, :stop_anonymous_comment, :alert_anonymous_comment]
before_filter :member_of_course, :only => [:index]
@ -16,12 +18,22 @@ class HomeworkCommonController < ApplicationController
end
def new
respond_to do |format|
format.html
end
end
#新建作业下一步
def next_step
@homework_type = params[:homework_common_type]
@homework = HomeworkCommon.new
@homework.safe_attributes = params[:homework_common]
@homework.late_penalty = 0
@homework.end_time = (Time.now + 3600 * 24).strftime('%Y-%m-%d')
@homework.publish_time = Time.now.strftime('%Y-%m-%d')
if @homework_type == "1"
#匿评作业相关属性
@homework_detail_manual = HomeworkDetailManual.new
@homework_detail_manual.ta_proportion = 0.6
@ -30,6 +42,13 @@ class HomeworkCommonController < ApplicationController
@homework_detail_manual.evaluation_start = Time.now.strftime('%Y-%m-%d')
@homework_detail_manual.evaluation_end = (Time.now + 3600 * 24).strftime('%Y-%m-%d')
@homework.homework_detail_manual = @homework_detail_manual
elsif @homework_type == "2"
#编程作业相关属性
@homework_detail_programing = HomeworkDetailPrograming.new
@homework.homework_detail_programing = @homework_detail_programing
end
respond_to do |format|
format.html
end
@ -50,6 +69,47 @@ class HomeworkCommonController < ApplicationController
homework.save_attachments(params[:attachments])
render_attachment_warning_if_needed(homework)
if homework.homework_type == 2
homework_detail_programing = HomeworkDetailPrograming.new
homework_detail_programing.language = "C++"
homework_detail_programing.standard_code = params[:standard_code]
question = {title:homework.name,content:homework.description}
question[:input] = []
question[:output] = []
if params[:input] && params[:output]
params[:input].each do |k,v|
if params[:output].include? k
homework_test = HomeworkTest.new
homework_test.input = v
homework_test.output = params[:output][k]
homework.homework_tests << homework_test
question[:input] << homework_test.input
question[:output] << homework_test.output
end
end
end
# uri = URI('http://test.gitlab.trustie.net/api/questions.json')
# req = Net::HTTP::Post.new(uri, initheader = {'Content-Type' =>'application/json'})
# req.body = question.to_json
# res = Net::HTTP.start(uri.hostname, uri.port) do |http|
# http.request(req)
# end
uri = URI('http://192.168.80.21:8080/api/questions.json')
body = question.to_json
res = Net::HTTP.new(uri.host, uri.port).start do |client|
request = Net::HTTP::Post.new(uri.path)
request.body = body
request["Content-Type"] = "application/json"
client.request(request)
end
result = JSON.parse(res.body)
homework_detail_programing.question_id = result["id"] if result["status"] && result["status"] == 0
homework.homework_detail_programing = homework_detail_programing
else
#匿评作业相关属性
homework_detail_manual = HomeworkDetailManual.new
homework_detail_manual.ta_proportion = params[:ta_proportion] || 0.6
@ -59,6 +119,7 @@ class HomeworkCommonController < ApplicationController
homework_detail_manual.evaluation_num = params[:evaluation_num]
homework_detail_manual.absence_penalty = params[:absence_penalty]
homework.homework_detail_manual = homework_detail_manual
end
if homework.save
respond_to do |format|
@ -98,10 +159,10 @@ class HomeworkCommonController < ApplicationController
end
@homework.late_penalty = params[:late_penalty]
end
@homework.course_id = @course.id
# @homework.course_id = @course.id
#匿评作业相关属性
if @homework.homework_type == 1
if @homework.homework_type == 1 && @homework_detail_manual
@homework_detail_manual.ta_proportion = params[:ta_proportion] || 0.6
@homework_detail_manual.evaluation_start = params[:evaluation_start]
@homework_detail_manual.evaluation_end = params[:evaluation_end]
@ -117,18 +178,49 @@ class HomeworkCommonController < ApplicationController
end
@homework_detail_manual.absence_penalty = params[:absence_penalty]
end
else #不是匿评作业缺评扣分为0分每个作品的缺评扣分改为0分防止某些作业在结束匿评之后改为普通作业
elsif @homework.homework_type == 0 #普通作业缺评扣分为0分每个作品的缺评扣分改为0分防止某些作业在结束匿评之后改为普通作业
@homework.student_works.where("absence_penalty != 0").each do |student_work|
student_work.late_penalty = 0
student_work.save
end
@homework_detail_manual.absence_penalty = 0
@homework_detail_manual.absence_penalty = 0 if @homework_detail_manual
end
if @homework.homework_type == 2 && @homework_detail_programing #编程作业
@homework_detail_programing.language = "C++"
@homework_detail_programing.standard_code = params[:standard_code]
homework_tests = @homework.homework_tests
#需要删除的测试
ids = homework_tests.map(&:id) - params[:input].keys.map(&:to_i)
ids.each do |id|
homework_test = HomeworkTest.find id
homework_test.destroy if homework_test
end
if params[:input] && params[:output]
params[:input].each do |k,v|
if params[:output].include? k
homework_test = HomeworkTest.find_by_id k
if homework_test #已存在的测试,修改
homework_test.input = v
homework_test.output = params[:output][k]
else #不存在的测试,增加
homework_test = HomeworkTest.new
homework_test.input = v
homework_test.output = params[:output][k]
homework_test.homework_common = @homework
end
homework_test.save
end
end
end
end
@homework.save_attachments(params[:attachments])
render_attachment_warning_if_needed(@homework)
if @homework.save && @homework_detail_manual.save
if @homework.save
@homework_detail_manual.save if @homework_detail_manual
@homework_detail_programing.save if @homework_detail_programing
respond_to do |format|
format.html {
flash[:notice] = l(:notice_successful_edit)
@ -227,6 +319,7 @@ class HomeworkCommonController < ApplicationController
def find_homework
@homework = HomeworkCommon.find params[:id]
@homework_detail_manual = @homework.homework_detail_manual
@homework_detail_programing = @homework.homework_detail_programing
@course = @homework.course
rescue
render_404

View File

@ -25,6 +25,7 @@ class MyController < ApplicationController
helper :issues
helper :users
helper :custom_fields
helper :user_score
BLOCKS = { 'issuesassignedtome' => :label_assigned_to_me_issues,
'issuesreportedbyme' => :label_reported_issues,
@ -88,6 +89,23 @@ class MyController < ApplicationController
end
end
def clear_user_avatar_temp
@user = User.current
diskfile = disk_filename('User', @user.id)
diskfile1 = diskfile + 'temp'
File.delete(diskfile1) if File.exist?(diskfile1)
end
def save_user_avatar
@user = User.current
diskfile = disk_filename('User', @user.id)
diskfile1 = diskfile + 'temp'
begin
FileUtils.mv diskfile1, diskfile, force: true if File.exist? diskfile1
ensure
File.delete(diskfile1) if File.exist?(diskfile1)
end
end
# Edit user's account
def account
@user = User.current
@ -119,6 +137,8 @@ class MyController < ApplicationController
@se.identity = params[:identity].to_i if params[:identity]
@se.technical_title = params[:technical_title] if params[:technical_title]
@se.student_id = params[:no] if params[:no]
@se.brief_introduction = params[:brief_introduction]
@se.description = params[:description]
if @user.save && @se.save
# 头像保存
@ -137,6 +157,7 @@ class MyController < ApplicationController
File.delete(diskfile1) if File.exist?(diskfile1)
end
render :layout=>'base_users_new'
end
# Destroys user's account
@ -159,6 +180,7 @@ class MyController < ApplicationController
# Manage user's password
def password
@act='password'
@user = User.current
unless @user.change_password_allowed?
flash.now[:error] = l(:notice_can_t_change_password)
@ -178,12 +200,14 @@ class MyController < ApplicationController
flash.now[:error] = l(:notice_account_wrong_password)
end
end
render :template => 'my/account',:layout=>'base_users_new'
rescue Exception => e
if e.message == 'wrong password'
flash.now[:error] = l(:notice_account_wrong_password)
else
flash.now[:error] = e.message
end
render :template => 'my/account',:layout=>'base_users_new'
end
# Create a new feeds key

View File

@ -23,7 +23,7 @@ class PollController < ApplicationController
def show
@poll = Poll.find params[:id]
if @poll.polls_status != 2 && !User.current.allowed_to?(:as_teacher,@course)
if @poll.polls_status != 2 && (!User.current.allowed_to?(:as_teacher,@course) || User.current.admin?)
render_403
return
end
@ -393,7 +393,7 @@ class PollController < ApplicationController
end
def is_member_of_course
render_403 unless(@course && User.current.member_of_course?(@course))
render_403 unless(@course && (User.current.member_of_course?(@course) || User.current.admin?))
end
def is_course_teacher

View File

@ -2,46 +2,86 @@ class StudentWorkController < ApplicationController
layout "base_courses"
include StudentWorkHelper
require 'bigdecimal'
require "base64"
before_filter :find_homework, :only => [:new, :index, :create, :student_work_absence_penalty, :absence_penalty_list, :evaluation_list]
before_filter :find_work, :only => [:edit, :update, :show, :destroy, :add_score, :praise_student_work]
before_filter :member_of_course, :only => [:index, :new, :create, :show, :add_score, :praise_student_work]
before_filter :author_of_work, :only => [:edit, :update, :destroy]
before_filter :teacher_of_course, :only => [:student_work_absence_penalty, :absence_penalty_list, :evaluation_list]
protect_from_forgery :except => :set_program_score
def index
@order,@b_sort,@name = params[:order] || "score",params[:sort] || "desc",params[:name] || ""
@order,@b_sort,@name,@group = params[:order] || "score",params[:sort] || "desc",params[:name] || "",params[:group]
@is_teacher = User.current.allowed_to?(:as_teacher,@course)
unless @group == "0" || @group.nil?
group_students = CourseGroup.find_by_id(@group).users
if group_students.empty?
student_in_group = '(0)'
else
student_in_group = '(' + group_students.map{|user| user.id}.join(',') + ')'
end
#老师 || 非匿评作业 || 匿评结束 显示所有的作品
@show_all = @is_teacher || @homework.homework_type != 1 || @homework.homework_detail_manual.comment_status == 3 || User.current.admin?
if @show_all
if @homework.homework_type == 1 || @is_teacher || User.current.admin? #超级管理员 || 老师 || 匿评结束 显示所有的作品
if @order == "name"
@stundet_works = search_homework_member @homework.student_works.select("*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").joins(:user).order("users.lastname #{@b_sort}, users.firstname #{@b_sort}"),@name
@stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").joins(:user).where("users.id in #{student_in_group}").order("users.lastname #{@b_sort}, users.firstname #{@b_sort}"),@name
else
@stundet_works = search_homework_member @homework.student_works.select("*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").order("#{@order} #{@b_sort}"),@name
@stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").joins(:user).where("users.id in #{student_in_group}").order("#{@order} #{@b_sort}"),@name
end
else #剩余情况: 学生 && 非匿评作业 如果未提交作品,只能看到自己的,提交了作品,能看到所有作品
my_work = @homework.student_works.select("*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").where(:user_id => User.current.id)
my_work = @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").where(:user_id => User.current.id)
if my_work.empty?
@stundet_works = []
else
if @order == "name"
@stundet_works = search_homework_member @homework.student_works.select("*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").joins(:user).order("users.lastname #{@b_sort}, users.firstname #{@b_sort}"),@name
@stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").joins(:user).where("users.id in #{student_in_group}").order("users.lastname #{@b_sort}, users.firstname #{@b_sort}"),@name
else
@stundet_works = search_homework_member @homework.student_works.select("*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").order("#{@order} #{@b_sort}"),@name
@stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").joins(:user).where("users.id in #{student_in_group}").order("#{@order} #{@b_sort}"),@name
end
end
end
else #学生
if @homework.homework_detail_manual.comment_status == 1 #未开启匿评,只显示我的作品
@stundet_works = @homework.student_works.select("*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").where(:user_id => User.current.id)
@stundet_works = @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").where(:user_id => User.current.id)
elsif @homework.homework_detail_manual.comment_status == 2 #匿评列表,显示匿评作品和我的作品
@is_evaluation = true
my_work = @homework.student_works.where(:user_id => User.current.id)
@stundet_works = my_work + User.current.student_works_evaluation_distributions.map(&:student_work).select { |work| work.homework_common_id == @homework.id}
end
end
@homework_commons = @course.homework_commons.order("created_at desc")
else
#老师 || 非匿评作业 || 匿评结束 显示所有的作品
@show_all = @is_teacher || @homework.homework_type != 1 || @homework.homework_detail_manual.comment_status == 3 || User.current.admin?
if @show_all
if @homework.homework_type == 1 || @is_teacher || User.current.admin? #超级管理员 || 老师 || 匿评结束 显示所有的作品
if @order == "name"
@stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").joins(:user).order("users.lastname #{@b_sort}, users.firstname #{@b_sort}"),@name
else
@stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").order("#{@order} #{@b_sort}"),@name
end
else #剩余情况: 学生 && 非匿评作业 如果未提交作品,只能看到自己的,提交了作品,能看到所有作品
my_work = @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").where(:user_id => User.current.id)
if my_work.empty?
@stundet_works = []
else
if @order == "name"
@stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").joins(:user).order("users.lastname #{@b_sort}, users.firstname #{@b_sort}"),@name
else
@stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").order("#{@order} #{@b_sort}"),@name
end
end
end
else #学生
if @homework.homework_detail_manual.comment_status == 1 #未开启匿评,只显示我的作品
@stundet_works = @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").where(:user_id => User.current.id)
elsif @homework.homework_detail_manual.comment_status == 2 #匿评列表,显示匿评作品和我的作品
@is_evaluation = true
my_work = @homework.student_works.where(:user_id => User.current.id)
@stundet_works = my_work + User.current.student_works_evaluation_distributions.map(&:student_work).select { |work| work.homework_common_id == @homework.id}
end
end
end
@homework_commons = @course.homework_commons.order("created_at desc")
@score = @b_sort == "desc" ? "asc" : "desc"
respond_to do |format|
@ -80,7 +120,24 @@ class StudentWorkController < ApplicationController
stundet_work.late_penalty = 0
end
render_attachment_warning_if_needed(stundet_work)
if stundet_work.save
if @homework.homework_type == 2 && @homework.homework_detail_programing #编程作业,学生提交作品后计算系统得分
url = "http://192.168.80.21:8080/api/questions/#{@homework.homework_detail_programing.question_id}/solutions.json"
solutions = {
student_work_id:stundet_work.id,
src:Base64.encode64(stundet_work.description),
language:1
}
uri = URI(url)
body = solutions.to_json
res = Net::HTTP.new(uri.host, uri.port).start do |client|
request = Net::HTTP::Post.new(uri.path)
request.body = body
request["Content-Type"] = "application/json"
client.request(request)
end
end
respond_to do |format|
format.html {
flash[:notice] = l(:notice_successful_create)
@ -99,10 +156,14 @@ class StudentWorkController < ApplicationController
end
def edit
if @homework.homework_type == 2 #编程作业不能修改作业
render_403
else
respond_to do |format|
format.html
end
end
end
def update
if params[:student_work]
@ -135,7 +196,9 @@ class StudentWorkController < ApplicationController
end
def destroy
if @work.destroy
if @homework.homework_type == 2 #编程作业,作品提交后不可以删除
render_403
elsif @work.destroy
respond_to do |format|
format.html {
redirect_to student_work_index_url(:homework => @homework.id)
@ -154,6 +217,12 @@ class StudentWorkController < ApplicationController
if @score
@score.comment = params[:new_form][:user_message] if params[:new_form] && params[:new_form][:user_message] && params[:new_form][:user_message] != ""
@score.score = params[:score] if params[:score]
if User.current.admin?
@score.reviewer_role = 1
else
role = User.current.members.where("course_id = ?",@course.id).first.roles.first.name
@score.reviewer_role = get_role_by_name(role)
end
@is_new = false
else
@score = StudentWorksScore.new
@ -161,8 +230,12 @@ class StudentWorkController < ApplicationController
@score.comment = params[:new_form][:user_message] if params[:new_form] && params[:new_form][:user_message] && params[:new_form][:user_message] != ""
@score.user_id = User.current.id
@score.student_work_id = @work.id
if User.current.admin?
@score.reviewer_role = 1
else
role = User.current.members.where("course_id = ?",@course.id).first.roles.first.name
User.current.admin? ? @score.reviewer_role = 1 : @score.reviewer_role = get_role_by_name(role)
@score.reviewer_role = get_role_by_name(role)
end
@is_new = true
end
@ -180,8 +253,10 @@ class StudentWorkController < ApplicationController
if @work.student_score.nil?
@work.final_score = @work.teaching_asistant_score
else
final_ta_score = BigDecimal.new("#{@work.teaching_asistant_score}") * BigDecimal.new("#{@homework.homework_detail_manual.ta_proportion}")
final_s_score = BigDecimal.new("#{@work.student_score}") * (BigDecimal.new('1.0') - BigDecimal.new("#{@homework.homework_detail_manual.ta_proportion}"))
ta_proportion = @homework.homework_detail_manual.ta_proportion if @homework.homework_detail_manual
ta_proportion = @homework.homework_detail_programing.ta_proportion if @homework.homework_detail_programing
final_ta_score = BigDecimal.new("#{@work.teaching_asistant_score}") * BigDecimal.new("#{ta_proportion}")
final_s_score = BigDecimal.new("#{@work.student_score}") * (BigDecimal.new('1.0') - BigDecimal.new("#{ta_proportion}"))
final_score = final_ta_score + final_s_score
@work.final_score = format("%.2f",final_score.to_f)
end
@ -303,6 +378,45 @@ class StudentWorkController < ApplicationController
end
end
#设置编程作业得分
def set_program_score
stundet_work = StudentWork.find_by_id params[:student_work_id]
@course = stundet_work.homework_common.course
student_score_count = 0
if stundet_work && params[:results] && params[:results].class.to_s == "Array"
homework_common = stundet_work.homework_common
params[:results].each do |result|
homework_test = homework_common.homework_tests.where("input = '#{result[:input]}' AND output = '#{result[:output]}'").first
if homework_test
student_work_test = StudentWorkTest.new
student_work_test.student_work = stundet_work
student_work_test.homework_test = homework_test
student_work_test.result = result[:status]
if student_work_test.result == 0
student_score_count += 1
end
student_work_test.save!
end
end
unless homework_common.homework_tests.empty?
stundet_work.student_score = student_score_count * 100.0 / homework_common.homework_tests.count
if stundet_work.teacher_score.nil?
if stundet_work.teaching_asistant_score.nil?
stundet_work.final_score = stundet_work.student_score
else
final_ta_score = BigDecimal.new("#{stundet_work.teaching_asistant_score}") * BigDecimal.new("#{homework_common.homework_detail_programing.ta_proportion}")
final_s_score = BigDecimal.new("#{stundet_work.student_score}") * (BigDecimal.new('1.0') - BigDecimal.new("#{homework_common.homework_detail_programing.ta_proportion}"))
final_score = final_ta_score + final_s_score
stundet_work.final_score = format("%.1f",final_score.to_f)
end
end
stundet_work.save!
end
end
end
private
#获取作业
def find_homework

View File

@ -39,13 +39,15 @@ class UsersController < ApplicationController
before_filter :require_admin, :except => [:show, :index, :search, :tag_save, :tag_saveEx,:user_projects, :user_newfeedback, :user_comments, :watch_contests, :info,
:user_watchlist, :user_fanslist,:update, :user_courses, :user_homeworks, :watch_projects, :show_score, :topic_score_index, :project_score_index,
:activity_score_index, :influence_score_index, :score_index,:show_new_score, :topic_new_score_index, :project_new_score_index,
:activity_new_score_index, :influence_new_score_index, :score_new_index,:update_score,:user_activities,:user_projects_index]
:activity_new_score_index, :influence_new_score_index, :score_new_index,:update_score,:user_activities,:user_projects_index,
:user_courses4show,:user_projects4show,:user_course_activities,:user_project_activities,:user_feedback4show,:user_visitorlist]
#edit has been deleted by huang, 2013-9-23
before_filter :find_user, :only => [:user_fanslist, :user_watchlist, :show, :edit, :update, :destroy, :edit_membership, :user_courses,
:user_homeworks, :destroy_membership, :user_activities, :user_projects, :user_newfeedback, :user_comments,
:watch_contests, :info, :watch_projects, :show_score, :topic_score_index, :project_score_index,
:activity_score_index, :influence_score_index, :score_index,:show_new_score, :topic_new_score_index, :project_new_score_index,
:activity_new_score_index, :influence_new_score_index, :score_new_index,:user_projects_index]
:activity_new_score_index, :influence_new_score_index, :score_new_index,:user_projects_index,
:user_courses4show,:user_projects4show,:user_course_activities,:user_project_activities,:user_feedback4show,:user_visitorlist]
before_filter :auth_user_extension, only: :show
#before_filter :rest_user_score, only: :show
#before_filter :select_entry, only: :user_projects
@ -56,6 +58,9 @@ class UsersController < ApplicationController
#before_filter :refresh_changests, :only =>[:user_activities,:user_courses,:user_projects,:user_newfeedback]
#visitor
before_filter :recorded_visitor, :only => [:show,:user_fanslist,:user_watchlist,:user_visitorlist]
helper :sort
include SortHelper
helper :custom_fields
@ -76,6 +81,9 @@ class UsersController < ApplicationController
# fq
helper :words
helper :project_score
helper :issues
include UsersHelper
def refresh_changests
if !(@user.nil?) && !(@user.memberships.nil?)
@ -104,23 +112,7 @@ class UsersController < ApplicationController
#added by young
def user_projects
if User.current.admin?
@memberships = @user.memberships.all(conditions: "projects.project_type = #{Project::ProjectType_project}")
else
cond = Project.visible_condition(User.current) + " AND projects.project_type <> 1"
@memberships = @user.memberships.all(:conditions => cond)
end
@memberships = @memberships.sort {|a,b| b.created_on.to_i <=> a.created_on.to_i}
# unless @memberships.nil?
# @user_projects = []
# @memberships.each do |membership|
# @user_projects << membership.project
# end
# @user_projects = @user_projects.sort {|a,b| b.created_on.to_i <=> a.created_on.to_i}
# end
#events = Redmine::Activity::Fetcher.new(User.current, :author => @user).events(nil, nil, :limit => 20)
#@events_by_day = events.group_by(&:event_date)
@state = 0
#add by huang
unless User.current.admin?
if !@user.active? #|| (@user != User.current && @memberships.empty? && events.empty?)
@ -129,9 +121,32 @@ class UsersController < ApplicationController
end
end
#end
# if User.current.admin?
# @memberships = @user.memberships.all(conditions: "projects.project_type = #{Project::ProjectType_project}")
# else
# cond = Project.visible_condition(User.current) + " AND projects.project_type <> 1"
# @memberships = @user.memberships.all(:conditions => cond)
# end
#events = Redmine::Activity::Fetcher.new(User.current, :author => @user).events(nil, nil, :limit => 20)
#@events_by_day = events.group_by(&:event_date)
# @state = 0
limit = 10;
query = Project.joins("join members m on #{Project.table_name}.id=m.project_id")
query = query.where("m.user_id = ? and #{Project.table_name}.project_type=?",@user.id,Project::ProjectType_project)
if(params[:status] == '1')
query = query.where("#{Project.table_name}.user_id = ?",@user.id);
elsif(params[:status] == '2')
query = query.where("#{Project.table_name}.user_id <> ?",@user.id);
end
@obj_count = query.count();
@obj_pages = Paginator.new @obj_count,limit,params['page']
@list = query.order("#{Project.table_name}.id desc").limit(limit).offset(@obj_pages.offset).all();
@params = params
respond_to do |format|
format.html
format.html{render :layout=>'base_users_new'}
format.api
end
end
@ -255,28 +270,45 @@ class UsersController < ApplicationController
#@user.coursememberships.all(:conditions => Course.visible_condition(User.current))
if User.current == @user || User.current.admin?
membership = @user.coursememberships.all
else
membership = @user.coursememberships.all(:conditions => Course.visible_condition(User.current))
limit = 10;
query = Course.joins("join members m on #{Course.table_name}.id=m.course_id")
query = query.where("m.user_id = ?",@user.id)
if(params[:status] == '1')
query = query.where("endup_time >= ? or endup_time is null or endup_time=''",Time.now);
elsif(params[:status] == '2')
query = query.where("endup_time < ?",Time.now);
end
@obj_count = query.count();
membership.sort! {|older, newer| newer.created_on <=> older.created_on }
@memberships = []
membership.collect { |e| @memberships.push(e)}
## 判断课程是否过期 [需封装]
@memberships_doing = []
@memberships_done = []
#now_time = Time.now.year
@memberships.map { |e|
#end_time = e.course.get_time.year
isDone = course_endTime_timeout?(e.course)
if isDone
@memberships_done.push e
else
@memberships_doing.push e
end
}
@obj_pages = Paginator.new @obj_count,limit,params['page']
@list = query.order("#{Course.table_name}.id desc").limit(limit).offset(@obj_pages.offset).all();
@params = params
render :layout=>'base_users_new'
# if User.current == @user || User.current.admin?
# membership = @user.coursememberships.all
# else
# membership = @user.coursememberships.all(:conditions => Course.visible_condition(User.current))
# end
#
# membership.sort! {|older, newer| newer.created_on <=> older.created_on }
# @memberships = []
# membership.collect { |e|
# @memberships.push(e)
# }
# ## 判断课程是否过期 [需封装]
# @memberships_doing = []
# @memberships_done = []
# #now_time = Time.now.year
# @memberships.map { |e|
# #end_time = e.course.get_time.year
# isDone = course_endTime_timeout?(e.course)
# if isDone
# @memberships_done.push e
# else
# @memberships_doing.push e
# end
# }
# respond_to do |format|
# format.html
# format.api
@ -414,7 +446,212 @@ class UsersController < ApplicationController
end
end
def user_courses4show
query = Course.joins("join members m on #{Course.table_name}.id=m.course_id")
query = query.where("m.user_id = ?",@user.id)
if User.current == @user #看自己
else
if @user.user_extensions!=nil && @user.user_extensions.identity == 0 #看老师
query = query.joins("join member_roles r on m.id = r.member_id")
query = query.where("r.role_id in(3,7,9)")
end
query = query.where(Course.table_name+".is_public = 1")
# or exists (select 1 from courses c2,members m2 where c2.id=m2.course_id and c2.id=#{Course.table_name}.id and m2.user_id= User.current.id)
end
if params[:lastid]!=nil && !params[:lastid].empty?
query = query.where("#{Course.table_name}.id < ?",params[:lastid])
end
@list = query.order("#{Course.table_name}.id desc").limit(8).all
render :layout=>nil
end
def user_projects4show
query = Project.joins("join members m on #{Project.table_name}.id=m.project_id")
query = query.where("m.user_id = ? and #{Project.table_name}.project_type=?",@user.id,Project::ProjectType_project)
if User.current == @user #看自己
else
query = query.where(Project.table_name+".is_public = 1")
# TODO or exists (select 1 from project c2,members m2 where c2.id=m2.course_id and c2.id=#{Project.table_name}.id and m2.user_id= User.current.id)
end
if params[:lastid]!=nil && !params[:lastid].empty?
query = query.where("#{Project.table_name}.id < ?",params[:lastid])
end
@list = query.order("#{Project.table_name}.id desc").limit(8).all
render :layout=>nil
end
# def user_course_activities
# @list = []
# lastid = nil
# if params[:lastid]!=nil && !params[:lastid].empty?
# lastid = params[:lastid];
# end
#
# user_ids = []
# if @user == User.current
# watcher = User.watched_by(@user)
# watcher.push(User.current)
# user_ids = watcher.map{|x| x.id}
# else
# user_ids << @user.id
# end
#
# query_rec_count = 8
# query_times = 10 #query_times次没查到query_rec_count条记录就不查了
# query_i = 0;
# while( true )
# query_i = query_i+1
# if(query_i>query_times)
# break
# end
# query = Activity.where(user_id: user_ids)
# if(lastid != nil)
# query = query.where("id < ?",lastid)
# end
# lastid,item_list = query_activities(query,'course');
# for item in item_list
# @list << item
# if @list.count() >= query_rec_count
# break
# end
# end
# if @list.count() >= query_rec_count
# break
# end
# if lastid == nil
# break
# end
# end
# render :layout=>nil
# end
#
# def user_project_activities
# @list = []
# lastid = nil
# if params[:lastid]!=nil && !params[:lastid].empty?
# lastid = params[:lastid];
# end
#
# user_ids = []
# if @user == User.current
# watcher = User.watched_by(@user)
# watcher.push(User.current)
# user_ids = watcher.map{|x| x.id}
# else
# user_ids << @user.id
# end
#
# query_rec_count = 8
# query_times = 10 #query_times次没查到query_rec_count条记录就不查了
# query_i = 0;
# while( true )
# query_i = query_i+1
# if(query_i>query_times)
# break
# end
# query = Activity.where(user_id: user_ids)
# if(lastid != nil)
# query = query.where("id < ?",lastid)
# end
# lastid,item_list = query_activities(query,'project');
# for item in item_list
# @list << item
# if @list.count() >= query_rec_count
# break
# end
# end
# if @list.count() >= query_rec_count
# break
# end
# if lastid == nil
# break
# end
# end
# render :action=>'user_course_activities',:layout=>nil
# end
def user_course_activities
lastid = nil
if params[:lastid]!=nil && !params[:lastid].empty?
lastid = params[:lastid];
end
user_ids = []
if @user == User.current
watcher = User.watched_by(@user)
watcher.push(User.current)
user_ids = watcher.map{|x| x.id}
else
user_ids << @user.id
end
query = Activity.joins("join courses c on c.id=#{Activity.table_name}.activity_container_id and #{Activity.table_name}.activity_container_type='Course'")
query = query.where("#{Activity.table_name}.user_id in (?)", user_ids)
if User.current != @user #看别人
if @user.user_extensions!=nil && @user.user_extensions.identity == 0 #看老师
query = query.joins("join members m on c.id=m.course_id and m.user_id = #{@user.id}")
query = query.joins("join member_roles r on m.id = r.member_id")
query = query.where("r.role_id in(3,7,9)")
end
query = query.where("c.is_public=1")
end
if(lastid != nil)
query = query.where("#{Activity.table_name}.id < ?",lastid)
end
query = query.order("#{Activity.table_name}.id desc")
@list = query_activities(query)
render :layout=>nil
end
def user_project_activities
lastid = nil
if params[:lastid]!=nil && !params[:lastid].empty?
lastid = params[:lastid];
end
user_ids = []
if @user == User.current
watcher = User.watched_by(@user)
watcher.push(User.current)
user_ids = watcher.map{|x| x.id}
else
user_ids << @user.id
end
query = Activity.joins("join projects c on c.id=#{Activity.table_name}.activity_container_id and #{Activity.table_name}.activity_container_type='Project'")
query = query.where(user_id: user_ids)
if User.current != @user #看别人
query = query.where("c.is_public=1")
end
if(lastid != nil)
query = query.where("#{Activity.table_name}.id < ?",lastid)
end
query = query.order("#{Activity.table_name}.id desc")
@list = query_activities(query);
render :action=>'user_course_activities',:layout=>nil
end
def user_feedback4show
query = @user.journals_for_messages
if params[:lastid]!=nil && !params[:lastid].empty?
query = query.where("#{JournalsForMessage.table_name}.id < ?",params[:lastid])
end
logger.info('xxoo')
@list = query.order("#{JournalsForMessage.table_name}.id desc").limit(3).all
logger.info('aavv')
render :layout=>nil,:locals => {:feed_list=>@list}
end
def show
render :layout=>'base_users_new'
end
def show_old
pre_count = 10 #limit
# Time 2015-02-04 11:46:34
# Author lizanle
@ -836,10 +1073,34 @@ class UsersController < ApplicationController
end
###add by huang
def user_watchlist
limit = 10;
query = User.watched_by(@user.id);
@obj_count = query.count();
@obj_pages = Paginator.new @obj_count,limit,params['page']
@list = query.order("#{Watcher.table_name}.id desc").limit(limit).offset(@obj_pages.offset).all();
render :template=>'users/user_fanslist',:layout=>'base_users_new'
end
###add by huang
def user_fanslist
limit = 10;
query = @user.watcher_users;
@obj_count = query.count();
@obj_pages = Paginator.new @obj_count,limit,params['page']
@list = query.order("#{Watcher.table_name}.id desc").limit(limit).offset(@obj_pages.offset).all();
@action = 'fans'
render :layout=>'base_users_new'
end
def user_visitorlist
limit = 10;
#query = @user.watcher_users;
query = User.joins("join visitors v on #{User.table_name}.id=v.user_id")
query = query.where("v.master_id=?",@user.id)
@obj_count = query.count();
@obj_pages = Paginator.new @obj_count,limit,params['page']
@list = query.order("v.updated_on desc").limit(limit).offset(@obj_pages.offset).all();
@action = 'visitor'
render :template=>'users/user_fanslist',:layout=>'base_users_new'
end
#william
@ -944,4 +1205,20 @@ class UsersController < ApplicationController
render_404
end
end
def recorded_visitor
if(User.current.logged? && User.current != @user)
#impl = Visitor.where('user_id=? and master_id=?',User.current.id,@user.id).find;
# impl = Visitor.find_by_sql('user_id=? and master_id=?',[User.current.id,@user.id]);
impl = Visitor.find_by_user_id_and_master_id(User.current.id,@user.id);
if(impl.nil?)
impl = Visitor.new
impl.user_id = User.current.id
impl.master_id = @user.id
else
impl.updated_on = Time.now
end
impl.save
end
end
end

View File

@ -16,12 +16,15 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class WatchersController < ApplicationController
before_filter :require_login#, :find_watchables, :only => [:watch, :unwatch]
helper :users
def watch
s = WatchesService.new
watchables = s.watch params.merge(:current_user_id => User.current.id)
respond_to do |format|
format.html { redirect_to_referer_or {render :text => (true ? 'Watcher added.' : 'Watcher removed.'), :layout => true}}
format.js { render :partial => 'set_watcher', :locals => {:user => User.current, :watched => watchables} }
format.js { render :partial => 'set_watcher', :locals => {:user => User.current, :watched => watchables,:params=>params,:opt=>'add'} }
end
rescue Exception => e
if e.message == "404"
@ -37,7 +40,7 @@ class WatchersController < ApplicationController
watchables = s.unwatch params.merge(:current_user_id => User.current.id)
respond_to do |format|
format.html { redirect_to_referer_or {render :text => (false ? 'Watcher added.' : 'Watcher removed.'), :layout => true}}
format.js { render :partial => 'set_watcher', :locals => {:user => User.current, :watched => watchables} }
format.js { render :partial => 'set_watcher', :locals => {:user => User.current, :watched => watchables,:params=>params,:opt=>'delete'} }
end
rescue Exception => e
if e.message == "404"

View File

@ -13,11 +13,12 @@ class WordsController < ApplicationController
end
refer_user_id = params[:new_form][:reference_user_id].to_i
@user.add_jour(User.current, message, refer_user_id)
list = @user.add_jour(User.current, message, refer_user_id)
unless refer_user_id == 0 || refer_user_id == User.current.id
User.find(refer_user_id).add_jour(User.current, message, refer_user_id)
list = User.find(refer_user_id).add_jour(User.current, message, refer_user_id)
end
@user.count_new_jour
@jour = list.last
# @user.count_new_jour
# if a_message.size > 5
# @message = a_message[-5, 5]
# else
@ -26,8 +27,8 @@ class WordsController < ApplicationController
# @message_count = a_message.count
end
end
@jours = @user.journals_for_messages.where('m_parent_id IS NULL').reverse
@jour = paginateHelper @jours,10
# @jours = @user.journals_for_messages.where('m_parent_id IS NULL').reverse
# @jour = paginateHelper @jours,10
respond_to do |format|
# format.html { redirect_to_referer_or {render :text => 'Watcher added.', :layout => true}}

View File

@ -42,4 +42,30 @@ module ActivitiesHelper
end
sorted_events
end
def get_container_type(activity)
#问卷
if activity.act_type == 'Poll'
return ['Course',activity.act.polls_group_id]
end
#注册
if activity.act_type == 'Principal'
return ['Principal',activity.act.id]
end
#留言
if activity.act_type == 'JournalsForMessage'
return [activity.act.jour_type,activity.act.jour_id]
end
# HomeworkCommon Issue Journal Message News
if activity.act.respond_to?('course') && activity.act.course
return ['Course',activity.act.course.id]
end
if activity.act.respond_to?('project') && activity.act.project
return ['Project',activity.act.project.id]
end
# Contest Contestnotification
return ['Unknow',0]
end
end

View File

@ -2292,6 +2292,8 @@ module ApplicationHelper
else
link = "<span class='fr mr10 pr_join_span ' title='学生提交作业数大于2时才可以启动匿评'>启动匿评</span>".html_safe
end
elsif homework.homework_type == 2 && homework.homework_detail_programing #编程作业作业
link = "<span class='fr mr10 pr_join_span ' title='编程作业'>编程作业</span>".html_safe
else
link = "<span class='fr mr10 pr_join_span ' title='未开启匿评作业不可以启动匿评'>启动匿评</span>".html_safe
end
@ -2305,6 +2307,8 @@ module ApplicationHelper
else
if homework.homework_type == 1 && homework.homework_detail_manual && homework.homework_detail_manual.comment_status != 1 #匿评作业,且作业状态不是在开启匿评之前
"<span class='fr mr10 pr_join_span '>#{l(:label_edit_homework)}</span>".html_safe
elsif homework.homework_type == 2 #编程作业不能修改作品
"<span class='fr mr10 pr_join_span ' title='编程作业不可修改作品'>作品已交</span>".html_safe
else
link_to l(:label_edit_homework), edit_student_work_path(work.id),:class => 'fr mr10 work_edit'
end
@ -2324,7 +2328,7 @@ module ApplicationHelper
elsif homework.homework_type == 0
"<span class='fr mr10 pr_join_span '>未启用匿评</span>".html_safe
elsif homework.homework_type == 2
"<span class='fr mr10 pr_join_span '>编程作业</span>".html_safe
"<span class='fr mr10 pr_join_span '>&nbsp;编程作业&nbsp;&nbsp;</span>".html_safe
end
end
@ -2339,4 +2343,8 @@ module ApplicationHelper
end
end
#将文本内的/n转换为<br>
def text_format text
text.gsub("\n","<br/>").html_safe
end
end

View File

@ -72,14 +72,19 @@ module IssuesHelper
issuetype = []
if value == "缺陷" || value == 1
issuetype << "issues fl"
elsif value == "功能" || value == 2
issuetype << "缺陷"
elsif value == "任务" || value == 4
issuetype << "duty fl"
issuetype << "任务"
elsif value == "支持" || value == 3
issuetype << "support fl"
elsif value == "任务" || value == 4
issuetype << "支持"
elsif value == "功能" || value == 2
issuetype << "function fl"
issuetype << "功能"
else
issuetype << "weekly fl"
issuetype << "周报"
end
end

View File

@ -80,4 +80,22 @@ module StudentWorkHelper
end
color
end
#获取分班信息
def course_group_list course
result = []
if course.course_groups && !course.course_groups.empty?
base = []
base << l(:label_chose_group)
base << 0
result << base
course.course_groups.each do |group|
option = []
option << group.name
option << group.id
result << option
end
end
result
end
end

View File

@ -303,4 +303,237 @@ module UsersHelper
end
end
end
def get_watcher_users(obj)
count = User.watched_by(obj.id).count
if count == 0
return [0,[]]
end
list = User.watched_by(obj.id).order("#{Watcher.table_name}.id desc").limit(10).all
return [count,list];
end
def get_fans_users(obj)
count = obj.watcher_users.count
if count == 0
return [0,[]]
end
list = obj.watcher_users.order("#{Watcher.table_name}.id desc").limit(10).all
return [count,list];
end
def get_visitor_users(obj)
query = Visitor.where("master_id=?",obj.id)
count = query.count
if count == 0
return [0,[]]
end
list = query.order("updated_on desc").limit(10).all
return [count,list];
end
def get_create_course_count(user)
return Course.where("tea_id = ?",user.id).count()
end
def get_join_course_count(user)
return user.coursememberships.count() - get_create_course_count(user)
end
def get_homework_commons_count(user)
return HomeworkCommon.where("user_id = ?",user.id).count()
end
def get_projectandcourse_attachment_count(user)
return Attachment.where("author_id = ? and container_type in ('Project','Course')",user.id).count()
end
def get_create_project_count(user)
return Project.where("user_id = ? and project_type = ?",user.id,Project::ProjectType_project).count()
end
def get_join_project_count(user)
return user.memberships.count(conditions: "projects.project_type = #{Project::ProjectType_project}") - get_create_project_count(user)
end
def get_create_issue_count(user)
return Issue.where("author_id = ?",user.id).count()
end
def get_resolve_issue_count(user)
return Issue.where("assigned_to_id = ? and status_id=3",user.id).count()
end
def get_anonymous_evaluation_count(user)
return StudentWorksScore.where("user_id = ? and reviewer_role=3",user.id).count()
end
# def query_activities(query,type)
# query_rec_count = 8
# # query = query.where("act_type='JournalsForMessage'")
# #query = query.where("act_type not in (?)", ['JournalsForMessage','Message','HomeworkCommon','News','Issue','Journal','Poll'])
# list = query.order("id desc").limit(query_rec_count).all
#
# result = [];
# for item in list
# container = get_activity_container(item,type)
# if( activity_is_show(item,container) )
# result << { :item=>item,:e=>container }
# end
# end
# return [lastid,result]
# end
# def get_activity_container activity,type
# e = nil;
# if type == 'Project'
# if activity.act_type == 'Poll'
# # 项目没有问卷
# # e = Project.find_by_id(activity.act.polls_group_id)
# else
# e = activity.act.project if activity.act.respond_to?('project')
# end
# end
# if type == 'Course'
# if activity.act_type == 'Poll'
# e = Course.find_by_id(activity.act.polls_group_id)
# else
# e = activity.act.course if activity.act.respond_to?('course')
# end
# end
#
# return e;
# end
def query_activities(query)
list = query.limit(8).all
result = [];
for item in list
container = get_activity_container(item)
result << { :item=>item,:e=>container }
end
return result
end
def get_activity_container activity
return activity.activity_container
# if type == 'Project'
# return activity.act.project if activity.act.respond_to?('project')
# end
# if type == 'Course'
# if activity.act_type == 'Poll'
# return Course.find_by_id(activity.act.polls_group_id)
# end
# return activity.act.course if activity.act.respond_to?('course')
# end
# return nil;
end
# def activity_is_show(activity,e)
# if(!e)
# return false
# end
#
# if activity.user_id == User.current.id
# return true
# end
# if( e.visible? )
# return true
# end
# return false
# end
def get_activity_act_showname_htmlclear(activity)
str = get_activity_act_showname(activity)
str = str.gsub(/<.*>/,'')
str = str.lstrip.rstrip
if str == ''
str = 'RE:'
end
return str.html_safe
end
def get_activity_act_showname(activity)
case activity.act_type
when "HomeworkCommon"
return activity.act.name
when "Issue"
return activity.act.subject
when "Journal"
return details_to_strings(activity.act.details,true).to_s
when "JournalsForMessage"
return activity.act.notes
when "Message"
return activity.act.subject
when "News"
return activity.act.title
when "Poll"
return activity.act.polls_name
when "Contest"
return ''
when "Contestnotification"
return ''
when "Principal"
return ''
else
return activity.act_type
end
end
def get_activity_act_createtime(activity)
case activity.act_type
when "HomeworkCommon"
return activity.act.created_at
when "Poll"
return activity.act.created_at
else
return activity.act.created_on
end
end
def get_activity_container_url e
if !e.visible?
return "javascript:;"
end
if e.class.to_s == 'Course'
return url_for(:controller => 'courses', :action=>"show", :id=>e.id, :host=>Setting.host_course)
end
return url_for(:controller => 'projects', :action=>"show", :id=>e.id, :host=>Setting.host_name)
end
def get_activity_url(activity,e)
if !e.visible?
return "javascript:;"
end
case activity.act_type
# when "Contest"
# when "Contestnotification"
# when "Principal"
when "HomeworkCommon"
return homework_common_index_path( :course=>e.id )
when "Issue"
return issue_path(activity.act.id)
when "Journal"
return issue_path( activity.act.journalized_id )
when "JournalsForMessage"
return e.class.to_s == 'Course' ? course_feedback_path(e) : project_feedback_path(e)
when "Message"
return e.class.to_s == 'Course' ? course_boards_path(e) : project_boards_path(e)
when "News"
return news_path(activity.act)
#return e.class.to_s == 'Course' ? course_news_index_path(e) : project_news_index_path(e)
when "Poll"
return poll_index_path( :polls_group_id=>activity.act.polls_group_id, :polls_type=>e.class.to_s )
else
return 'javascript:;'
end
end
def get_activity_opt(activity,e)
case activity.act_type
when "HomeworkCommon"
return '创建了作业'
when "News"
return e.class.to_s == 'Course' ? '发布了通知' : '添加了新闻'
when "Issue"
return '发表了问题'
when "Journal"
return '回复了问题'
when "JournalsForMessage"
return e.class.to_s == 'Course' ? '发表了留言' : '提交了反馈'
#return ( activity.act.reply_id == nil || activity.act.reply_id == 0 ) ? '' : ''
when "Message"
return ( activity.act.parent_id == nil || activity.act.parent_id == '' ) ? '发布了帖子' : '回复了帖子'
when "Poll"
return '发布了问卷'
else
return '有了新动态'
end
end
end

View File

@ -2,9 +2,20 @@ class Activity < ActiveRecord::Base
attr_accessible :act_id, :act_type, :user_id
belongs_to :act, :polymorphic => true
belongs_to :user
belongs_to :activity_container, polymorphic: true
validates :act_id, presence: true
validates :act_type, presence: true
validates :user_id, presence: true
include Trustie::Cache::ClearCourseEvent
before_create :set_container_type_val
#helper :activities
include ActivitiesHelper
def set_container_type_val
container_type,container_id =get_container_type(self)
self.activity_container_type = container_type
self.activity_container_id = container_id
end
end

View File

@ -2,4 +2,5 @@ class HomeworkTest < ActiveRecord::Base
attr_accessible :input, :output, :homework_common_id
belongs_to :homework_common
has_one :student_work_test
end

View File

@ -7,6 +7,13 @@ class StudentWork < ActiveRecord::Base
has_many :student_works_evaluation_distributions, :dependent => :destroy
has_many :student_works_scores, :dependent => :destroy
belongs_to :project
has_one :student_work_test
before_destroy :delete_praise
acts_as_attachable
def delete_praise
PraiseTread.where("praise_tread_object_id = #{self.id} AND praise_tread_object_type = 'StudentWork'").destroy_all
end
end

View File

@ -0,0 +1,42 @@
# encoding: utf-8
class StudentWorkTest < ActiveRecord::Base
attr_accessible :student_work_id, :homework_test_id
belongs_to :homework_test
belongs_to :student_work
def status_to_s
case self.result
when -1
'编译出错'
when -2
'答题错误'
when -3
'答案错误'
when 1
'运行出错'
when 2
'超时'
when 3
'内存超出'
when 4
'输出超出'
when 5
'禁用函数'
when 6
'其他错误'
when 0
'成功'
else
'未知错误'
end
end
def test_score
if self.result == 0
format("%.1f",100.0 / self.student_work.homework_common.homework_tests.count)
else
0
end
end
end

3
app/models/visitor.rb Normal file
View File

@ -0,0 +1,3 @@
class Visitor < ActiveRecord::Base
belongs_to :user
end

View File

@ -678,12 +678,11 @@ class CoursesService
end
# 课程讨论区
# latest_message = course.boards.first.topics.page(1).per(2)
# unless latest_message.first.nil?
# latest_course_dynamics << {:type => 2, :time => latest_message.first.created_on, :count =>course.boards.nil? ? 0 : course.boards.first.topics.count,
# :topics => latest_message.all}
# dynamics_count += 1
# end
latest_message = course.boards.first.topics.page(1).per(2)
unless latest_message.first.nil?
latest_course_dynamics << {:type => 2, :time => latest_message.first.created_on, :count =>course.boards.nil? ? 0 : course.boards.first.topics.count,
:topics => latest_message.all}
end
# 课程资源
# latest_attachment = course.attachments.order("created_on desc").page(1).per(2)
@ -788,6 +787,45 @@ class CoursesService
student_works
end
# 获取课程的讨论区信息
def board_message_list params,current_user
# 课程讨论区
course = Course.find(params[:course_id])
latest_message = course.boards.first.topics.page(params[:page] || 1).per(10)
end
#获取回复列表
def board_message_reply_list params,current_user
board = Board.find(params[:board_id])
reply_list = board.topics.where("id = #{params[:msg_id]}").first.children.order("created_on desc").page(params[:page] || 1).per(10)
end
#回复讨论区
def board_message_reply params,current_user
author = Message.find(params[:parent_id]).author
quote = "<blockquote>" << author.realname << "(" << author.nickname << ")写到: <br/>" << params[:quote] <<"<div class='cl'></div></blockquote>"
reply = Message.new
reply.author = current_user
reply.board = Board.find(params[:board_id])
params[:reply] = {}
params[:reply][:subject] = params[:subject] #本回复标题
params[:reply][:content] = params[:content] #本回复内容
params[:reply][:quote] = {}
params[:reply][:quote][:quote] = params[:quote] #本回复引用的内容也是父id内容
params[:reply][:parent_topic] = params[:parent_id] # 父id
params[:reply][:board_id] = params[:board_id] #讨论区id
params[:reply][:id] = params[:root_id] #根id
reply.safe_attributes = params[:reply]
if params[:root_id] == params[:parent_id]
reply.content = reply.content
else
reply.content = quote + reply.content
end
Message.find(params[:root_id]).children << reply
reply
end
# # 开启匿评
# #statue 1:启动成功2启动失败作业总数大于等于2份时才能启动匿评3:已开启匿评,请务重复开启,4:没有开启匿评的权限
# def start_anonymous_comment params,current_user

View File

@ -1,4 +1,8 @@
<% if @source_type=='User' %>
var imgSpan = $("img[nhname='avatar_image']");
imgSpan.attr({"src":'<%= "#{@urlfile.to_s}?#{Time.now.to_i}" %>'});
<% else %>
var imgSpan = jQuery('#avatar_image');
imgSpan.attr({"src":'<%= "#{@urlfile.to_s}?#{Time.now.to_i}" %>'});
<% end %>

View File

@ -1,10 +1,10 @@
<!-- huang -->
<h3><%=l(:label_newtype_contest)%></h3>
<!--&lt;!&ndash; huang &ndash;&gt;-->
<!--<h3><%=l(:label_newtype_contest)%></h3>-->
<%= labelled_form_for @bid, :url => {:controller => 'bids', :action => 'create_contest'} do |f| %>
<div class="box tabular">
<%= render :partial => 'form_contest', :locals => { :f => f } %>
<%= submit_tag l(:button_create) %>
<%= javascript_tag "$('#bid_name').focus();" %>
<% end %>
</div>
<!--<%= labelled_form_for @bid, :url => {:controller => 'bids', :action => 'create_contest'} do |f| %>-->
<!--<div class="box tabular">-->
<!--<%= render :partial => 'form_contest', :locals => { :f => f } %>-->
<!--<%= submit_tag l(:button_create) %>-->
<!--<%= javascript_tag "$('#bid_name').focus();" %>-->
<!--<% end %>-->
<!--</div>-->

View File

@ -19,7 +19,7 @@
<li ><span class="c_blue02 w280">作业名称</span><span class="c_blue02 w70">得分</span></li>
<% @member_score.homework_common_list.each do |homework_common| %>
<li>
<span class="c_grey02 w280">
<span class="c_grey02 w280 hiddent">
<%= homework_common.name %>
</span>
<span class="c_red w70">

View File

@ -1,8 +1,8 @@
<% if @save_flag %>
$('#finish_course_<%=@course.id%>').replaceWith("<%= escape_javascript(set_course_time(@course_prefs))%>");
$('#finish_course_<%=@course.id%>').replaceWith("<%= escape_javascript(set_course_time(@course_prefs))%>");
var html = "<%= escape_javascript( render( :partial => 'users/course_form', :locals => {:item => @course_prefs} ) )%>";
$('#nh_course_<%=@course.id%>').replaceWith(html);
// alert("关闭成功");
<% else %>
alert('权限不足,设置失败,请在论坛提交问题,等待管理员处理。');
alert('权限不足,设置失败,请在论坛提交问题,等待管理员处理。');
<% end %>

View File

@ -1,7 +1,8 @@
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'join_private_course') %>');
showModal('ajax-modal', '540px');
$('#ajax-modal').css('height','330px');
$('#ajax-modal').siblings().remove();
//$('#ajax-modal').siblings().remove();
$('#ajax-modal').siblings().hide();
$('#ajax-modal').before("<span style='float: right;cursor:pointer;padding-left: 513px;'>" +
"<a href='javascript:' onclick='hidden_join_course_form();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
$('#ajax-modal').parent().removeClass("alert_praise");

View File

@ -10,7 +10,6 @@
<div class="cl"></div>
<li >
<label class="label02 ">&nbsp;&nbsp;&nbsp;<%= l(:field_quote)%>&nbsp;</label>
<!--<textarea name="" placeholder="请在此填入作业的要求及评分依据" class=" w548 h150 mb10 fl" ></textarea>-->
<div style="width: 83%;float: left;">
<% if edit_mode %>
<%= f.kindeditor :description,:editor_id => 'homework_description_editor',:owner_id => homework.id,:owner_type =>OwnerTypeHelper::HOMEWORKCOMMON %>

View File

@ -0,0 +1,125 @@
<ul class="hwork_new_basic">
<li >
<label class="label02 mb20">
<span class="c_red">*</span>
&nbsp;<%= l(:field_name)%>&nbsp;
</label>
<input type="text" name="homework_common[name]" id="homework_name" class="w548 h26 fl" maxlength="255" onkeyup="regex_homework_name();" value="<%= homework.name%>" >
<p id="homework_name_span" class="c_red ml110"></p>
</li>
<div class="cl"></div>
<li >
<label class="label02 ">&nbsp;&nbsp;&nbsp;<%= l(:field_quote)%>&nbsp;</label>
<div style="width: 83%;float: left;">
<% if edit_mode %>
<%= f.kindeditor :description,:editor_id => 'homework_description_editor',:owner_id => homework.id,:owner_type =>OwnerTypeHelper::HOMEWORKCOMMON %>
<% else %>
<%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %>
<%= f.kindeditor :description,:editor_id => 'homework_description_editor' %>
<% end %>
</div>
</li>
<div class="cl"></div>
<li class="mt10">
<label class="label02">&nbsp;&nbsp;附件:&nbsp;</label>
<%= render :partial => 'attachments/new_form', :locals => {:container => homework} %>
</li>
<div class="cl"></div>
<li class="fl">
<label class="label02">
<span class="c_red">*</span>
&nbsp;<%= l(:label_limit_time)%>&nbsp;
</label>
<input type="text" name="homework_common[end_time]" id="homework_end_time" class="hwork_input02 fl" readonly="readonly" value="<%= homework.end_time%>" >
<%= calendar_for('homework_end_time')%>
<div class="cl"></div>
</li>
<li class="fl ml100" style="display: none;">
<label class="label02">&nbsp;发布日期:&nbsp;</label>
<input type="text" name="homework_common[publish_time]" id="homework_publish_time" class="hwork_input02 fl" readonly="readonly" value="<%= homework.publish_time%>" >
<%= calendar_for('homework_publish_time')%>
<div class="cl"></div>
</li>
<li>
<label class="label02">迟交扣分:&nbsp;</label>
<%= select_tag :late_penalty,options_for_select(late_penalty_option,homework.late_penalty), {:class => "fl mb10 h26 w70"} %>
<span class="fl mt5">&nbsp;分</span>
<div class="cl"></div>
</li>
</ul><!--hwork_new_basic end--->
<div class="cl"></div>
<div class="hwork_new_set">
<p class="fl ml20 f14 mb10 c_orange">编程评测设置</p>
<div class="cl"></div>
<ul>
<li >
<label class="label02">&nbsp;开发语言:&nbsp;</label>
<select class="fl mb10 h26 w150" >
<option>C++</option>
</select>
<div class="cl"></div>
</li>
<li >
<label class="label02">评分比例:&nbsp;</label>
<%= select_tag :ta_proportion,options_for_select(ta_proportion_option,homework.homework_detail_programing.ta_proportion), {:class => "fl mb10 h26 w70"} %>
<span class="ml5 fl mt5">×&nbsp;教辅评分</span>
<span class="ml5 fl mt5">&nbsp;&nbsp;+&nbsp;&nbsp;</span>
<input type="text" id="student_proportion" value="<%= (100 - homework.homework_detail_programing.ta_proportion* 100).to_i%>%" class="fl mb10 h26 w70" readonly>
<span class="ml5 fl mt5">×&nbsp;系统评分</span>
<span class="ml5 fl mt5">=&nbsp;学生得分</span>
<div class="cl"></div>
</li>
<li >
<label class="label02" >&nbsp;&nbsp;</label>
<span class=" fl c_red">如果教师对学生作品进行了评分,则教师评分为学生最终得分。</span>
<div class="cl"></div>
</li>
<li >
<label class="label02">&nbsp;标准代码:&nbsp;</label>
<textarea name="standard_code" class=" w547 h150 mb10 fl"><%= homework.homework_detail_programing.standard_code%></textarea>
<div class="cl"></div>
</li>
<% if edit_mode %>
<% homework.homework_tests.each do |homework_test|%>
<div>
<li>
<label class="label02">&nbsp;测试输入:&nbsp;</label>
<input type="text" class="fl h26 w186 mb10" name="input[<%= homework_test.id%>]" value="<%= homework_test.input%>"/>
</li>
<li >
<label class=" fl f14 ml10">&nbsp;输出:&nbsp;</label>
<input type="text" class="fl h26 w186 mb10" name="output[<%= homework_test.id%>]" value="<%= homework_test.output%>"/>
</li>
<li>
<a class="icon_add ml10 " href="javascript:void(0);" title="添加测试" onclick="add_programing_test($(this).parent().parent())"></a>
<a class="icon_remove" href="javascript:void(0);" title="删除测试" onclick="remove_programing_test($(this).parent().parent())"></a>
<span class="green_btn fl ml5 mt1">测试</span>
</li>
<div class="cl"></div>
</div>
<% end%>
<% else %>
<div>
<li>
<label class="label02">&nbsp;测试输入:&nbsp;</label>
<input type="text" class="fl h26 w186 mb10" name="input[0]" />
</li>
<li >
<label class=" fl f14 ml10">&nbsp;输出:&nbsp;</label>
<input type="text" class="fl h26 w186 mb10" name="output[0]" />
</li>
<li>
<a class="icon_add ml10 " href="javascript:void(0);" title="添加测试" onclick="add_programing_test($(this).parent().parent())"></a>
<a class="icon_remove" href="javascript:void(0);" title="删除测试" onclick="remove_programing_test($(this).parent().parent())"></a>
<span class="green_btn fl ml5 mt1">测试</span>
</li>
<div class="cl"></div>
</div>
<% end %>
</ul>
</div>

View File

@ -7,10 +7,18 @@
</h2>
</div>
<div class="hwork_new">
<%if @homework.homework_type == 2%>
<%= form_for @homework do |f| %>
<%= render :partial => 'homework_common/homework_common_form', :locals => { :homework => @homework,:f => f,:edit_mode => true } %>
<%= render :partial => 'homework_common/homework_detail_programing_form', :locals => { :homework => @homework,:f => f,:edit_mode => true } %>
<a href="javascript:void(0)" class="blue_btn fl mr10" onClick="submit_homework('edit_homework_common_<%= @homework.id%>');" >提交</a>
<%= link_to '取消',homework_common_index_path(:course => @course.id),:class => 'grey_btn fl'%>
<% end%>
<% else %>
<%= form_for @homework do |f| %>
<%= render :partial => 'homework_common/homework_detail_manual_form', :locals => { :homework => @homework,:f => f,:edit_mode => true } %>
<a href="javascript:void(0)" class="blue_btn fl mr10" onClick="submit_homework('edit_homework_common_<%= @homework.id%>');" >提交</a>
<%= link_to '取消',homework_common_index_path(:course => @course.id),:class => 'grey_btn fl'%>
<% end%>
<% end%>
</div><!--hwork_new end-->
<div class="cl"></div>

View File

@ -1,17 +1,27 @@
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
<%= error_messages_for 'homework_common' %>
<div class="project_r_h">
<h2 class="project_h2">
<%= l(:label_course_homework_new)%>
</h2>
</div>
<div class="hwork_new">
<%= labelled_form_for @homework,:url => {:controller => 'homework_common',:action => 'create'} do |f| %>
<%= hidden_field_tag "course",@course.id%>
<%= render :partial => 'homework_common/homework_common_form', :locals => { :homework => @homework,:f => f,:edit_mode => false } %>
<a href="javascript:void(0)" class="blue_btn fl mr10" onClick="submit_homework('new_homework_common');" >提交</a>
<%= link_to '取消',homework_common_index_path(:course => @course.id),:class => 'grey_btn fl'%>
<div class="hwork_new" id="hwork_new">
<%= form_for("new_homework_common",:url => next_step_homework_common_index_path) do |f|%>
<input type="hidden" name="course" value="<%= @course.id%>">
<h3 class="c_blue f16 mb10">
请选择将要发布的作业类型
</h3>
<input type="radio" class="mb10 fl" name="homework_common_type" value="1" id="homework_detail_manual_radio" checked/>
<span class="ml5 fl">
人工评分的作业(支持匿名互评、灵活设置评分比例)
</span>
<div class="cl"></div>
<input type="radio" class="mb20 fl" name="homework_common_type" value="2" id="homework_detail_programing_radio"/>
<span class="ml5 fl">
自动评测的编程作业支持C++程序的自动评分)
</span>
<div class="cl"></div>
<a href="javascript:void(0);" class=" orange_btn" onclick="$(this).parent().submit();">
下一步
</a>
<% end%>
</div><!--hwork_new end-->
<div class="cl"></div>

View File

@ -0,0 +1,30 @@
<%= javascript_include_tag "/assets/kindeditor/kindeditor" %>
<%= error_messages_for 'homework_common' %>
<div class="project_r_h">
<h2 class="project_h2">
<%= l(:label_course_homework_new)%>
</h2>
</div>
<% if @homework_type == "1"%>
<div class="hwork_new">
<%= labelled_form_for @homework,:url => {:controller => 'homework_common',:action => 'create'} do |f| %>
<%= hidden_field_tag "course",@course.id%>
<%= render :partial => 'homework_common/homework_detail_manual_form', :locals => { :homework => @homework,:f => f,:edit_mode => false } %>
<a href="javascript:void(0)" class="blue_btn fl mr10" onClick="submit_homework('new_homework_common');" >提交</a>
<%= link_to "上一步", new_homework_common_path(:course => @course.id), :class => "orange_btn_homework fl"%>
<%= link_to '取消',homework_common_index_path(:course => @course.id),:class => 'grey_btn fl'%>
<% end%>
</div><!--hwork_new end-->
<% elsif @homework_type == "2"%>
<div class="hwork_new">
<%= labelled_form_for @homework,:url => {:controller => 'homework_common',:action => 'create'} do |f| %>
<%= hidden_field_tag "course",@course.id%>
<%= hidden_field_tag "homework_common[homework_type]","2"%>
<%= render :partial => 'homework_common/homework_detail_programing_form', :locals => { :homework => @homework,:f => f,:edit_mode => false } %>
<a href="javascript:void(0)" class="blue_btn fl mr10" onClick="submit_homework('new_homework_common');" >提交</a>
<%= link_to "上一步", new_homework_common_path(:course => @course.id), :class => "orange_btn_homework fl"%>
<%= link_to '取消',homework_common_index_path(:course => @course.id),:class => 'grey_btn fl'%>
<% end%>
</div><!--hwork_new end-->
<div class="cl"></div>
<% end%>

View File

@ -7,7 +7,7 @@
<div class="problem_main">
<% column_content = ( query.inline_columns.map {|column| "#{column_content_new(column, issue)}"}) %>
<% unless issue.author.nil? || issue.author.name == "Anonymous" %>
<span class ="<%= get_issue_type(column_content[1])[0] %>"></span>
<span class ="<%= get_issue_type(column_content[1])[0] %>" title="<%= get_issue_type(column_content[1])[1] %>"></span>
<div class="problem_txt fl">
<%= link_to issue.author.name, user_path(issue.author), :class => "problem_name c_orange fl" %>
<span class="fl"><%= l(:label_post_on_issue) %>(<%= "#{raw column_content[2]}" %>)</span>

View File

@ -14,7 +14,7 @@
</div>
<div class="talk_txt fl">
<p class="pro_page_tit" style="word-break:break-all;">
<span class='<%= "#{get_issue_type(@issue.tracker_id)[0]} fl" %>'><%= get_issue_type(@issue.tracker_id)[1] %></span>
<span class='<%= "#{get_issue_type(@issue.tracker_id)[0]} fl" %>' title="<%= get_issue_type(@issue.tracker_id)[1] %>"></span>
<span style="padding-left: 5px;"><%= @issue.subject %></span>
<span class='<%= "#{get_issue_priority(@issue.priority_id)[0]} " %>'><%= get_issue_priority(@issue.priority_id)[1] %></span>
</p><br/>

View File

@ -0,0 +1,13 @@
<div id="Footer">
<ul class="copyright" style="text-align:center;">
<li><%= @organizer.description.html_safe %></li>
</ul>
<div class="cl"></div>
<ul class="footlogo">
<% @companies && @companies.each do |company| %>
<li class="fl" style="margin:0 8px;">
<a href="<%= company.url %>" target="_blank" title="<%=company.name%>"><img src="<%= url_to_avatar(company) %>" width="100" height="30" alt="<%=company.name%>" /></a>
</li>
<% end %>
</ul>
</div>

View File

@ -101,9 +101,6 @@
addSlipMenu();
addProjectSlipMenu ();
addCourseSlipMenu();
});
jQuery(document).ready(function($) {
$('.sub_menu').find("a").attr('target', '_blank');
$('.project_sub_menu').find("a").attr('target', '_blank');
$('.course_sub_menu').find("a").attr('target', '_blank');

View File

@ -0,0 +1,76 @@
<div id="Header" >
<div class="logo fl" >
<%=link_to image_tag("/images/logo.png",weight:"35px", height: "30px")%>
</div>
<div id="TopNav" class="fl">
<%= render_dynamic_nav if User.current.logged? || !Setting.login_required? -%>
</div>
<div id="TopUser" class="fr">
<div id="menu">
<ul class="menu">
<% if User.current.logged? %>
<li>
<%=link_to_user(User.current)%><!--<a href="javascript:void(0);" class="parent">用户名称</a>-->
<ul>
<% hidden_non_project = Setting.find_by_name("hidden_non_project")
visiable = hidden_non_project && hidden_non_project.value == "0"%>
<% if @show_course == 1 && !visiable %>
<% if User.current.user_extensions && [UserExtensions::TEACHER, UserExtensions::STUDENT].include?(User.current.user_extensions.identity) -%>
<% hasCourse=false %>
<% User.current.courses.each do |course| %>
<% if !course_endTime_timeout?(course) %>
<% hasCourse=true %>
<% end %>
<% end %>
<% if hasCourse %>
<li>
<a href="<%= url_for(:controller => 'users', :action => 'user_courses', :id=>User.current.id, :host=>Setting.host_user) %>" class="parent">我的课程</a>
<ul>
<% User.current.courses.each do |course| %>
<% if !course_endTime_timeout?(course) %>
<li title="<%=course.name%>"><a href="<%= url_for(:controller => 'courses', :action=>"show", :id=>course.id, :host=>Setting.host_course) %>"><%= course.name %></a>
<% end %>
<% end %>
</ul>
</li>
<% end %>
<% end -%>
<% end %>
<% if User.current.projects.count>0 %>
<li>
<a href="<%= url_for(:controller => 'users', :action => 'user_projects', :id=>User.current.id, :host=>Setting.host_user) %>" class="parent">我的项目</a>
<ul>
<% User.current.projects.each do |project| %>
<li title="<%=project.name%>"><a href="<%= url_for(:controller => 'projects', :action=>"show", :id=>project.id, :host=>Setting.host_name) %>"><%=project.name%></a></li>
<% end %>
</ul>
</li>
<% end %>
<!--<li><a href="javascript:void(0);" class="parent">我的课程</a>-->
<!--<ul>-->
<!--<li><a href="javascript:void(0);">新建课程</a></li>-->
<!--<li><a href="javascript:void(0);">我的课程0我的课程我的课程01我的课程011</a></li>-->
<!--<li><a href="javascript:void(0);">我的课程02</a></li>-->
<!--<li><a href="javascript:void(0);">我的课程02</a></li>-->
<!--</ul>&lt;!&ndash;-level3 end-&ndash;&gt;-->
<!--</li>&lt;!&ndash;-level2 end-&ndash;&gt;-->
<!--<li><a href="javascript:void(0);" class="parent">我的项目</a>-->
<!--<ul>-->
<!--<li><a href="javascript:void(0);">新建项目</a></li>-->
<!--<li><a href="javascript:void(0);">我的项目01</a></li>-->
<!--<li><a href="javascript:void(0);">我的项目0</a></li>-->
<!--<li><a href="javascript:void(0);">我的项目02</a></li>-->
<!--</ul>&lt;!&ndash;-level3 end-&ndash;&gt;-->
<!--</li>&lt;!&ndash;-level2 end-&ndash;&gt;-->
<!--<li><a href="javascript:void(0);">我的主页</a></li>-->
</ul>
</li><!---level1 end--->
<!--<li ><a href="javascript:void(0);">退出</a></li>-->
<% end %>
</ul>
<%= render_menu :account_menu -%>
</div>
</div>
</div>
<div class="cl"></div>

View File

@ -0,0 +1,12 @@
<% fans_count,fans_list = get_fans_users(user) %>
<div id="fans_nav_list" class="leftbox mt10" style="display:<%= fans_count==0 ? 'none' : 'block' %>">
<h4 class="fl">粉丝</h4><a href="<%=url_for(:controller => 'users', :action => 'user_fanslist', :id=>user.id)%>" data-count="<%= fans_count %>" style="display:<%= fans_count>10 ? 'block' : 'block' %>" class="more fr mr10">更多</a>
<div class="cl"></div>
<div class="mt5">
<% for fans in fans_list %>
<%= link_to image_tag(url_to_avatar(fans), :style => "width:38px;height:38px;"), user_path(fans), :class => "pic_members", :title => "#{fans.name}" %>
<% end %>
<div class="cl"></div>
</div>
</div><!--leftbox end-->

View File

@ -0,0 +1,8 @@
<% if(User.current.logged? && User.current!=target)%>
<%if(target.watched_by?(User.current))%>
<a id="user_watch_id" href="<%= watch_path(:object_type=>
'user',:object_id=>target.id,:target_id=>target.id) %>" class="fr qx_btn mr10" data-method="delete" data-remote="true" title="取消关注">取消</a>
<% else %>
<a id="user_watch_id" href="<%= watch_path(:object_type=>'user',:object_id=>target.id,:target_id=>target.id) %>" class="fr gz_btn mr10" data-method="post" data-remote="true" title="添加关注">关注</a>
<% end %>
<% end %>

View File

@ -0,0 +1,11 @@
<% watcher_count,watcher_list = get_watcher_users(user) %>
<div id="watcher_nav_list" class="leftbox mt10" style="display:<%= watcher_count==0 ? 'none' : 'block' %>">
<h4 class="fl">关注</h4><a href="<%=url_for(:controller => 'users', :action => 'user_watchlist', :id=>user.id)%>" data-count="<%= watcher_count %>" style="display:<%= watcher_count>10 ? 'block' : 'block' %>" class="more fr mr10">更多</a>
<div class="cl"></div>
<div class="mt5">
<% for watcher in watcher_list %>
<%= link_to image_tag(url_to_avatar(watcher), :style => "width:38px;height:38px;"), user_path(watcher), :class => "pic_members", :title => "#{watcher.name}" %>
<% end %>
<div class="cl"></div>
</div>
</div><!--leftbox end-->

View File

@ -0,0 +1,332 @@
<% @nav_dispaly_home_path_label = 1
@nav_dispaly_main_course_label = 1
@nav_dispaly_main_project_label = 1
@nav_dispaly_main_contest_label = 1 %>
<% @nav_dispaly_forum_label = 1%>
<% @nav_dispaly_user_label = show_item_on_navbar(params) %>
<% @center_flag = (User.current == @user) %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<title><%= h html_title %></title>
<meta name="description" content="<%= Redmine::Info.app_name %>" />
<meta name="keywords" content="issue,bug,tracker" />
<%= csrf_meta_tag %>
<%= favicon %>
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'public_new', 'leftside_new','users', :media => 'all' %>
<%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
<%= javascript_heads %>
<%= heads_for_theme %>
<%= call_hook :view_layouts_base_html_head %>
<!-- page specific tags -->
<%= yield :header_tags -%>
<!--
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>个人中心st</title>
<link href="css/public.css" rel="stylesheet" type="text/css" />
<link href="css/leftside.css" rel="stylesheet" type="text/css" />
<link href="css/users.css" rel="stylesheet" type="text/css" />
<script src="js/jquery-1.3.2.js" type="text/javascript"></script>
<script src="js/jquery-1.8.3-ui-1.9.2-ujs-2.0.3.js" type="text/javascript"></script>
<script type="text/javascript" src="js/sidebar.js"></script>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.8.4.custom.min.js"></script>
<script type="text/javascript" src="js/jQuery.peSlider.js"></script>
</script>
<script type="text/javascript">
//头部导航
var menuids=["TopUserNav"] //Enter id(s) of SuckerTree UL menus, separated by commas
function buildsubmenus(){
for (var i=0; i<menuids.length; i++){
var ultags=document.getElementById(menuids[i]).getElementsByTagName("ul")
for (var t=0; t<ultags.length; t++){
ultags[t].parentNode.getElementsByTagName("a")[0].className="subfolderstyle"
ultags[t].parentNode.onmouseover=function(){
this.getElementsByTagName("ul")[0].style.display="block"
}
ultags[t].parentNode.onmouseout=function(){
this.getElementsByTagName("ul")[0].style.display="none"
}
}
}
}
if (window.addEventListener)
window.addEventListener("load", buildsubmenus, false)
else if (window.attachEvent)
window.attachEvent("onload", buildsubmenus)
</script>
<script type="text/javascript">//侧导航
$(function(){
$(".subNav").click(function(){
$(this).toggleClass("currentDd").siblings(".subNav").removeClass("currentDd")
$(this).toggleClass("currentDt").siblings(".subNav").removeClass("currentDt")
// 修改数字控制速度, slideUp(500)控制卷起速度
$(this).next(".navContent").slideToggle(500).siblings(".navContent").slideUp(500);
})
})
</script>
<script type="text/javascript">
function show_window () {
$('#light').css('display','block');
$('#fade').css('display','block');
}
function close_window(){
$('#light').css('display','none');
$('#fade').css('display','none');
}
//弹框l
</script> -->
</head>
<body>
<div id="Container">
<%= render :partial => 'layouts/base_header_new'%>
<div id="TopBar">
<div class="topbar_info02 fl">
<h2><a href="javascript:void(0);" target="_blank" class="c_blue"><%= @center_flag ? '个人中心' : '个人主页' %></h2>
<p>当前位置 :
<%=link_to l(:field_homepage), home_path %> &gt; <%=link_to (@center_flag ? '个人中心' : '个人主页'), user_path(@user) %> &gt; <%=link_to @user.name, user_path(@user) %>
</p>
</div>
<!--<div class="search fl">-->
<!--<form class="search">-->
<!--<input type="text" name="serach" placeholder="输入关键词进行搜索" class="search_text fl">-->
<!--<a href="javascript:void(0);" class="search_btn fl f14 c_white" >搜 索</a>-->
<!--</form>-->
<!--</div>-->
</div><!--TopBar end-->
<div class="cl"></div>
<div id="content">
<div id="LSide" class="fl">
<div class="users_info">
<div class="pic_head">
<%= image_tag(url_to_avatar(@user), :id=>'nh_user_tx',:style=>"width:216px;height:216px;",:alt=>"头像") %>
<% if @center_flag %>
<a href="<%= url_for(:controller => 'my', :action => 'clear_user_avatar_temp') %>" data-remote="true" class="pic_edit usersphoto_edit"></a>
<% end %>
</div><!--pic_head end-->
<div class="users_name mt5">
<%=link_to @user.name, user_path(@user),:class=>"fl c_dark fb f14" %>
<% if (@user.user_extensions && (@user.user_extensions.identity != 2) ) %>
<span class="<%= @user.user_extensions.gender==1?'icon_female':'icon_male' %> fl mt3 ml5"></span>
<% end %>
<%= render :partial => 'layouts/user_watch_btn', :locals => {:target => @user} %>
</div>
<div class="cl"></div>
<div class="mt5 ">
<%=l(:label_user_watcher)%><%= link_to User.watched_by(@user.id).count.to_s, {:controller=>"users", :action=>"user_watchlist",:id=>@user.id},:class=>"c_blue",:nh_name=>"watcher_count" %>
<span>|&nbsp;</span>
<%=l(:label_x_user_fans, :count => User.current.watcher_users(User.current.id).count)%><%= link_to @user.watcher_users.count.to_s, {:controller=>"users", :action=>"user_fanslist",:id=>@user.id},:class=>"c_blue",:nh_name=>"fans_count"%>
<span>|&nbsp;</span>积分(<%= link_to(format("%.2f" ,get_option_number(@user,1).total_score ).to_i,
{:controller => 'users', :action => 'show_new_score', :remote => true, :id => @user.id }, :class => 'c_blue',:id => 'user_score') %>
</div>
<div class="cl"></div>
<% if (@user.user_extensions) %>
<div class="pf_intro"><%= @user.user_extensions.brief_introduction %></div>
<% end %>
</div><!--uers_info end-->
<div class="leftbox mt10">
<ul class="leftbox_ul_left">
<li>加入时间&nbsp;:</li>
<% if @user.user_extensions!=nil && @user.user_extensions.identity == 2 %>
<li><%= l(:label_company_name) %>&nbsp;:</li>
<% elsif !@user.firstname.empty? || !@user.lastname.empty? %>
<li>真实姓名&nbsp;:</li>
<% end %>
<% unless @user.user_extensions.nil? %>
<% if @user.user_extensions.identity == 0 %>
<li>职称&nbsp;:</li>
<% end %>
<% if @user.user_extensions && @user.user_extensions.location && !@user.user_extensions.location.empty?%>
<li>地区&nbsp;:</li>
<% end %>
<% if (@user.user_extensions.identity == 0 || @user.user_extensions.identity == 1) && !@user.user_extensions.school.nil? %>
<li>工作单位&nbsp;:</li>
<% elsif @user.user_extensions.identity == 3 && !@user.user_extensions.occupation.nil? && !@user.user_extensions.occupation.empty? %>
<li>工作单位&nbsp;:</li>
<% elsif @user.user_extensions.identity == 2 %>
<li>工作单位&nbsp;:</li>
<% end %>
<% if (!@user.user_extensions.description.nil? && !@user.user_extensions.description.empty?) %>
<li>个人简介&nbsp;:</li>
<% end %>
<% end %>
</ul>
<ul class="leftbox_ul_right c_dgrey">
<li><%= format_date(@user.created_on) %></li>
<li style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="<%= @user.show_name %>"><%= @user.show_name %></li>
<% unless @user.user_extensions.nil? %>
<% if @user.user_extensions.identity == 0 %>
<li><%= get_technical_title @user %></li>
<% end %>
<% if @user.user_extensions && @user.user_extensions.location && !@user.user_extensions.location.empty?%>
<li><%= @user.user_extensions.location %>&nbsp;&nbsp;<%= @user.user_extensions.location_city %></li>
<% end %>
<% if (@user.user_extensions.identity == 0 || @user.user_extensions.identity == 1) && !@user.user_extensions.school.nil? %>
<li><a href="<%= url_for(:controller=>'welcome',:action => 'course', :school_id => @user.user_extensions.school.id,:host=>Setting.host_course) %>"><%= @user.user_extensions.school.name %></a></li>
<% elsif @user.user_extensions.identity == 3 && !@user.user_extensions.occupation.nil? && !@user.user_extensions.occupation.empty? %>
<li><%= @user.user_extensions.occupation %></li>
<% elsif @user.user_extensions.identity == 2 %>
<li style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="<%= @user.show_name %>"><%= @user.show_name %></li>
<% end %>
<% if (!@user.user_extensions.description.nil? && !@user.user_extensions.description.empty?) %>
<li style="word-break:break-all;"><%= @user.user_extensions.description %></li>
<% end %>
<% end %>
</ul>
<div class="cl"></div>
</div>
<% if @center_flag %>
<div class="subNavBox ">
<div class="subNav "><a href="<%=url_for(:controller => 'users', :action => 'show',:id=>@user.id)%>" class=" f14 c_blue02">动态</a></div>
<div class="subNav subNav_jiantou"><a href="<%=url_for(:controller => 'users', :action => 'user_courses',:id=>@user.id)%>" class=" f14 c_blue02">我的课程<span style="font-weight:normal;font-size:12px;color:#FF5722;">(<%=@user.courses.count%>)</span></a></div>
<!--<ul class="navContent " >-->
<!--<li><a href="javascirpt:void();" >大学计算机基础</a></li>-->
<!--<li><a href="javascirpt:void();" >大牛软件核心知识开放课程</a></li>-->
<!--<li><a href="javascirpt:void();" >大学计算机基础</a></li>-->
<!--<li><a href="javascirpt:void();" >大牛软件核心知识开放课程</a></li>-->
<!--<li><a href="javascirpt:void();" >大学计算机基础</a></li>-->
<!--</ul>-->
<div class="subNav subNav_jiantou"><a href="<%=url_for(:controller => 'users', :action => 'user_projects',:id=>@user.id)%>" class=" f14 c_blue02">我的项目<span style="font-weight:normal;font-size:12px;color:#FF5722;">(<%=@user.projects.count%>)</span></a></div>
<!--<ul class="navContent " >-->
<!--<li><a href="javascirpt:void();" >Trustie-Forge</a></li>-->
<!--<li><a href="javascirpt:void();" >Trustie-weekly</a></li>-->
<!--<li><a href="javascirpt:void();" >大学计算机基础</a></li>-->
<!--<li><a href="javascirpt:void();" >大牛软件核心知识开放课程</a></li>-->
<!--<li><a href="javascirpt:void();" >大学计算机基础</a></li>-->
<!--</ul>-->
<div class="subNav "><a href="<%= url_for(:controller => 'my', :action => 'account') %>" class=" f14 c_blue02">编辑资料</a></div>
</div><!--侧导航 end-->
<% end %>
<div class="cl"></div>
<div class="leftbox mt10">
<ul class="leftbox_ul_left">
<% if !@user.user_extensions.nil? && @user.user_extensions.identity == 0 %>
<li>创建课程&nbsp;:</li>
<li>发布作业&nbsp;:</li>
<% end %>
<li>加入课程&nbsp;:</li>
<li>参加匿评&nbsp;:</li>
<li>发布资源&nbsp;:</li>
<li>创建项目&nbsp;:</li>
<li>加入项目&nbsp;:</li>
<li>发布缺陷&nbsp;:</li>
<li>解决缺陷&nbsp;:</li>
</ul>
<ul class="leftbox_ul_right c_dgrey">
<% if !@user.user_extensions.nil? && @user.user_extensions.identity == 0 %>
<li><%= get_create_course_count(@user) %></li>
<li><%= get_homework_commons_count(@user) %></li>
<% end %>
<li><%= get_join_course_count(@user) %></li>
<li><%= get_anonymous_evaluation_count(@user) %></li>
<li><%= get_projectandcourse_attachment_count(@user) %></li>
<li><%= get_create_project_count(@user) %></li>
<li><%= get_join_project_count(@user) %></li>
<li><%= get_create_issue_count(@user) %></li>
<li><%= get_resolve_issue_count(@user) %></li>
</ul>
<div class="cl"></div>
</div>
<div class="cl"></div>
<%= render :partial => 'layouts/user_watch_list', :locals => {:user => @user} %>
<%= render :partial => 'layouts/user_fans_list', :locals => {:user => @user} %>
<% visitor_count,visitor_list = get_visitor_users(@user) %>
<div class="leftbox mt10" style="display:<%= visitor_count==0 ? 'none' : 'block' %>">
<h4 class="fl">访客</h4><a href="<%=url_for(:controller => 'users', :action => 'user_visitorlist', :id=>@user.id)%>" data-count="<%= visitor_count %>" style="display:<%= visitor_count>10 ? 'block' : 'block' %>" class="more fr mr10">更多</a>
<div class="cl"></div>
<div class="mt5">
<% for visitor in visitor_list %>
<%= link_to image_tag(url_to_avatar(visitor.user), :style => "width:38px;height:38px;"), user_path(visitor.user), :class => "pic_members", :title => "#{visitor.user.name}" %>
<% end %>
<div class="cl"></div>
</div>
</div>
</div><!--LSide end-->
<%= yield %>
</div><!--Content end-->
<div class="cl"></div>
<%= render :partial => 'layouts/new_footer'%>
<div class="cl"></div>
</div><!--Container end-->
<%= render :partial => 'layouts/new_feedback' %>
<div id="ajax-modal" style="display:none;"></div>
<%= javascript_include_tag '/javascripts/avatars.js' %>
<div id="nh_tx_dialog_html" class="white_content" style="display:none;">
<div>
<div><a href="javascript:hideModal();" class="box_close"></a></div>
<div class="cl"></div>
<div class="pro_new">
<h3 class="box_h3 mb10">头像设置</h3>
<div class="uppicBox">
<%= file_field_tag 'avatar[image]',
:id => nil,
:class => 'uppic_btn',
:style => 'width:70px;',#added by young
:size => "1",
:multiple => false,
:onchange => 'addInputAvatar(this);',
:data => {
:max_file_size => Setting.attachment_max_size.to_i.kilobytes,
:max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)),
:max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i,
:file_type => Redmine::Configuration['pic_types'].to_s,
:type_support_message => l(:error_pic_type),
:upload_path => upload_avatar_path(:format => 'js'),
:description_placeholder => nil ,# l(:label_optional_description)
:source_type => @user.class.to_s,
:source_id => @user.id.to_s
} %>
<!--<br/>-->
<!--<span>只支持jpg,png,gif,大小不超过5M</span>-->
</div>
<div class="showpicBox">
<p>预览</p>
<%= image_tag(url_to_avatar(@user), :style=>"width:96px;height:96px;",:class=>"mb5 mt10",:nhname=>'avatar_image') %>
<span >96px*96px</span> <br />
<div class="mb20"></div>
<%= image_tag(url_to_avatar(@user), :style=>"width:48px;height:48px;",:class=>"mb5",:nhname=>'avatar_image') %>
<br />
<span>48px*48px</span> <br />
</div>
<div class="cl mb10"></div>
<a href="javascript:hideModal();" class=" fr grey_btn mr2"> 取&nbsp;&nbsp;消</a>
<a href="<%= url_for(:controller => 'my', :action => 'save_user_avatar') %>" data-remote="true" class="blue_btn fr mr10">确&nbsp;&nbsp;定</a>
</div><!--talknew end-->
<div class="cl"></div>
</div><!--floatbox end-->
</div>
</body>
</html>

View File

@ -1,135 +1,45 @@
<% @nav_dispaly_home_path_label = 1
@nav_dispaly_main_course_label = 1
@nav_dispaly_main_project_label = 1
@nav_dispaly_main_contest_label = 1 %>
<% @nav_dispaly_forum_label = 1%>
<style>
div.content{padding-top:10px;}
.pcontent>.school_list,.content>.school_list { padding-left: 5px;}
</style>
<script type="text/javascript">
$(document).ready(
function () {
$("#province").attr("href", "#WOpenWindow")
$("#province").leanModal({top: 100, closeButton: ".modal_close"});
var $lastname = $('#user_lastname')
var $firstname = $('#user_firstname')
var $enterprise = $('#enterprise_name')
$lastname.blur(function () {
var pas1 = document.getElementById("user_lastname").value;
<div id="RSide" class="fl">
<div id="users_setting">
<div id="users_tb_" class="users_tb_">
<ul>
<li id="users_tb_1" class="users_hovertab" onclick="x:HoverLi(1);">基本资料</li>
<li id="users_tb_2" class="users_normaltab" onclick="i:HoverLi(2);">账号管理</li>
</ul>
</div><!--tb_ end-->
<div class="cl"></div>
<div class="users_ctt">
<%= labelled_form_for :user, @user, :url => {:action => "account"}, :html => {:id => 'my_account_form', :method => :post} do |f| %>
<div class="users_dis" id="users_tbc_01">
<% if( @act.nil? || @act != 'password') %>
<%= render_flash_messages %>
<%= error_messages_for 'user' %>
<% end %>
<ul class="setting_left">
<li>登录名&nbsp;:&nbsp;</li>
<li>邮箱&nbsp;:&nbsp;</li>
<li>身份&nbsp;:&nbsp;</li>
<li nhname="tag" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" style="display:none;">姓氏&nbsp;:&nbsp;</li>
<li nhname="tag" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" style="display:none;">名字&nbsp;:&nbsp;</li>
<li nhname="tag" nh_tag_2="true" style="display:none;">组织名&nbsp;:&nbsp;</li>
<li nhname="tag" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" style="display:none;">性别&nbsp;:&nbsp;</li>
<li nhname="tag" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" style="display:none;">工作单位&nbsp;:&nbsp;</li>
<li>地区&nbsp;:&nbsp;</li>
<li>邮件通知&nbsp;:&nbsp;</li>
<li>个人签名&nbsp;:&nbsp;</li>
<li>个人简介&nbsp;:&nbsp;</li>
<li>&nbsp;&nbsp;</li>
</ul>
<ul class="setting_right ">
<li><%= f.text_field :login,:no_label=>true, :required => true, :name => "login",:class=>"w210"%></li>
<li><%= f.text_field :mail,:no_label=>true, :required => true,:class=>"w210"%></li>
if (pas1 == "") {
$('#valid_lastname').html('<span class="red">' + "<%= l(:lastname_empty) %>"+ "</span>");
$('#lastname_limit').hide();
}
else {
$('#valid_lastname').html('<span class="red">' + "</span>");
$('#lastname_limit').show();
}
});
$firstname.blur(function () {
var pas1 = document.getElementById("user_firstname").value;
if (pas1 == "") {
$('#valid_firstname').html('<span class="red">' + "<%= l(:firstname_empty) %>"+ "</span>");
$('#firstname_limit').hide();
}
else {
$('#valid_firstname').html('<span class="red">' + "</span>");
$('#firstname_limit').show();
}
});
$enterprise.blur(function () {
var pas1 = document.getElementById("enterprise_name").value;
if (pas1 == "") {
$('#valid_companyname').html('<span class="red">' + "<%= l(:enterprise_empty) %>"+ "</span>");
}
else {
$('#valid_lastname').html('<span class="red">' + "</span>");
}
});
}
);
</script>
<script type="text/javascript">
function submit_my_account_form()
{
var lastname = document.getElementById('user_lastname').value;
var firstname = document.getElementById('user_firstname').value;
if(lastname != "" && firstname != "")
{
$("#my_account_form").submit();
}
else {
parent.alert("<%= l(:label_firstname_lastname_empty)%>");
}
}
function get_options(value) {
var prefix = "";
if(location.href.indexOf('ros')>=0)
{
prefix = "/ros"
}
$.ajax({
type: "POST",
url: prefix + '/school/get_options/' + encodeURIComponent(value),
data: 'text',
success: function (data) {
$("#province").val(value);
$("#schoollist").html(data);
}
});
}
</script>
<div class="contextual" style="padding-right: 10px;">
<%= link_to(l(:button_change_password), {:action => 'password'}, :class => 'icon icon-passwd') if @user.change_password_allowed? %>
<%= call_hook(:view_my_account_contextual, :user => @user) %>
</div>
<h3 style="padding-left: 10px;">
<%= l(:label_my_account) %>
</h3>
<%= error_messages_for 'user' %>
<fieldset class="box" style="margin:10px;">
<%= labelled_form_for :user, @user,
:url => {:action => "account"},
:html => {:id => 'my_account_form',
:method => :post} do |f| %>
<fieldset class="collapsible collapsed" style="width:800px;margin-left: 10px;">
<legend onclick="toggleFieldset(this);">
<%= l(:label_my_photo) %>
</legend>
<div>
<!--upload profiles-->
<%= render :partial => "avatar/avatar_form",:style => "display:inline", :locals => {source: @user} %>
<!--upload-->
</div>
</fieldset>
<fieldset class="collapsible collapsed" style="width:800px;margin-left: 10px;">
<legend onclick="toggleFieldset(this);">
<%= l(:label_information_plural) %>
</legend>
<div>
<!-- 昵称 -->
<p style="width:730px;padding-left: 40px;">
<%= f.text_field :login, :required => true, :size => 25, :name => "login", :style => 'border:1px solid #d3d3d3;'%>
<span class='font_lighter'><%= l(:label_max_number) %></span>
<br/>
</p>
<p style="width:400px;padding-left: 53px;">
<label for="userIdentity">
<%= l(:label_identity) %><span class="required"> *</span></label>
<select onchange="showtechnical_title(this.value, $('#userTechnical_title'));" name="identity" id="userIdentity" class="location" style="margin: -4px;">
<option value="">
<%= l(:label_account_identity_choose) %>
</option>
<li>
<select onchange="showtechnical_title(this.value);" name="identity" id="userIdentity" class="location" class="w70" style="height:28px;margin-left:2px;">
<option value="0">
<%= l(:label_account_identity_teacher) %>
</option>
@ -142,185 +52,52 @@
<option value="3">
<%= l(:label_account_identity_developer) %>
</option>
</select>
<span id='technical_title' style='display:none'>
<select name="technical_title" id="userTechnical_title"></select>
</span>
<span id='no' style='display:none'>
<!-- modified by fq -->
<select nhname="tag" nh_tag_0="true" name="technical_title" id="userTechnical_title" class="w70" style='display:none;height:28px;'>
<option value="教授">教授</option>
<option value="副教授">副教授</option>
<option value="讲师">讲师</option>
<option value="助教">助教</option>
</select>
<span nhname="tag" nh_tag_1="true" style='display:none;'>
<% if !User.current.user_extensions.nil? && !User.current.user_extensions.student_id.nil? %>
<%= text_field_tag :no, User.current.user_extensions.student_id, :placeholder => l(:label_account_identity_studentID) %>
<%= text_field_tag :no, User.current.user_extensions.student_id, :placeholder => l(:label_account_identity_studentID),:style=>"width:127px;" %>
<% else %>
<%= text_field_tag :no, nil, :placeholder => l(:label_account_identity_studentID) %></span>
<% end %>
<!-- end -->
</span>
</p>
<span id='name' style='display:none'>
<p style="width:530px;padding-left: 53px;">
<%= f.text_field :lastname, :size => 25, :required => true %>
<span class='font_lighter' id="lastname_limit">
<%= l(:field_lastname_eg) %>
</span>
<span id="valid_lastname"></span>
</p>
<p style="width:530px;padding-left: 53px;">
<%= f.text_field :firstname, :size => 25, :required => true %>
<span class='font_lighter' id="firstname_limit">
<%= l(:field_firstname_eg) %>
</span>
<span id="valid_firstname"></span>
</p>
</span>
<span id='enterprise' style='display:none'>
<p style="width:400px;padding-left: 39px;">
<%= l(:label_company_name)%><span style="color: #bb0000"> *</span>
<%= text_field_tag :enterprise_name, @user.firstname %>
<span id="valid_companyname"></span>
</p>
</span>
<!-- added by bai 增加账户里的性别-->
<span id='gender' style='display:none'>
<% if @user.user_extensions.nil? %>
<p style="width:400px;padding-left: 53px;">
<label for="gender"><%= l(:label_gender) %>&nbsp;&nbsp;</label>
<%= select_tag 'gender', "<option value = '0'>#{l(:label_gender_male)}</option><option value = '1'>#{l(:label_gender_female)}</option>".html_safe, :class => 'gender' %>
</p>
<% else %>
<% if @user.user_extensions.gender == 0 %><!-- label_gender_male -->
<p style="width:400px;padding-left: 53px;">
<label for="gender"><%= l(:label_gender) %>&nbsp;&nbsp;</label>
<%= select_tag 'gender', "<option value = '0'>#{l(:label_gender_male)}</option><option value = '1'>#{l(:label_gender_female)}</option>".html_safe, :class => 'gender' %>
</p>
<% else %>
<p style="width:400px;padding-left: 54px;">
<label for="gender"><%= l(:label_gender) %>&nbsp;&nbsp;</label>
<%= select_tag 'gender', "<option value = '0'>#{l(:label_gender_male)}</option><option value = '1' selected='selected'>#{l(:label_gender_female)}</option>".html_safe, :class => 'gender' %>
</p>
<% end %>
<%= text_field_tag :no, nil, :placeholder => l(:label_account_identity_studentID),:style=>"60px" %></span>
<% end %>
</span>
<!-- added by Wen -->
<p id="occupation_detail" style="padding-left: 25px; display: none">
<label for="occupation_name"><%= l(:field_occupation) %></label>
<span class="required">&nbsp;</span>
<% if User.current.user_extensions.nil? %>
<input id="province" name="province" style="display: none" type="text" value=<%= l(:field_occupation_click) %> readonly>
<input id="occupation" name="occupation" style="display: none" type="text" value="" />
<input id="occupation_name" type="text" style="display: none" readonly/>
<% else %>
<% if User.current.user_extensions.identity == 3 || User.current.user_extensions.identity == 2 %>
<input id="province" name="province" style="display: none" type="text" value=<%= l(:field_occupation_click) %> readonly>
<input id="occupation" name="occupation" style="display: none" type="text" value="<%= @user.user_extensions.occupation %>" />
<input id="occupation_name" type="text" style="display: none" readonly/>
<% elsif User.current.user_extensions.school.nil? %>
<input id="province" name="province" style="display: none" type="text" value=<%= l(:field_occupation_click) %> readonly>
<input id="occupation" name="occupation" style="display: none" type="text" />
<input id="occupation_name" type="text" style="display: none" readonly/>
<% else %>
<input id="province" name="province" style="display: none" type="text" value="<%= User.current.user_extensions.school.province %>" readonly/>
<input id="occupation" name="occupation" type="text" style="display: none" value="<%= User.current.user_extensions.school.id %>"/>
<input id="occupation_name" type="text" style="display: none" value="<%= User.current.user_extensions.school.name %>" readonly="true" style="background-color: #E2E2E2;"/>
<% end %>
<% end %>
</p>
<div id="WOpenWindow">
<a class="modal_close" href="#"></a>
<h2 style="margin: 10px"><%= l(:lable_school_list)%></h2>
&nbsp;&nbsp;
<div class="pcontent">
<ul id="provincelist" class="school_list">
<% @ss = School.find_by_sql("select distinct province from schools") %>
<% @ss.each do |s| %>
<li style="width: 15%; float: left;">
<a style="cursor: pointer;" onclick="get_options('<%= s.province %>')"><%= s.province %>
</a>
</li>
<% end %>
</ul>
</div>
<div class="content" style="font-size: 13px">
<ul id="schoollist" class="school_list">
<li nhname="tag" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" style="display:none;"><%= f.text_field :lastname,:no_label=>true, :required => true,:class=>"w210" %>
<li nhname="tag" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" style="display:none;"><%= f.text_field :firstname,:no_label=>true, :required => true,:class=>"w210" %>
<li nhname="tag" nh_tag_2="true" style="display:none;"><%= text_field_tag :enterprise_name,@user.firstname,:no_label=>true, :required => true,:class=>"w210" %>
<li nhname="tag" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" style="display:none;">
<select class="w70" style="height:28px;margin-left:2px;" id="gender" name="gender"><option value="0">男</option><option value="1">女</option></select>
</li>
</ul>
</div>
</div>
<script type="text/javascript">
function test(id, name) {
//$("#occupation").html("<option value='"+id+"'>"+name+"</option>");
$("#occupation").val(id);
$("#occupation_name").val(name);
$("#lean_overlay").hide();
$("#WOpenWindow").hide();
}
</script>
<!-- added by bai 增加了地区 -->
<!-- end -->
<p style="width:357px;padding-left: 27px;">
<%= f.text_field :mail, :required => true %>
</p>
<p style="width:426px;padding-left:54px;">
<%= f.select :language, :Chinese => :zh, :English => :en %>
</p>
<% if !User.current.user_extensions.nil? %>
<% province = User.current.user_extensions.location %>
<% city = User.current.user_extensions.location_city %>
<% identity = User.current.user_extensions.identity %>
<% occupation1 = User.current.user_extensions.occupation %>
<% occupation = User.current.user_extensions.occupation %>
<% title = User.current.user_extensions.technical_title %>
<% language = User.current.language %>
<li nhname="tag" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" style="display:none;">
<% if User.current.user_extensions.nil? %>
<input nhname="tag" nh_tag_0="true" nh_tag_1="true" id="province" name="province" style="display: none;" class="w70" type="text" value=<%= l(:field_occupation_click) %> readonly>
<input nhname="tag" nh_tag_3="true" id="occupation" name="occupation" style="display: none;" class="w210" type="text" value="" />
<input nhname="tag" nh_tag_0="true" nh_tag_1="true" id="occupation_name" type="text" style="display: none;width:117px;" readonly/>
<% elsif User.current.user_extensions.identity == 3 || User.current.user_extensions.identity == 2 %>
<input nhname="tag" nh_tag_0="true" nh_tag_1="true" id="province" name="province" style="display: none;" class="w70" type="text" value=<%= l(:field_occupation_click) %> readonly>
<input nhname="tag" nh_tag_3="true" id="occupation" name="occupation" style="display: none;" class="w210" type="text" value="<%= @user.user_extensions.occupation %>" />
<input nhname="tag" nh_tag_0="true" nh_tag_1="true" id="occupation_name" type="text" style="display: none;width:117px;" readonly/>
<% elsif User.current.user_extensions.school.nil? %>
<input nhname="tag" nh_tag_0="true" nh_tag_1="true" id="province" name="province" style="display: none;" class="w70" type="text" value=<%= l(:field_occupation_click) %> readonly>
<input nhname="tag" nh_tag_3="true" id="occupation" name="occupation" style="display: none;" class="w210" type="text" />
<input nhname="tag" nh_tag_0="true" nh_tag_1="true" id="occupation_name" type="text" style="display: none;width:117px;" readonly/>
<% else %>
<% province = "湖南省" %>
<% city = "长沙"%>
<% identity = ""%>
<% occupation1 = ""%>
<% title = "" %>
<% language = ""%>
<input nhname="tag" nh_tag_0="true" nh_tag_1="true" id="province" name="province" style="display: none;" class="w70" type="text" value="<%= User.current.user_extensions.school.province %>" readonly/>
<input nhname="tag" nh_tag_3="true" id="occupation" name="occupation" type="text" style="display: none;" class="w210" value="<%= User.current.user_extensions.school.id %>"/>
<input nhname="tag" nh_tag_0="true" nh_tag_1="true" id="occupation_name" type="text" style="display: none;width:117px;" value="<%= User.current.user_extensions.school.name %>" readonly="true" style="background-color: #E2E2E2;"/>
<% end %>
<script type="text/javascript" language="javascript">
$().ready(function () {
var province = "<%= "#{province}" %>"
var city = "<%= "#{city}" %>"
init_province_and_city(document.getElementById('userProvince'), province, document.getElementById('userCity'), city);
var identity = "<%= "#{identity}" %>"
var title = "<%= "#{title}" %>"
var language = "<%= "#{language}" %>"
var occupation1 = "<%= "#{occupation}" %>"
</li>
init_identity_and_title(document.getElementById('userIdentity'), identity, document.getElementById('userTechnical_title'), title, language);
});
</script>
<p style="width:400px;padding-left: 55px;"><label style="margin-right: 5px;" for="userProvince"><%= l(:label_location) %></label>
<select onchange="showcity(this.value, document.getElementById('userCity'));" name="province" id="userProvince" class="location">
<option value=""><%= l('location.select.click')%></option>
<li>
<select onchange="showcity(this.value, document.getElementById('userCity'));" name="province" id="userProvince" class="location" style="height:28px;margin-left:2px;">
<option value="">--请选择省份--</option>
<option value="北京">北京</option>
<option value="上海">上海</option>
<option value="广东">广东</option>
@ -357,52 +134,100 @@
<option value="台湾">台湾</option>
<option value="海外">海外</option>
</select>
<select name="city" id="userCity" class="location"></select>
</p>
<select name="city" id="userCity" class="location" style="height:28px;"></select>
</li>
<li>
<%= select_tag( 'user[mail_notification]', options_for_select( user_mail_notification_options(@user), @user.mail_notification) ) %>
<label>不要发送对我自己提交的修改的通知<%= check_box_tag 'no_self_notified', 1, @user.pref[:no_self_notified],:style=>"height:14px;" %></label>
</li>
<li><input name="brief_introduction" class="w450" type="text" value="<%= (@user.user_extensions.nil?) ? '' : @user.user_extensions.brief_introduction %>"></li>
<li style="height:auto;"><textarea name="description" class="w450 h200" style="resize:none;"><%= (@user.user_extensions.nil?) ? '' : @user.user_extensions.description %></textarea></li>
<li style="display:none;"><%= f.select :language, :Chinese => :zh, :English => :en %></li>
<li class="ml2">
<a href="javascript:$('#my_account_form_btn').click();" class="blue_btn fl">确认</a>
<input type="submit" id="my_account_form_btn" style="display:none;"/>
<!--<a href="javascript:void(0);" class="grey_btn ml10 fl">取消</a>-->
</li>
</ul>
<div class="cl"></div>
</div><!--tbc_01 end-->
<% end %>
<%= form_tag({:action => "password"},:id => 'my_password_form') do %>
<div class="users_undis" id="users_tbc_02">
<% if( !@act.nil? && @act == 'password') %>
<%= render_flash_messages %>
<%= error_messages_for 'user' %>
<% end %>
<ul class="setting_left">
<li>原始密码&nbsp;:&nbsp;</li>
<li>新密码&nbsp;:&nbsp;</li>
<li>确认密码&nbsp;:&nbsp;</li>
</ul>
<ul class="setting_right ">
<li><input id="password" name="password" class="w210" type="password" required="true"></li>
<li><input id="new_password" name="new_password" class="w210" type="password" required="true"><span class="c_red ml5">请输入6-12个字符</span></li>
<li><input id="new_password_confirmation" name="new_password_confirmation" class="w210" type="password" required="true"></li>
<li class="ml2">
<a href="javascript:$('#my_password_form_btn').click();" class="blue_btn fl">确认</a>
<input type="submit" id="my_password_form_btn" style="display:none;"/>
<!--<a href="javascript:void(0);" class="grey_btn ml10 fl">取消</a>-->
</li>
</ul>
<div class="cl"></div>
</div><!--tbc_02 end-->
<div class="cl"></div>
<% end %>
</div><!--ctt end-->
</div><!--users_setting end-->
</div>
<div id="WOpenWindow">
<a class="modal_close" href="#"></a>
<h2 style="margin: 10px"><%= l(:lable_school_list)%></h2>
&nbsp;&nbsp;
<div class="pcontent">
<ul id="provincelist" class="school_list">
<% @ss = School.find_by_sql("select distinct province from schools") %>
<% @ss.each do |s| %>
<li style="width: 15%; float: left;">
<a style="cursor: pointer;" onclick="get_options('<%= s.province %>')"><%= s.province %>
</a>
</li>
<% end %>
</ul>
</div>
<div class="content" style="font-size: 13px">
<ul id="schoollist" class="school_list">
<% if Setting.openid? %>
<p>
<%= f.text_field :identity_url %>
</p>
<% end %>
</ul>
</div>
</div>
<% @user.custom_field_values.select(&:editable?).each do |value| %>
<p> <%= custom_field_tag_with_label :user, value %> </p>
<% end %>
<%= call_hook(:view_my_account, :user => @user, :form => f) %>
</fieldset>
<fieldset class="collapsible collapsed" style="width:800px;margin-left: 10px;">
<legend onclick="toggleFieldset(this);">
<%= l(:field_mail_notification) %>
</legend>
<div style="padding-left: 3px;"> <!-- modified by ming -->
<p style="width:380px;">
<%= render :partial => 'users/mail_notifications' %>
</p></div>
</fieldset>
<!-- added by william -->
<fieldset class="collapsible collapsed" style="width:800px;margin-left: 10px;display: none">
<legend onclick="toggleFieldset(this);">
<%= l(:label_user_extensions) %>
</legend>
<div>
<%= render :partial => 'users/user_extensions' %></div>
</fieldset>
<!-- end -->
<input type="button" class="enterprise" value="<%=l(:button_save) %>" onclick="submit_my_account_form();" >
</fieldset>
<%= stylesheet_link_tag 'nyan' %>
<%= javascript_include_tag '/javascripts/jquery.leanModal.min.js' %>
<% if !User.current.user_extensions.nil? %>
<% province = User.current.user_extensions.location %>
<% city = User.current.user_extensions.location_city %>
<% identity = User.current.user_extensions.identity %>
<% occupation1 = User.current.user_extensions.occupation %>
<% occupation = User.current.user_extensions.occupation %>
<% title = User.current.user_extensions.technical_title %>
<% language = User.current.language %>
<% else %>
<% province = "湖南省" %>
<% city = "长沙"%>
<% identity = ""%>
<% occupation1 = ""%>
<% title = "" %>
<% language = ""%>
<% end %>
<% html_title(l(:label_my_account)) -%>
<script type="text/javascript" language="javascript">
<script type="text/javascript">
function showcity(province, cityField) {
switch (province) {
case "北京" :
@ -588,20 +413,10 @@
}*/
}
}
function init_province_and_city(pField, province, cField, city) {
for (var i = 0; i < pField.options.length; i++) {
if (pField.options[i].value == province) {
pField.selectedIndex = i;
function showtechnical_title(val){
$("*[nhname='tag']").hide();
$("*[nh_tag_"+val+"='true']").show();
}
}
showcity(province, cField);
for (var i = 0; i < cField.options.length; i++) {
if (cField.options[i].value == city) {
cField.selectedIndex = i;
}
}
}
function init_identity_and_title(pField, identity, cField, title, language) {
for (var i = 0; i < pField.options.length; i++) {
if (pField.options[i].value == identity) {
@ -655,89 +470,69 @@
}
}
}
function showtechnical_title(identity, technical_titleField) {
switch (identity) {
case '0' :
$('#technical_title').show()
$('#no').hide()
$('#name').show()
$('#enterprise').hide()
$('#gender').show()
$('#occupation_detail').show()
$('input#province').show()
$('input#occupation_name').show()
$('input#occupation').hide()
var technical_titleOptions = new Array(
"<%= l(:label_technicl_title_professor) %>", "<%= l(:label_technicl_title_associate_professor) %>", "<%= l(:label_technicl_title_lecturer) %>", "<%= l(:label_technicl_title_teaching_assistant) %>");
break;
case '1' :
$('#technical_title').hide()
$('#no').show()
$('#name').show()
$('#enterprise').hide()
$('#gender').show()
$('#occupation_detail').show()
$('input#province').show()
$('input#occupation_name').show()
$('input#occupation').hide()
var technical_titleOptions = new Array(
"<%= l(:label_technicl_title_professor) %>", "<%= l(:label_technicl_title_associate_professor) %>", "<%= l(:label_technicl_title_lecturer) %>", "<%= l(:label_technicl_title_teaching_assistant) %>");
break;
case '2' :
$('#technical_title').hide()
$('#no').hide()
$('#name').hide()
$('#enterprise').show()
$('#gender').hide()
$('#occupation_detail').hide()
var technical_titleOptions = new Array(
"<%= l(:label_technicl_title_professor) %>", "<%= l(:label_technicl_title_associate_professor) %>", "<%= l(:label_technicl_title_lecturer) %>", "<%= l(:label_technicl_title_teaching_assistant) %>");
break;
case '3':
$('#technical_title').hide()
$('#no').hide()
$('#name').show()
$('#enterprise').hide()
$('#gender').show()
$('#occupation_detail').show()
$('input#province').hide()
$('input#occupation_name').hide()
$('input#occupation').show()
// document.getElementById("occupation").value = "";
var technical_titleOptions = new Array(
"<%= l(:label_technicl_title_professor) %>", "<%= l(:label_technicl_title_associate_professor) %>", "<%= l(:label_technicl_title_lecturer) %>", "<%= l(:label_technicl_title_teaching_assistant) %>");
break;
default:
$('#technical_title').hide()
$('#no').hide()
$('#name').show()
$('#enterprise').hide()
$('#gender').show()
$('#occupation_detail').hide()
var technical_titleOptions = new Array(
"<%= l(:label_technicl_title_professor) %>", "<%= l(:label_technicl_title_associate_professor) %>", "<%= l(:label_technicl_title_lecturer) %>", "<%= l(:label_technicl_title_teaching_assistant) %>");
break;
}
technical_titleField.options.length = 0;
for (var i = 0; i < technical_titleOptions.length; i++) {
technical_titleField.options[i] = new Option(technical_titleOptions[i], technical_titleOptions[i]);
/*
if (cityField.options[i].value==city)
function get_options(value) {
var prefix = "";
if(location.href.indexOf('ros')>=0)
{
//alert("here put City ok!");
document.oblogform["city"].selectedIndex = i;
}*/
prefix = "/ros"
}
$.ajax({
type: "POST",
url: prefix + '/school/get_options/' + encodeURIComponent(value),
data: 'text',
success: function (data) {
$("#province").val(value);
$("#schoollist").html(data);
}
});
}
function test(id, name) {
//$("#occupation").html("<option value='"+id+"'>"+name+"</option>");
$("#occupation").val(id);
$("#occupation_name").val(name);
$("#lean_overlay").hide();
$("#WOpenWindow").hide();
}
function init_province_and_city(pField, province, cField, city) {
for (var i = 0; i < pField.options.length; i++) {
if (pField.options[i].value == province) {
pField.selectedIndex = i;
}
}
showcity(province, cField);
for (var i = 0; i < cField.options.length; i++) {
if (cField.options[i].value == city) {
cField.selectedIndex = i;
}
}
}
$(function(){
//学校
$("#province").attr("href", "#WOpenWindow")
$("#province").leanModal({top: 100, closeButton: ".modal_close"});
//地区
var province = "<%= "#{province}" %>"
var city = "<%= "#{city}" %>"
init_province_and_city(document.getElementById('userProvince'), province, document.getElementById('userCity'), city);
//select
var identity = "<%= "#{identity}" %>"
var title = "<%= "#{title}" %>"
var language = "<%= "#{language}" %>"
var occupation1 = "<%= "#{occupation}" %>"
init_identity_and_title(document.getElementById('userIdentity'), identity, document.getElementById('userTechnical_title'), title, language);
$("#userIdentity").change();
<% if( !@act.nil? && @act == 'password') %>
$("#users_tb_2").click();
<% end %>
});
</script>
<script type="text/javascript">
function g(o){return document.getElementById(o);}
function HoverLi(n){
for(var i=1;i<=2;i++){g('users_tb_'+i).className='users_normaltab';g('users_tbc_0'+i).className='users_undis';}g('users_tbc_0'+n).className='users_dis';g('users_tb_'+n).className='users_hovertab';
}
</script>

View File

@ -0,0 +1,7 @@
$("img[nhname='avatar_image']").attr('src',$("#nh_user_tx").attr('src'));
$('#ajax-modal').html($("#nh_tx_dialog_html").html());
showModal('ajax-modal','460px');
$('#ajax-modal').siblings().hide();
$('#ajax-modal').parent().removeClass("alert_praise");
//$('#ajax-modal').parent().css("top","").css("left","");
$('#ajax-modal').parent().addClass("alert_box");

View File

@ -0,0 +1,2 @@
$("#nh_user_tx").replaceWith('<%= image_tag(url_to_avatar(@user), :id=>'nh_user_tx',:style=>"width:216px;height:216px;",:alt=>"头像") %>');
hideModal();

View File

@ -1,7 +1,8 @@
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'projects/join_project') %>');
showModal('ajax-modal', '540px');
$('#ajax-modal').css('height','260px');
$('#ajax-modal').siblings().remove();
//$('#ajax-modal').siblings().remove();
$('#ajax-modal').siblings().hide();
$('#ajax-modal').before("<span style='float: right;cursor:pointer;padding-left: 513px;'>" +
"<a href='#' onclick='hidden_join_course_form();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
$('#ajax-modal').parent().removeClass("alert_praise");

View File

@ -1,12 +1,11 @@
<h3 style="padding-top: 40px;"><%= l(:label_statistics) %></h3>
<div class="project_r_h">
<h2 class="project_h2"><%= l(:label_statistics) %></h2>
</div>
<p>
<%= tag("embed", :width => 670, :height => 300, :type => "image/svg+xml", :src => url_for(:controller => 'repositories', :action => 'graph', :id => @project, :repository_id => @repository.identifier_param, :graph => "commits_per_month")) %>
<%= tag("embed", :width => 670, :height => 300, :type => "image/svg+xml", :src => url_for(:controller => 'repositories', :action => 'graph', :id => @project, :repository_id => @repository.identifier_param, :graph => "commits_per_month")) %>
</p>
<p>
<%= tag("embed", :width => 670, :height => 400, :type => "image/svg+xml", :src => url_for(:controller => 'repositories', :action => 'graph', :id => @project, :repository_id => @repository.identifier_param, :graph => "commits_per_author")) %>
<%= tag("embed", :width => 670, :height => 400, :type => "image/svg+xml", :src => url_for(:controller => 'repositories', :action => 'graph', :id => @project, :repository_id => @repository.identifier_param, :graph => "commits_per_author")) %>
</p>
<p><%= link_to l(:button_back), :action => 'show', :id => @project %></p>
<% html_title(l(:label_repository), l(:label_statistics)) -%>

View File

@ -9,7 +9,7 @@
<%= link_to student_work.user.show_name,user_path(student_work.user),:title => student_work.user.show_name, :class => "c_blue02"%>
</li>
<li class=" hwork_tit">
<%= link_to student_work.name, student_work_path(student_work),:remote => true,:title => student_work.name, :class => "c_blue02"%>
<%= link_to student_work.name, student_work_path(student_work.id),:remote => true,:title => student_work.name, :class => "c_blue02"%>
</li>
<li class=" hwork_time_c">
<% if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(student_work.created_at.to_s).strftime("%Y-%m-%d") %>
@ -26,7 +26,7 @@
</li>
<li class=" hwork_code02 <%= score_color student_work.student_score%> student_score_info" >
<%= student_work.student_score.nil? ? "--" : format("%.1f",student_work.student_score)%>
<% unless student_work.student_score.nil?%>
<% unless student_work.student_score.nil? || student_work.homework_common.homework_type == 2%>
<span class="">
(<%= student_work.student_works_scores.where(:reviewer_role => 3).count%>)
</span>

View File

@ -2,42 +2,46 @@
<span class="c_dark f14 fb fl">学号</span>
</li>
<li class=" hwork_name f14 fb c_dark">
<%= link_to "姓名",@show_all ? student_work_index_path(:homework => @homework.id,:order => "name", :sort => @score, :name => @name) : "javascript:void(0)",:class => "f14 f_b c_dark fl"%>
<%= link_to "姓名",@show_all ? student_work_index_path(:homework => @homework.id,:order => "name", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "f14 f_b c_dark fl"%>
<% if @show_all && @order == "name"%>
<a href="javascript:void(0);" class="<%= @score == 'desc' ? 'st_up' : 'st_down'%>" ></a>
<%= link_to "",student_work_index_path(:homework => @homework.id,:order => "name", :sort => @score, :name => @name, :group => @group) ,:class => @score == 'desc' ? 'st_up' : 'st_down'%>
<% end%>
</li>
<li class="hwork_tit">
<span class="c_dark f14 fb fl">作品名称</span>
</li>
<li class=" hwork_time f14 fb c_dark">
<%= link_to "时间",@show_all ? student_work_index_path(:homework => @homework.id,:order => "created_at", :sort => @score, :name => @name) : "javascript:void(0)",:class => "f14 f_b c_dark fl"%>
<%= link_to "时间",@show_all ? student_work_index_path(:homework => @homework.id,:order => "created_at", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "f14 f_b c_dark fl"%>
<% if @show_all && @order == "created_at"%>
<%= link_to "",student_work_index_path(:homework => @homework.id,:order => "created_at", :sort => @score, :name => @name) ,:class => @score == 'desc' ? 'st_up' : 'st_down'%>
<%= link_to "",student_work_index_path(:homework => @homework.id,:order => "created_at", :sort => @score, :name => @name, :group => @group) ,:class => @score == 'desc' ? 'st_up' : 'st_down'%>
<% end%>
</li>
<li class="mr5 w40 ml15">
<%= link_to "教师",@show_all ? student_work_index_path(:homework => @homework.id,:order => "teacher_score", :sort => @score, :name => @name) : "javascript:void(0)",:class => "f14 f_b c_dark fl"%>
<%= link_to "教师",@show_all ? student_work_index_path(:homework => @homework.id,:order => "teacher_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "f14 f_b c_dark fl"%>
<% if @show_all && @order == "teacher_score"%>
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "teacher_score", :sort => @score, :name => @name) ,:class => @score == 'desc' ? 'st_up' : 'st_down'%>
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "teacher_score", :sort => @score, :name => @name, :group => @group) ,:class => @score == 'desc' ? 'st_up' : 'st_down'%>
<% end%>
</li>
<li class="mr5 w40 ml20">
<%= link_to "教辅",@show_all ? student_work_index_path(:homework => @homework.id,:order => "teaching_asistant_score", :sort => @score, :name => @name) : "javascript:void(0)",:class => "f14 f_b c_dark fl"%>
<%= link_to "教辅",@show_all ? student_work_index_path(:homework => @homework.id,:order => "teaching_asistant_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "f14 f_b c_dark fl"%>
<% if @show_all && @order == "teaching_asistant_score"%>
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "teaching_asistant_score", :sort => @score, :name => @name) ,:class => @score == 'desc' ? 'st_up' : 'st_down'%>
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "teaching_asistant_score", :sort => @score, :name => @name, :group => @group) ,:class => @score == 'desc' ? 'st_up' : 'st_down'%>
<% end%>
</li>
<li class="mr5 ml10 w40">
<%= link_to "匿评",@show_all ? student_work_index_path(:homework => @homework.id,:order => "student_score", :sort => @score, :name => @name) : "javascript:void(0)",:class => "f14 f_b c_dark fl"%>
<li class="ml15 w40">
<% if @homework.homework_type == 1%>
<%= link_to "匿评",@show_all ? student_work_index_path(:homework => @homework.id,:order => "student_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "f14 f_b c_dark fl"%>
<% elsif @homework.homework_type == 2%>
<%= link_to "系统",@show_all ? student_work_index_path(:homework => @homework.id,:order => "student_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "f14 f_b c_dark fl"%>
<% end %>
<% if @show_all && @order == "student_score"%>
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "student_score", :sort => @score, :name => @name) ,:class => @score == 'desc' ? 'st_up' : 'st_down'%>
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "student_score", :sort => @score, :name => @name, :group => @group) ,:class => @score == 'desc' ? 'st_up' : 'st_down'%>
<% end%>
</li>
<li class="ml20">
<%= link_to "成绩",@show_all ? student_work_index_path(:homework => @homework.id,:order => "score", :sort => @score, :name => @name) : "javascript:void(0)",:class => "f14 f_b c_dark fl"%>
<%= link_to "成绩",@show_all ? student_work_index_path(:homework => @homework.id,:order => "score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "f14 f_b c_dark fl"%>
<% if @show_all && @order == "score"%>
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "score", :sort => @score, :name => @name) ,:class => @score == 'desc' ? 'st_up' : 'st_down'%>
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "score", :sort => @score, :name => @name, :group => @group) ,:class => @score == 'desc' ? 'st_up' : 'st_down'%>
<% end%>
</li>

View File

@ -0,0 +1,75 @@
<div class="show_hwork_arrow"></div>
<div class="show_hwork">
<ul>
<li class="fl" >
<span class="tit_fb">
上交时间:
</span>
<%=format_time @work.created_at %>
</li>
<% if @work.user != User.current%>
<!-- 不是自己显示为点赞,编程作业不可编辑和删除 -->
<li class="fr" id="student_work_praise_<%= @work.id%>">
<%= render :partial => 'student_work_praise' %>
</li>
<% end%>
<div class="cl"></div>
<li >
<span class="tit_fb ">
编程代码:
</span>
<div class="show_hwork_p break_word">
<%= text_format @work.description%>
</div>
<div class="cl"></div>
</li>
<li ><span class="tit_fb ">测试结果:</span>
<table class="border_ce" cellpadding="0" cellspacing="0">
<tbody>
<!--<%#@work.student_work_test.each do |test|%>-->
<!--<tr class="<%#= cycle("", "b_grey") %>">-->
<!--<td class="td_tit">-->
<!--<%#= test.homework_test.input%>-->
<!--</td>-->
<!--<td class="td_tit">-->
<!--<%#= test.homework_test.output%>-->
<!--</td>-->
<!--<td class="td_50 c_red"><%#= test.status_to_s%></td>-->
<!--<td class="td_50 "><%#= test.test_score%></td>-->
<!--</tr>-->
<!--<%# end%>-->
<%@homework.homework_tests.each do |test|%>
<tr class="<%= cycle("", "b_grey") %>">
<td class="td_tit">
<%= test.input%>
</td>
<td class="td_tit">
<%= test.output%>
</td>
<td class="td_50 c_red"><%= test.student_work_test.nil? ? "正在编译" : test.student_work_test.status_to_s%></td>
<td class="td_50 "><%= test.student_work_test.nil? ? "0" : test.student_work_test.test_score%></td>
</tr>
<% end%>
</tbody>
</table>
<div class="cl"></div>
</li>
<% if @is_teacher%>
<!-- 编程作业老师才可以评分 -->
<div id="add_student_score_<%= @work.id%>" class="mt10 evaluation">
<%= render :partial => 'add_score',:locals => {:work => @work,:score => @score}%>
</div>
<% end%>
</ul>
<div class="ping_box mt10" id="score_list_<%= @work.id%>" style="<%= @work.student_works_scores.empty? ? 'padding:0px;' : ''%>">
<%@work.student_works_scores.order("updated_at desc").each do |score|%>
<div id="work_score_<%= score.id%>">
<%= render :partial => 'student_work_score',:locals => {:score => score}%>
</div>
<% end%>
</div><!---ping_box end--->
<a href="javascript:void(0);" class="fr c_blue mt5 mb5" onclick="$('#about_hwork_<%= @work.id%>').html('');">收起</a>
</div><!---show_hwork end--->

View File

@ -36,7 +36,7 @@
<li >
<span class="tit_fb ">内容:</span>
<div class="show_hwork_p break_word">
<%= textilizable @work.description%>
<%= text_format @work.description%>
</div>
<div class="cl"></div>
</li>

View File

@ -2,36 +2,36 @@
<span class="c_dark f14 fb fl">学号</span>
</li>
<li class=" hwork_name f14 fb c_dark">
<%= link_to "姓名",@show_all ? student_work_index_path(:homework => @homework.id,:order => "name", :sort => @score, :name => @name) : "javascript:void(0)",:class => "f14 f_b c_dark fl"%>
<%= link_to "姓名",@show_all ? student_work_index_path(:homework => @homework.id,:order => "name", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "f14 f_b c_dark fl"%>
<% if @show_all && @order == "name"%>
<a href="javascript:void(0);" class="<%= @score == 'desc' ? 'st_up' : 'st_down'%>" ></a>
<%= link_to "",student_work_index_path(:homework => @homework.id,:order => "name", :sort => @score, :name => @name, :group => @group) ,:class => @score == 'desc' ? 'st_up' : 'st_down'%>
<% end%>
</li>
<li class="hwork_tit_une">
<span class="c_dark f14 fb fl">作品名称</span>
</li>
<li class=" hwork_time f14 fb c_dark">
<%= link_to "时间",@show_all ? student_work_index_path(:homework => @homework.id,:order => "created_at", :sort => @score, :name => @name) : "javascript:void(0)",:class => "f14 f_b c_dark fl"%>
<%= link_to "时间",@show_all ? student_work_index_path(:homework => @homework.id,:order => "created_at", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "f14 f_b c_dark fl"%>
<% if @show_all && @order == "created_at"%>
<%= link_to "",student_work_index_path(:homework => @homework.id,:order => "created_at", :sort => @score, :name => @name) ,:class => @score == 'desc' ? 'st_up' : 'st_down'%>
<%= link_to "",student_work_index_path(:homework => @homework.id,:order => "created_at", :sort => @score, :name => @name, :group => @group) ,:class => @score == 'desc' ? 'st_up' : 'st_down'%>
<% end%>
</li>
<li class="mr5 w40 ml15">
<%= link_to "教师",@show_all ? student_work_index_path(:homework => @homework.id,:order => "teacher_score", :sort => @score, :name => @name) : "javascript:void(0)",:class => "f14 f_b c_dark fl"%>
<%= link_to "教师",@show_all ? student_work_index_path(:homework => @homework.id,:order => "teacher_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "f14 f_b c_dark fl"%>
<% if @show_all && @order == "teacher_score"%>
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "teacher_score", :sort => @score, :name => @name) ,:class => @score == 'desc' ? 'st_up' : 'st_down'%>
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "teacher_score", :sort => @score, :name => @name, :group => @group) ,:class => @score == 'desc' ? 'st_up' : 'st_down'%>
<% end%>
</li>
<li class="mr5 w40 ml20">
<%= link_to "教辅",@show_all ? student_work_index_path(:homework => @homework.id,:order => "teaching_asistant_score", :sort => @score, :name => @name) : "javascript:void(0)",:class => "f14 f_b c_dark fl"%>
<%= link_to "教辅",@show_all ? student_work_index_path(:homework => @homework.id,:order => "teaching_asistant_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "f14 f_b c_dark fl"%>
<% if @show_all && @order == "teaching_asistant_score"%>
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "teaching_asistant_score", :sort => @score, :name => @name) ,:class => @score == 'desc' ? 'st_up' : 'st_down'%>
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "teaching_asistant_score", :sort => @score, :name => @name, :group => @group) ,:class => @score == 'desc' ? 'st_up' : 'st_down'%>
<% end%>
</li>
<li class="ml20">
<%= link_to "成绩",@show_all ? student_work_index_path(:homework => @homework.id,:order => "score", :sort => @score, :name => @name) : "javascript:void(0)",:class => "f14 f_b c_dark fl"%>
<%= link_to "成绩",@show_all ? student_work_index_path(:homework => @homework.id,:order => "score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "f14 f_b c_dark fl"%>
<% if @show_all && @order == "score"%>
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "score", :sort => @score, :name => @name) ,:class => @score == 'desc' ? 'st_up' : 'st_down'%>
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "score", :sort => @score, :name => @name, :group => @group) ,:class => @score == 'desc' ? 'st_up' : 'st_down'%>
<% end%>
</li>

View File

@ -2,20 +2,23 @@ $("#add_student_score_<%= @work.id%>").html("<%= escape_javascript(render :parti
$('#score_<%= @work.id%>').peSlider({range: 'min'});
<% if @is_new%>
$("#score_list_<%= @work.id%>").prepend("<div id='work_score_<%= @score.id%>'><%= escape_javascript(render :partial => 'student_work_score', :locals => {:score => @score}) %></div>");
$("#score_list_<%= @work.id%>").prepend("<div id='work_score_<%= @score.id%>'><%= escape_javascript(render :partial => 'student_work_score', :locals => {:score => @score}) %></div>");
<% else %>
$("#work_score_<%= @score.id%>").html("<%= escape_javascript(render :partial => 'student_work_score', :locals => {:score => @score}) %>");
$("#work_score_<%= @score.id%>").html("<%= escape_javascript(render :partial => 'student_work_score', :locals => {:score => @score}) %>");
<% end%>
$("#score_list_<%= @work.id%>").removeAttr("style");
<% if @is_teacher %>
<% if @homework.homework_type == 1%>
$("#student_work_<%= @work.id%>").replaceWith("<%= escape_javascript(render :partial => 'evaluation_student_work',:locals => {:student_work => @work}) %>");
<% else%>
$("#student_work_<%= @work.id%>").replaceWith("<%= escape_javascript(render :partial => 'student_work',:locals => {:student_work => @work}) %>");
<% end%>
<% if @homework.homework_type == 1%>
$("#student_work_<%= @work.id%>").replaceWith("<%= escape_javascript(render :partial => 'evaluation_student_work',:locals => {:student_work => @work}) %>");
<% elsif @homework.homework_type == 2%>
$("#student_work_<%= @work.id%>").replaceWith("<%= escape_javascript(render :partial => 'evaluation_student_work',:locals => {:student_work => @work}) %>");
<% else%>
$("#student_work_<%= @work.id%>").replaceWith("<%= escape_javascript(render :partial => 'student_work',:locals => {:student_work => @work}) %>");
<% end%>
<% else %>
$("#student_work_<%= @work.id%>").replaceWith("<%= escape_javascript(render :partial => 'evaluation_work',:locals => {:student_work => @work}) %>");
$("#student_work_<%= @work.id%>").replaceWith("<%= escape_javascript(render :partial => 'evaluation_work',:locals => {:student_work => @work}) %>");
<% end%>

View File

@ -2,14 +2,6 @@
<h2 class="project_h2">编辑作品</h2>
</div>
<div class="Newwork">
<!--<div id="tb_" class="hwork_tb_">-->
<!--<ul>-->
<!--<li id="tb_1" class="hwork_hovertab" onclick="x:HoverLi(1);" >-->
<!--课程名称课程名称课程名</li>-->
<!--<li id="tb_2" class="hwork_normaltab" onclick="i:HoverLi(2);">-->
<!--成员</li>-->
<!--</ul>-->
<!--</div>-->
<div class="hwork_ctt">
<div class="hwork_dis" id="tbc_01">
<%= labelled_form_for @work,:html => { :multipart => true } do |f|%>

View File

@ -48,8 +48,9 @@
<%= link_to "所有作品(<span class='c_red'>#{@stundet_works.count}</span>)".html_safe,student_work_index_path(:homework => @homework.id), :class => "fl"%>
</span>
<% if @show_all%>
<input type="text" value="<%= @name%>" placeholder="昵称、学号、姓名搜索" class="min_search ml10 fl" onkeypress="SearchByName($(this),'<%= student_work_index_path(:homework => @homework.id)%>',event);">
<a class="student_work_search fl" onclick="SearchByName_1($(this).prev(),'<%= student_work_index_path(:homework => @homework.id)%>');" href="javascript:void(0)">搜索</a>
<input type="text" value="<%= @name%>" placeholder="昵称、学号、姓名搜索" class="min_search ml10 fl" onkeypress="SearchByName($(this).val(),$(this).next().val(),'<%= student_work_index_path(:homework => @homework.id)%>',event);">
<%= select_tag(:late_penalty,options_for_select(course_group_list(@course),@group), {:class => "fl h22 w100 ml10"}) if @is_teacher %>
<a class="student_work_search fl" onclick="SearchByName_1($(this).prev().prev().val(),$(this).prev().val(),'<%= student_work_index_path(:homework => @homework.id)%>');" href="javascript:void(0)">搜索</a>
<%= link_to("缺评情况",student_work_absence_penalty_student_work_index_path(:homework => @homework.id), :class => "student_work_search fl", :target => "_blank") if((@is_teacher || User.current.admin?) && @homework.homework_type == 1) %>
<% end%>
<% if @is_teacher%>
@ -89,7 +90,7 @@
<div id="about_hwork_<%= student_work.id%>" ></div>
<% end%>
<% else %>
<% if @homework.homework_type == 1%>
<% if @homework.homework_type == 1 || @homework.homework_type == 2%>
<ul class="hwork_ul">
<%= render :partial => 'evaluation_student_work_title'%>
</ul><!---hwork_ul end-->

View File

@ -33,9 +33,12 @@
<p>
<label class="fl"><span class="c_red">*</span>&nbsp;&nbsp;作品名称&nbsp;&nbsp;&nbsp;&nbsp;</label>
<%= f.text_field "name", :required => true, :size => 60, :class => "bo fl", :maxlength => 200, :placeholder => "作品名称", :onkeyup => "regexStudentWorkName();" %>
<a href="javascript:void(0)" class="fl ml10 mt3" onclick="show_project();" >项目信息
<% if @homework.homework_type != 2%>
<a href="javascript:void(0)" class="fl ml10 mt3" onclick="show_project();" >
项目信息
<img class="ml5 " src="../images/bid/pic_question.png" width="15" height="15" Title="项目是一种由用户创建的基于&#10;网络的协作空间,能够为个人&#10;或小组提供分布式的协同交流&#10;和资料管理等方面的。">
</a>
<% end%>
<div class="cl"></div>
<p id="student_work_name_span" class="c_red ml90 mb10"></p>
</p>
@ -46,17 +49,23 @@
</p>
<div class="cl"></div>
<p>
<label class="fl"><span class="c_red">*</span>&nbsp;&nbsp;作品描述&nbsp;&nbsp;&nbsp;&nbsp;</label>
<%= f.text_area "description", :class => "w620 hwork_txt ", :maxlength => 3000, :placeholder => "最多3000个汉字", :onkeyup => "regexStudentWorkDescription();"%>
<label class="fl">
<span class="c_red">*</span>&nbsp;
<%= @homework.homework_type == 2 ? "提交代码" : "作品描述"%>
&nbsp;&nbsp;&nbsp;
</label>
<%= f.text_area "description", :class => "w620 hwork_txt ", :placeholder => "作品描述不能为空", :onkeyup => "regexStudentWorkDescription();"%>
<div class="cl"></div>
<p id="student_work_description_textarea" class="c_red ml90 mb10"></p>
</p>
<div class="cl"></div>
<% if @homework.homework_type != 2%>
<p>
<label class="fl">&nbsp;&nbsp;&nbsp;添加附件&nbsp;&nbsp;&nbsp;&nbsp;</label>
<%= render :partial => 'attachments/new_form' %>
</p>
<div class="cl"></div>
<% end%>
<p class="ml80 ">
<a href="javascript:void(0)" class="blue_btn fl c_white" onclick="new_student_work();">提交作品</a>
<%= link_to "返&nbsp;&nbsp;回".html_safe, student_work_index_path(:homework => @homework), :class => "blue_btn grey_btn fl c_white"%>

View File

@ -0,0 +1 @@
成功

View File

@ -2,6 +2,10 @@ if($("#about_hwork_<%= @work.id%>").children().length > 0)
{$("#about_hwork_<%= @work.id%>").html("");}
else
{
<% if @homework.homework_type == 2%>
$("#about_hwork_<%= @work.id%>").html("<%= escape_javascript(render :partial => 'programing_work_show') %>");
<% else%>
$("#about_hwork_<%= @work.id%>").html("<%= escape_javascript(render :partial => 'show') %>");
<% end%>
$('#score_<%= @work.id%>').peSlider({range: 'min'});
}

View File

@ -1,74 +1,46 @@
<div class="content_frame">
<ul class="user_course_sort">
<% for membership in memberships %>
<li>
<table width="660" border="0" align="center" style="border-bottom: 1px dashed rgb(204, 204, 204); margin-bottom: 10px;font-size:14px;">
<tr>
<td colspan="2" valign="top" width="50">
<%= image_tag(url_to_avatar(membership.course), :class => 'avatar') %>
</td>
<td>
<table width="580" border="0">
<tr>
<td colspan="2" valign="top">
<span>
<%= link_to_course(membership.course) %>
</span>
<span style="float: right">
<%= render :partial => 'courses/set_course_time', :locals => {:course => membership.course} %>
<% if (User.current == @user && (!@user.allowed_to?(:as_teacher,membership.course)))%>
<%= join_in_course(membership.course, User.current) %>
<% can_edit_flag = User.current.allowed_to?(:as_teacher,item) || User.current.admin? %>
<% course_end_flag = course_endTime_timeout?(item) %>
<div class="courses_list line" id="nh_course_<%=item.id%>">
<div class="courses_list_pic fl">
<a href="<%= url_for(:controller => 'courses', :action=>"show", :id=>item.id, :host=>Setting.host_course) %>" title="<%= item.name %>">
<%= image_tag(url_to_avatar(item), :style => 'width:64px;height:64px;') %>
</a>
</div>
<div class="courses_list_info fl ml10">
<a href="<%= url_for(:controller => 'courses', :action=>"show", :id=>item.id, :host=>Setting.host_course) %>" title="<%= item.name %>" class="courses_list_title f14 fb <%=course_end_flag ? 'c_dark' : 'c_blue02'%> fl"><%= item.name %></a>
<% if(can_edit_flag) %>
<% if(course_end_flag) %>
<a href="<%=restartcourse_course_path(item)%>" class="pic_eye_grey fl ml5" title="重开课程" data-confirm="确定要重开课程?" data-method="post" data-remote="true"></a>
<% else %>
<a href="<%=finishcourse_course_path(item, format: :js)%>" class="pic_eye_blue fl ml5" title="关闭课程" data-confirm="确定要关闭课程?" data-method="post" data-remote="true"></a>
<% end %>
&nbsp;&nbsp;&nbsp;&nbsp;
<%= l(:label_x_base_courses_member, :count => membership.course.members.count) %>
(<%= "#{membership.course.members.count}" %>)
&nbsp;&nbsp;
<%= l(:label_homework) %>
(
<span class="">
<%= link_to (membership.course.homework_commons.count), homework_common_index_path(:course => membership.course.id) %>
</span>
)
&nbsp;&nbsp;
<%= l(:label_course_news) %>
(
<span style="color: #ed8924">
<%= link_to (membership.course.news.count), {:controller => 'news', :action => 'index', :course_id => membership.course.id} %>
</span>)
</span>
<% end %>
<div class="cl"></div>
<div class="courses_list_table">
<table><tbody>
<tr>
<td class="td_w60 ">主讲老师:</td>
<td class="td_w70 ">
<a href="<%= user_path(item.teacher) %>" title="<%= item.teacher.show_name %>"><%= item.teacher.show_name %></a>
</td>
<td class="td_w60 ">课程作业:</td>
<td class="td_w110 "><a href="<%=url_for(:controller => 'homework_common', :action => 'index',:course=>item.id, :host=>Setting.host_course)%>"><%= item.homework_commons.count %></a></td>
</tr>
<tr>
<td colspan="2" width="580" style="word-break:break-all;word-wrap: break-word;">
<p class="font_description">
<%= textilizable membership.course.short_description %>
</p>
</td>
<td>学生人数:</td>
<td><a href="<%= url_for(:controller => 'courses', :action=>"member", :id=>item.id,:role=>2, :host=>Setting.host_course) %>"><%= studentCount(item) %></a></td>
<td>开课学期:</td>
<td><%= item.time %><%= get_course_term_locales item %></td>
</tr>
<tr>
<td>
<% @course = Course.find_by_extra(membership.course.extra) %>
<% unless (@course.nil? || @course.teacher.nil? || @course.teacher.name.nil?) %>
<span class="font-lighter" style="float: left">
<%= l(:label_main_teacher) %>
: <%= link_to(@course.teacher.realname, user_path(@course.teacher)) %>
</span>
<span style="float: right; padding-left: 8px">
<%= l(:label_course_term) %>
: <%= @course.time %><%= get_course_term_locales @course %>
</span>
</tbody></table>
</div>
</div>
<% if(course_end_flag) %>
<span class="grey_n_btn fr mt20">课程结束</span>
<% elsif(can_edit_flag) %>
<a href="<%=url_for(:controller => 'homework_common', :action => 'new',:course=>item.id, :host=>Setting.host_course)%>" class="blue_n_btn fr mt20">发布作业</a>
<% else %>
<a href="<%=url_for(:controller => 'homework_common', :action => 'index',:course=>item.id, :host=>Setting.host_course)%>" class="blue_n_btn fr mt20">提交作品</a>
<% end %>
</td>
</tr>
</table>
</td>
</tr>
</table>
</li>
<% end %>
</ul>
<div class="cl"></div>
</div>
<%= call_hook :view_account_left_bottom, :user => @user %>

View File

@ -4,7 +4,7 @@
<div class="inf_user_image">
<table style="border-bottom: solid 1px #80a6d2;" width="100%">
<tr>
<td align="left" valign="middle" ><%= image_tag(url_to_avatar(@user), :class => 'avatar2') %></td>
<td align="left" valign="middle" ><%= image_tag(url_to_avatar(@user), :class => 'avatar2',:style=>'max-width:150px;max-height:150px;') %></td>
<td width="35%">
<table>
<tr class="info_font" align="center" style=" word-wrap: break-word; word-break: break-all"><td><%= h @user.name %></td></tr>

View File

@ -0,0 +1,50 @@
<div class="courses_list line" id="fans_item_<%=item.id%>">
<div class="courses_list_pic fl">
<a href="javascirpt:void();">
<%= image_tag(url_to_avatar(item), :style=>"width:64px;height:64px;",:alt=>"头像") %>
</a>
</div>
<div class="courses_list_info fl ml10">
<a href="<%= user_path(item) %>" title="<%= item.show_name %>" class="courses_list_title f14 fb c_blue02 fl"><%= item.show_name %></a>
<div class="cl"></div>
<div class="courses_list_table ">
<% if item.user_extensions && !item.user_extensions.brief_introduction.nil? && !item.user_extensions.brief_introduction.empty? %>
<p class="fans_sign" title="<%= item.user_extensions.brief_introduction %>">个性签名:<%= item.user_extensions.brief_introduction %></p>
<% end %>
<table><tbody><tr>
<td class="td_w60 ">加入时间:</td>
<td class="td_w110 "><%= format_date(item.created_on) %></td>
<% if (item.user_extensions.identity == 0 || item.user_extensions.identity == 1) && !item.user_extensions.school.nil? %>
<td class="td_w60 ">工作单位:</td>
<td class="td_w110 ">
<li style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="<%= item.user_extensions.school.name %>">
<a href="<%= url_for(:controller=>'welcome',:action => 'course', :school_id => item.user_extensions.school.id,:host=>Setting.host_course) %>"><%= item.user_extensions.school.name %></a>
</li>
</td>
<% elsif item.user_extensions.identity == 3 && !item.user_extensions.occupation.nil? && !item.user_extensions.occupation.empty? %>
<td class="td_w60 ">工作单位:</td>
<td class="td_w110 ">
<li style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="<%= item.user_extensions.occupation %>">
<%= item.user_extensions.occupation %>
</li>
</td>
<% elsif item.user_extensions.identity == 2 %>
<td class="td_w60 ">工作单位:</td>
<td class="td_w110 ">
<li style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="<%= item.show_name %>">
<%= item.show_name %>
</li>
</td>
<% end %>
</tr></tbody></table>
</div>
</div>
<% if(User.current.logged? && User.current != item )%>
<%if(item.watched_by?(User.current))%>
<a href="<%= watch_path(:object_type=>'user',:object_id=>item.id,:target_id=>target.id) %>" class="grey_n_btn fr mt20" data-method="delete" data-remote="true" title="取消关注">取消关注</a>
<% else %>
<a href="<%= watch_path(:object_type=>'user',:object_id=>item.id,:target_id=>target.id) %>" class="blue_n_btn fr mt20" data-method="post" data-remote="true" title="添加关注">添加关注</a>
<% end %>
<% end %>
<div class="cl"></div>
</div>

View File

@ -1,661 +1,344 @@
<% if User.current.id == @user.id %>
<div class="menu-div">
<div class="menu">
<span style="color: #000; font-weight: bold;">
<%= l(:label_user_activities, :name => @user.name) %>
</span>
<ul><%#链接绑定在页面最下方的jQuery%>
<li mode='all' class="<%= "on" if @state.eql?(0) %>">
<%= l :label_user_all_activity %>
</li>
<li mode='myself' class="<%= "on" if @state.eql?(1) %>">
<%= l :label_user_activity_myself %>
</li>
<li mode='respond' class="<%= "on" if @state.eql?(2) %>">
<%= l :label_user_all_respond %>
</li>
</ul>
</div>
<script type="text/javascript">
</script>
</div>
<div style="height:20px"></div>
<%= form_tag(:controller => 'users', :action => "show") do %>
<div class="user-search-block hidden" style="float:right;margin-top:-55px">
<table width="100%" valign="center">
<tr>
<td align="right">
<div class="project-search">
<%= text_field_tag 'user', params[:user], :size => 30 %>
<%= submit_tag l(:label_search_by_user), :class => "small", :name => nil %>
</div>
</td>
</tr>
</table>
</div>
<style type="text/css">
div.ke-toolbar{display:none;width:400px;border:none;background:none;padding:0px 0px;}
span.ke-toolbar-icon{line-height:26px;font-size:14px;padding-left:26px;}
span.ke-toolbar-icon-url{background-image:url( /images/public_icon.png )}
div.ke-toolbar .ke-outline{padding:0px 0px;line-height:26px;font-size:14px;}
span.ke-icon-emoticons{background-position:0px -671px;width:50px;height:26px;}
span.ke-icon-emoticons:hover{background-position:-79px -671px;width:50px;height:26px;}
div.ke-toolbar .ke-outline{border:none;}
</style>
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
<% @center_flag = (User.current == @user) %>
<% if @center_flag %>
<div class="top_new">
<span class="<%= (@user.user_extensions.identity == 0 && @user.allowed_to?(:add_course, nil, :global => true)) ? 'top_new_bg' : 'top_newcourses_bg'%> fl"></span>
<% if @user.allowed_to?(:add_project, nil, :global => true) %>
<a href="<%= url_for(:controller => 'projects', :action => 'new',:host=>Setting.host_name) %>" class="bgreen_n_btn fr ml10 mt2" target="_blank">新建项目</a>
<% else %>
<a href="<%= join_project_projects_path %>" data-remote ="true" class="green_n_btn fr mt2">加入项目</a>
<% end %>
<% if @user.user_extensions.identity == 0 && @user.allowed_to?(:add_course, nil, :global => true) %>
<a href="<%= url_for(:controller => 'courses', :action => 'new',:host=>Setting.host_course) %>" class="green_n_btn fr mt2" target="_blank">新建课程</a>
<% else %>
<!--<a href="<%#= url_for(:controller => 'courses', :action => 'join_private_courses',:host=>Setting.host_course) %>" data-remote ="true" class="green_n_btn fr mt2">加入课程</a>-->
<a href="<%= join_private_courses_courses_path %>" data-remote ="true" class="green_n_btn fr mt2">加入课程</a>
<% end %>
<div class="cl"></div>
</div>
<% end %>
<%= render_flash_messages %>
<% unless @state == 2 %>
<% unless @activity.empty? %>
<div id="activity">
<% @activity.each do |e| %>
<%# 以下一行代码解决有未知的活动无法转换成Model报错%>
<% (Rails.logger.error "[Error] =========================================================> NameError: uninitialized constant " + e.act_type.to_s; next;) if e.act_type.safe_constantize.nil? %>
<% act = e.act %>
<% unless act.nil? %>
<% if e.act_type == 'JournalsForMessage' || e.act_type == 'HomeworkCommon' || e.act_type == 'Journal'|| e.act_type == 'Changeset' || e.act_type == 'Message' || e.act_type == 'Principal' || e.act_type == 'News' || e.act_type == 'Issue' || e.act_type == 'Contest' %>
<div id="RSide" class="fl">
<div class="message_box mb10">
<div nhname='new_message' style="display:none;">
<form action="<%= url_for(:controller => 'words', :action => 'create', :user_id => @user.id) %>" data-remote="true" method="post">
<textarea nhname='new_message_textarea' name="new_form[user_message]" style="display:none;"></textarea>
<p nhname='contentmsg'></p>
<div nhname='toolbar_container' style="float:left;padding-top:3px;"></div>
<a id="new_message_cancel_btn" href="javascript:void(0)" class="grey_n_btn fr " style="margin-top:3px;">取消</a>
<a id="new_message_submit_btn" href="javascript:void(0)" class="blue_n_btn fr mr5 " style="margin-top:3px;">发布</a>
</form>
</div>
<div class="cl"></div>
<table width="660" border="0" align="left" style="border-bottom: 1px dashed rgb(204, 204, 204); margin-bottom: 10px;font-size:14px;">
<tr>
<td colspan="2" valign="top" width="50">
<%= image_tag(url_to_avatar(e.user), :class => "avatar") %>
</td>
<td>
<table border="0" class="info-break" style="width:580px;">
<% case e.act_type %>
<% when 'JournalsForMessage' %>
<tr>
<td colspan="2" valign="top">
<% if User.current.login == e.user.try(:login) %>
<strong>
<%= link_to("#{l(:label_i)}", user_path(e.user_id)) %>
</strong>
&nbsp;
<% if User.current.language == "zh" %>
<span class="font_lighter">
<%= l(:label_i_have_feedback) %>
<%= link_to("#{e.act.user.name}", user_path(e.act.user.id)) %>
<%= l(:label_of_feedback) + l(:label_layouts_feedback) %>
</span>
<% else %>
<span class="font_lighter">
<%= l(:label_i_have_feedback) %>
<%= l(:label_layouts_feedback) + l(:label_of_feedback) %>
<%= link_to("#{e.act.user.name}", user_path(e.act.user.id)) %>
</span>
<% end %>
<% else %>
<strong>
<%= link_to("#{e.user.name}", user_path(e.user_id)) %>
</strong>
<% if User.current.language == "zh" %>
<span class="font_lighter">
<%= l(:label_have_feedback) %>
<%= link_to("#{e.act.user.name}", user_path(e.act.user.id)) %>
<%= l(:label_of_feedback) + l(:label_layouts_feedback) %>
</span>
<% else %>
<span class="font_lighter">
<%= l(:label_have_feedback) %>
<%= l(:label_layouts_feedback) + l(:label_of_feedback) %>
<%= link_to("#{e.act.user.name}", user_path(e.act.user.id)) %>
</span>
<% end %>
<% end %>
</td>
</tr>
<tr>
<td colspan="2" class="upload_img" style="max-width:580px;">
<p class="font_description">
<%= textAreailizable act.notes %>
</p>
<div style="display: inline-block; float: right; margin-top: 0px">
<span>
<%= user_jour_feed_back_url e %>
</span>
<div class="message_list_box" nhname="list_more_div" id="nh_messages" style="display:none;">
<div nhname="container" data-nodatamsg="暂无留言" data-pagesize="3" data-url="<%= url_for(:controller => 'users', :action => 'user_feedback4show') %>" data-isclose="0" data-currpage="0" data-hasmore="1"></div>
<div class="message_list_more">
<a nhname="expand" href="javascript:void(0)" class="c_blue02">点击展开更多</a> <a nhname="close" style="display:none" href="javascript:void(0)" class="c_lgrey fr mr10">收起</a>
<div class="cl"></div>
</div>
</td>
</tr>
<tr>
<td>
<div style="display: inline-block; float: left; margin-top: 0px" width="200" align="right" class="a">
<span class="font_lighter">
<%= (l(:label_update_time).to_s << ': ' << format_time(e.act.created_on)).to_s %>
</span>
</div>
<div style="display: inline-block; float: right; margin-top: 0px"></div>
</td>
</tr>
<% when 'HomeworkCommon' %>
<tr>
<% if e.user == User.current %>
<td colspan="2" valign="top">
<strong>
<%= link_to("#{l(:label_i)}", user_path(e.user_id)) %>
</strong>
<span class="font_lighter">
<%= l(:label_i_new_activity) %>
</span>
<%= link_to format_activity_title("#{l(:label_active_homework)}##{act.id}:#{act.name}"), student_work_index_path(:homework => e.act_id) %>
</td>
<% else %>
<td colspan="2" valign="top">
<strong>
<%= link_to(h(e.user), user_path(e.user_id)) %>
</strong>&nbsp;
<span class="font_lighter">
<%= l(:label_new_activity) %>
</span>&nbsp;
<%= link_to format_activity_title("#{l(:label_active_homework)}##{act.id}:#{act.name}"), student_work_index_path(:homework => e.act_id) %>
</td>
<% end %>
</tr>
<tr>
<td colspan="2" class="upload_img" style="max-width:580px;">
<p class="font_description">
<%= textAreailizable act, :description %>
</p></td>
</tr>
<tr>
<td>
<div style="display: inline-block; float: left; margin-top: 0px" width="200" align="right" class="a">
<span class="font_lighter">
<%= (l(:label_update_time).to_s << ': ' << format_time(e.act.created_at)).to_s %>
</span>
</div>
<!--<div style="display: inline-block; float: right; margin-top: 0px">-->
<!--<span>-->
<!--<%#= link_to l(:label_find_all_comments), respond_path(e.act_id) %>-->
<!--</span>-->
<!--<a class="font_lighter">-->
<!--<%#= l(:label_comments_count, :count => e.act.commit) %>-->
<!--</a>-->
<!--</div>-->
</td>
</tr>
<% when 'Journal' %>
<tr>
<% if e.user == User.current %>
<td colspan="2" valign="top">
<strong>
<%= link_to("#{l(:label_i)}", user_path(e.user_id)) %>
</strong>
&nbsp;
<span class="font_lighter">
<%= l(:label_i_new_activity) %>
</span>
&nbsp;
<%= link_to(l(:label_activity_project)+""+act.issue.project.name, project_path(act.issue.project.id)) %>
<%= link_to format_activity_title("#{act.issue.tracker} ##{act.issue.id}: #{act.issue.subject}"),
{:controller => 'issues', :action => 'show', :id => act.issue.id, :anchor => "change-#{act.id}"} %>
</td>
<% else %>
<td colspan="2" valign="top">
<strong>
<%= link_to(h(e.user), user_path(e.user_id)) %>
</strong>
&nbsp;
<span class="font_lighter">
<%= l(:label_new_activity) %>
</span>
&nbsp;
<%= link_to(l(:label_activity_project)+""+act.issue.project.name, project_path(act.issue.project.id)) %>
<%= link_to format_activity_title("#{act.issue.tracker} ##{act.issue.id}: #{act.issue.subject}"),
{:controller => 'issues', :action => 'show', :id => act.issue.id, :anchor => "change-#{act.id}"} %>
</td>
<% end %>
</tr>
<tr>
<% if act.notes.nil? %>
<% desStr = '' %>
<% else %>
<% desStr= textAreailizable(act, :notes) %>
<% end %>
<td colspan="2" class="upload_img" style="max-width:580px;">
<p class="font_description">
<%= desStr %>
</p>
</td>
</tr>
<tr>
<td>
<div style="display: inline-block; float: left; margin-top: 0px" width="200" align="right" class="a">
<span class="font_lighter">
<%= (l(:label_update_time).to_s << ': ' << format_time(e.act.created_on)).to_s %>
</span>
</div>
<div style="display: inline-block; float: right; margin-top: 0px"></div>
</td>
</tr>
<% when 'Changeset' %>
<tr>
<% if e.user == User.current %>
<td colspan="2" valign="top">
<strong>
<%= link_to("#{l(:label_i)}", user_path(e.user_id)) %>
</strong>
&nbsp;
<span class="font_lighter">
<%= l(:label_i_new_activity) %>
</span>
&nbsp;
<%= link_to format_activity_title(act.title),
{:controller => 'repositories',
:action => 'revision',
:id => act.repository.project,
:repository_id => act.repository.identifier_param,
:rev => act.identifier} %>
</td>
<% else %>
<td colspan="2" valign="top">
<strong>
<%= link_to(h(e.user), user_path(e.user_id)) %>
</strong>
&nbsp;
<span class="font_lighter">
<%= l(:label_new_activity) %>
</span>
&nbsp;
<%= link_to format_activity_title(act.title),
{:controller => 'repositories',
:action => 'revision',
:id => act.repository.project,
:repository_id => act.repository.identifier_param,
:rev => act.identifier} %>
</td>
<% end %>
</tr>
<tr>
<td colspan="2" class="upload_img" style="max-width:580px;">
<p class="font_description">
<%= textAreailizable act, :long_comments %>
</p>
</td>
</tr>
<tr>
<td>
<div style="display: inline-block; float: left; margin-top: 0px" width="200" align="right" class="a">
<span class="font_lighter">
<%= format_time(e.act.committed_on) %>
</span>
</div>
<div style="display: inline-block; float: right; margin-top: 0px">
<span><%= link_to l(:label_find_all_comments),
{:controller => 'repositories',
:action => 'revision',
:id => act.repository.project,
:repository_id => act.repository.identifier_param,
:rev => act.identifier} if e.act.count!= 0 %>
</span>
<a class="font_lighter">
<%= l(:label_comments_count, :count => e.act.count) %>
</a>
</div>
</td>
</tr>
<% when 'Message' %>
<tr>
<% if e.user == User.current %>
<td colspan="2" valign="top">
<strong>
<%= link_to("#{l(:label_i)}", user_path(e.user_id)) %>
</strong>
&nbsp;
<span class="font_lighter">
<%= l(:label_i_new_activity) %>
</span>
&nbsp;
<%= link_to format_activity_title("#{act.board.name}: #{act.subject}"),
act.board.project ? project_boards_path(act.board.project,:topic_id => act.id) : course_boards_path(act.board.course,:topic_id => act.id),
:class => "problem_tit fl fb " %>
</td>
<% else %>
<td colspan="2" valign="top">
<strong>
<%= link_to(h(e.user), user_path(e.user_id)) %>
</strong>
&nbsp;
<span class="font_lighter">
<%= l(:label_new_activity) %>
</span>
&nbsp;
<%= link_to format_activity_title("#{act.board.name}: #{act.subject}"),
{:controller => 'messages',
:action => 'show',
:board_id => act.board_id}.merge(act.parent_id.nil? ? {:id => act.id} : {:id => act.parent_id, :r => act.id, :anchor => "message-#{act.id}"}) %>
</td>
<% end %>
</tr>
<tr>
<td colspan="2" class="upload_img" style="max-width:580px;">
<p class="font_description">
<%= textAreailizable(act, :content) %>
</p>
</td>
</tr>
<tr>
<td>
<div style="display: inline-block; float: left; margin-top: 0px" width="200" align="right" class="a">
<span class="font_lighter">
<%= (l(:label_update_time).to_s << ': ' << format_time(e.act.created_on)).to_s %>
</span>
</div>
<div style="display: inline-block; float: right; margin-top: 0px"></div>
</td>
</tr>
<% when 'Principal' %>
<tr>
<% if e.user == User.current %>
<td colspan="2" valign="top">
<strong>
<%= link_to("#{l(:label_i)}", user_path(e.user_id)) %>
</strong>
&nbsp;
<span class="font_lighter">
<%= l(:label_new_user) %>
</span>
</td>
<% else %>
<td colspan="2" valign="top">
<strong>
<%= link_to(h(e.user), user_path(e.user_id)) %>
</strong>
&nbsp;
<span class="font_lighter">
<%= l(:label_new_user) %>
</span>
</td>
<% end %>
</tr>
<tr>
<td colspan="2" class="upload_img" style="max-width:580px;">
<p class="font_description"></p>
</td>
</tr>
<tr>
<td>
<div style="display: inline-block; float: left; margin-top: 0px" width="200" align="right" class="a">
<span class="font_lighter">
<%= (l(:label_update_time).to_s << ': ' << format_time(e.act.created_on)).to_s %>
</span>
</div>
<div style="display: inline-block; float: right; margin-top: 0px"></div>
</td>
</tr>
<% when 'News' %>
<tr>
<% if e.user == User.current %>
<td colspan="2" valign="top">
<strong>
<%= link_to("#{l(:label_i)}", user_path(e.user_id)) %>
</strong>
&nbsp;
<span class="font_lighter">
<%= l(:label_i_new_activity) %>
</span>
&nbsp;
<%= link_to format_activity_title(" #{act.title}"), {:controller => 'news', :action => 'show', :id => act.id} %>
</td>
<% else %>
<td colspan="2" valign="top">
<strong>
<%= link_to(h(e.user), user_path(e.user_id)) %>
</strong>
&nbsp;
<span class="font_lighter">
<%= l(:label_new_activity) %>
</span>
&nbsp;
<%= link_to format_activity_title("#{l(:label_news)}: #{act.title}"), {:controller => 'news', :action => 'show', :id => act.id} %>
</td>
<% end %>
</tr>
<tr>
<td colspan="2" class="upload_img" style="max-width:580px;">
<p class="font_description">
<%= textAreailizable act, :description %>
</p>
</td>
</tr>
<tr>
<td>
<div style="display: inline-block; float: left; margin-top: 0px" width="200" align="right" class="a">
<span class="font_lighter">
<%= (l(:label_update_time).to_s << ': ' << format_time(e.act.created_on)).to_s %>
</span>
</div>
<div style="display: inline-block; float: right; margin-top: 0px">
<span>
<%= link_to l(:label_find_all_comments), {:controller => 'news', :action => 'show', :id => act.id} if e.act.comments_count!= 0 %>
</span>
<a class="font_lighter">
<%= l(:label_comments_count, :count => e.act.comments_count) %>
</a>
</div>
</td>
</tr>
<% when 'Issue' %>
<% if e.user == User.current %>
<tr>
<td colspan="2" valign="top">
<strong>
<%= link_to("#{l(:label_i)}", user_path(e.user_id)) %>
</strong>
&nbsp;
<span class="font_lighter">
<%= l(:label_i_new_activity) %>
</span>&nbsp;
<%= link_to format_activity_title("#{act.source_from} (#{act.status}): #{act.tracker.name} #{act.subject}"),
{:controller => 'issues',
:action => 'show',
:id => act.id} %>
</td>
</tr>
<tr>
<td colspan="2" class="upload_img" style="max-width:580px;">
<%= textAreailizable act, :description %>
</td>
</tr>
<tr>
<td>
<div style="display: inline-block; float: left; margin-top: 0px" width="200" align="right" class="a">
<span class="font_lighter">
<%= (l(:label_update_time).to_s << ': ' << format_time(e.act.created_on)).to_s %>
</span>
</div>
<div style="display: inline-block; float: right; margin-top: 0px">
<span>
<%= link_to l(:label_find_all_comments), {:controller => 'issues', :action => 'show', :id => act.id} if e.act.journals.count!= 0 %>
</span>
<a class="font_lighter">
<%= l(:label_comments_count, :count => e.act.journals.count) %>
</a>
</div>
</td>
</tr>
<% else %>
<td colspan="2" valign="top">
<strong>
<%= link_to(h(e.user), user_path(e.user_id)) %>
</strong>&nbsp;
<span class="font_lighter">
<%= l(:label_new_activity) %>
</span>&nbsp;
<%= link_to format_activity_title("#{act.source_from} (#{act.status}): #{act.tracker.name} #{act.subject}"),
{:controller => 'issues',
:action => 'show',
:id => act.id} %>
</td>
</tr>
<tr>
<td colspan="2" class="upload_img" style="max-width:580px;">
<%= textAreailizable act, :description %>
</td>
</tr>
<tr>
<td>
<div style="display: inline-block; float: left; margin-top: 0px" width="200" align="right" class="a">
<span class="font_lighter">
<%= (l(:label_update_time).to_s << ': ' << format_time(e.act.created_on)).to_s %>
</span>
</div>
<div style="display: inline-block; float: right; margin-top: 0px">
<span>
<%= link_to l(:label_find_all_comments), {:controller => 'issues', :action => 'show', :id => act.id} if e.act.journals.count!= 0 %>
</span>
<a class="font_lighter">
<%= l(:label_comments_count, :count => e.act.journals.count) %>
</a>
</div>
</td>
</tr>
<% end %>
<% when 'Contest' %>
<tr>
<% if e.user == User.current && @show_contest == 1 %>
<td colspan="2" valign="top">
<strong>
<%= link_to("#{l(:label_i)}", user_path(e.user_id)) %>
</strong>
&nbsp;
<span class="font_lighter">
<%= l(:label_i_new_activity) %>
</span>
&nbsp;
<%= link_to format_activity_title("#{l(:label_contest)}: #{act.name}"), {:controller => 'contests', :action => 'show_contest', :id => act.id} %>
</td>
<% else %>
<td colspan="2" valign="top">
<strong>
<%= link_to(h(e.user), user_path(e.user_id)) %>
</strong>
&nbsp;
<span class="font_lighter">
<%= l(:label_new_activity) %>
</span>
&nbsp;
<%= link_to format_activity_title("#{l(:label_contest)}: #{act.name}"), {:controller => 'contests', :action => 'show_contest', :id => act.id} %>
</td>
<% end %>
</tr>
<tr>
<td colspan="2" class="upload_img" style="max-width:580px;">
<p class="font_description">
<%= textAreailizable act, :description %>
</p>
</td>
</tr>
<tr>
<td>
<div style="display: inline-block; float: left; margin-top: 0px" width="200" align="right" class="a">
<span class="font_lighter">
<%= (l(:label_update_time).to_s << ': ' << format_time(e.act.created_on)).to_s %>
</span>
</div>
</tr>
<% else %>
<% end %><!-- < % #case end %> -->
</table>
</td>
</tr>
</table>
<% end %>
<% end %><!-- < % #unless act.nil? end %> -->
<% end %><!-- < % #@activity.each do |e| end%> -->
</div>
<div class="pagination" style="float:left;">
<ul> <%= pagination_links_full @activity_pages %> </ul>
</div>
<% else %> <!-- < %# unless @activity.empty? %> -->
<% if @user == User.current %>
<%= l(:label_user_activities_no) %>
<% else %>
<p class="font_description">
<%= l(:label_user_activities_other) %>
</p>
<% end %>
<% end %><!-- < %# unless @activity.empty? end %> -->
<% else %>
<% unless @message.empty? %>
<div id="activity">
<% @message.each do |e| -%>
<table width="660" border="0" align="left" style="border-bottom: 1px dashed rgb(204, 204, 204); margin-bottom: 10px;">
<tr>
<td colspan="2" valign="top" width="50"><%= image_tag(url_to_avatar(e.user), :class => "avatar") %></td>
<td>
<table width="580" border="0">
<tr>
<td colspan="2" valign="top">
<strong> <%= link_to(h(e.user), user_path(e.user)) %></strong><span class="font_lighter">
<% if e.instance_of?(JournalsForMessage) %>
<% if e.reply_id == User.current.id %>
<% if e.jour_type == 'Bid' %>
<%= l(:label_in_bids) %><%= link_to(e.jour.name, respond_path(e.jour)) %>&nbsp;<%= l(:label_quote_my_words) %>
<% elsif e.jour_type == 'User' %>
<%= l(:label_in_users) %><%= link_to(e.jour.firstname, feedback_path(e.jour)) %>&nbsp;<%= l(:label_quote_my_words) %>
<% elsif e.jour_type == 'Project' %>
<%= l(:label_in_projects) %><%= link_to(e.jour.name, feedback_path(e.jour)) %>&nbsp;<%= l(:label_reply_plural) %>
<% end %>
<% else %>
<%= l(:label_about_requirement) %><%= link_to(e.jour.name, respond_path(e.jour_id)) %>&nbsp;<%= l(:label_have_respond) %>
<% end %>
<% else %>
<% if e.journal_reply.nil? || e.journal_reply.reply_id != User.current.id %>
<%= l(:label_about_issue) %><%= link_to(e.issue.subject, issue_path(e.journalized_id)) %><%= l(:label_have_respond) %>
<% else %>
<%= l(:label_in_issues) %><%= link_to(e.issue.subject, issue_path(e.issue)) %><%= l(:label_quote_my_words) %>
<% end %>
<% end %> </span>
</td>
</tr>
<tr>
<td colspan="2" class="upload_img" style="max-width:580px;">
<p class="font_description">
<%= textAreailizable e.notes %>
</p>
</td>
</tr>
<tr>
<td align="left"><a class="font_lighter"></a></td>
<td width="200" align="right" class="a">
<span class="font_lighter">
<%= format_time e.created_on %>
</span>
</td>
</tr>
</table>
</td>
</tr>
</table>
<% end %>
</div>
<div class="pagination" style="float:left;">
<ul>
<%= pagination_links_full @info_pages %>
</ul>
</div>
<% if !@center_flag %>
<div class="users_courses_box line_box mb10" nhname="list_more_div" style="display:none;">
<div class="users_top">
<a href="<%=url_for(:controller => 'users', :action => 'user_courses')%>" class="f14 fb fl c_dark ml10 mt8"><%= @center_flag ? '我的课程' : 'TA的课程' %></a>
<% if @center_flag %>
<% if @user.user_extensions.identity == 0 && @user.allowed_to?(:add_course, nil, :global => true) %>
<a href="<%= url_for(:controller => 'courses', :action => 'new',:host=>Setting.host_course) %>" class=" green_u_btn fr mt8 mr8" target="_blank">新建课程</a>
<% else %>
<p class="font_description">
<%= l(:label_no_user_respond_you) %>
</p>
<a href="<%= join_private_courses_courses_path %>" data-remote ="true" class=" green_u_btn fr mt8 mr8">加入课程</a>
<% end %>
<% end %>
</div>
<div class="cl"></div>
<div nhname="container" data-nodatamsg="暂无课程" data-url="<%= url_for(:controller => 'users', :action => 'user_courses4show') %>" data-isclose="0" data-currpage="0" data-hasmore="1"></div>
<div class="cl"></div>
<div class="message_list_more mt10">
<a nhname="expand" href="javascript:void(0)" class="c_blue02">点击展开更多</a> <a nhname="close" style="display:none" href="javascript:void(0)" class="c_lgrey fr">收起</a>
<div class="cl"></div>
</div>
<div class="cl"></div>
</div>
<% end %>
<div class="users_courses_box line_box mb10" nhname="list_more_div" style="display:none;">
<h4 class="users_h4">课程动态</h4>
<div nhname="container" data-nodatamsg="暂无动态" data-url="<%= url_for(:controller => 'users', :action => 'user_course_activities') %>" data-isclose="0" data-currpage="0" data-hasmore="1"></div>
<div class="message_list_more">
<a nhname="expand" href="javascript:void(0)" class="c_blue02">点击展开更多</a> <a nhname="close" style="display:none" href="javascript:void(0)" class="c_lgrey fr">收起</a>
<div class="cl"></div>
</div>
</div>
<% end %>
<script type="text/javascript" language="javascript">
$(document).ready(function ($) {
$("#content .menu-div:first~ div").first().find("a").attr("target", "_blank");
$('[mode=all]').click(function (event) {
window.location.href = '<%=user_url(@user)%>';
<% if !@center_flag %>
<div class="users_courses_box line_box mb10" nhname="list_more_div" style="display:none;">
<div class=" users_top">
<a href="<%=url_for(:controller => 'users', :action => 'user_projects')%>" class="f14 fb fl c_dark ml10 mt8"><%= @center_flag ? '我的项目' : 'TA的项目' %></a>
<% if @center_flag %>
<% if @user.allowed_to?(:add_project, nil, :global => true) %>
<a href="<%= url_for(:controller => 'projects', :action => 'new',:host=>Setting.host_name) %>" class=" green_u_btn fr mt8 mr8" target="_blank">新建项目</a>
<% else %>
<a href="<%= join_project_projects_path %>" data-remote ="true" class=" green_u_btn fr mt8 mr8">加入项目</a>
<% end %>
<% end %>
</div>
<div class="cl"></div>
<div nhname="container" data-nodatamsg="暂无项目" data-url="<%= url_for(:controller => 'users', :action => 'user_projects4show') %>" data-isclose="0" data-currpage="0" data-hasmore="1"></div>
<div class="cl"></div>
<div class="message_list_more mt10">
<a nhname="expand" href="javascript:void(0)" class="c_blue02">点击展开更多</a> <a nhname="close" style="display:none" href="javascript:void(0)" class="c_lgrey fr">收起</a>
<div class="cl"></div>
</div>
<div class="cl"></div>
</div>
<% end %>
<div class="users_courses_box line_box mb10" nhname="list_more_div" style="display:none;">
<h4 class="users_h4">项目动态</h4>
<div nhname="container" data-nodatamsg="暂无动态" data-url="<%= url_for(:controller => 'users', :action => 'user_project_activities') %>" data-isclose="0" data-currpage="0" data-hasmore="1"></div>
<div class="message_list_more">
<a nhname="expand" href="javascript:void(0)" class="c_blue02">点击展开更多</a> <a nhname="close" style="display:none" href="javascript:void(0)" class="c_lgrey fr">收起</a>
<div class="cl"></div>
</div>
</div>
</div>
<script type="text/javascript">
$(function(){
function init_editor(params){
params.textarea.removeAttr('placeholder');
var editor = params.kindutil.create(params.textarea, {
resizeType : 1,minWidth:"1px",width:"100%",height:"150px",
items:['emoticons'],
afterChange:function(){//按键事件
nh_check_field({content:this,contentmsg:params.contentmsg,textarea:params.textarea});
},
afterCreate:function(){
var toolbar = $("div[class='ke-toolbar']",params.div_form);
$(".ke-outline>.ke-toolbar-icon",toolbar).append('表情');
params.toolbar_container.append(toolbar);
}
}).loadPlugin('paste');
return editor;
}
function nh_check_field(params){
var result=true;
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('内容不能为空');
params.contentmsg.css({color:'#ff0000'});
}else{
params.contentmsg.html('填写正确');
params.contentmsg.css({color:'#008000'});
}
params.contentmsg.show();
}
}
return result;
}
function init_form(params){
params.form.submit(function(){
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
});
$('[mode=myself]').click(function (event) {
window.location.href = '<%=user_url(@user, type: 1)%>';
if(is_checked){
if(flag){
return true;
}else{
$(this)[0].submit();
return false;
}
}
return false;
});
}
function nh_reset_form(params){
params.form[0].reset();
params.textarea.empty();
if(params.editor != undefined){
params.editor.html(params.textarea.html());
}
params.contentmsg.hide();
}
KindEditor.ready(function(K){
$("a[nhname='reply_btn']").live('click',function(){
var params = {};
params.kindutil = K;
params.container = $(this).parent('div');
params.div_form = $("div[nhname='div_form']",params.container);
params.form = $("form",params.div_form);
params.textarea = $("textarea[name='user_notes']",params.div_form);
params.contentmsg = $("p[nhname='contentmsg']",params.div_form);
params.toolbar_container = $("div[nhname='toolbar_container']",params.div_form);
params.cancel_btn = $("a[nhname='cancel_btn']",params.div_form);
params.submit_btn = $("a[nhname='submit_btn']",params.div_form);
if(params.textarea.data('init') == undefined){
params.editor = init_editor(params);
init_form(params);
params.cancel_btn.click(function(){
nh_reset_form(params);
toggleAndSettingWordsVal(params.div_form, params.textarea);
});
params.submit_btn.click(function(){
params.form.submit();
});
params.textarea.data('init',1);
}
params.cancel_btn.click();
setTimeout(function(){
if(!params.div_form.is(':hidden')){
params.textarea.show();
params.textarea.focus();
params.textarea.hide();
}
},300);
});
$("div[nhname='new_message']").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='new_message_textarea']",params.div_form);
params.contentmsg = $("p[nhname='contentmsg']",params.div_form);
params.toolbar_container = $("div[nhname='toolbar_container']",params.div_form);
params.cancel_btn = $("#new_message_cancel_btn");
params.submit_btn = $("#new_message_submit_btn");
if(params.textarea.data('init') == undefined){
params.editor = init_editor(params);
init_form(params);
params.cancel_btn.click(function(){
nh_reset_form(params);
});
params.submit_btn.click(function(){
params.form.submit();
});
params.textarea.data('init',1);
$(this).show();
}
});
$('[mode=respond]').click(function (event) {
window.location.href = '<%=user_url(@user, type: 2)%>';
});
});
</script>
<% html_title(l(:label_activity)) -%>
<script type="text/javascript">
function init_list_more_div(params){
var p=params;
p.exbtn.click(function(){
var isclose = p.container.data('isclose');
var hasmore = p.container.data('hasmore');
if(isclose == '1'){
$("div[nhname='rec']",p.container).show();
p.container.data('isclose','0');
change_status_4_list_more_div(params);
return;
}
if(hasmore == '0'){
change_status_4_list_more_div(params,'get');
return;
}
var url = p.container.data('url');
if($("div[nhname='rec']",p.container).length > 0){
var lastid = $("div[nhname='rec']",p.container).filter(':last').data('id');
url += "?lastid="+lastid;
}
$.ajax( {url:url,dataType:'text',success:function(data){
var html = $("<div>"+data+"</div>");
var lens = $("div[nhname='rec']",html).length;
if(lens < p.size){
p.container.data('hasmore','0');
}
if(lens>0){
var currpage = parseInt(p.container.data('currpage'))+1;
p.container.data('currpage',currpage);
p.container.append(html.html())
}
change_status_4_list_more_div(params,'get');
p.div.show();
}} );
});
p.clbtn.click(function(){
var i=0;
$("div[nhname='rec']",p.container).each(function(){
i++;
if(i> p.size){
$(this).hide();
}
});
p.container.data('isclose','1');
change_status_4_list_more_div(params);
});
p.exbtn.click();
}
function change_status_4_list_more_div(params,opt){
var p=params;
if($("div[nhname='rec']",p.container).length == 0 && opt != 'get'){
p.exbtn.click();
return;
}
var show_lens = $("div[nhname='rec']",p.container).length - $("div[nhname='rec']",p.container).filter(':hidden').length;
if( show_lens > p.size ){
p.clbtn.show();
}else{
p.clbtn.hide();
}
if($("div[nhname='rec']",p.container).length == 0){
p.exbtn.html(p.nodatamsg);
}else if( p.container.data('hasmore') == '1' || p.container.data('isclose')=='1' ){
p.exbtn.html('点击展开更多');
}else{
p.exbtn.html('没有更多了');
}
}
function init_list_more_div_params(div){
var params = {};
params.div = div;
params.container = $("div[nhname='container']",div);
params.exbtn = $("a[nhname='expand']",div);
params.clbtn = $("a[nhname='close']",div);
params.size = params.container.data('pagesize');
params.nodatamsg = params.container.data('nodatamsg');
if( params.size == undefined ){
params.size = 8;
}
return params;
}
$(function(){
$("div[nhname='list_more_div']").each(function(){
var params = init_list_more_div_params($(this));
init_list_more_div(params)
});
});
</script>

View File

@ -1,3 +1,4 @@
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'users/show_new_score') %>');
showModal('ajax-modal', '400px');
$('#ajax-modal').siblings().show();
$('#ajax-modal').addClass('new-watcher');

View File

@ -0,0 +1,19 @@
<% for rec in @list %>
<div class="users_courses_list" nhname="rec" data-id="<%= rec[:item].id %>">
<span class="fl" style="width:180px;">
<a href="<%= get_activity_container_url(rec[:e]) %>" class=" fl users_coursename ml5" title="<%= rec[:e].name %>">
<%= rec[:e].name %>
</a>
<%# if( rec[:e].is_public == false || rec[:e].is_public == 0 ) %>
<!--<font class="img_private">私有</font>-->
<%# end %>
</span>
<a href="<%= user_path(rec[:item].user.id) %>" class="c_orange course_name fl mr5" title="<%= rec[:item].user.show_name %>"><%= rec[:item].user.show_name %></a>
<span class="fl mr5 c_grey"><%= get_activity_opt(rec[:item],rec[:e]) %></span>
<a href="<%= get_activity_url(rec[:item],rec[:e]) %>"
class="c_blue02 fl users_courses_txt hidepic" title="<%= get_activity_act_showname(rec[:item]) %>">
<%= get_activity_act_showname_htmlclear(rec[:item]) %>
</a>
<span class="fr c_grey mr10"><%= time_tag(get_activity_act_createtime(rec[:item])).html_safe %></span>
</div>
<% end %>

View File

@ -1,33 +1,31 @@
<% if @user.user_extensions.identity == UserExtensions::TEACHER %>
<%= render :partial => 'my_course' %>
<% else %> <!--for student-->
<%= render :partial => 'my_joinedcourse' %>
<% end %>
<script type="text/javascript" language="javascript">
$(document).ready(function($) {
$("#content .content_frame").find("a").attr("target", "_blank");
$("content-title-top p:first").find("a").attr("target", "_blank");
$("#content .content_frame [color=#666666]").find("a").removeAttr("target");
$('#content .content-title-top table[width=580] td:first span:eq(1)').find("a:first").removeAttr("target");
});
</script>
<div class="top_new">
<span class="<%= (@user.user_extensions.identity == 0 && @user.allowed_to?(:add_course, nil, :global => true)) ? 'top_new_bg' : 'top_newcourses_bg'%> fl"></span>
<% if @user.user_extensions.identity == 0 && @user.allowed_to?(:add_course, nil, :global => true) %>
<a href="<%= url_for(:controller => 'courses', :action => 'new',) %>" class="green_n_btn fr mt2" target="_blank">新建课程</a>
<% else %>
<a href="<%= join_private_courses_courses_path %>" data-remote ="true" class="green_n_btn fr mt2">加入课程</a>
<% end %>
<div class="cl"></div>
</div>
<script type="text/javascript">
$(document).ready(function() {
var $menu = $('.user_course_list .menu');
var $li_tags = $menu.find('[mode]');
var $dyn_list = $('.dyn_list_wrapper');
$menu.find('[mode]').each(function(index, el) {
$(el).click(function() {
mode = $(el).attr('mode');
$menu.find('[mode]').removeClass( "on" );
$( this ).addClass( "on" );
var wrapper = $('[mode='+mode+']')
$dyn_list.addClass( "hidden" );
wrapper.removeClass('hidden')
})
});
});
</script>
<% html_title(l(:label_user_course)) -%>
<div id="RSide" class="fl">
<div class="courses_box">
<div class="courses_top mb10">
<h2 class="courses_h2 fl">所有课程</h2>
<div class="courses_select fr">
<a href="<%= url_for(:controller => 'users', :action => 'user_courses')%>" class="select_btn <%= (@params['status']!='1' && @params['status']!='2') ? 'select_btn_select' : '' %> fl "> 全部</a>
<a href="<%= url_for(:controller => 'users', :action => 'user_courses', :status=>'1')%>" class="select_btn <%= (@params['status']=='1') ? 'select_btn_select' : '' %> fl ">正在进行</a>
<a href="<%= url_for(:controller => 'users', :action => 'user_courses', :status=>'2')%>" class="select_btn <%= (@params['status']=='2') ? 'select_btn_select' : '' %> fl "> 已经结束</a>
</div>
<div class="cl"></div>
</div>
<% for item in @list %>
<%= render :partial => 'course_form', :locals => {:item => item} %>
<% end %>
<p class="nodata" style="display:<%= @list.count > 0 ? 'none' : 'block' %>;"><%= l(:label_no_data) %></p>
</div>
<ul class="wlist" style=" border:none;">
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
</ul>
<div class="cl"></div>
</div>

View File

@ -0,0 +1,16 @@
<% for item in @list %>
<div class="home_courses_list fl" nhname="rec" data-id="<%= item.id %>">
<div class="courses_list_pic fl ml10 mr10">
<a href="<%= url_for(:controller => 'courses', :action=>"show", :id=>item.id, :host=>Setting.host_course) %>"><%= image_tag(url_to_avatar(item), :style => 'width:64px;height:64px;') %></a>
</div>
<span class="fl" style="width:260px;">
<a href="<%= url_for(:controller => 'courses', :action=>"show", :id=>item.id, :host=>Setting.host_course) %>" class="home_list_title c_blue02 fl mb10" title="<%= item.name %>"><%= item.name %></a>
</span>
<div class="fl c_dgrey">
<p>主讲老师:<a href="<%= user_path(item.teacher) %>" title="<%= item.teacher.show_name %>"><%= item.teacher.show_name %></a></p>
<p>课程作业:<a href="<%=url_for(:controller => 'homework_common', :action => 'index',:course=>item.id, :host=>Setting.host_course)%>"><%= item.homework_commons.count %></a> <span class="ml10"></span>学生:<a href="<%= url_for(:controller => 'courses', :action=>"member", :id=>item.id,:role=>2, :host=>Setting.host_course) %>"><%= studentCount(item) %></a></p>
</div>
<div class="cl"></div>
</div>
<% end %>

View File

@ -1,52 +1,25 @@
<!--add by huang-->
<h3><%= l(:label_x_user_fans, :count => User.current.watcher_users(User.current.id).count) %></h3>
<div class="inf_user_image">
<% for user in @user.watcher_users %>
<ul class="list_watch">
<li>
<table width="660px" border="0" align="center">
<tr>
<td colspan="2" valign="top" width="50">
<%= link_to image_tag(url_to_avatar(user), :class => "avatar"),user_path(user),:title => "#{user.name}" %>
</td>
<td>
<table width="580px" border="0">
<tr> <!-- modified by bai -->
<td colspan="2" valign="top">
<strong><%= content_tag "div", link_to(user.name, user_path(user)), :class => "project_avatar_name" %></strong>
</td>
</tr>
<tr>
<!-- added by bai 区分了个人列表里的项目与课程 -->
<td colspan="2" width="580px"><p class="font_description">
<% cond = Project.visible_condition(User.current) + " AND projects.project_type <> 1" %>
<% memberships = user.memberships.all(:conditions => cond) %>
<%= l(:label_x_contribute_to, :count => memberships.count) %>
<% for member in memberships %>
<%= link_to_project(member.project) %><%= (user.memberships.last == member) ? '' : '' %>
<div id="RSide" class="fl">
<div class="courses_box">
<div class="courses_top mb10" id="<%= (@action == 'fans' || @action == 'visitor' ) ? 'nh_fans_list' : 'nh_wacth_list' %>">
<% if @action == 'fans' %>
<h2 class="courses_h2 fl">粉丝</h2>
<div class="courses_select fr">共有<span class="c_orange" nh_name="fans_count"><%=@obj_count%></span>名粉丝</div>
<% elsif @action == 'visitor' %>
<h2 class="courses_h2 fl">访客</h2>
<div class="courses_select fr">共有<span class="c_orange"><%=@obj_count%></span>访客</div>
<% else %>
<h2 class="courses_h2 fl">关注</h2>
<div class="courses_select fr">一共关注<span class="c_orange" nh_name="watcher_count"><%=@obj_count%></span>人</div>
<% end %>
<p class="font_description">
<% user_courses = user_courses_list(user) %>
<%= l(:label_x_course_contribute_to, :count => user_courses.count) %>
<%= "" unless user_courses.empty? %>
<% for course in user_courses %>
<%= link_to course.name,{:controller => 'courses',:action => 'show',id:course.id, host: Setting.host_course} %><%= (user_courses.last == course) ? '' : '' %>
<div class="cl"></div>
</div>
<% for item in @list %>
<%= render :partial => 'users/user_fans_item', :locals => {:item => item,:target=>@user} %>
<% end %>
</p>
</td>
</tr>
<!-- end -->
<tr>
<td width="200" align="right" class="font_lighter"><%= l(:label_user_joinin) %><%= format_date(user.created_on) %>
</td>
</tr>
</table>
</td>
</tr>
</table>
</li>
<p id="nodata" class="nodata" style="display:<%= @list.count > 0 ? 'none' : 'block' %>;"><%= l(:label_no_data) %></p>
</div>
<ul class="wlist" style=" border:none;">
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
</ul>
<% end %>
<div class="cl"></div>
</div>

View File

@ -0,0 +1,36 @@
<% for item in feed_list %>
<div class="message_list" id="nh_jours_<%= item.id %>" nhname="rec" data-id="<%= item.id %>">
<a href="<%= user_path(item.user) %>" class="users_pic fl">
<%= image_tag url_to_avatar(item.user),:width => '27',:height => '27' %>
</a>
<a href="<%= user_path(item.user) %>" title="<%= item.user.show_name %>" class="course_name fl c_blue02 ml5 mt5"><%= item.user.show_name %></a>
<% if item.at_user %>
<span class="fl c_dark mt5">&nbsp;回复</span>
<a href="<%= user_path(item.at_user) %>" title="<%= item.at_user.show_name %>" class="course_name fl c_blue02 ml5 mt5"><%= item.at_user.show_name %></a>
<% end %>
<span class="fl c_dark mt5">&nbsp;:&nbsp;</span>
<div class="massage_txt fl mt5"><%=item.notes.html_safe%></div>
<% if JournalsForMessage.create_by_user? User.current %>
<a href="javascript:void(0)" nhname='reply_btn' class="fl mt5 c_purple ml5">回复</a>
<% end %>
<% if User.current.admin? || item.user.id == User.current.id %>
<a href="<%= url_for(:controller => 'words', :action=>"destroy", :object_id=>item.id,:user_id=>item.user.id) %>" data-confirm="您确定要删除吗?" data-remote="true" data-method="delete" class="fl mt5 c_purple ml5">删除</a>
<% end %>
<span class="massage_time fr"><%= time_tag(item.created_on).html_safe %></span>
<div class="cl"></div>
<div nhname='div_form' class="mt10 ml80" style="display:none;">
<form action="<%= url_for(:controller => 'words', :action => 'create_reply') %>" data-remote="true" method="post">
<input id="reference_id" name="reference_id" type="hidden" value="<%= (item.m_parent_id.nil? || item.m_parent_id==0 ) ? item.id : item.m_parent_id %>">
<input id="reference_user_id" name="reference_user_id" type="hidden" value="<%= item.user.id %>">
<input id="reference_message_id" name="reference_message_id" type="hidden" value="<%= item.id %>">
<input id="show_name" name="show_name" type="hidden" value="true">
<textarea name='user_notes' style="display:none;"></textarea>
<p nhname='contentmsg'></p>
<div nhname='toolbar_container' style="float:left;padding-top:3px;"></div>
<a nhname="cancel_btn" href="javascript:;" class="grey_n_btn fr" style="margin-top:3px;">取消</a>
<a nhname="submit_btn" href="javascript:;" class="blue_n_btn fr mr5" style="margin-top:3px;">发布</a>
</form>
<div class="cl"></div>
</div>
</div>
<% end %>

View File

@ -1,66 +1,56 @@
<!--add by huang-->
<!--span class="font_lighter" >温馨提示:项目可以是一次作业,也可以是别人或者自己创建的一项小工程~</span-->
<div class="menu-div">
<div class="menu">
<%= link_to(l(:label_project_new), {:controller => 'projects', :action => 'new', :course => 0, :project_type => 0}, :class => 'icon icon-add') if(User.current.allowed_to?(:add_project, nil, :global => true) && @user == User.current)%>
<ul><%#链接绑定在页面最下方的jQuery%>
<li mode='take' class="<%= "on" if @state.eql?(0)%>"><%=l :label_project_take%></li>
<li mode='watched' class="<%= "on" if @state.eql?(1)%>"><%=l :label_has_watched_project%></li>
</ul>
</div>
</div>
<div style="height:20px"></div>
<%#= watch_projects @state %>
<% unless @memberships.empty? %>
<div class="content_frame">
<ul class="user_project_sort">
<% for membership in @memberships %>
<li>
<table width="660" border="0" align="center" style="border-bottom: 1px dashed rgb(204, 204, 204); margin-bottom: 10px;font-size:14px;">
<tr>
<td colspan="2" valign="top" width="50" ><%= image_tag(url_to_avatar(membership.project), :class => 'avatar') %></td>
<td>
<table width="580" border="0">
<tr>
<td colspan="2" valign="top"><strong> <%= link_to_user(membership.user) if membership.respond_to?(:user) %></strong>
<span class="font_lighter"> <%= l(:label_project_take_in) %></span> <%= link_to_project(membership.project) %></td>
</tr>
<tr>
<td colspan="2" width="580" style="word-break:break-all;word-wrap: break-word;">
<p class="font_description">
<%= membership.project.short_description%>
</p></td>
</tr>
<tr>
<td align="left"><span class="font_lighter"><%= l(:label_create_time) %> : <%= format_time(membership.created_on) %></span></td><!-- modified by ming -->
<td align="right" ><%= h membership.roles.sort.collect(&:to_s).join(', ') %> </td>
</tr>
</table></td>
</tr>
</table>
</li>
<div class="top_new">
<span class="<%= (@user.user_extensions.identity == 0 && @user.allowed_to?(:add_course, nil, :global => true)) ? 'top_new_bg' : 'top_newcourses_bg'%> fl"></span>
<% if @user.allowed_to?(:add_project, nil, :global => true) %>
<a href="<%= url_for(:controller => 'projects', :action => 'new') %>" class="bgreen_n_btn fr ml10 mt2" target="_blank">新建项目</a>
<% else %>
<a href="<%= join_project_projects_path %>" data-remote ="true" class="green_n_btn fr mt2">加入项目</a>
<% end %>
</ul>
<% else %>
<% if @user != User.current %>
<p class="font_description"><%= l(:label_project_un) %></p>
<% else %>
<p class="font_description"><%= l(:label_project_unadd) %></p>
<% end %>
<% end %>
<%= call_hook :view_account_left_bottom, :user => @user %>
<div class="cl"></div>
</div>
<div id="RSide" class="fl">
<div class="courses_box">
<div class="courses_top mb10">
<h2 class="courses_h2 fl">全部项目</h2>
<div class="courses_select fr">
<a href="<%= url_for(:controller => 'users', :action => 'user_projects')%>" class="select_btn <%= (@params['status']!='1' && @params['status']!='2') ? 'select_btn_select' : '' %> fl "> 全部</a>
<a href="<%= url_for(:controller => 'users', :action => 'user_projects', :status=>'1')%>" class="select_btn <%= (@params['status']=='1') ? 'select_btn_select' : '' %> fl ">我创建</a>
<a href="<%= url_for(:controller => 'users', :action => 'user_projects', :status=>'2')%>" class="select_btn <%= (@params['status']=='2') ? 'select_btn_select' : '' %> fl "> 我参与</a>
</div>
<div class="cl"></div>
</div>
<% for item in @list %>
<% creator = User.find(item.user_id)%>
<div class="courses_list line">
<div class="courses_list_pic fl"><a href="<%= url_for(:controller => 'projects', :action=>"show", :id=>item.id, :host=>Setting.host_name) %>"><%= image_tag(url_to_avatar(item), :style => 'width:64px;height:64px;') %></a></div>
<div class="courses_list_info fl ml10">
<a href="<%= url_for(:controller => 'projects', :action=>"show", :id=>item.id, :host=>Setting.host_name) %>" class="courses_list_title f14 fb c_blue02 fl" title="<%= item.name %>"><%= item.name %></a>
<div class="cl"></div>
<div class="courses_list_table ">
<table>
<tbody><tr>
<td class="td_w60 ">创建者:</td>
<td class="td_w70 "><a href="<%= user_path(creator) %>" title="<%= creator.show_name %>"><%= creator.show_name %></a></td>
<td class="td_w60 ">创建时间:</td>
<td class="td_w110 "><%= format_date(item.created_on) %></td>
</tr>
<tr>
<td>成员人数:</td>
<td><a href="<%= url_for(:controller => 'projects', :action=>"member", :id=>item.id, :host=>Setting.host_name) %>"><%= item.members.count %></a></td>
<td>项目类型:</td>
<td><%= item.project_new_type == 1 ? l(:label_development_team) : (item.project_new_type == 2 ? l(:label_research_group) : l(:label_friend_organization))%></td>
</tr>
</tbody></table>
</div>
</div>
<a href="<%= url_for(:controller => 'issues', :action=>"new", :project_id=>item.id, :host=>Setting.host_name) %>" class="blue_n_btn fr mt20">发布问题</a>
<div class="cl"></div>
</div>
<% end %>
<p class="nodata" style="display:<%= @list.count > 0 ? 'none' : 'block' %>;"><%= l(:label_no_data) %></p>
</div>
<ul class="wlist" style=" border:none;">
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
</ul>
<div class="cl"></div>
</div>
<script type="text/javascript" language="javascript">
$(document).ready(function($) {
$("#content .tabs_new~").find("a").attr("target", "_blank");
$("#content .tabs_new~ .pagination").find("a").removeAttr("target");
$('[mode=take]').click(function(event) {window.location.href='<%=user_projects_user_url%>'; });
$('[mode=watched]').click(function(event) {window.location.href='<%=watch_projects_user_url(type: 1)%>'; });
});
</script>
<% html_title(l(:label_user_project)) -%>

View File

@ -0,0 +1,16 @@
<% for item in @list %>
<div class="home_courses_list fl" nhname="rec" data-id="<%= item.id %>">
<div class="courses_list_pic fl ml10 mr10">
<a href="<%= url_for(:controller => 'projects', :action=>"show", :id=>item.id, :host=>Setting.host_name) %>"><%= image_tag(url_to_avatar(item), :style => 'width:64px;height:64px;') %></a>
</div>
<span class="fl" style="width:260px;">
<a href="<%= url_for(:controller => 'projects', :action=>"show", :id=>item.id, :host=>Setting.host_name) %>" class="home_list_title c_blue02 fl mb10" title="<%= item.name %>"><%= item.name %></a>
</span>
<div class="fl c_dgrey">
<!--<p>项目评分:<a href="<%#= url_for(:controller => 'projects', :action => 'show_projects_score', :id => item.id,:host=>Setting.host_name) %>" data-remote="true"><%#= format( "%.2f" , project_scores(item) ).to_i %></a></p>-->
<p>项目评分:<a href="<%= url_for(:controller => 'projects', :action => 'show_projects_score', :id => item.id) %>" data-remote="true"><%= format( "%.2f" , project_scores(item) ).to_i %></a></p>
<p>发布缺陷:<a href="<%= url_for(:controller => 'issues', :action=>"index", :project_id=>item.id, :host=>Setting.host_name) %>"><%= item.issues.count %></a> <span class="ml10"></span>成员:<a href="<%= url_for(:controller => 'projects', :action=>"member", :id=>item.id, :host=>Setting.host_name) %>"><%= item.members.count %></a></p>
</div>
<div class="cl"></div>
</div>
<% end %>

View File

@ -1,3 +1,59 @@
<% if( params[:object_type] == 'user') %>
<% if( params[:target_id] == params[:object_id] ) %>
<% target = User.find_by_id(params[:target_id]) %>
//btn
var btn_html = "<%= escape_javascript( render( :partial => 'layouts/user_watch_btn', :locals => {:target => target} ) )%>";
$('#user_watch_id').replaceWith(btn_html);
//count
$("*[nh_name='fans_count']").html("<%= target.watcher_users.count.to_s %>");
//left list
var list_left_html = "<%= escape_javascript( render( :partial => 'layouts/user_fans_list', :locals => {:user => target} ) )%>";
$('#fans_nav_list').replaceWith(list_left_html);
//list
if( $("#nh_fans_list") != undefined && $("#nh_fans_list").length != 0 ){
<% if( opt == 'add') %>
var list_html = "<%= escape_javascript( render( :partial => 'users/user_fans_item', :locals => {:item=>User.current,:target => target} ) )%>";
$("#nh_fans_list").after(list_html);
$("#nodata").hide();
<% else %>
$("#fans_item_<%= User.current.id %>",$("#nh_fans_list").parent('div')).remove();
if( $('>div',$("#nh_fans_list").parent('div')).length == 1 ){
$("#nodata").show();
}
<% end %>
}
<% elsif( params[:target_id] == User.current.id.to_s )%>
<% target = User.find_by_id(params[:target_id]) %>
<% item = User.find_by_id(params[:object_id]) %>
//count
$("*[nh_name='watcher_count']").html("<%= User.watched_by(target.id).count.to_s %>");
//left list
var list_left_html = "<%= escape_javascript( render( :partial => 'layouts/user_watch_list', :locals => {:user => target} ) )%>";
$('#watcher_nav_list').replaceWith(list_left_html);
//list
if( $("#nh_wacth_list") != undefined && $("#nh_wacth_list").length != 0 ){
<% if( opt == 'delete') %>
$("#fans_item_<%= item.id %>",$("#nh_wacth_list").parent('div')).remove();
if( $('>div',$("#nh_wacth_list").parent('div')).length == 1 ){
$("#nodata").show();
}
<% end %>
}else if($("#nh_fans_list") != undefined && $("#nh_fans_list").length != 0){
var list_html = "<%= escape_javascript( render( :partial => 'users/user_fans_item', :locals => {:item=>item,:target => target} ) )%>";
$('#fans_item_<%= item.id %>').replaceWith(list_html);
}
<% else %>
<% target = User.find_by_id(params[:target_id]) %>
<% item = User.find_by_id(params[:object_id]) %>
//list
var list_html = "<%= escape_javascript( render( :partial => 'users/user_fans_item', :locals => {:item=>item,:target => target} ) )%>";
$('#fans_item_<%= item.id %>').replaceWith(list_html);
<% end %>
<% else %>
<% selector = ".#{watcher_css(watched)}" %>
<% id_selector = "#{watcher_css(watched)}" %>
if($("<%= selector %>").get(0) == undefined)
@ -9,3 +65,6 @@ else
$("<%= selector %>").each(function(){$(this).replaceWith("<%= escape_javascript watcher_link(watched, user) %>")});
}
<% end %>

View File

@ -1,9 +1,15 @@
//$('#message').html('<#%= escape_javascript(render(:partial => 'words/message', :locals => {:jour => @jour, :state => false, :user => @user, :feedback_pages => @feedback_pages,:show_name => true})) %>');
//$('#message').html('<%#= escape_javascript(render(:partial => 'words/message', :locals => {:jour => @jour, :state => false, :user => @user, :feedback_pages => @feedback_pages,:show_name => true})) %>');
<% if !@jour.nil? && @jour.jour_type == 'Principal' %>
var html = $("<div>"+"<%= escape_javascript( render(:template => 'users/user_feedback4show',:locals => {:feed_list=>[@jour]} )) %>"+"</div>");
$("div[nhname='container']",$("#nh_messages")).prepend(html.html());
$('#new_message_cancel_btn').click();
var params = init_list_more_div_params($("#nh_messages"));
change_status_4_list_more_div(params);
<% else %>
$('#history').html('<%= escape_javascript(render(:partial => 'users/history',:locals => { :journals => @jour, :state => false})) %>')
$('#jour_count').html('<%= @obj_count%>')
$('#pre_show').html('<%= escape_javascript(render(:partial => 'pre_show', :locals => {:content => nil})) %>');
$('#new_form_user_message').val("");
if($('#new_message_cancel_btn') != undefined && $('#new_message_cancel_btn').length!=0){
$('#new_message_cancel_btn').click();
}
$('#new_form_reference_user_id').val("");
<% end %>

View File

@ -1,4 +1,13 @@
<% if @save_succ %>
<% if !@jfm.nil? && @jfm.jour_type == 'Principal' %>
var html = $("<div>"+"<%= escape_javascript( render(:template => 'users/user_feedback4show',:locals => {:feed_list=>[@jfm]} )) %>"+"</div>");
$("div[nhname='container']",$("#nh_messages")).prepend(html.html());
// $('#new_message_cancel_btn').click();
$("a[nhname='reply_btn']",$("#nh_jours_<%= @jfm.m_reply_id %>")).click();
var params = init_list_more_div_params($("#nh_messages"));
change_status_4_list_more_div(params);
<% else %>
var pre_append = $('<%= j(
render :partial => "words/journal_reply_items",
:locals => {:reply => @jfm, :journal => @jfm.parent, :m_reply_id => @jfm,:show_name => @show_name}
@ -12,6 +21,8 @@
textarea1.val('');
$('#course_respond_form_<%=@jfm.m_reply_id.to_s%>').hide();
setMaxLengthItem(pre_append.find('textarea')[0]);
<% end %>
<% else %>
alert("<%= l(:label_feedback_fail) %>");
<% end %>

View File

@ -1,6 +1,12 @@
<% if @journal_destroyed.nil? %>
alert('<%=l(:notice_failed_delete)%>');
<% elsif (['Principal','Project','Course', 'Bid', 'Contest', 'Softapplication'].include? @journal_destroyed.jour_type)%>
<% if @user && @jours_count%>
$("#nh_jours_<%= @journal_destroyed.id %>",$("div[nhname='container']",$("#nh_messages"))).remove();
var params = init_list_more_div_params($("#nh_messages"));
change_status_4_list_more_div(params);
<% else %>
<% if @bid && @jours_count %>
$('#jours_count').html("<%= @jours_count %>");
<% elsif @course && @jours_count%>
@ -12,6 +18,8 @@
destroyedItem.fadeOut(600,function(){
destroyedItem.remove();
});
<% end %>
<% else %>
$('#message').html('<%= escape_javascript(render(:partial => 'words/message', :locals => {:jour => @jour, :state => false, :user => @user, :feedback_pages => @feedback_pages})) %>');
$('#new_form_reference_user_id').val("");

View File

@ -2026,6 +2026,7 @@ zh:
label_file_lost_list: 缺失文件列表
lable_unset: 未设置
label_chose_group: 请选择分班

View File

@ -85,7 +85,7 @@ RedmineApp::Application.routes.draw do
get 'alert_anonymous_comment'
end
collection do
post 'next_step'
end
end
@ -100,6 +100,7 @@ RedmineApp::Application.routes.draw do
get 'student_work_absence_penalty'
get 'absence_penalty_list'
get 'evaluation_list'
post 'set_program_score'
end
end
@ -297,6 +298,12 @@ RedmineApp::Application.routes.draw do
match 'user_watchlist', :to => 'users#user_watchlist', :via => :get, :as => "user_watchlist" #add by huang
match 'user_fanslist', :to => 'users#user_fanslist', :via => :get, :as => "user_fanslist" #add by huang
match 'user_courses', :to => 'users#user_courses', :via => :get
match 'user_courses4show', :to => 'users#user_courses4show', :via => :get
match 'user_projects4show', :to => 'users#user_projects4show', :via => :get
match 'user_course_activities', :to => 'users#user_course_activities', :via => :get
match 'user_project_activities', :to => 'users#user_project_activities', :via => :get
match 'user_feedback4show', :to => 'users#user_feedback4show', :via => :get
match 'user_visitorlist', :to => 'users#user_visitorlist', :via => :get
match 'user_homeworks', :to => 'users#user_homeworks', :via => :get
match 'watch_projects', :to => 'users#watch_projects', :via => :get
# added by bai
@ -340,6 +347,8 @@ RedmineApp::Application.routes.draw do
match 'my/remove_block', :via => :post
match 'my/order_blocks', :via => :post
match 'my/change_mail_notification', via: :get
match 'my/save_user_avatar', :to => 'my#save_user_avatar', :via => [:get, :post]
match 'my/clear_user_avatar_temp', :to => 'my#clear_user_avatar_temp', :via => [:get, :post]
get 'my/page2', :to => 'my#page2', :as => "my_page2"

View File

@ -0,0 +1,9 @@
class AddProportionToPrograming < ActiveRecord::Migration
def up
add_column :homework_detail_programings, :ta_proportion, :float, :default => 0.1
end
def down
remove_column :homework_detail_programings, :ta_proportion
end
end

View File

@ -0,0 +1,9 @@
class ChangeStudenWorkDesc < ActiveRecord::Migration
def up
change_column :student_works,:description,:text,:limit => 4294967295
end
def down
change_column :student_works,:description,:text
end
end

View File

@ -0,0 +1,9 @@
class AddQuestionIdToHomework < ActiveRecord::Migration
def up
add_column :homework_detail_programings, :question_id, :integer
end
def down
remove_column :homework_detail_programings, :question_id
end
end

View File

@ -0,0 +1,9 @@
class AddDescriptionToUserExtensions < ActiveRecord::Migration
def up
add_column :user_extensions, :description, :string, default: ''
end
def down
remove_column :user_extensions, :description
end
end

View File

@ -0,0 +1,14 @@
class CreateVisitors < ActiveRecord::Migration
def change
create_table :visitors do |t|
t.integer :user_id
t.integer :master_id
t.datetime :updated_on
t.datetime :created_on
end
add_index "visitors", ["user_id"], :name => "index_visitors_user_id"
add_index "visitors", ["master_id"], :name => "index_visitors_master_id"
add_index "visitors", ["updated_on"], :name => "index_visitors_updated_on"
end
end

View File

@ -0,0 +1,11 @@
class AddActivityContainerTypeToActivities < ActiveRecord::Migration
def up
add_column :activities, :activity_container_id, :int
add_column :activities, :activity_container_type, :string, default: ''
end
def down
remove_column :activities, :activity_container_type
remove_column :activities, :activity_container_id
end
end

View File

@ -0,0 +1,14 @@
class CreateTestResult < ActiveRecord::Migration
def up
create_table :student_work_tests do |t|
t.integer :student_work_id
t.integer :homework_test_id
t.integer :result
t.timestamps
end
end
def down
drop_table :student_work_tests
end
end

View File

@ -0,0 +1,13 @@
class ChangeActivitiesContainerType < ActiveRecord::Migration
def up
activities = Activity.where("activity_container_type = ''")
activities.each do |activity|
activity.set_container_type_val
activity.save
end
end
def down
Activity.where("activity_container_type <> ''").update_all(activity_container_type: '',activity_container_id:nil)
end
end

View File

@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20150702073308) do
ActiveRecord::Schema.define(:version => 20150715070534) do
create_table "activities", :force => true do |t|
t.integer "act_id", :null => false
@ -588,6 +588,8 @@ ActiveRecord::Schema.define(:version => 20150702073308) do
t.integer "homework_common_id"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.float "ta_proportion", :default => 0.1
t.integer "question_id"
end
create_table "homework_evaluations", :force => true do |t|
@ -721,16 +723,6 @@ ActiveRecord::Schema.define(:version => 20150702073308) do
add_index "journal_details", ["journal_id"], :name => "journal_details_journal_id"
create_table "journal_details_copy", :force => true do |t|
t.integer "journal_id", :default => 0, :null => false
t.string "property", :limit => 30, :default => "", :null => false
t.string "prop_key", :limit => 30, :default => "", :null => false
t.text "old_value"
t.text "value"
end
add_index "journal_details_copy", ["journal_id"], :name => "journal_details_journal_id"
create_table "journal_replies", :id => false, :force => true do |t|
t.integer "journal_id"
t.integer "user_id"
@ -1229,9 +1221,17 @@ ActiveRecord::Schema.define(:version => 20150702073308) do
t.integer "project_id"
end
create_table "student_work_tests", :force => true do |t|
t.integer "student_work_id"
t.integer "homework_test_id"
t.integer "result"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "student_works", :force => true do |t|
t.string "name"
t.text "description"
t.text "description", :limit => 2147483647
t.integer "homework_common_id"
t.integer "user_id"
t.float "final_score"

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

View File

@ -394,6 +394,7 @@ function show_bid_dead_line(year,month,day,divname)
+ "</form>"
+ "<p class='fr'>作品提交还剩:</p>");
}
//验证新建作业的名字
function regex_homework_name()
{
@ -414,6 +415,7 @@ function regex_homework_name()
//验证匿评数量
function regex_evaluation_num()
{
if($("#evaluation_num").length == 0){ return true;}
var evaluation_num = $.trim($("#evaluation_num").val());
var regex = /^\d+$/;
if(evaluation_num=="")
@ -471,6 +473,8 @@ $(function(){
});
//第一次加载时,如果未开启匿评作业,隐藏显示匿评配置信息
$(function(){
if($("#homework_common_homework_type").attr("id") != null && $("#homework_common_homework_type").val() != 2)
{
if($("#homework_common_homework_type").attr("checked") == "checked")
{
$("#evaluation_setting").show();
@ -481,6 +485,7 @@ $(function(){
$("#evaluation_setting").hide();
$("#ta_proportion").attr("disabled","disabled");
}
}
});
//老师提交 新建/修改 作业
@ -501,6 +506,25 @@ function submit_homework(id)
}
}
//增加测试结果
function add_programing_test(obj) {
var now = new Date().getTime();
obj.after("<div><li><label class='label02'>&nbsp;测试输入:&nbsp;</label><input type='text' class='fl h26 w186 mb10' name='input[" + now +"]'' />" +
"</li><li ><label class='fl f14 ml10'>&nbsp;输出:&nbsp;</label><input type='text' class='fl h26 w186 mb10' name='output[" + now +"]' />" +
"</li><li><a class='icon_add ml10' href='javascript:void(0);' title='添加测试' onclick='add_programing_test($(this).parent().parent())'></a>" +
"<a class='icon_remove' href='javascript:void(0);' title='删除测试' onclick='remove_programing_test($(this).parent().parent())'></a>" +
"<span class='green_btn fl ml5 mt1'>测试</span></li><div class='cl'></div></div>");
}
//删除测试结果
function remove_programing_test(obj) {
if(obj.siblings("div").length == 0){
alert("至少需要一组测试");
}
else{
obj.remove();
}
}
function show_window (id1,id2,top,left) {
$('#'+ id1).css('top',top);
$('#'+ id1).css('left',left);
@ -837,14 +861,14 @@ function clickOK(path)
});
}
//查询
function SearchByName(obj,url,event)
function SearchByName(name,group,url,event)
{
var keycode = (event.keyCode ? event.keyCode : event.which);
if(keycode == '13'){
location.href = url + "&name=" + obj.val();
location.href = url + "&name=" + name + "&group=" + group;
}
}
function SearchByName_1(obj,url)
function SearchByName_1(name,group,url)
{
location.href = url + "&name=" + obj.val();
location.href = url + "&name=" + name + "&group=" + group;
}

View File

@ -1,11 +1,15 @@
function addSlipMenu () {
var loggedas = $('#current_user_li:first');
var loggedas = $('#current_user_li a:first');
var sub_menu = $('#user_sub_menu');
loggedas.mouseenter(function(event) {
loggedas.mouseenter(function() {
sub_menu.show();
$('#my_projects_ul').hide();
$('#my_courses_ul').hide();
});
sub_menu.mouseleave(function(event) {
sub_menu.mouseleave(function() {
sub_menu.hide();
$('#my_projects_ul').hide();
$('#my_courses_ul').hide();
});
}
@ -13,24 +17,26 @@ function addProjectSlipMenu () {
var loggedas = $('#my_projects_li');
var project_sub_menu = $('#my_projects_ul');
var course_sub_menu = $('#my_courses_ul');
loggedas.mouseenter(function(event) {
loggedas.mouseenter(function() {
course_sub_menu.hide();
project_sub_menu.show();
});
loggedas.mouseleave(function(event) {
loggedas.mouseleave(function() {
project_sub_menu.hide();
course_sub_menu.hide();
});
}
function addCourseSlipMenu () {
var loggedas = $('#my_courses_li');
var project_sub_menu = $('#my_projects_ul');
var course_sub_menu = $('#my_courses_ul');
loggedas.mouseenter(function(event) {
loggedas.mouseenter(function() {
project_sub_menu.hide();
course_sub_menu.show();
});
loggedas.mouseleave(function(event) {
loggedas.mouseleave(function() {
course_sub_menu.hide();
project_sub_menu.hide();
});
}

View File

@ -30,6 +30,10 @@ a:hover.news_foot{ color:#787b7e; border:1px solid #d4d4d4;}
.box_h3{ color:#15bccf; text-align:center; font-size:16px;}
.box_p{ color:#404040; margin-bottom:5px;}
.fb_item{ color:#919191; border:1px solid #919191; height:28px; margin-bottom:10px; padding-left:5px; width:290px;}
a.icon_addm{ background:url(../images/img_floatbox.png) 0 -33px no-repeat; width:16px; height:16px; display:block; margin:5px 0 0 5px;}
a:hover.icon_addm{background:url(../images/img_floatbox.png) 0 -61px no-repeat; }
a.icon_removem{ background:url(../images/img_floatbox.png) -22px -33px no-repeat;width:16px; height:16px; display:block; margin:5px 0 0 5px}
a:hover.icon_removem{background:url(../images/img_floatbox.png) -22px -61px no-repeat;}
a.btn_free{ background:#ff5722; display:block; width:80px; text-align:center; color:#fff; height:26px; padding-top:3px; margin-bottom:10px;}
a:hover.btn_free{ background:#d63502;}
/*成员邀请*/
@ -338,7 +342,6 @@ a:hover.st_add{ color:#ff8e15;}
.upbtn{ margin:40px 0 0 15px; display:block; padding:2px 5px; border:1px solid #eaeaea;}
.upbtn:hover{border:1px solid #64bdd9; color:#64bdd9;cursor: pointer;}
.upload_file{margin-left: -60px;margin-top: 40px;width: 50px;position: absolute;height: 24px;opacity: 0;cursor: pointer}
/* 功能倒计时*/
.w_img{ float:left; margin:10px 10px 15px 0px;}
.w_p{ float:left; color:#15bccf; font-size:16px; font-weight:bold; margin-top:70px; }
@ -349,7 +352,9 @@ a:hover.st_add{ color:#ff8e15;}
.upload_con h2{ display:block; background:#eaeaea; font-size:14px; color:#343333; height:31px; width: auto; margin-top:25px; padding-left:20px; padding-top:5px;}
.upload_box{ width:430px; margin:15px auto;}
a.link_file{ background:url(../images/pic_file.png) 0 2px no-repeat; padding-left:20px; }
a:hover.link_file{ background:url(../images/pic_file.png) 0 -25px no-repeat; color:#3ca5c6;}
.r_txt_tit{width:510px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;color:#15bccf; float:left; color:#09658c; font-size:14px;}
blockquote {background: #eeeeee;padding: 10px;margin-bottom: 10px;word-break: break-all;word-wrap: break-word;}
.respond-form{display: none;margin: auto;clear: both;}
@ -561,8 +566,8 @@ a.files_tag_select{ background:#64bdd9; color:#fff; border:1px solid #64bdd9; pa
.hwork_new_left{ width:220px; float:left; }
.hwork_new_right{ width:350px; float:left; margin-left:40px;}
.w305{ width:305px;}
.icon_add{ background:url(images/icons.png) 0px -310px no-repeat; width:16px; height:27px; display:block;float:left; margin-right:5px;}
a:hover.icon_add{background:url(images/icons.png) -20px -310px no-repeat;}
.icon_add{ background:url(../stylesheets/images/icons.png) 0px -310px no-repeat; width:16px; height:27px; display:block;float:left; margin-right:5px;}
a:hover.icon_add{background:url(../stylesheets/images/icons.png) -20px -310px no-repeat;}
/* 20150505讨论区*/
.w664{ width:664px;}
@ -598,10 +603,12 @@ a:hover.Reply_pic{border:1px solid #64bdd9;}
/*.talk_new{ border-bottom:1px dashed #d9d9d9; padding-bottom:10px;}*/
#about_newtalk{ display:none;}
/* 20150423作业评分*/
.ml14{ margin-left:14px;}
.w548{ width:552px;}
.w547{ width:544px;}
.w196{ width:196px;}
.w186{ width:186px;}
.w459{ width:459px;}
.hwork_new_set{border:1px dashed #CCC; background:#f5f5f5; text-align:center; padding:10px 0; margin-bottom:10px;}
.hwork_new_grey{background:#dbdbdb; width:610px; padding:10px 20px; margin:0 auto; text-align:left; margin-bottom:5px;}
@ -610,6 +617,8 @@ a:hover.Reply_pic{border:1px solid #64bdd9;}
.w305{ width:305px;}
.icon_add{background:url(images/icons.png) 0px -310px no-repeat; width:16px; height:27px; display:block;float:left; margin-right:5px;}
a:hover.icon_add{background:url(images/icons.png) -20px -310px no-repeat;}
.icon_remove{background:url(images/icons.png) 0px -338px no-repeat; width:16px; height:27px; display:block;float:left;}
a:hover.icon_remove{background:url(images/icons.png) -20px -338px no-repeat;}
/* 20150506上传头像*/
.uppicBox{ width:265px; height:265px; background:#f2f2f5; float:left; color:#666; text-align:center;}
@ -656,6 +665,7 @@ a:hover.ping_pic{border:1px solid #64bdd9;}
a.down_btn{ border:1px solid #CCC; color:#999; padding:0px 5px; font-size:12px; text-align:center; display:block;}
a:hover.down_btn{ background:#14ad5a; color:#fff; border:1px solid #14ad5a;}
.fr{ float:right;}
.min_search{ width:140px; height:20px; border:1px solid #d0d0d0; color:#666; background:url(../images/public_icon.png) 185px -193px no-repeat; }
.li_min_search{ float:right; margin-right:-10px;}
.info_ni_download{ width:100px; padding:5px;position: absolute;display:none;-moz-border-radius:3px; -webkit-border-radius:3px; border-radius:3px; box-shadow:0px 0px 5px #194a81; color:#666; background:#fff; text-align:left;margin-left: 200px;margin-top: 10px;}
.info_ni{ width:100px; padding:5px;position: absolute;display:none;-moz-border-radius:3px; -webkit-border-radius:3px; border-radius:3px; box-shadow:0px 0px 5px #194a81; color:#666; background:#fff; text-align:left;margin-left: 50px;margin-top: -5px;}
@ -674,6 +684,12 @@ input#score{ width:40px;}
.ui-slider .ui-slider-handle:hover,.ui-slider .ui-slider-handle:focus{background:#64bdd9;}
.ui-slider .ui-slider-handle:active{background-image:none;}
.ui-slider .ui-slider-range{position:absolute;z-index:1;font-size:.7em;display:block;border:0;top:0;height:100%;background:#64bdd9;left:0;}
/* 编程作品 */
.border_ce{ border:1px solid #e4e4e4; }
.border_ce tr td{ height:26px; }
.td_tit{width:155px; text-align:center;}
.td_50{width:50px; text-align:center;}
a.work_list_tit{width:610px; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;}
.filename { background: url(../images/pic_file.png) 0 -25px no-repeat;color: #3ca5c6;max-width: 150px;border: none; padding-left: 20px;margin-right: 10px;margin-bottom: 5px; white-space: nowrap; text-overflow:ellipsis;}
.evaluation{position: relative;}

View File

@ -0,0 +1,67 @@
.topbar_info02{ margin:5px 10px;width:480px; }
.topbar_info02 p{color: #7f7f7f;}
.search{ margin-top:8px; float:right; margin-right:5px;}
/*信息*/
.project_info{ background:#fff; padding:10px; padding-right:0px;width:222px; padding-right:8px; margin-bottom:10px;}
.pr_info_id{ width:137px; color:#5a5a5a; font-size:14px; margin-top:5px;}
.pr_info_logo{ border:1px solid #eaeaea; width:60px; height:60px; padding:1px;}
.pr_info_logo:hover{ border:1px solid #64bdd9; }
.pr_info_join{}
a.pr_join_a{ color:#fff; display:block; padding:0 5px 0 3px; padding-top:2px; height:20px; margin-right:5px; float:left; text-align:center; background-color:#64bdd9; float:left; }
a:hover.pr_join_a{ background:#41a8c8;}
.pr_join_span{color: #fff; display:block; padding:0 5px; padding-top:2px; height:20px; margin-right:5px; float:left; text-align:center; background: #CCC;}
.pr_setting{ display:block; background:url(../images/leftside.png) -1px 0 no-repeat; width:11px; height:11px; margin-top:3px; float:left; }
.pr_copy{ display:block; background:url(../images/leftside.png) -1px -23px no-repeat; width:11px; height:11px; margin-top:3px; float:left; }
.pr_close{ display:block; background:url(../images/leftside.png) -1px -49px no-repeat; width:11px; height:11px; margin-top:3px; float:left; }
.pr_add{display:block; background:url(../images/leftside.png) 0px -71px no-repeat; width:11px; height:11px; margin-top:3px; float:left; }
.pr_arrow{display:block; background:url(../images/leftside.png) 0px -90px no-repeat; width:11px; height:11px; margin-top:3px; float:left; }
.pr_info_name{ color:#3e4040; font-size:14px; line-height:1.5;}
.pr_info_name:hover{ color:#3ca5c6;}
.pr_info_score{ font-size:14px; color:#3e4040; }
.pr_info_score a{ color:#ff7143;}
.pr_info_score a:hover{ color:#64bdd9;}
.img_private{ background:url(../images/new_project/img_project.png) 0 0 no-repeat; width:33px; height:16px; color:#fff; font-size:12px; padding-left:7px; }
/*.img_private{ background:url(../images/project/img_project.png) 0 0 no-repeat; width:33px; height:16px; color:#fff; font-size:12px; padding-left:7px; }*/
.info_foot_num{ color:#3ca5c6; }
.pr_info_foot{ color:#7f7f7f; margin-top:5px; }
.info_foot_num:hover{ color:#2390b2;}
.info_box{background:#fff; padding:10px;width:220px; }
.info_box ul li{ font-size:12px; color: #3e4040; line-height:1.7;}
/*左侧导航*/
.subNavBox{width:240px; background:#fff;margin:10px 10px 0 0;}
.subNav{border-bottom:solid 1px #e5e3da;cursor:pointer;font-weight:bold;font-size:14px;color:#3ca5c6; height:26px;padding-left:10px;background-color:#fff; padding-top:2px;}
.subNav_jiantou{background:url(../images/jiantou1.jpg) no-repeat;background-position:95% 50%; background-color:#fff;}
.subNav_jiantou:hover{color:#0781b4; }
.currentDd{color:#0781b4;}
.currentDt{background-color:#fff;}
.navContent{display: none;border-bottom:solid 1px #e5e3da; }
.navContent li a{display:block;width:240px;heigh:28px;text-align:center;font-size:12px;line-height:28px;color:#333}
.navContent li a:hover{color:#fff;background-color:#b3e0ee}
a.subnav_num{ font-weight:normal; color:#ff7143; font-size:12px;}
a.subnav_green{ background:#28be6c; color:#fff; font-size:12px; font-weight:normal;height:18px; padding:0px 5px; padding-top:2px; display:block; margin-top:2px; margin-bottom:5px; float:right; margin-right:5px;}
a:hover.subnav_green{ background:#14ad5a;}
/*简介*/
.project_intro{ width:220px; padding:10px; background:#fff; margin-top:10px; padding-top:5px; color:#6d6d6d; line-height:1.9;}
.course_description{max-height: 112px;overflow:hidden; word-break: break-all;word-wrap: break-word;}
.course_description_none{max-height: none;}
.lg-foot{ border:1px solid #e8eef2; color: #929598; text-align:center; width:220px; height:23px; cursor:pointer;}
.lg-foot:hover{ color:#787b7e; border:1px solid #d4d4d4;}
/****标签(和资源库的tag样式一致)***/
.project_Label{ width:220px; padding:10px; background:#fff; margin-top:10px; padding-top:5px; margin-bottom:10px;}
a.yellowBtn{ display:inline-block;color:#0d90c3; height:22px;}
.submit{height:21px;border:0; cursor:pointer; background:url(../images/btn.png) no-repeat 0 0;width:42px; margin-top:2px; margin-left:3px; }
.isTxt{background:#fbfbfb url(../images/inputBg.png) repeat-x left top;height:22px;line-height:22px;border:1px solid #c1c1c1;padding:0 5px;color:#666666;}
.re_tag{ width: auto; padding:0 5px; padding-top:2px; height:20px; border:1px solid #f8df8c; background:#fffce6; margin-right:5px; }
.re_tag a{ color:#0d90c3;}
.tag_h{ }
.tag_h span,.tag_h a{ margin-bottom:5px;}

View File

@ -79,6 +79,7 @@ h4{ font-size:14px; color:#3b3b3b;}
.mr50{margin-right: 50px;}
.mr55{margin-right: 55px;}
.mr70{margin-right: 70px;}
.mt1{margin-top: 1px;}
.mt3{ margin-top:3px;}
.mt5{ margin-top:5px;}
.mt8{ margin-top:8px;}
@ -109,6 +110,7 @@ h4{ font-size:14px; color:#3b3b3b;}
.w350{ width:350px;}
.w610{ width:610px;}
.w600{ width:600px;}
.h20{height: 20px;}
.h22{ height:22px;}
.h26{ height:26px;}
.h50{ height:50px;}
@ -166,6 +168,7 @@ a.green_btn{background:#28be6c;color:#fff;font-size:14px; font-weight:normal; pa
a:hover.green_btn{ background:#14ad5a;}
.blue_btn{ background:#64bdd9; color:#fff; font-size:14px; font-weight:normal;padding:2px 10px; text-align:center;}
a.blue_btn{background:#64bdd9;color:#fff;font-size:14px; font-weight:normal; padding:2px 10px; text-align:center;}
a.orange_btn_homework{background:#d63502;color:#fff;font-size:14px; font-weight:normal; padding:2px 10px; text-align:center;}
a:hover.blue_btn{ background:#329cbd;cursor: pointer;}
a.orange_btn{ background:#ff5722;color:#fff;font-size:14px; font-weight:normal; padding:2px 10px; text-align:center; }
a:hover.orange_btn{ background:#d63502;}

View File

@ -0,0 +1,432 @@
/* CSS Document */
/* 2015-06-26 */
body,h1,h2,h3,h4,h5,h6,hr,p,blockquote,dl,dt,dd,ul,ol,li,pre,form,fieldset,legend,button,input,textarea,th,td{ margin:0; padding:0;}
body,table,input,textarea,select,button { font-family: "微软雅黑","宋体"; font-size:12px;line-height:1.5; background:#eaebec;}
div,img,tr,td,table{ border:0;}
table,tr,td{border:0;cellspacing:0; cellpadding:0;}
ol,ul,li{ list-style-type:none}
a:link,a:visited{color:#7f7f7f;text-decoration:none;}
a:hover,a:active{color:#000;}
/*常用*/
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:hover{ background:#b5e2fa; color:#000; border:1px solid #3c7fb1;}
table{ background:#fff;}
.more{ font-weight:normal; color:#999; font-size:12px;}
.no_line{ border-bottom:none;}
.line{border-bottom:1px dashed #d4d4d4; padding-bottom:10px; margin-bottom:10px;}
.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;}
/* font & color */
h2{ font-size:18px; color:#15bccf;}
h3{ font-size:14px; color:#e8770d;}
h4{ font-size:14px; color:#3b3b3b;}
.f12{font-size:12px; font-weight:normal;}
.f14{font-size:14px;}
.f16{font-size:16px;}
.f18{font-size:18px;}
.fb{font-weight:bold;}
.lh20{line-height:20px;}
.lh22{line-height:22px;}
.lh24{line-height:24px;}
.lh26{line-height:26px;}
.fmYh{font-family:"MicroSoft Yahei";}
.font999{ color:#999;}
.fontRed{color:#770000;}
.text_c{ text-align:center;}
/* Float & Clear */
.cl{ clear:both; overflow:hidden; }
.fl{float:left;display:inline;}
.fr{float:right;display:inline;}
.f_l{ float:left;}
.f_r{ float:right;}
.clearfix:after{clear:both;content:".";display:block;font-size:0;height:0;line-height:0;visibility:hidden}
.clearfix{clear:both;zoom:1}
.break_word{ word-break:break-all; word-wrap: break-word;}
.white_space{white-space:nowrap;}
/* Spacing */
.ml2{ margin-left:2px;}
.ml3{ margin-left:3px;}
.ml4{ margin-left:4px;}
.ml5{ margin-left:5px;}
.ml8{ margin-left:8px;}
.ml10{ margin-left:10px;}
.ml15{ margin-left:15px;}
.ml20{ margin-left:20px;}
.ml40{ margin-left:40px;}
.ml45{ margin-left:45px;}
.ml55{ margin-left:55px;}
.ml30{ margin-left:30px;}
.ml60{ margin-left:60px;}
.ml80{ margin-left:80px;}
.ml90{ margin-left:90px;}
.ml100{ margin-left:100px;}
.ml110{ margin-left:110px;}
.mr5{ margin-right:5px;}
.mr10{ margin-right:10px;}
.mr20{ margin-right:20px;}
.mr30{ margin-right:30px;}
.mr40{ margin-right:40px;}
.mt3{ margin-top:3px;}
.mt5{ margin-top:5px;}
.mt8{ margin-top:8px;}
.mt10{ margin-top:10px;}
.mb5{ margin-bottom:5px;}
.mb10{ margin-bottom:10px;}
.mb20{ margin-bottom:20px;}
.pl15{ padding-left:15px;}
.w20{ width:20px;}
.w60{ width:60px;}
.w70{ width:70px;}
.w90{ width:90px;}
.w210{ width:210px;}
.w150{ width:150px;}
.w280{ width:280px;}
.w430{ width:470px;}
.w520{ width:520px;}
.w543{ width:543px;}
.w557{ width:557px;}
.w583{ width:583px;}
.w350{ width:350px;}
.w610{ width:610px;}
.w600{ width:600px;}
.h22{ height:22px;}
.h26{ height:26px;}
.h50{ height:50px;}
.h70{ height:70px;}
.h150{ height:150px;}
/* Font & background Color */
a.b_grey{ background: #F5F5F5;}
a.b_dgrey{ background: #CCC;}
a.c_orange{color:#ff5722;}
a:hover.c_orange{color: #d33503;}
a.c_lorange{color:#ff9900;}
a:hover.c_lorange{color:#fff;}
a.c_blue{ color:#15bccf;}
a.c_dblue{ color:#09658c;}
a:hover.c_dblue{ color:#15bccf;}
a.c_white{ color:#fff;}
a.c_dorange{ color:#fd6e2a;}
a.c_dark{color: #3e4040;}
a:hover.c_dark{color: #3ca5c6;}
a.b_blue{background: #64bdd9;}
a:hover.b_blue{background: #41a8c8;}
a.b_green{background:#28be6c;}
a:hover.b_green{background:#14ad5a;}
a.c_blue02{color: #3ca5c6;}
a:hover.c_blue02{color: #0781b4;}
a.c_red{ color:#F00;}
a:hover.c_red{ color: #C00;}
a.c_purple{color: #426e9a;}
a:hover.c_purple{color: #d33503;}
a.c_green{ color:#28be6c;}
.b_grey{ background: #F5F5F5;}
.b_dgrey{ background: #CCC;}
.c_orange{color:#e8770d;}
.c_dark{ color:#2d2d2d;}
.c_lorange{ color:#ff9900;}
.c_purple{color: #6883b6;}
.c_blue{ color:#15bccf;}
.c_red{ color:#F00;}
.c_green{ color:#28be6c;}
.c_dblue{ color:#09658c;}
.b_blue{background:#64bdd9;}
.b_green{background:#28be6c;}
.b_w{ background:#fff;}
/* commonBtn */
.grey_btn{ background:#d9d9d9; color:#656565;font-size:14px; font-weight:normal; text-align:center;padding:2px 10px;}
a.grey_btn{ background:#d9d9d9; color:#656565;font-size:14px; font-weight:normal; text-align:center;padding:2px 10px;}
a:hover.grey_btn{ background:#717171; color:#fff;}
.grey_n_btn{ background:#d9d9d9; color:#656565; font-weight:normal;padding:2px 10px; text-align:center;}
a.grey_n_btn{background:#d9d9d9; color:#656565;font-weight:normal; padding:2px 10px; text-align:center;}
a:hover.grey_n_btn{ background:#717171; color:#fff;}
.green_btn{ background:#28be6c; color:#fff; font-size:14px; font-weight:normal;padding:2px 10px; text-align:center;}
a.green_btn{background:#28be6c;color:#fff;font-size:14px; font-weight:normal; padding:2px 10px; text-align:center;}
a:hover.green_btn{ background:#14ad5a;}
.blue_btn{ background:#64bdd9; color:#fff; font-size:14px; font-weight:normal;padding:2px 10px; text-align:center;}
a.blue_btn{background:#64bdd9;color:#fff;font-size:14px; font-weight:normal; padding:2px 10px; text-align:center;}
a:hover.blue_btn{ background:#329cbd;}
a.orange_btn{ background:#ff5722;color:#fff;font-size:14px; font-weight:normal; padding:2px 10px; text-align:center; }
a:hover.orange_btn{ background:#d63502;}
.green_u_btn{border:1px solid #3cb761; padding:2px 10px; color:#3cb761;}
a.green_u_btn{border:1px solid #3cb761; padding:2px 10px; color:#3cb761;}
a:hover.green_u_btn{ background:#3cb761; color:#fff;}
.orange_u_btn{border:1px solid #ff5d31; padding:2px 10px; color:#ff5d31;}
a.orange_u_btn{border:1px solid #ff5d31; padding:2px 10px; color:#ff5d31;}
a:hover.orange_u_btn{background:#ff5d31; color:#fff;}
.bgreen_u_btn{border:1px solid #1abc9c; padding:2px 10px; color:#1abc9c;}
a.bgreen_u_btn{border:1px solid #1abc9c1; padding:2px 10px; color:#1abc9c;}
a:hover.bgreen_u_btn{background:#1abc9c; color:#fff;}
.blue_u_btn{border:1px solid #64bdd9; padding:2px 10px; color:#64bdd9;}
a.blue_u_btn{border:1px solid #64bdd9; padding:2px 10px; color:#64bdd9;}
a:hover.blue_u_btn{background:#64bdd9; color:#fff;}
.blue_n_btn{ background:#64bdd9; color:#fff; font-weight:normal;padding:2px 10px; text-align:center;}
a.blue_n_btn{background:#64bdd9;color:#fff;font-weight:normal; padding:2px 10px; text-align:center;}
a:hover.blue_n_btn{ background:#329cbd;}
.green_n_btn{background:#3cb761; padding:2px 10px; color:#fff;}
a.green_n_btn{background:#3cb761; padding:2px 10px; color:#fff;}
a:hover.green_n_btn{ background:#14ad5a;}
.orange_n_btn{background:#ff5d31; padding:2px 10px; color:#fff;}
a.orange_n_btn{background:#ff5d31; padding:2px 10px; color:#fff;}
a:hover.orange_n_btn{background:#d63502;}
.bgreen_n_btn{background:#1abc9c; padding:2px 10px; color:#fff;}
a.bgreen_n_btn{background:#1abc9c; padding:2px 10px; color:#fff;}
a:hover.bgreen_n_btn{background:#08a384;}
.nolink_btn{ background:#BCBCBC; color: #fff; padding:2px 5px;}
.more_btn{-moz-border-radius:3px; -webkit-border-radius:3px; border:1px solid #9DCEFF; color:#9DCEFF; border-radius:3px; padding:0px 3px;}
.upbtn{ margin:42px 0 0 10px; border:none; color:#999; width:150px;}
.red_btn_cir{ background:#e74c3c; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;}
.green_btn_cir{ background:#28be6c; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;}
.blue_btn_cir{ background:#3498db; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;}
.orange_btn_cir{ background:#e67e22; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal; font-size:12px;}
.bgreen_btn_cir{ background:#1abc9c; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal; font-size:12px;}
/* commonpic */
.pic_date{ display:block; background:url(../images/public_icon.png) -31px 0 no-repeat; width:16px; height:15px; float:left;}
.pic_add{ display:block; background:url(../images/public_icon.png) -31px -273px no-repeat; width:16px; height:15px; float:left;}
.pic_sch{ display:block; background:url(../images/public_icon.png) -31px -195px no-repeat; width:16px; height:15px; float:left;}
.pic_mes{ display:block; background:url(../images/public_icon.png) 0px -376px no-repeat; width:20px; height:15px; padding-left:18px;}
.pic_img{ display:block; background:url(../images/public_icon.png) -31px -419px no-repeat; width:20px; height:15px; }
.pic_del{ display:block; background:url(../images/public_icon.png) 0px -235px no-repeat; width:20px; height:15px; }
.pic_del:hover{ background:url(../images/public_icon.png) -32px -235px no-repeat; }
.pic_stats{display:block; background:url(../images/public_icon.png) 0px -548px no-repeat; width:20px; height:15px;}
.pic_files{display:block; background:url(../images/public_icon.png) 0px -578px no-repeat; width:20px; height:15px;}
.pic_text{display:block; background:url(../images/public_icon.png) 0px -609px no-repeat; width:20px; height:18px;}
.pic_text02{display:block; background:url(../images/public_icon.png) 0px -642px no-repeat; width:20px; height:19px;}
.pic_edit{display:block; background:url(../images/public_icon.png) 0px -32px no-repeat; width:20px; height:15px;}
.pic_edit:hover{display:block; background:url(../images/public_icon.png) -32px -32px no-repeat; width:20px; height:15px;}
/*框架主类容*/
#Container{ width:1000px; margin:0 auto; }
/*头部导航*/
#Header{ margin:10px 0; background:#15bccf; height:40px; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px; }
.logo{ margin:5px 10px; }
#TopNav{}
#TopNav ul li{ margin-top:8px;}
.topnav_a a{ font-size:14px; font-weight:bold; color:#fff; margin-right:10px;}
.topnav_a a:hover{color: #a1ebff;}
#TopUser{}
#TopUser ul li{ margin-top:8px;}
.topuser_a a{ font-size:14px; font-weight:bold; color:#fff; margin-right:10px;}
.topuser_a a:hover{color: #a1ebff;}
#TopUser02{ }
#TopUser02 li{ float: left;}
#TopUser02 li a{ margin-right:10px;color: #FFF;text-align: center;}
#TopUser02 li a:hover{color: #a1ebff;}
#TopUser02 div{ position: absolute;visibility: hidden;background:#fff;border: 1px solid #15bccf;}
#TopUser02 div a{position: relative;display: block;white-space: nowrap;text-align: left; line-height:1.9; margin-left:5px;background: #fff;color:#15bccf; font-weight:normal;}
#TopUser02 div a:hover{ color:#e8770d; font-weight: bold;}
/*头部导航下拉*/
div#menu {height:41px; font-size:14px; font-weight:bold; }
div#menu ul {float: left;}
div#menu ul.menu { padding-left: 30px; }
div#menu li {position: relative; z-index: 9; margin: 0; display: block; float: left; }
div#menu li:hover>ul { left: -2px;}
div#menu a {position: relative;z-index: 10; height: 41px; display: block; float: left;line-height: 41px; text-decoration: none; font-size:14px; }
div#menu a:hover, div#menu a:hover span { color: #a1ebff; }
div#menu li.current a {}
div#menu {display: block; cursor: pointer; background-repeat: no-repeat;background-position: 95% 0;padding-right: 15px; _padding-right: 20px;}
div#menu ul a.parent {background: url(../images/item.png) -20px -30px no-repeat; width:60px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;}
div#menu ul a.parent:hover {background: url(../images/item.png) -20px -60px no-repeat;}
div#menu ul ul a.parent {background: url(../images/item.png) -20px 6px no-repeat;}
div#menu ul ul a.parent:hover {background: url(../images/item.png) -20px -11px no-repeat;}
/* menu::level1 */
div#menu a { padding: 5px 12px 0 10px;line-height: 30px; color: #fff;}
div#menu li { background: url(images/main-delimiter.png) 98% 4px no-repeat; }
div#menu li.last { background: none; }
/* menu::level2 */
div#menu ul ul li { background: none; }
div#menu ul ul { position: absolute;top: 38px; left: -999em; width: 90px; padding: 5px 0 0 0; background:#fff; border:1px solid #15bccf; margin-top:1px;}
div#menu ul ul a {padding: 0 0 0 15px; height: auto; float: none;display: block; line-height: 24px; font-size:12px; font-weight:normal;color:#15bccf;}
div#menu ul ul a:hover { color:#ff9900;}
div#menu ul ul li.last { margin-left:15px; }
div#menu ul ul li {width: 100%;}
/* menu::level3 */
div#menu ul ul ul {padding: 0;margin: -38px 0 0 92px !important; width:140px; }
div#menu ul ul ul li a{ width:125px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;color:#15bccf;}
/*主类容*/
#Main{ background:#fff; margin-bottom:10px;}
#content{}
#content02{ background:#fff; padding:10px; margin-bottom:10px;}
/*主类容搜索*/
#TopBar{ height:60px; margin-bottom:10px; background:#fff;}
.topbar_info02{ margin:5px 10px;width:480px; }
.topbar_info02 p{color: #7f7f7f;}
.search{ margin-top:8px; margin-left:71px;}
.search_form{margin-top:8px;margin-left:72px;}
.topbar_info{ width:350px; color:#5c5c5c; font-size:16px; margin-right:50px; line-height:1.3; padding-left:100px;}
a.search_btn{ display:block; background:#15bccf; color:#fff; width:60px; height:24px; text-align:center; padding-top:3px;}
a:hover.search_btn{ background: #0fa9bb;}
.search_text{ border:1px solid #15bccf; background:#fff; width:220px; height:25px; padding-left:5px; }
/*主类容左右分栏*/
#LSide{ width:240px; }
#RSide{ width:730px; margin-left:10px; background:#fff; padding:10px; margin-bottom:10px;}
/*底部*/
#Footer{ padding-top:10px; background:#fff; margin-bottom:10px;}
.copyright{ width:780px; margin:0 auto;height:30px; }
.footlogo{ width:580px; margin:0 auto;height:50px; }
/*意见反馈*/
html{ overflow-x:hidden;}
.scrollsidebar{ position: fixed; bottom:1px; right:1px; background:none; }
.side_content{width:154px; height:auto; overflow:hidden; float:left; }
.side_content .side_list {width:154px;overflow:hidden;}
.show_btn{ width:0; height:112px; overflow:hidden; float:left; margin-top:190px;cursor:pointer;}
.show_btn span { display:none;}
.close_btn{width:24px;height:24px;cursor:pointer;}
.side_title,.side_bottom,.close_btn,.show_btn {background:url(../images/sidebar_bg.png) no-repeat; }
.side_title {height:35px;}
.side_bottom { height:8px;}
.side_center {font-family:Verdana, Geneva, sans-serif; padding:0px 12px; font-size:12px;}
.close_btn { float:right; display:block; width:21px; height:16px; margin:9px 10px 0 0; _margin:16px 5px 0 0;}
.close_btn span { display:none;}
.side_center .custom_service p { text-align:center; padding:6px 0; margin:0; vertical-align:middle;}
.msgserver { margin-top:5px;}
/*.msgserver a { background:url(../images/sidebar_bg.png) no-repeat -119px -112px; padding-left:22px; height:21px; display:block; }*/
.msgserver a { height:21px; display:block; }
.opnionText{box-shadow:none; width:122px; height:180px; border-color: #DFDFDF; background:#fff; color:#999; padding:3px; font-size:12px;overflow:auto; background-attachment:fixed;border-style:solid;}
a.opnionButton{ display:block; background:#15bccf; width:130px; height:23px; margin-top:5px; text-align:center; padding-top:3px;}
a:hover.opnionButton{background: #0fa9bb; }
/* blue skin as the default skin */
.side_title {background-position:-195px 0;}
.side_center {background:url(../images/blue_line.png) repeat-y center; }
.side_bottom {background-position:-195px -50px;}
a.close_btn {background-position:-44px 0;}
a:hover.close_btn {background-position:-66px 0;}
.show_btn {background-position:-119px 0;}
.msgserver a {color:#15bccf; }
.msgserver a:hover { text-decoration:underline; }
/***** Ajax indicator ******/
#ajax-indicator {
position: absolute; /* fixed not supported by IE */
background-color:#eee;
border: 1px solid #bbb;
top:35%;
left:40%;
width:20%;
font-weight:bold;
text-align:center;
padding:0.6em;
z-index:100000;
opacity: 0.5;
}
html>body #ajax-indicator { position: fixed; }
#ajax-indicator span {
background-position: 0% 40%;
background-repeat: no-repeat;
background-image: url(../images/loading.gif);
padding-left: 26px;
vertical-align: bottom;
}
div.modal {
border-radius: 5px;
background: #fff;
z-index: 50;
padding: 4px;
}
.ui-widget-content {
border: 1px solid #ddd;
color: #333;
}
.ui-widget {
font-family: Verdana, sans-serif;
font-size: 1.1em;
}
.ui-dialog .ui-dialog-content {
position: relative;
border: 0;
padding: .5em 1em;
background: none;
overflow: auto;
zoom: 1;
}
.ui-widget-overlay {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.ui-widget-overlay {
background: #666 url(http://forge.trustie.net/stylesheets/jquery/images/xui-bg_diagonals-thick_20_666666_40x40.png.pagespeed.ic.9mfuw_R0z1.png) 50% 50% repeat;
opacity: .5;
filter: Alpha(Opacity=50);
}
/***** end Ajax indicator ******/
/***** Flash & error messages ****/
#errorExplanation, div.flash, .nodata, .warning, .conflict {
padding: 4px 4px 4px 30px;
margin-bottom: 12px;
font-size: 1.1em;
border: 2px solid;
}
div.flash {margin-top: 8px;}
div.flash.error, #errorExplanation {
background: url(../images/exclamation.png) 8px 50% no-repeat;
background-color: #ffe3e3;
border-color: #dd0000;
color: #880000;
}
div.flash.notice {
background: url(../images/true.png) 8px 5px no-repeat;
background-color: #dfffdf;
border-color: #9fcf9f;
color: #005f00;
}
div.flash.warning, .conflict {
background: url(../images/warning.png) 8px 5px no-repeat;
background-color: #FFEBC1;
border-color: #FDBF3B;
color: #A6750C;
text-align: left;
}
.nodata, .warning {
text-align: center;
background-color: #FFEBC1;
border-color: #FDBF3B;
color: #A6750C;
}
#errorExplanation ul { font-size: 0.9em;}
#errorExplanation h2, #errorExplanation p { display: none; }
.conflict-details {font-size:80%;}
/***** end Flash & error messages ****/
/*弹出框*/
.black_overlay{display:none;position:fixed;top:0px;left:0px;width:100%;height:100%;background-color:black;z-index:1001;-moz-opacity:0.8;opacity:.80;filter:alpha(opacity=80);}
.white_content{display:none;position:fixed;top:15%;left:30%;width:420px;height: auto; margin-bottom:20px;padding:16px;border:3px solid #15bccf;background-color:white;z-index:1002;overflow:auto;}
.white_content02{display:none;position:fixed;top:15%;left:30%;width:200px;height: auto; margin-bottom:20px;padding:10px;border:3px solid #15bccf;background-color:white;z-index:1002;overflow:auto;}
.newhwork_content{ display:none;position:fixed;top:15%;left:30%;width:600px;height: auto; margin-bottom:20px;padding:16px;border:3px solid #15bccf;background-color:white;z-index:1002;overflow:auto;}
.floatbox{ width:420px; border:3px solid #15bccf; background:#fff; padding:5px;}
a.box_close{ display:block; float:right; width:16px; height:16px; background:url(../images/img_floatbox.png) 0 0 no-repeat;}
a:hover.box_close{background:url(../images/img_floatbox.png) -22px 0 no-repeat;}
div.ke-statusbar{height:1px; border-top:none;}

View File

@ -0,0 +1,127 @@
#RSide{ min-height:860px;}
/* 左侧信息*/
.users_info{background:#fff; padding:10px; width:230px; padding-right:0px; margin-bottom:10px; }
.pic_head{ width:214px; height:214px; border:1px solid #cbcbcb; padding:2px; position:relative;}
.pic_head:hover{border:1px solid #64bdd9;}
.usersphoto_edit{ position:absolute; left:198px; top:200px;}
.icon_male{ background:url(../images/pic_uersall.png) 0 0 no-repeat; width:15px; height:15px;}
.icon_female{ background:url(../images/pic_uersall.png) 0 -24px no-repeat; width:15px; height:15px;}
.pf_intro{ width:222px; margin-top:5px; color:#696969;word-break: break-all; }
.leftbox{ width:230px; padding:10px; padding-right:0px; padding-bottom:5px;background:#fff; margin-bottom:10px; margin-right:10px;}
.pic_members{ background:url(../images/pic_users.jpg) 0 0 no-repeat; display:block; width:38px; height:38px; border:1px solid #e9edf0; margin-right:5px; margin-bottom:5px;float:left;}
.pic_members:hover{border:1px solid #c9c9c9;}
/*新建*/
.top_new{ height:26px; border-bottom:10px solid #eaebed; padding:10px; background:#fff; float:left; margin-left:10px; width:730px; }
.top_new_bg{ background:url(../images/pic_uersall.png) -43px 3px no-repeat; height:26px; width:260px;}
.top_newcourses_bg{ background:url(../images/pic_uersall.png) -43px -29px no-repeat; height:28px; width:260px;}
.top_newproject_bg{ background:url(../images/pic_uersall.png) -43px -56px no-repeat; height:26px; width:260px;}
.newbtn{ height:24px; background:#18ca74; color:#fff; font-size:14px; padding:2px 12px 0 12px;}
.newbtn:hover{background: #14ad5a;}
a.newbtn_add{ display:block; background:url(../images/pic_uersall.png) -265px 3px no-repeat; height:20px; width:15px;}
a.newbtn_t{ font-size:14px; font-weight:bold; color:#fff;}
/*留言*/
a.icon_face{background:url(../images/public_icon.png) 0px -671px no-repeat; display:block; height:25px; width:40px; padding-left:25px; padding-top:3px; }
a:hover.icon_face{background:url(../images/public_icon.png) -79px -671px no-repeat; }
.inputUsers_message{ border:1px solid #d2d2d2; width:718px; height:48px; color:#666; padding:5px; margin-bottom:5px;}
.inputUsers_message02{ border:1px solid #d2d2d2; width:618px; height:26px; color:#666; padding:5px; margin-bottom:5px; }
.message_list_box{ background:#f5f5f5; padding:10px;}
.users_pic{ width:27px; height:27px; border:1px solid #e3e3e3;}
.users_pic:hover{ border:1px solid #a5a5a5;}
.massage_txt{ max-width:360px; color: #666;word-break:break-all;}
.massage_time{ color:#8d8d8d; margin-top:5px;}
.message_list{ border-bottom:1px dashed #c9c9c9; padding-bottom:10px; margin-bottom:10px;}
.message_list_more{ text-align:center; width:720px;}
/*课程动态*/
.line_box{ width:728px; border:1px solid #d9d9d9; padding-bottom:10px;}
.users_courses_list{ height:24px; border-bottom:1px dashed #CCC; margin-bottom:10px;}
.users_coursename{max-width:135px; font-weight:bold; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; margin-right:5px; }
.course_name{max-width:60px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;}
.c_grey{ color:#8d8d8d;}
.users_courses_txt{max-width:330px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;}
.users_top{ height:39px; border-bottom:1px solid #d9d9d9; margin-bottom:10px;}
.users_h4{border-bottom:1px solid #d9d9d9; height:29px; padding:10px 0 0 10px; margin-bottom:10px; }
/*弹框*/
.white_content_users{display:none;position:fixed;top:45%;left:45%;width:210px;height: auto; margin-bottom:20px;padding:10px;border:3px solid #15bccf;background-color:white;z-index:1002;overflow:auto;}
a.box_close{background:url(../images/img_floatbox.png) -22px 0 no-repeat;}
/*我的课程*/
.courses_top{ height:27px; border-bottom:3px solid #ebebeb;}
.courses_h2{ font-size:16px; font-weight:bold; color:#64bddb; border-bottom:3px solid #64bddb; padding-bottom:3px; padding-right:3px;}
.courses_select{}
a.select_btn{ border:1px solid #acacac; padding:0px 10px; color:#989898; display:block;}
a.select_btn:hover{ background:#64bddb; color:#fff;}
a.select_btn_select{ background:#64bddb; color:#fff;}
.courses_list_pic{ border:1px solid #ede7e9; width:64px; height:64px; padding:1px;}
.courses_list_pic:hover{border:1px solid #64bdd9;}
.courses_list_title{ max-width:500px;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;}
.pic_eye_blue{display:block; background:url(../images/pic_uersall.png) -372px 3px no-repeat; width:16px; height:15px; }
.pic_eye_grey{display:block; background:url(../images/pic_uersall.png) -372px -10px no-repeat; width:16px; height:15px; }
.td_w70{ width:70px;}
.td_w60{ width:60px;}
.td_w110{ width:110px;}
.mt20{ margin-top:20px;}
.courses_list{ padding-bottom:10px; }
.courses_list_table{ color:#6e6e6e;}
/****翻页***/
.wlist{float:right;}
.wlist li{float:left;}
.wlist a{ float:left; border:1px solid #64bdd9; padding:0 5px; margin-left:3px; color:#64bdd9;}
.wlist a:hover{border:1px solid #64bdd9; background-color:#64bdd9; color:#fff; text-decoration:none;}
.wlist_select a { background-color:#48aac9; color:#fff;}
/* 设置 */
#users_setting{clear:both;width:730px;/*滑动门的宽度*/}
/* TAB 切换效果 */
.users_tb_{ border-bottom:3px solid #CCC; height:26px; }
.users_tb_ ul{height:26px; }
.users_tb_ li{float:left;height:26px;width: 90px;cursor:pointer; font-size:14px; text-align:center; }
/* 控制显示与隐藏css类 */
.users_normaltab { color:#666; }
.users_hovertab { color:#64bdd9; border-bottom:3px solid #64bdd9; font-weight:bold;}
.users_normaltab a { color:#64bdd9 ; }
.users_hovertab a{color:#fff; background-color:#64bdd9; text-decoration:none;}
.users_dis{display:block; }
.users_undis{display:none;}
.users_ctt{ font-size:14px; color:#666; margin-top:10px;}
.setting_left{ width:85px; text-align:right; float:left;}
.setting_left li{ height:28px;line-height:28px;}
.setting_right{width:500px; text-align:left; float:left; margin-left:8px;}
.setting_right li{ height:28px;line-height:28px;}
.users_ctt ul li{ margin-bottom:10px;}
.users_ctt input,.users_ctt select,.users_ctt textarea{ border:1px solid #CCC;}
.users_ctt input,.users_ctt select,.users_ctt option{ height:26px;}
.users_ctt input,.users_ctt textarea{ margin-left:2px;}
.users_ctt textarea{ margin-bottom:none;}
.w450{ width:450px;}
.w210{ width:200px;}
.w70{ width:70px;}
.h200{ height:200px;}
/* 个人主页*/
a.gz_btn{display:block; background:url(../images/pic_uersall.png) -318px -25px no-repeat; width:33px; height:18px; border:1px solid #cdcdcd; color:#333333; padding:0px 0 0 18px;}
a:hover.gz_btn{ color:#ff5722;}
a.qx_btn{display:block; background:url(../images/pic_uersall.png) -318px -47px no-repeat; width:33px; height:18px; border:1px solid #cdcdcd; color:#333333; padding:0px 0 0 18px;}
a:hover.qx_btn{color:#64bdd9;}
a.c_lgrey{ color:#CCC;}
a:hover.c_lgrey{ color:#3ca5c6;}
.leftbox_ul_left{ width:60px; float:left; text-align:right; }
.leftbox_ul_right{ width:155px; float:left; margin-left:10px; }
.leftbox_ul_left li,.leftbox_ul_right li{ margin-bottom:5px;}
.c_dgrey{ color:#696969;}
.home_courses_list{ width:364px; margin-bottom:10px; }
.home_list_title{ max-width:260px; font-size:14px; font-weight:bold;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;}
.users_list{ }
.users_course_intro{ width:530px;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;}
/* 20150506上传头像*/
.uppicBox{ width:265px; height:265px; background:#f2f2f5; float:left; color:#666; text-align:center;}
.showpicBox{width:133px; height:250px; background:#f2f2f5; float:left; margin-left:20px; text-align:center; padding-top:15px; color:#666;}
.mr2{ margin-right:2px;}
.uppic_btn{border:none; width:150px; background:none; margin-bottom:5px; color:#666; margin-top:105px;}
/* 新建作品*/
.mr8{ margin-right:8px;}
.mt2{ margin-top:2px;}
.fans_sign{ width:560px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;}
.newhwork_div ul li{ margin-bottom:10px; font-size:14px; color:#666;}
.newhwork_div input,.newhwork_div select{ height:26px;border:1px solid #CCC; }
.newhwork_div textarea{border:1px solid #CCC;}
.w460{ width:460px;}
a.hidepic>img{display:none;}