Merge branch 'dev_bigdata' into dev_shixun_project

Conflicts:
	app/views/layouts/_footer.html.erb
	app/views/layouts/base_contest_community.html.erb
	app/views/layouts/base_contests.html.erb
	app/views/layouts/base_course_community.html.erb
	app/views/layouts/base_courses.html.erb
	app/views/layouts/base_project_community.html.erb
	app/views/layouts/new_base.html.erb
	app/views/layouts/new_base_user.html.erb
	db/schema.rb
	public/stylesheets/css/structure.css
	public/stylesheets/font/FontAwesome.otf
	public/stylesheets/font/fontawesome-webfont.eot
	public/stylesheets/font/fontawesome-webfont.svg
	public/stylesheets/font/fontawesome-webfont.ttf
	public/stylesheets/font/fontawesome-webfont.woff
	public/stylesheets/font2/FontAwesome.otf
	public/stylesheets/font2/fontawesome-webfont.eot
	public/stylesheets/font2/fontawesome-webfont.svg
	public/stylesheets/font2/fontawesome-webfont.ttf
	public/stylesheets/font2/fontawesome-webfont.woff
	public/stylesheets/fonts/FontAwesome.otf
	public/stylesheets/fonts/fontawesome-webfont.eot
	public/stylesheets/fonts/fontawesome-webfont.svg
	public/stylesheets/fonts/fontawesome-webfont.ttf
	public/stylesheets/fonts/fontawesome-webfont.woff
This commit is contained in:
cxt 2017-03-24 16:17:01 +08:00
commit e3150716f3
158 changed files with 2489 additions and 1451 deletions

View File

@ -4,9 +4,9 @@ unless RUBY_PLATFORM =~ /w32/
# unix-like only
gem 'iconv'
if RUBY_PLATFORM =~ /darwin/
# gem "rmagick", "= 2.15.4" ## osx must be this version
gem "rmagick", "= 2.15.4" ## osx must be this version
elsif RUBY_PLATFORM =~ /linux/
# gem "rmagick", "~> 2.13.1" ## centos yum install ImageMagick-devel
gem "rmagick", "~> 2.13.1" ## centos yum install ImageMagick-devel
end
gem 'certified'
gem 'net-ssh', '2.9.1'

View File

@ -1,3 +1,4 @@
#coding=utf-8
# Redmine - project management software
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
@ -148,7 +149,7 @@ class AccountController < ApplicationController
return
end
end
render :layout => 'static_base'
render :layout => 'login_bigdata'
end
end
@ -172,12 +173,17 @@ class AccountController < ApplicationController
end
else
us = UsersService.new
@user = us.register user_params.merge(:should_confirmation_password => true)
@user = us.register user_params.merge(:should_confirmation_password => false)
case Setting.self_registration
when '1'
#register_by_email_activation(@user)
unless @user.new_record?
redirect_to account_email_valid_path(:mail => @user.mail, :user_id => @user.id)
if params[:user][:mail]
redirect_to account_email_valid_path(:mail => @user.mail, :user_id => @user.id)
else
self.logged_user = @user
redirect_to my_account_url(:tip=>1)
end
# flash[:notice] = l(:notice_account_register_done)
# render action: 'email_valid', locals: {:mail => @user.mail}
end
@ -267,6 +273,13 @@ class AccountController < ApplicationController
req[:message] = faker.errors[:login]
end
if valid_attr.eql?('phone')
faker.phone = valid_value
faker.valid?
req[:valid] = faker.errors[:phone].blank?
req[:message] = ""
end
if valid_attr.eql?('mail')
faker.mail = valid_value
faker.valid?
@ -278,6 +291,135 @@ class AccountController < ApplicationController
render :json => req
end
# 手机号或邮箱是否已注册
def valid_register_user
req = Hash.new(false)
req[:message] = ''
valid_attr = params[:valid]
valid_value = params[:value]
if valid_attr.eql?('phone')
user = User.where(:phone => valid_value).first
req[:valid] = !user.nil?
req[:message] = user.nil? ? "该手机号未注册" : ""
elsif valid_attr.eql?('mail')
user = User.where(:mail => valid_value).first
req[:valid] = !user.nil?
req[:message] = user.nil? ? "该邮箱未注册" : ""
end
render :json => req
end
# 验证码是否有效
def valid_verification_code
req = Hash.new(false)
req[:valid] = false
type = params[:type].to_i
if type == 1 || type == 2 || params[:phone] =~ /^1\d{10}$/
code = VerificationCode.where(:phone => params[:phone], :code => params[:code], :code_type => (params[:type].to_i != 1 && params[:type].to_i != 2) ? 2 : params[:type].to_i ).last
else
code = VerificationCode.where(:email => params[:phone], :code => params[:code], :code_type => 3).last
end
req[:valid] = !code.nil? && (Time.now.to_i - code.created_at.to_i) <= 10*60
render :json => req
end
# 发送验证码type 1注册手机验证码 2找回密码手机验证码 3找回密码邮箱验证码
def get_verification_code
code = %W(0 1 2 3 4 5 6 7 8 9)
type = params[:type].to_i
req = Hash.new(false)
req[:status] = 0
if type == 1
if User.where(:phone => params[:value]).count > 0
req[:status] = 2
else
begin
verification_code = code.sample(6).join
status = Trustie::Sms.send(mobile: params[:value], code: verification_code)
if status
VerificationCode.create(:phone => params[:value], :status => 1, :code_type => 1, :code => verification_code)
end
rescue => e
Rails.logger.error "发送验证码出错: #{e}"
end
req[:status] = 1
end
else
if params[:value] =~ /^[a-zA-Z0-9]+([._\\]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/
if User.where(:mail => params[:value]).count == 0
req[:status] = 2
else
begin
verification_code = code.sample(6).join
user = User.where(:mail => params[:value]).first
token = Token.new(:user => user, :action => "recovery")
if token.save
Mailer.run.lost_password(token, verification_code)
VerificationCode.create(:email => params[:value], :status => 1, :code_type => 3, :code => verification_code)
end
rescue => e
Rails.logger.error "发送验证码出错: #{e}"
end
req[:status] = 3
req[:link] = params[:value].split("@")[1]
end
elsif params[:value] =~ /^1\d{10}$/
if User.where(:phone => params[:value]).count == 0
req[:status] = 2
else
begin
verification_code = code.sample(6).join
status = Trustie::Sms.send(mobile: params[:value], code: verification_code)
if status
VerificationCode.create(:phone => params[:value], :status => 1, :code_type => 2, :code => verification_code)
end
rescue => e
Rails.logger.error "发送验证码出错: #{e}"
end
req[:status] = 1
end
else
req[:status] = 2
end
end
render :json => req
end
def reset_psd
if request.get?
@user = User.where("phone = '#{params[:value]}' or mail = '#{params[:value]}'").first
if @user
respond_to do |format|
format.html { render :layout => "login_bigdata"}
end
else
redirect_to signin_path
return
end
else
@user = User.find params[:user]
if @user
@user.password, @user.password_confirmation = params[:new_password], params[:new_password_confirmation]
if @user.save
Token.where(:user_id => @user, :action => "recovery").destroy_all
respond_to do |format|
format.js
end
else
redirect_to signin_path
return
end
else
redirect_to signin_path
return
end
end
end
def email_valid
begin
@mail_type = params[:mail].split("@")[1]
@ -286,7 +428,7 @@ class AccountController < ApplicationController
return render_404
end
respond_to do |format|
format.html { render :layout => "base_mail"}
format.html { render :layout => "login_bigdata"}
format.js
end
end
@ -309,14 +451,13 @@ class AccountController < ApplicationController
def change_email
user = User.find params[:user_id].to_i
user.update_attributes(:mail => params[:value])
result = {:email => user.mail}
result = {:email => user.mail, :email_link => user.mail.split("@")[1]}
render :json => result
end
def email_activation
end
private
@ -456,7 +597,7 @@ class AccountController < ApplicationController
logger.warn "Failed login for '#{params[:username]}' from #{request.remote_ip} at #{Time.now.utc}"
# flash[:error] = l(:notice_account_invalid_creditentials_new)
# render signin_path(:login=>true)
render :action => 'email_activation'
render :action => 'email_activation',:layout => 'login_bigdata'
end
# Register a user for email activation.

View File

@ -475,7 +475,6 @@ class AdminController < ApplicationController
else
@limit = 15#per_page_option
end
@status = params[:status] || 1
scope = User.logged.status(@status)
scope = scope.like(params[:name],params[:search_by][:id]) if params[:name].present?
@ -483,8 +482,7 @@ class AdminController < ApplicationController
@user_pages = Paginator.new @user_count, @limit, params['page']
@user_base_tag = params[:id] ? 'base_users':'base'
@users = scope.offset(@user_pages.offset).limit(@user_pages.per_page)
@users = scope.order(sort_clause).offset(@user_pages.offset).limit(@user_pages.per_page).all
respond_to do |format|
format.html {
@groups = Group.all.sort

View File

@ -47,6 +47,8 @@ class AtController < ApplicationController
find_topic(id)
when 'JournalsForMessage'
find_journals_for_message(id)
when 'Journal'
find_journal(id)
when 'Principal'
find_principal(id)
when 'BlogComment'
@ -134,8 +136,14 @@ class AtController < ApplicationController
#Message
def find_message(id)
message = Message.find(id)
at_persons = message.board.messages.map(&:author)
(at_persons || []) + (find_project(message.board.project_id)||[])
if message.board.course_id.nil?
at_persons = message.board.messages.map(&:author)
(at_persons || []) + (find_project(message.board.project_id)||[])
else
type = 'Course'
course_id = message.board.course_id
find_at_users(type, course_id)
end
end
#News
@ -159,6 +167,12 @@ class AtController < ApplicationController
#Journal
def find_journal(id)
journal = Journal.find id
if journal.journalized_type == 'Issue'
issue_id = journal.issue.id
find_at_users(journal.journalized_type, issue_id)
end
end
#Document

View File

@ -310,7 +310,8 @@ class AttachmentsController < ApplicationController
@history.version = @old_history.nil? ? 1 : @old_history.version + 1
@history.save #历史记录保存完毕
#将最新保存的记录 数据替换到 需要修改的文件记录
@old_attachment.attributes = @attachment.attributes.dup.except("id","container_id","container_type","is_public","downloads", "quotes")
@old_attachment.attributes = @attachment.attributes.dup.except("id","container_id","container_type","is_public","downloads", "quotes",'is_publish','publish_time')
@status = @old_attachment.is_publish
# 如果附件描述被修改,则保存附件
unless params[:description] == @attachment.description
@old_attachment.description = params[:description]
@ -327,6 +328,14 @@ class AttachmentsController < ApplicationController
end
end
def update_attachment_publish_time
@attachment = Attachment.find params[:id]
@status = params[:status].to_i
if @status == 0
@attachment.update_attributes(:is_publish => 1, :publish_time => Time.now)
end
end
# prams[:type] => history 历史版本
def destroy
if params[:type] == "history"

View File

@ -31,6 +31,7 @@ class AvatarController < ApplicationController
end
end
size = @temp_file.size
if @temp_file && (@temp_file.size > 0)
if @temp_file.size > Setting.upload_avatar_max_size.to_i
@status = 1
@ -65,7 +66,11 @@ class AvatarController < ApplicationController
end
end
Trustie::Utils::Image.new(diskfile,true).compress(300)
if @source_type == 'Contest'
Trustie::Utils::Image.new(diskfile,true).compress(900)
else
Trustie::Utils::Image.new(diskfile,true).compress(300)
end
@status = 0
@msg = ''
else
@ -75,6 +80,15 @@ class AvatarController < ApplicationController
end
@temp_file = nil
sleep(3)
unless File.size(diskfile) < size
logger.info("###############################################################sleep")
sleep(0.5)
end
#@src_file = diskfile
respond_to do |format|
format.json{
render :inline => {status: @status, message:@msg, url:"#{@urlfile.to_s}?#{Time.now.to_i}"}.to_json,:content_type => 'text/html'

View File

@ -15,7 +15,7 @@ class ContestantWorksController < ApplicationController
def new
#更新消息
if @contestwork.work_status == 1
#if @contestwork.work_status == 1
noEvaluation = @contestwork.contest_messages.where("user_id =? and viewed =?", User.current.id, 0)
noEvaluation.update_all(:viewed => true)
@ -24,9 +24,9 @@ class ContestantWorksController < ApplicationController
respond_to do |format|
format.html{ render :layout => "base_contests"}
end
else
render_403
end
#else
# render_403
#end
end
def index

View File

@ -627,13 +627,14 @@ class CoursesController < ApplicationController
member = @course.members.find params[:member_id]
student_role = member.member_roles.where("role_id = 10").first
teacher_role = member.member_roles.where("role_id = 7 || role_id = 9").first
joined = StudentsForCourse.where('student_id = ? and course_id = ?', member.user_id,@course.id)
joined.destroy_all
if member && member.deletable? && student_role
user_admin = CourseInfos.where("user_id = ? and course_id = ?", member.user_id, @course.id)
if user_admin.size > 0
user_admin.destroy_all
end
joined = StudentsForCourse.where('student_id = ? and course_id = ?', member.user_id,@course.id)
joined.destroy_all
if member.member_roles.count > 1&& student_role && teacher_role
student_role.destroy

View File

@ -483,6 +483,7 @@ class ExerciseController < ApplicationController
end
end
=end
@name,@select_group = params[:name].to_s.strip || "",params[:group]
@is_teacher = User.current.allowed_to?(:as_teacher,@course) || User.current.admin?
if @is_teacher
@all_exercises = @course.exercises.order("created_at desc")
@ -490,17 +491,53 @@ class ExerciseController < ApplicationController
@all_exercises = @course.exercises.where("exercise_status > 1").order("created_at desc")
end
student_id = @course.student.blank? ? "(-1)" : "(" + @course.student.map{|student| student.student_id}.join(",") + ")"
@exercise_count = @exercise.exercise_users.where("commit_status = 1 and user_id in #{student_id}").count
if @is_teacher || (!@exercise.exercise_users.where("user_id = #{User.current.id} and user_id in #{student_id}").empty? && @exercise.end_time <= Time.now)
@exercise_users_list = @exercise.exercise_users.where("user_id in #{student_id}")
@show_all = true;
elsif !@exercise.exercise_users.where("user_id = #{User.current.id} and user_id in #{student_id}").empty? && @exercise.end_time > Time.now
@exercise_users_list = @exercise.exercise_users.where("user_id = ? and user_id in #{student_id}",User.current.id)
if @select_group
if @select_group == "0"
none_group_students = @course.members.select{ |member| member.course_group_id == 0 }
if none_group_students.empty?
student_in_group = '(0)'
else
student_in_group = '(' + none_group_students.map{ |member| member.user_id }.join(',') + ')'
end
elsif @select_group == "-1"
all_group_students = @course.members.select{ |member| member.course_group_id }
if all_group_students.empty?
student_in_group = '(0)'
else
student_in_group = '(' + all_group_students.map{ |member| member.user_id }.join(',') + ')'
end
else
course_group = CourseGroup.find_by_id(@select_group)
group_students = course_group.users
if group_students.empty?
student_in_group = '(0)'
else
student_in_group = '(' + group_students.map{ |user| user.id }.join(',') + ')'
end
end
if @is_teacher || (!@exercise.exercise_users.where("user_id = #{User.current.id}").empty? && @exercise.end_time <= Time.now)
@exercise_users_list = search_exercise_member @exercise.exercise_users.where("user_id in #{student_id} and user_id in #{student_in_group}"), @name
@show_all = true;
elsif !@exercise.exercise_users.where("user_id = #{User.current.id}").empty? && @exercise.end_time > Time.now
@exercise_users_list = search_exercise_member @exercise.exercise_users.where("user_id = ? and user_id in #{student_id} and user_id in #{student_in_group}",User.current.id), @name
else
@exercise_users_list = []
end
else
@exercise_users_list = []
if @is_teacher || (!@exercise.exercise_users.where("user_id = #{User.current.id}").empty? && @exercise.end_time <= Time.now)
@exercise_users_list = search_exercise_member @exercise.exercise_users.where("user_id in #{student_id}"), @name
@show_all = true;
elsif !@exercise.exercise_users.where("user_id = #{User.current.id}").empty? && @exercise.end_time > Time.now
@exercise_users_list = search_exercise_member @exercise.exercise_users.where("user_id = ? and user_id in #{student_id}",User.current.id), @name
else
@exercise_users_list = []
end
end
@exercise_count = @exercise.exercise_users.where("commit_status = 1 and user_id in #{student_id}").count
@left_nav_type = 8
respond_to do |format|
format.js
format.html
format.xls {
filename = "#{@course.teacher.lastname.to_s + @course.teacher.firstname}_#{@course.name}_#{@course.time.to_s + @course.term}_#{@exercise.exercise_name}#{l(:excel_exercise_list)}.xls"
@ -654,6 +691,10 @@ class ExerciseController < ApplicationController
# 更新提交状态
cur_exercise_user = ExerciseUser.where("user_id =? and exercise_id=?", User.current, @exercise.id).first
cur_exercise_user.update_attributes(:status => 1, :commit_status => 1)
if @exercise.time && @exercise.time != -1
score = calculate_student_score(@exercise, User.current)
cur_exercise_user.update_attributes(:score => score)
end
# 答题过程中需要统计完成量
#@uncomplete_question = get_uncomplete_question(@exercise, User.current)
# 获取改学生的考试得分
@ -889,6 +930,19 @@ class ExerciseController < ApplicationController
xls_report.string
end
#根据条件过滤作业结果
def search_exercise_member exercises,name
if name == ""
select_exercises = exercises
else
name = name.downcase
select_exercises = exercises.select{ |exercise|
exercise.user[:login].to_s.downcase.include?(name) || exercise.user.user_extensions[:student_id].to_s.downcase.include?(name) || (exercise.user[:lastname].to_s.downcase + exercise.user[:firstname].to_s.downcase).include?(name)
}
end
select_exercises
end
# ExerciseUser记录用户是否已提交问卷有对应的记录则已提交没有则新建一个
def get_exercise_user exercise_id,user_id
eu = ExerciseUser.find_by_exercise_id_and_user_id(exercise_id,user_id)

View File

@ -121,7 +121,7 @@ class ForumsController < ApplicationController
order = ""
@order_str = ""
if(params[:reorder_complex])
order = " last_replies_memos.created_at #{params[:reorder_complex]}, #{Memo.table_name}.created_at #{params[:reorder_complex]}"
order = "replies_count #{params[:reorder_complex]}, #{Memo.table_name}.created_at #{params[:reorder_complex]}"
@order_str = "reorder_complex="+params[:reorder_complex]
elsif(params[:reorder_popu])
order = "replies_count #{params[:reorder_popu]}"
@ -166,16 +166,16 @@ class ForumsController < ApplicationController
order = ""
@order_str = ""
if(params[:reorder_complex])
order = " last_replies_memos.created_at #{params[:reorder_complex]}, #{Memo.table_name}.created_at #{params[:reorder_complex]}"
order = "#{Memo.table_name}.sticky desc, last_replies_memos.created_at #{params[:reorder_complex]}, #{Memo.table_name}.created_at #{params[:reorder_complex]}"
@order_str = "reorder_complex="+params[:reorder_complex]
elsif(params[:reorder_popu])
order = "replies_count #{params[:reorder_popu]}"
order = "#{Memo.table_name}.sticky desc, replies_count #{params[:reorder_popu]}"
@order_str = "reorder_popu="+params[:reorder_popu]
elsif(params[:reorder_time])
order = "#{Memo.table_name}.updated_at #{params[:reorder_time]}"
order = "#{Memo.table_name}.sticky desc, #{Memo.table_name}.updated_at #{params[:reorder_time]}"
@order_str = "reorder_time="+params[:reorder_time]
else
order = "#{Memo.table_name}.updated_at desc"
order = "#{Memo.table_name}.sticky desc, #{Memo.table_name}.updated_at desc"
@order_str = "reorder_time=desc"
end
@memo = Memo.new(:forum => @forum)

View File

@ -156,7 +156,7 @@ class HomeworkCommonController < ApplicationController
eval_start = homework_detail_manual.evaluation_start
if eval_start.nil? || (Time.parse(eval_start.to_s) <= @homework.end_time && homework_detail_manual.comment_status <= 1)
homework_detail_manual.evaluation_start = @homework.end_time + 7
homework_detail_manual.evaluation_start = (@homework.end_time + 7*24*60*60).strftime("%Y-%m-%d")
homework_detail_manual.evaluation_end = homework_detail_manual.evaluation_start + 7
end
end

View File

@ -50,6 +50,8 @@ class MemosController < ApplicationController
@memo = Memo.new(params[:memo])
@memo.forum_id = @forum.id
@memo.author_id = User.current.id
# 问吧置顶sticky:1 置顶0不置顶
@memo.sticky = params[:memo][:sticky].to_i
if params[:memo][:parent_id]
@memo.root_id = (Memo.find params[:memo][:parent_id]).root_id.nil? ? params[:memo][:parent_id].to_i : (Memo.find params[:memo][:parent_id]).root_id
@ -189,6 +191,14 @@ class MemosController < ApplicationController
end
end
#置顶功能
def change_sticky
@memo.sticky ? @memo.update_attribute(:sticky, false) : @memo.update_attribute(:sticky, true)
respond_to do |format|
format.html { redirect_to forum_memo_path(@memo.forum, @memo) }
end
end
private
def find_memo

View File

@ -57,6 +57,9 @@ class MessagesController < ApplicationController
@replies = @replies[@page * @limit..@page * @limit + 9]
@reply = Message.new(:subject => "RE: #{@message.subject}")
if @course
#帖子消息状态更新
course_messages = CourseMessage.where("user_id =? and course_message_type =? and course_message_id =? and course_id =? and viewed =?", User.current.id, 'Message', @topic.id, @course.id, 0)
course_messages.update_all(:viewed => true)
#@replies = @topic.children.
#includes(:author, :attachments, :praise_tread_cache, {:board => :project}).
#reorder("#{Message.table_name}.created_on DESC").
@ -64,6 +67,11 @@ class MessagesController < ApplicationController
#offset(@reply_pages.offset).
#all
#@replies = paginateHelper messages_replies,10
# 班级帖子回复消息设为已读
@replies.each do |comment|
course_message = CourseMessage.where(:course_message_type => 'Message', :course_message_id => comment.id, :user_id => User.current.id, :viewed => 0)
course_message.update_all(:viewed => 1)
end
@left_nav_type = 2
respond_to do |format|
format.js
@ -71,6 +79,9 @@ class MessagesController < ApplicationController
end
#render :action => "show", :layout => "base_courses"#by young
elsif @project
#帖子消息状态更新
project_messages = ForgeMessage.where("user_id =? and forge_message_type =? and forge_message_id =? and project_id =? and viewed =?", User.current.id, 'Message', @topic.id, @project.id, 0)
project_messages.update_all(:viewed => true)
#@reply_pages = Paginator.new @reply_count, REPLIES_PER_PAGE, page
# @replies = @topic.children.
# includes(:author, :attachments, {:board => :project}).
@ -78,11 +89,25 @@ class MessagesController < ApplicationController
# limit(@reply_pages.per_page).
# offset(@reply_pages.offset).
# all
# 项目帖子回复消息设为已读
@replies.each do |comment|
project_message = ForgeMessage.where(:forge_message_type => 'Message', :forge_message_id => comment.id, :user_id => User.current.id, :viewed => 0)
project_message.update_all(:viewed => 1)
end
respond_to do |format|
format.js
format.html {render :layout => 'base_projects'}
end
elsif @contest
#帖子消息状态更新
contest_messages = ContestMessage.where("user_id =? and contest_message_type =? and contest_message_id =? and contest_id =? and viewed =?", User.current.id, 'Message', @topic.id, @contest.id, 0)
contest_messages.update_all(:viewed => true)
# 竞赛帖子回复消息设为已读
@replies.each do |comment|
contest_message = ContestMessage.where(:contest_message_type => 'Message', :contest_message_id => comment.id, :user_id => User.current.id, :viewed => 0)
contest_message.update_all(:viewed => 1)
end
@left_nav_type = 4
respond_to do |format|
format.js
@ -187,13 +212,15 @@ class MessagesController < ApplicationController
# @reply.reply_id = params[:id]
parent.children << @reply
else
@quote = params[:quote][:quote]
#@quote = params[:quote][:quote]
@reply = Message.new
@reply.author = User.current
@reply.board = @board
@reply.subject = @topic.subject
@reply.content = params[:content]
@reply.safe_attributes = params[:reply]
@reply.content = @quote + @reply.content
@reply.subject = "RE: #{@topic.subject}" unless params[:reply][:subject]
#@reply.content = @quote + @reply.content
#@reply.subject = "RE: #{@topic.subject}" unless params[:reply][:subject]
@reply.root_id = @topic.id
@topic.children << @reply
# @reply.reply_id = params[:id]

View File

@ -636,7 +636,7 @@ class OrganizationsController < ApplicationController
end
def apply_subdomain
organization = Organization.find(params[:id])
@applied_message_count = AppliedMessage.where(:applied_id => organization.id, :name => params[:domain].downcase, :status => 1).count
@applied_message_count = AppliedMessage.where(:applied_id => organization.id, :name => params[:domain].downcase, :status => 0).count
# 如果申请过该名字,怎不能重复申请
if @applied_message_count > 0
@flag = 1
@ -670,7 +670,7 @@ class OrganizationsController < ApplicationController
end
# 自己处理自己的消息则不需要另外发送消息
if User.current.id != @applied_message.applied_user_id
AppliedMessage.create(:user_id => @applied_message.applied_user_id, :applied_id => organization_id, :applied_type => 'Organization', :viewed => 0, :satus => 2, :applied_user_id => User.current.id, :name => org_domain.downcase)
OrgMessage.create(:user_id => params[:user_id], :organization_id => organization_id, :message_type => 'AgreeApplySubdomain', :message_id => organization_id, :sender_id => User.current.id, :viewed => 0, :content => params[:org_domain])
end
@applied_message.status = 2
@applied_message.updated_at = Time.now
@ -696,7 +696,7 @@ class OrganizationsController < ApplicationController
applied_messages.update_all(:status => 4, :viewed => true, :updated_at => Time.now)
# 自己处理自己的消息则不需要另外发送消息
if User.current.id != @applied_message.applied_user_id
AppliedMessage.create(:user_id => @applied_message.applied_user_id, :applied_id => organization_id, :applied_type => 'Organization', :viewed => 0, :satus => 4, :applied_user_id => User.current.id, :name => org_domain.downcase)
OrgMessage.create(:user_id => params[:user_id], :organization_id => organization_id, :message_type => 'DisagreeApplySubdomain', :message_id => organization_id, :sender_id => User.current.id, :viewed => 0, :content => params[:org_domain])
end
@applied_message.status = 4
@applied_message.updated_at = Time.now

View File

@ -33,7 +33,8 @@ class ProjectsController < ApplicationController
:view_homework_attaches,:join_project, :project_home, :training_execute, :training_task_status]
before_filter :authorize, :only => [:show, :settings, :edit, :sort_project_members, :update, :modules, :close, :reopen,:view_homework_attaches,:course]
before_filter :authorize_global, :only => [:new, :create,:view_homework_attaches]
before_filter :require_admin, :only => [ :copy, :unarchive, :destroy, :calendar]
before_filter :require_admin, :only => [ :copy, :unarchive, :calendar]
before_filter :require_admin_or_manager, :only => [ :destroy]
before_filter :file
@ -211,6 +212,12 @@ class ProjectsController < ApplicationController
@trackers = Tracker.sorted.all
@project = Project.new
@project.safe_attributes = params[:project]
if params[:course_id]
@course = Course.find params[:course_id]
elsif params[:contest_id]
@contest = Contest.find params[:contest_id]
end
render :layout => 'new_base'
else
redirect_to signin_url
@ -793,7 +800,7 @@ class ProjectsController < ApplicationController
GITLABTYPE = "Repository::Gitlab"
def archive
if request.post?
if @project.archive && @project.gpid
if @project.destroy && @project.gpid
# 删除版本库信息
begin
g = Gitlab.client
@ -1103,36 +1110,52 @@ class ProjectsController < ApplicationController
redirect_to project_url(@project)
end
REP_TYPE = "Repository::Gitlab"
# Delete @project
def destroy
@project_to_destroy = @project
@project_to_destroy.destroy
ActiveRecord::Base.transaction do
g = Gitlab.client
g.delete_project(@project.gpid)
# 删除Trustie版本库记录
repoisitory = Repository.where(:project_id => @project.id, :type => GITLABTYPE).first
repoisitory.delete
@project.update_column(:gpid, nil)
@project.update_column(:forked_from_project_id, nil)
@project_to_destroy = @project
@project_to_destroy.destroy
end
respond_to do |format|
format.html { redirect_to admin_projects_url }
format.api { render_api_ok }
if params[:type] == "project"
format.html{redirect_to user_path(User.current)}
else
format.html{redirect_to admin_projects_url(:status => params[:status])}
end
end
# hide project in layout
@project = nil
end
REP_TYPE = "Repository::Gitlab"
# Delete @project's repository
def destroy_repository
if is_project_manager?(User.current.id, @project.id)
@gitlab_repository = Repository.where(:project_id => @project, :type => REP_TYPE).first
@is_true = params[:is_true]
if @is_true
unless @is_true.nil?
begin
g = Gitlab.client
g.delete_project(@project.gpid)
@gitlab_repository.destroy
@gitlab_repository = nil
scm = params[:repository_scm] || (Redmine::Scm::Base.all & Setting.enabled_scm).first
@repository = Repository.factory(scm)
@repository.is_default = @project.repository.nil?
@project.update_attribute(:gpid, nil)
d_project = g.delete_project(@project.gpid)
if d_project
@gitlab_repository.destroy
@project.update_attribute(:gpid, nil)
@gitlab_repository = nil
end
rescue Exception => e
puts e
if @gitlab_repository
@gitlab_repository.destroy
@project.update_attribute(:gpid, nil)
@gitlab_repository = nil
end
end
end
else
@ -1294,6 +1317,13 @@ class ProjectsController < ApplicationController
return projects
end
#gcmend
def require_admin_or_manager
return unless require_login
if !(User.current.admin? || User.current.manager_of_project?(@project.id))
render_403
return false
end
true
end
end

View File

@ -160,7 +160,7 @@ class StudentWorkController < ApplicationController
student_work.name = params[:title]
student_work.description = params[:src]
if @homework.end_time < Time.now.to_s
if !is_test && @homework.end_time < Time.now.to_s
student_work.late_penalty = @homework.late_penalty
else
student_work.late_penalty = 0
@ -954,6 +954,9 @@ class StudentWorkController < ApplicationController
render_attachment_warning_if_needed(@new_score)
if @new_score.save
if @work.re_commit && @new_score.reviewer_role != 3
@work.re_commit = 0
end
if @homework.homework_type == 3
@is_group_leader = !@work.student_work_projects.empty?
end
@ -1314,29 +1317,43 @@ class StudentWorkController < ApplicationController
end
def forbidden_anonymous_comment
@homework.update_column('anonymous_comment', @homework.anonymous_comment == 0 ? 1 : 0)
homework_detail_manual = @homework.homework_detail_manual
homework_detail_programing = @homework.homework_detail_programing
if @homework.anonymous_comment == 1
homework_detail_manual.ta_proportion = @homework.homework_type == 2 ? 0.4 : 1.0
else
homework_detail_manual.ta_proportion = @homework.homework_type == 2 ? 0.3 : 0.6
end
if @homework.homework_type == 2 && homework_detail_programing
if homework_detail_manual.comment_status != 0
@homework.update_column('anonymous_comment', @homework.anonymous_comment == 0 ? 1 : 0)
homework_detail_programing = @homework.homework_detail_programing
if @homework.anonymous_comment == 1
homework_detail_programing.ta_proportion = 0.6
homework_detail_manual.ta_proportion = @homework.homework_type == 2 ? 0.4 : 1.0
@status = 1
else
homework_detail_programing.ta_proportion = 0.5
if @homework.end_time < Time.now
homework_detail_manual.evaluation_start = (Time.now + 7*24*60*60).strftime("%Y-%m-%d")
homework_detail_manual.evaluation_end = homework_detail_manual.evaluation_start + 7
@status = 2
else
homework_detail_manual.evaluation_start = (@homework.end_time + 7*24*60*60).strftime("%Y-%m-%d")
homework_detail_manual.evaluation_end = homework_detail_manual.evaluation_start + 7
@status = 3
end
homework_detail_manual.ta_proportion = @homework.homework_type == 2 ? 0.3 : 0.6
end
if @homework.homework_type == 2 && homework_detail_programing
if @homework.anonymous_comment == 1
homework_detail_programing.ta_proportion = 0.6
else
homework_detail_programing.ta_proportion = 0.5
end
end
homework_detail_manual.save
homework_detail_programing.save if homework_detail_programing
@homework.student_works.each do |student_work|
set_final_score @homework,student_work
student_work.save
end
@user_activity_id = params[:user_activity_id].to_i
@hw_status = params[:hw_status].to_i
else
@status = 0
end
homework_detail_manual.save
homework_detail_programing.save if homework_detail_programing
@homework.student_works.each do |student_work|
set_final_score @homework,student_work
student_work.save
end
@user_activity_id = params[:user_activity_id].to_i
@hw_status = params[:hw_status].to_i
end
def revise_attachment
@ -1351,6 +1368,7 @@ class StudentWorkController < ApplicationController
student_work = StudentWork.find attachment.container_id
CourseMessage.create(:user_id => student_work.homework_common.user_id, :course_id => student_work.homework_common.course_id, :viewed => false,:course_message_id=>attachment.container_id,:course_message_type=>'StudentWork',:status=>2)
end
@work.update_attributes(:re_commit => 1)
respond_to do |format|
format.js
end

View File

@ -1436,8 +1436,8 @@ class UsersController < ApplicationController
end
end
homework_detail_manual.evaluation_start = homework.end_time + 7 if homework.end_time
homework_detail_manual.evaluation_end = homework.end_time + 14 if homework.end_time
homework_detail_manual.evaluation_start = (homework.end_time + 7*24*60*60).strftime("%Y-%m-%d") if homework.end_time
homework_detail_manual.evaluation_end = homework_detail_manual.evaluation_start + 7 if homework.end_time
homework_detail_manual.evaluation_num = params[:evaluation_num] || 3
homework_detail_manual.absence_penalty = 0
homework.homework_detail_manual = homework_detail_manual
@ -2089,6 +2089,8 @@ class UsersController < ApplicationController
def show
if User.current == @user
# 点击小铃铛,更新点击时间
update_onclick_time if params[:click_user_message] == 'true'
# 全部设为已读
# 自己的主页显示消息
messages_all = MessageAll.where(:user_id => @user.id)

View File

@ -202,6 +202,7 @@ class VersionsController < ApplicationController
@is_setting = params[:is_setting]
@is_create = params[:is_create]
@is_index = params[:is_index]
@version_id = params[:id]
end
def update
@ -276,10 +277,11 @@ class VersionsController < ApplicationController
end
# 判断里程碑是否重名
# 项目内的里程碑不能重名,项目之间的里程碑能重名
def judge_version_title
begin
version = Version.where(:name => params[:version_name], :project_id => @project.id).first
if version.blank?
if version.blank? || version.id == params[:version_id].to_i
result = {:result => true}
else
result = {:result => false}

View File

@ -6,7 +6,7 @@ class ZipdownController < ApplicationController
#检查权限
#勿删 before_filter :authorize, :only => [:assort,:download_user_homework]
## 200M
MAX_DOWN_SIZE = 200 * 1024 * 1024
MAX_DOWN_SIZE = 500 * 1024 * 1024
include ZipService
@ -32,7 +32,7 @@ class ZipdownController < ApplicationController
def assort
if params[:obj_class] == "Bid"
bid = Bid.find params[:obj_id]
render_403 if User.current.allowed_to?(:as_teacher,bid.courses.first)
#render_403 if User.current.allowed_to?(:as_teacher,bid.courses.first)
zipfile = checkfileSize(bid.homeworks) {
zip_bid bid
}

View File

@ -2615,7 +2615,7 @@ module ApplicationHelper
if attachment.container
if attachment.container.class.to_s=="PhoneAppVersion"
candown = true
elsif attachment.container.class.to_s != "HomeworkAttach" && attachment.container.class.to_s != "StudentWork" && (attachment.container.has_attribute?(:project) || attachment.container.has_attribute?(:project_id)) && attachment.container.project
elsif attachment.container.class.to_s != "HomeworkAttach" && attachment.container.class.to_s != "StudentWork" && attachment.container.class.to_s != "ContestantWork" && (attachment.container.has_attribute?(:project) || attachment.container.has_attribute?(:project_id)) && attachment.container.project
project = attachment.container.project
candown= User.current.member_of?(project) || (project.is_public && attachment.is_public == 1)
elsif attachment.container.is_a?(Project)
@ -2689,7 +2689,8 @@ module ApplicationHelper
#如果学生作品被打分后修改,应该给老师提示
def send_message_to_teacher student_work
if StudentWork === student_work
if student_work.student_works_scores.any?
if student_work.student_works_scores.where("reviewer_role != 3").any?
student_work.update_column('re_commit', 1)
course = student_work.homework_common.course
course.members.map(&:user_id).uniq.each do|user_id|
if User.find(user_id).allowed_to?(:as_teacher, course)
@ -3302,7 +3303,7 @@ module ApplicationHelper
def user_for_contest_work homework,is_contestant,work
count = homework.contestant_works.has_committed.count
if User.current.logged?
if User.current.member_of_contest?(homework.contest)
if User.current.member_of_contest?(homework.contest) || User.current.admin?
if !is_contestant #老师显示作品数量
link_to "作品(#{count})", contestant_works_path(:work =>homework.id, :tab => 2), :class => "c_blue"
else #学生显示提交作品、修改作品等按钮
@ -3314,6 +3315,12 @@ module ApplicationHelper
else
link_to "提交作品(#{count})", new_contestant_work_path(:work => homework.id),:class => 'c_blue'
end
elsif work.nil? && homework.work_status > 1
if homework.work_type ==3 && project.nil? && homework.work_detail_group.base_on_project
link_to "补交作品(#{count})","javascript:void(0)", :class => 'c_grey',:style=>"cursor:not-allowed",:title => '请先关联项目再补交作品'
else
link_to "补交作品(#{count})", new_contestant_work_path(:work => homework.id),:class => 'c_blue'
end
else
if homework.work_status == 1 && work.user_id == User.current.id
link_to "修改作品(#{count})", edit_contestant_work_path(work.id),:class => 'c_blue'

View File

@ -1,7 +1,7 @@
#encoding: utf-8
module ContestantWorksHelper
def get_status status
def get_contest_new_status status
str = ""
case status
when 0

View File

@ -56,15 +56,19 @@ module StudentWorkHelper
result
end
def get_status status
def get_status status, re_commit
str = ""
case status
when 0
str = "未提交"
when 1
str = "已提交"
when 2
str = "迟交"
if re_commit
str = "重新提交"
else
case status
when 0
str = "未提交"
when 1
str = "已提交"
when 2
str = "迟交"
end
end
str
end

View File

@ -3,7 +3,7 @@ class BidingProject < ActiveRecord::Base
attr_accessible :bid_id, :project_id, :user_id, :description,:reward
belongs_to :bid
belongs_to :project
# belongs_to :project
belongs_to :user
DESCRIPTION_LENGTH_LIMIT = 500

View File

@ -111,8 +111,9 @@ class HomeworkCommon < ActiveRecord::Base
#作业微信通知delay
def send_homework_wechat_message_delay
self.course.members.each do |m|
# if m.user_id != self.user_id
#self.course_messages << CourseMessage.new(:user_id => m.user_id, :course_id => self.course_id, :viewed => false)
if m.user_id != self.user_id
self.course_messages << CourseMessage.new(:user_id => m.user_id, :course_id => self.course_id, :viewed => false)
end
rolesids = []
m.roles.each do |role|
rolesids << role.id

View File

@ -837,10 +837,11 @@ class Mailer < ActionMailer::Base
:subject => l(:mail_subject_register, Setting.app_title)
end
def lost_password(token)
def lost_password(token, code="111111")
set_language_if_valid(token.user.language)
@login = token.user.try(:login)
@token = token
@url = url_for(:controller => 'account', :action => 'lost_password', :token => token.value)
@code = code
mail :to => token.user.mail,
:subject => l(:mail_subject_lost_password, Setting.app_title)
end

View File

@ -69,7 +69,7 @@ class News < ActiveRecord::Base
:author_key => :author_id
acts_as_watchable
after_create :act_as_course_activity, :add_author_as_watcher, :add_news_count, :act_as_student_score,:delay_news_wechat_send, :delay_news_send, :act_as_contest_message
after_create :act_as_course_activity, :add_author_as_watcher, :add_news_count, :act_as_student_score,:delay_news_wechat_send, :delay_news_send
after_update :update_activity
after_destroy :delete_kindeditor_assets, :decrease_news_count, :delete_org_activities, :down_course_score
@ -230,13 +230,13 @@ class News < ActiveRecord::Base
end
def act_as_contest_message
if self.contest_id
self.contest.contest_members.each do | m|
if m.user_id != self.author_id
self.contest_messages << ContestMessage.new(:user_id => m.user_id, :contest_id => self.contest_id, :viewed => false)
end
end
end
# if self.contest_id
# self.contest.contest_members.each do | m|
# if m.user_id != self.author_id
# self.contest_messages << ContestMessage.new(:user_id => m.user_id, :contest_id => self.contest_id, :viewed => false)
# end
# end
# end
end
def delay_news_send
@ -265,7 +265,7 @@ class News < ActiveRecord::Base
vs = []
self.contest.contest_members.each do | m|
if m.user_id != self.author_id
vs << {contest_message_type:'Contest',contest_message_id:self.id, :user_id => m.user_id,
vs << {contest_message_type:'News',contest_message_id:self.id, :user_id => m.user_id,
:contest_id => self.contest_id, :viewed => false}
if vs.size >= 30

View File

@ -70,8 +70,8 @@ class Project < ActiveRecord::Base
has_many :repositories, :dependent => :destroy, conditions: "hidden=false"
has_many :changesets, :through => :repository
#added by xianbo for delete biding_project
has_many :biding_projects, :dependent => :destroy
has_many :contesting_projects, :dependent => :destroy
# has_many :biding_projects, :dependent => :destroy
# has_many :contesting_projects, :dependent => :destroy
has_many :softapplications, :through => :projecting_softapplications
#ended by xianbo
# added by fq

View File

@ -1,6 +1,6 @@
#学生提交作品表 #work_status :0 未提交 1 已提交 2 迟交 3 分组作品复制的组员作品
class StudentWork < ActiveRecord::Base
attr_accessible :name, :description, :homework_common_id, :user_id, :final_score, :teacher_score, :student_score, :teaching_asistant_score, :system_score, :work_score, :project_id, :is_test, :simi_id, :simi_value, :work_status, :commit_time, :late_penalty, :absence_penalty
attr_accessible :name, :description, :homework_common_id, :user_id, :final_score, :teacher_score, :student_score, :teaching_asistant_score, :system_score, :work_score, :project_id, :is_test, :simi_id, :simi_value, :work_status, :commit_time, :late_penalty, :absence_penalty, :re_commit
belongs_to :homework_common
belongs_to :user

View File

@ -247,7 +247,8 @@ class User < Principal
LOGIN_LENGTH_LIMIT = 30
MAIL_LENGTH_LIMIT = 60
validates_presence_of :login, :mail, :if => Proc.new { |user| !user.is_a?(AnonymousUser) }
#validates_presence_of :login, :mail, :if => Proc.new { |user| !user.is_a?(AnonymousUser) }
validates_presence_of :login, :if => Proc.new { |user| !user.is_a?(AnonymousUser) }
validates_uniqueness_of :login, :if => Proc.new { |user| user.login_changed? && user.login.present? }, :case_sensitive => false
validates_uniqueness_of :mail, :if => Proc.new { |user| user.mail_changed? && user.mail.present? }, :case_sensitive => false
# Login must contain letters, numbers, underscores only
@ -405,7 +406,8 @@ class User < Principal
end
user = User.current
onclick_time = user.onclick_time.onclick_time
course_count = CourseMessage.where("user_id =? and viewed =? and created_at >?", user.id, 0, onclick_time).count
delete_courses = Course.where(:is_delete => 1).blank? ? "(-1)" : "(" + Course.where(:is_delete => 1).map(&:id).join(",") + ")"
course_count = CourseMessage.where("user_id =? and viewed =? and created_at >? and course_id not in #{delete_courses}", user.id, 0, onclick_time).count
contest_count = ContestMessage.where("user_id =? and viewed =? and created_at >?", user.id, 0, onclick_time).count
forge_count = ForgeMessage.where("user_id =? and viewed =? and created_at >?", user.id, 0, onclick_time).count
user_feedback_count = UserFeedbackMessage.where("user_id =? and viewed =? and created_at >?", user.id, 0, onclick_time).count
@ -536,6 +538,7 @@ class User < Principal
end
VALID_EMAIL_REGEX = /\A[\w+\-.]+@[a-z\d\-]+(\.[a-z]+)*\.[a-z]+\z/i
VALID_PHONE_REGEX = /^1\d{10}$/
# VALID_EMAIL_REGEX = /^[0-9a-zA-Z_-]+@[0-9a-zA-Z_-]+(\.[0-9a-zA-Z_-]+)+$/
# Returns the user that matches provided login and password, or nil
#登录,返回用户名与密码匹配的用户
@ -547,6 +550,8 @@ class User < Principal
return nil if login.empty? || password.empty?
if (login =~ VALID_EMAIL_REGEX)
user = find_by_mail(login)
elsif (login =~ VALID_PHONE_REGEX)
user = find_by_phone(login)
else
user = find_by_login(login)
end
@ -780,6 +785,10 @@ class User < Principal
where("LOWER(mail) = ?", mail.to_s.downcase).first
end
def self.find_by_phone(phone)
where("phone = ?", phone).first
end
# Returns true if the default admin account can no longer be used
def self.default_admin_account_changed?
!User.active.find_by_login("admin").try(:check_password?, "admin")
@ -943,6 +952,15 @@ class User < Principal
end
end
def manager_of_project?(project_id)
@result = false
mem = Member.where("user_id = ? and project_id = ?", self.id, project_id)
unless mem.blank?
@result = mem.first.roles.to_s.include?("Manager") ? true : false
end
return @result
end
# 判断是否是竞赛的主办人
def admin_of_contest?(contest)
if contest.nil?

View File

@ -0,0 +1,5 @@
class VerificationCode < ActiveRecord::Base
#status发送状态
#code_type发送类型1 手机注册 2 手机找回密码 3 邮箱找回密码
attr_accessible :code, :code_type, :email, :phone, :status
end

View File

@ -24,18 +24,34 @@ class ContestsService
if params[:invite_code].present?
role_ids = params[:role]
#如果已经发送过消息了,那么就要给个提示
if AppliedContest.where(:contest_id => contest.id, :user_id => current_user.id, :status => 0).count != 0
@state = 7
else
if role_ids.size == 1
AppliedContest.create(:contest_id => contest.id, :user_id => current_user.id, :role => role_ids[0], :status => 0)
else
role_ids.each do |role_id|
AppliedContest.create(:contest_id => contest.id, :user_id => current_user.id, :role => role_id, :status => 0)
end
if role_ids.include?("15")
member = ContestMember.new(:user_id => current_user.id)
contest.contest_members << member
contest_member_roles = member.contest_member_roles
contest_member_roles << ContestMemberRole.new(:role_id => 15)
ContestantForContest.create(:student_id => current_user.id, :contest_id => contest.id)
# 给管理员发消息
admins = contest_managers contest
admins.each do |member|
course_join = ContestMessage.new(:user_id =>member.user_id, :contest_message_id=>current_user.id,:contest_id => contest.id,:contest_message_type=>"JoinContest", :content => role_ids, :viewed => false, :status => 2)
course_join.save
end
@state = 0
else
#如果已经发送过消息了,那么就要给个提示
if AppliedContest.where(:contest_id => contest.id, :user_id => current_user.id, :status => 0).count != 0
@state = 7
else
if role_ids.size == 1
AppliedContest.create(:contest_id => contest.id, :user_id => current_user.id, :role => role_ids[0], :status => 0)
else
role_ids.each do |role_id|
AppliedContest.create(:contest_id => contest.id, :user_id => current_user.id, :role => role_id, :status => 0)
end
end
@state = 6
end
@state = 6
end
else
@state = 1

View File

@ -10,14 +10,24 @@ class UsersService
#参数约定
#成功返回注册后的User实例失败直接抛异常
# 生成邀请码
CODES = %W(0 1 2 3 4 5 6 7 8 9)
def generate_user_login type
code = CODES.sample(8).join
code = type + code.to_s
return generate_user_login(type) if User.where(login: code).present?
code
end
def register(params)
@user = User.new
@user.admin = false
@user.register
@user.login = params[:login]
@user.login = generate_user_login params[:mail] ? 'm' : (params[:phone] ? 'p' : 'w')
@user.mail = params[:mail]
password = params[:password]
password_confirmation = params[:password_confirmation]
@user.phone = params[:phone]
password = params[:password] || params[:mail_password]
password_confirmation = params[:password] || params[:mail_password]
should_confirmation_password = params[:should_confirmation_password]
if !password.blank? && !password_confirmation.blank? && should_confirmation_password
@user.password, @user.password_confirmation = password, password_confirmation
@ -26,13 +36,17 @@ class UsersService
else
@user.password = ""
end
case Setting.self_registration
when '1'
@user = email_activation_register(@user)
when '3'
@user = automatically_register(@user)
else
@user = administrator_manually__register(@user)
if params[:mail]
case Setting.self_registration
when '1'
@user = email_activation_register(@user)
when '3'
@user = automatically_register(@user)
else
@user = administrator_manually__register(@user)
end
else
@user = automatically_register(@user)
end
if @user.id != nil
ue = @user.user_extensions ||= UserExtensions.new

View File

@ -0,0 +1,12 @@
<div class="task-popup" style="width: 550px;">
<div class=" task-popup-title clearfix">
<h3 class="fl color-grey">提示</h3>
<a href="<%= signin_path %>"><i class="fa fa-times-circle font-18 link-color-grey fr mt5"></i></a>
</div>
<div class="task-popup-content">
<p class="task-popup-text-center font-16">您已经成功设置密码,请使用新密码登录!</p>
</div>
<div class="task-popup-submit clearfix inner-t-c">
<a href="<%= signin_path %>" class="task-btn task-btn-green">确定</a>
</div>
</div>

View File

@ -1,90 +1,63 @@
<div class="new_content">
<div class="email_verify">
<p class="email_verify_prompt"><span class="icons_email_prompt"></span>您的账号尚未激活,请先进入您的注册邮箱(<span class="c_red" id="user_email_show"><%= @user.mail %></span>),激活您的账号。</p>
<button class="email_verify_btn mt30 ml30" onclick = "resendMail('<%= resendmail_path(@user) %>','<%= @user.id %>');">重新发送激活邮件</button>
<%#= link_to l(:label_mail_resend), { :controller => 'account', :action => 'resendmail',:user => @user}, :class=>"email_verify_btn mt30 ml30", :remote => true, :method => 'get' %>
<ul class="email_prompt_txt ml30 mt30" style="width:580px;margin-bottom: 20px">
<p class="email_prompt_p">如果您尚未收到激活邮件,请按照以下步骤操作:</p>
<li>检查邮箱的“订阅邮件”、“垃圾邮件”,可能会发现激活邮件。 </li>
<li>如果激活邮件已无效,请点击重新发送激活邮件按钮。</li>
<li>如果重发注册验证邮箱邮件仍然没有收到,请<a href="javascript:void(0);" class="link-blue" id="change_email">更换邮箱地址</a>,重新发送激活邮件</li>
<li>如果您始终无法收到激活邮件,请直接给我们留言:</li>
<div class="mt10">
<textarea style="resize: none;width: 570px;" class="email_prompt_mes" placeholder="<%= l(:label_email_feedback_tips) %>"></textarea>
<div class="c1"></div>
<button class="email_sub_btn fr" onclick="leave_email_activation_message('<%= leave_email_activation_message_path(1)%>','<%= @user.id %>');">确定</button>
<div class="cl"></div>
<% email = @user.mail.split("@")[1] %>
<div class="new_login">
<div class="new-login-header clearfix">
<h2 class="fl">激活邮箱账号</h2>
<p class="fr mt20 font-16">
<%= link_to '首页', home_path %>
<span class="ml5 mr5">|</span>
<%= link_to "帮助中心", "#{Setting.protocol}://#{Setting.host_name}/forums/1/memos/1168" %>
</p>
</div>
<div class="new_login_con">
<div class=" task-email-box">
<div class="task-email-box-pd">
<div class="alert alert-blue mb20">
您的账号尚未激活,请先登录您的邮箱,激活您的账号
</div>
<span>只需要登录邮箱(<font id="user_email_show"><%= @user.mail %></font>),点击链接激活即可</span><br/>
<a href="http://mail.<%= email %>" id="user_email_link" class="new_login_submit mt20 mb20" target="_blank">立即去邮箱激活账号</a>
<span class="task-line"></span>
<ul class="clearfix">
<li class="font-bd">还没有收到激活账号邮件?</li>
<li>1尝试到广告邮件、垃圾邮件目录中找找邮件可能被误杀了</li>
<li>2再次发送验证邮件</li>
<li>3如果仍然没有收到注册验证邮件请更换邮件地址</li>
<li class="mt20 mb20">
<%= link_to '<span class="ml10"></span><span onclick="settime(this);">重新发送激活邮件<span><span class="mr10"></span>'.html_safe, { :controller => 'account', :action => 'resendmail', :user => @user},:id => 'resend_email_a', :class => 'task-btn fl mr20', :remote => true, :method => 'get' %>
<a href="javascript:void(0)" class="task-btn fl" id="change_user_email"><span class="ml20"></span>更换邮件地址<span class="mr20"></span></a>
<div class="cl"></div>
</li>
<li class="mt20 none" id="change_user_email_block">
<input type="text" class="new_loggin_users fl" name="user[mail]" id="user_new_email" placeholder="请输入有效的邮箱地址" style="width:325px; padding-left:5px;">
<a href="javascript:void(0);" class="fr task-btn-ver" onclick="submit_user_emails('<%= @user.id %>')"><span class="ml5"></span>确定<span class="mr5"></span></a>
<p class="color-red fl" id="mail_req" style="display: none;">请输入正确的邮箱</p>
<div class="cl"></div>
</li>
</ul>
</div>
</ul>
</div>
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){
$("#change_email").click(function(){
$.ajax({
url: "<%= change_user_email_user_path(@user) %>"
});
});
});
function resendMail(url,id)
{
$.get(
url,
{user: id },
function (data) {
//邮箱@之前用a**b格式显示
var mail = data.email;
var pos = mail.indexOf("@");
var restr = mail.substring(1,pos-1);
if( mail.split("@")[0].length > 2 ){
mail = mail.replace(restr,"***");
}
$(".email_verify_btn").replaceWith("<p class='email_verify_p mt30 ml30'>激活邮件已发送至您的注册邮箱("+mail+"),请及时登录邮箱进行验证。</p>");
}
);
}
function leave_email_activation_message(url,user)
{
if ($(".email_prompt_mes").val().length == 0){
//弹框请他输入文字
var htmlvalue = "</br><div style='width:550px;text-align:center'>您的留言不能为空</div></br><div style='width:67px; margin:0 auto; text-align:center'><a href='javascript:void(0);' class='Blue-btn' onclick='hideModal()'>确定</a></div>";
pop_up_box(htmlvalue,580,30,50);
return;
}
$.ajax({
url: url,
data: {user: user, text: $(".email_prompt_mes").val() },
type: "POST",
success: function (data) {
var htmlvalue = "<div class='email_tancon'><h2 class='email_tan_title'>您的留言已发送</h2><p class='email_tan_p'>我们将尽快处理好并通知您。感谢您的反馈!</p></div>"
pop_up_box(htmlvalue, 580, 30, 45);
$(".email_prompt_mes").val("");
}
});
}
function regex_mv_name()
{
var name = $.trim($("#subject").val());
if(name.length == 0)
{
$("#mail_valid_feedback_tip").show();
return false;
}
else
{
$("#mail_valid_feedback_tip").hide();
return true;
<script>
var countdown = 60;
function settime(val) {
if (countdown == 0) {
val.removeAttribute("disabled");
$("#resend_email_a").removeClass("task-btn-grey");
val.innerHTML="重新发送激活邮件";
countdown = 60;
} else {
val.setAttribute("disabled", true);
$("#resend_email_a").addClass("task-btn-grey");
val.innerHTML=countdown + "s后可重新发送";
countdown--;
if(countdown >= 0){
setTimeout(function() {
settime(val)
},1000)
}
}
}
function f_submit()
{
if(regex_mv_name()){
$("#new_memo").submit();
}
}
</script>
</script>

View File

@ -1,97 +1,55 @@
<title><%= l(:label_regiter_account)%></title>
<% email = @user.mail.split("@")[1] %>
<div class="new_content">
<div class="email_verify" style="width: 580px;">
<p class="fb f18" style="color:green;"><i class="icon-ok mr5 f18"></i>注册成功!
<span style=" color:#3b94d6; font-size:12px; font-weight:normal;">请在24小时内点击邮件中的链接来激活您的账号。</span></p>
<p class="f14 mt30 mb5">请登录邮箱(<span class="c_red" id="user_email_show"><%= @user.mail %></span>)收取账号激活邮件。<br/>点击邮件中的激活链接,方可使用该账号
</p>
<p>
<a href="http://mail.<%= email %>" class="btn btn-blue" target="_blank"><%= l(:label_check_email)%></a>
&nbsp; &nbsp; <%= link_to "<input class='btn btn-blue' type='button' id='btn' value='重新发送激活邮件' onclick='settime(this)' />".html_safe, { :controller => 'account', :action => 'resendmail', :user => @user}, :remote => true, :method => 'get' %>
</p>
<ul class="email_prompt_txt mt30" style="width: 580px;">
<p class="email_prompt_p">如果您一直收不到激活邮件,请按照以下步骤操作:</p>
<li>请确认是否填写了正确的邮箱地址 </li>
<li>请注意查看邮箱中的“订阅邮件”、“垃圾邮件”可能Trustie的邮件被误杀了</li>
<li>请点击重新发送激活邮件按钮</li>
<li>如果重发注册验证邮箱邮件仍然没有收到,请<a href="javascript:void(0);" class="link-blue" id="change_email">更换邮箱地址</a>,重新发送激活邮件</li>
<li>如果您始终无法收到激活邮件,请直接给我们留言:</li>
<div class="mt10">
<textarea style="resize: none;width: 570px;" class="email_prompt_mes" placeholder="<%= l(:label_email_feedback_tips) %>"></textarea>
<div class="c1"></div>
<button class="email_sub_btn fr" onclick="leave_email_activation_message('<%= leave_email_activation_message_path(1)%>','<%= @user.id %>');">确定</button>
<div class="cl"></div>
<div class="new_login">
<div class="new-login-header clearfix">
<h2 class="fl">激活邮箱账号</h2>
<p class="fr mt20 font-16">
<%= link_to '首页', home_path %>
<span class="ml5 mr5">|</span>
<%= link_to "帮助中心", "#{Setting.protocol}://#{Setting.host_name}/forums/1/memos/1168" %>
</p>
</div>
<div class="new_login_con">
<div class=" task-email-box">
<div class="task-email-box-pd">
<h2 class="color-light-green mb10" ><i class="fa fa-envelope mr10 font-18 "></i>激活邮件已发送</h2>
<span>只需要登录邮箱(<font id="user_email_show"><%= @user.mail %></font>),点击链接激活即可</span><br/>
<a href="http://mail.<%= email %>" id="user_email_link" class="new_login_submit mt20 mb20" target="_blank">立即去邮箱激活账号</a>
<span class="task-line"></span>
<ul class="clearfix">
<li class="font-bd">还没有收到激活账号邮件?</li>
<li>1尝试到广告邮件、垃圾邮件目录中找找邮件可能被误杀了</li>
<li>2再次发送验证邮件</li>
<li>3如果仍然没有收到注册验证邮件请更换邮件地址</li>
<li class="mt20 mb20">
<%= link_to '<span class="ml10"></span><span onclick="settime(this);">重新发送激活邮件<span><span class="mr10"></span>'.html_safe, { :controller => 'account', :action => 'resendmail', :user => @user},:id => 'resend_email_a', :class => 'task-btn fl mr20', :remote => true, :method => 'get' %>
<a href="javascript:void(0)" class="task-btn fl" id="change_user_email"><span class="ml20"></span>更换邮件地址<span class="mr20"></span></a>
<div class="cl"></div>
</li>
<li class="mt20 none" id="change_user_email_block">
<input type="text" class="new_loggin_users fl" name="user[mail]" id="user_new_email" placeholder="请输入有效的邮箱地址" style="width:325px; padding-left:5px;">
<a href="javascript:void(0);" class="fr task-btn-ver" onclick="submit_user_emails('<%= @user.id %>')"><span class="ml5"></span>确定<span class="mr5"></span></a>
<p class="color-red fl" id="mail_req" style="display: none;">请输入正确的邮箱</p>
<div class="cl"></div>
</li>
</ul>
</div>
</ul>
</div>
</div>
</div>
<script>
$(document).ready(function(){
$("#change_email").click(function(){
$.ajax({
url: "<%= change_user_email_user_path(@user) %>"
});
});
});
function leave_email_activation_message(url,user)
{
if ($(".email_prompt_mes").val().length == 0){
//弹框请他输入文字
var htmlvalue = "</br><div style='width:550px;text-align:center'>您的留言不能为空</div></br><div style='width:67px; margin:0 auto; text-align:center'><a href='javascript:void(0);' class='Blue-btn' onclick='hideModal()'>确定</a></div>";
pop_up_box(htmlvalue,580,30,50);
return;
}
$.ajax({
url: url,
data: {user: user, text: $(".email_prompt_mes").val() },
type: "POST",
success: function (data) {
var htmlvalue = "<div class='email_tancon'><h2 class='email_tan_title'>您的留言已发送</h2><p class='email_tan_p'>我们将尽快处理好并通知您。感谢您的反馈!</p></div>"
pop_up_box(htmlvalue, 580, 30, 50);
$(".email_prompt_mes").val("");
}
});
}
function regex_mv_name()
{
var name = $.trim($("#subject").val());
if(name.length == 0)
{
$("#mail_valid_feedback_tip").show();
return false;
}
else
{
$("#mail_valid_feedback_tip").hide();
return true;
}
}
function f_submit()
{
if(regex_mv_name()){
$("#new_memo").submit();
}
}
var countdown = 60;
function settime(val) {
if (countdown == 0) {
val.removeAttribute("disabled");
$("#btn").removeClass("btn-grey");
val.value="重新获取验证码";
$("#resend_email_a").removeClass("task-btn-grey");
val.innerHTML="重新发送激活邮件";
countdown = 60;
} else {
val.setAttribute("disabled", true);
$("#btn").addClass("btn-grey");
val.value="重新发送(" + countdown + ")";
$("#resend_email_a").addClass("task-btn-grey");
val.innerHTML=countdown + "s后可重新发送";
countdown--;
if(countdown >= 0){
setTimeout(function() {
@ -100,51 +58,4 @@
}
}
}
$(function(){
var u = navigator.userAgent;
if((u.indexOf('Android') > -1 || u.indexOf('Linux') > -1 ||u.indexOf('iPhone') > -1 || u.indexOf('Mac') > -1)){
$("#scrollsidebar").css("display","none");
return;
}
$(".closeSidebar, .hide-side-bar").click(function(){
$(".show_btn").css("display","none");
$("#scrollsidebar").css("display","none");
return false;
});
$("#button1").click(function(){
myTips("反馈成功","success");
});
$("#scrollsidebar").fix({
float: 'right', //default.left or right
minStatue: cookieget('minStatue'),
skin: 'green', //default.gray or blue
durationTime: 600
});
$("#subject").keydown(function(){
alert("2222");
var curLength=$("#subject").val().length;
if(curLength>50){
var num=$("#subject").val().substr(0,50);
$("#subject").val(num);
}
else{
$("#textCount").text(50-$("#subject").val().length)
}
}).keyup(function(){
var curLength=$("#subject").val().length;
if(curLength>50){
var num=$("#subject").val().substr(0,50);
$("#subject").val(num);
}
else{
$("#textCount").text(50-$("#subject").val().length)
}
});
});
</script>

View File

@ -1,164 +1,103 @@
<div class="new_register">
<div class="new_register_con ">
<div class="new_login_box " style="margin-top: 50px;">
<% if @message %>
<p class="f14 mb5" style=" color:#fff;"><i class="<%= params[:type] == "expired" ? 'icon-bolt mr5' : 'icon-ok mr5' %>"></i><%= h @message %></p>
<% end %>
<h2 class="new_login_h2">登录
<a href="<%= user_join_path %>" class="fr mt5" style="color:#fff;">立即注册</a><div class="cl"></div>
</h2>
<div class="new_login_form">
<%= form_tag(signin_path,:id=>'main_login_form',:method=>'post') do %>
<div class="new_login ">
<div class="new-login-header clearfix">
<h2 class="fl">登录</h2>
<p class="fr mt20 font-16">
<%= link_to '首页', home_path %>
<span class="ml5 mr5">|</span>
<%= link_to "帮助中心", "#{Setting.protocol}://#{Setting.host_name}/forums/1/memos/1168" %>
</p>
</div>
<div class="new_login_con">
<div class="new_login_box clearfix">
<ul class="new_login_weixin clearfix">
<p class="" style="text-align: center; font-size: 18px;">登录</p>
<!--<li id="login_weixin_nav_1" class="login_weixin_nav_hover" onclick="HoverLi(1);">-->
<!--<a href="javascript:void(0);" class="login_weixin_nav_nomal" ><i class="fa fa-qrcode mr10 mt3 font-16"></i>扫码登录</a>-->
<!--</li>-->
<!--<li id="login_weixin_nav_2" onclick="HoverLi(2);" >-->
<!--<a href="javascript:void(0);" class="login_weixin_nav_nomal" ><i class="fa fa-desktop mr10 mt3 "></i>密码登录</a>-->
<!--</li>-->
</ul>
<div id="login_weixin_content_1" class="undis">
<div class="code_wxbox" >
<div class="wx_img" id="login_QR_img"><img src="images/bigdata/trustie_QR.jpg" width="150" height="150"></div>
<div class="wx_img" id="wx_help_img" style="display:none;"><img src="images/bigdata/wx_help.png" width="150" height="150"></div>
<div class="wx_0s">
<div class="ts mb10">请使用微信扫描上方二维码登录</div>
<div class="usehelp">
<a href="javascript:void(0)" onmouseover="$('#login_QR_img').hide(); $('#wx_help_img').show();" onmouseout="$('#login_QR_img').show(); $('#wx_help_img').hide();" class="wx_help">使用帮助</a>
</div>
</div>
</div>
</div>
<div id="login_weixin_content_2">
<div class="new_login_form">
<p class="fr mt10 mb10 font-12">没有账号?
<a href="<%= user_join_path %>" class="ml10">立即注册</a>
</p>
<div class="cl"></div>
<%= form_tag(signin_path,:id=>'main_login_form',:method=>'post') do %>
<%= back_url_hidden_field_tag %>
<ul>
<li class="new_loggin_users">
<%= text_field_tag 'username', params[:username], :tabindex => '1', :class=>'new_loggin_input',:placeholder=>'请输入邮箱地址或登录名', :onkeypress => "user_name_keypress(event);"%>
<i class="fa fa-user font-16 ml10 color-grey"></i>
<input type="text" id="name_loggin_input" name="username" class="new_loggin_input" placeholder="手机/邮箱" onkeypress="user_name_keypress(event);">
</li>
<li class="new_loggin_li new_login_lock">
<%= password_field_tag 'password', nil, :tabindex => '2', :class => 'new_loggin_input' , :placeholder => '请输入登录密码', :onkeypress => "user_name_keypress(event);"%>
<p class="new_login_error"><%= flash.empty? || flash[:error].nil? ? "" : flash[:error].html_safe %></p>
<li class="new_loggin_users">
<i class="fa fa-lock font-16 ml10 color-grey"></i>
<input type="password" id="password_loggin_input" name="password" class="new_loggin_input" placeholder="请输入密码" onkeypress="user_name_keypress(event);">
</li>
<p id="login_error_notice" class="color-red mb5" style="margin-top: -15px;"><%= flash.empty? || flash[:error].nil? ? "" : flash[:error].html_safe %></p>
<li>
<% if Setting.autologin? %>
<label><%= check_box_tag 'autologin', 1, true, :tabindex => 4, :class => "new_login_check" %><%= l(:label_stay_logged_in) %></label>
<% end %>
<a href="<%= lost_password_path %>" class="fr" style="color:#fff;">
<a href="<%= lost_password_path %>" class="fr">
<% if Setting.lost_password? %>忘记密码<% end %>
</a>
<div class="cl"></div>
</li>
<li>
<a href="javascript:void(0);" id="regist_btn" onclick="loginin();" class ="new_login_submit" id="login_btn" style="text-decoration:none">登录</a>
<a href="javascript:void(0);" onclick="loginin();" class ="new_login_submit" id="login_btn" style="text-decoration:none">登录</a>
</li>
</ul>
<% end %>
<% end %>
</div>
</div>
<div class="cl"></div>
</div>
<div class="cl"></div>
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){
$(".homepageSearchIcon").click(function(){
var val=$('input:radio[name="search_type"]:checked').val();
if(val==null){
$("#navSearchAlert").css({display:"block"});
}
else {
$("#navSearchAlert").css({display:"none"});
}
});
});
$(document).ready(function(){
$(".navHomepageSearchBoxcontainer").mouseover(function(){
$(".navSearchTypeBox").css({display:"block"});
});
$(".navHomepageSearchBoxcontainer").mouseout(function(){
$(".navSearchTypeBox").css({display:"none"});
});
})
$(document).ready(function(){
if(<%= @login%>){
$("#signUpBox").css({display:"none"});
$("#loginInBox").css({display:"block"});
}else{
$("#signUpBox").css({display:"block"});
$("#loginInBox").css({display:"none"});
<script type="text/javascript" language="javascript">
//登录tab
function g(o){
return document.getElementById(o);
}
function HoverLi(n){
for(var i=1;i<=2;i++){
g('login_weixin_nav_'+i).className='login_weixin_nav_nomal';
g('login_weixin_content_'+i).className='undis';
}
});
g('login_weixin_nav_'+n).className='login_weixin_nav_hover';
g('login_weixin_content_'+n).className='dis';
}
var $login_correct = false;
var $mail_correct = false;
var $passwd_correct = false;
var $passwd_comfirm_correct = false;
jQuery(document).ready(function () {
var $login = $('#user_login')
var $mail = $('#user_mail')
var $password = $('#user_password')
var $password_confirmation = $('#user_password_confirmation')
$login.blur(function (event) {
if ($(this).is('#user_login')) {
if (/^[a-zA-Z][a-zA-Z\d]{3,14}$/.test(this.value) == false){
$('#login_req').html('<span style="color: #c00202">只能使用英文字母和数字必须以字母开头长度不少于4个字符、不超过15个字符</span>');
$('#login_req').show();
return ;
}
else{
$.get(
'<%=account_valid_ajax_path%>',
{ valid: "login",
value: this.value },
function (data) {
if (data.valid) {
$('#login_req').html('<span style="color: green">'+data.message+'</span>');
$login_correct = true;
} else {
$('#login_req').html( '<span style="color: #c00202">'+data.message+'</span>');
$login_correct = false;
}
$('#login_req').css('display','block');
});
}
$(function(){
<% if flash[:error] || !flash.empty? %>
for(var i=1;i<=2;i++){
g('login_weixin_nav_'+i).className='login_weixin_nav_nomal';
g('login_weixin_content_'+i).className='undis';
}
g('login_weixin_nav_2').className='login_weixin_nav_hover';
g('login_weixin_content_2').className='dis';
<% end %>
}
// ;
$("#name_loggin_input").on('focus', function(){
$("#login_error_notice").html("");
});
$mail.blur(function (event) {
if (/^[a-zA-Z0-9]+([._\\]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/.test(this.value) == false){
$('#mail_req').html( '<span style="color: #c00202">邮件格式不对</span>').show();
$mail_correct = false;
return ;
}
if ($(this).is('#user_mail')) {
$.get('<%=account_valid_ajax_path%>',
{ valid: "mail",
value: this.value },
function (data) {
if (data.valid) {
$('#mail_req').html( '<span style="color: green">'+data.message+'</span>' );
$mail_correct = true;
} else {
$('#mail_req').html( '<span style="color: #c00202">'+data.message+'</span>' );
$mail_correct = false;
}
$('#mail_req').css('display','block');
});
}
;
});
$password.blur(function () {
var pas1 = document.getElementById("user_password").value;
var password_min_length = <%= Setting.password_min_length.to_i %>
if (pas1.length >= password_min_length) {
$('#passwd_req').html('');
$passwd_correct = true;
}
else {
$('#passwd_req').html( '<span style="color: #c00202">'+'<%= l(:setting_password_min_length_limit, :count => Setting.password_min_length.to_i) %>'+'</span>');
$passwd_correct = false;
}
$('#passwd_req').css('display','block');
});
$password_confirmation.blur(function () {
var password_min_length = <%= Setting.password_min_length.to_i %>
var pas1 = document.getElementById("user_password").value;
var pas2 = document.getElementById("user_password_confirmation").value;
if (pas1.length >= password_min_length && pas1 == pas2 ) {
$('#confirm_req').html('<span style="color: green">'+'<%= l(:setting_password_success) %>'+'</span>');
$passwd_comfirm_correct = true;
}
else {
$('#confirm_req').html('<span style="color: #c00202">'+'<%= l(:setting_password_error) %>'+'</span>');
$passwd_comfirm_correct = false;
}
$('#confirm_req').css('display','block');
$("#password_loggin_input").on('focus', function(){
$("#login_error_notice").html("");
});
});
</script>

View File

@ -1,26 +1,58 @@
<%= stylesheet_link_tag 'css/public'%>
<div class="homepageContentContainer ">
<div class="homepageContent BgBox">
<h2 class="BgBox_h2">忘记密码</h2>
<div class="BgBoxCon">
<%= form_tag(lost_password_path) do %>
<p class="BgBoxConP mb5">通过注册邮箱链接重设密码</p>
<!--<input type="text" class="NomalInput mb20 " value="请输入登录邮箱地址" />-->
<%= text_field_tag 'mail', nil, :size => 40, :placeholder => '请输入注册邮箱',:class=>'NomalInput mb20'%>
<% if flash[:error] %>
<p class="c_red mt-20 ml5"><%= flash[:error]%></p>
<!--<div style="color: red" class="mb5" ><%#= flash[:error]%></div>-->
<% elsif flash[:notice] %>
<p class="c_green mb5"><%= flash[:notice]%></p>
<!--<div style="color: green" class="mb5" ><%#= flash[:notice]%></div>-->
<% end %>
<div class="LoginButton"><a href="javascript:void(0);" class="c_white db" onclick="$(this).parent().parent().submit();">提交</a></div>
<% end %>
<div class="new_login">
<div class="new-login-header clearfix">
<h2 class="fl">找回密码</h2>
<p class="fr mt20 font-16">
<%= link_to '首页', home_path %>
<span class="ml5 mr5">|</span>
<%= link_to "帮助中心", "#{Setting.protocol}://#{Setting.host_name}/forums/1/memos/1168" %>
</p>
</div>
<div class="password-header clearfix">
<h3 class="fl ml15">找回密码</h3>
<span class="fl ml10 mr10 mt3 " >|</span>
<span class="fl mt3">第一步:安全验证</span>
</div>
<div class="new_login_con">
<div class="new_login_box clearfix">
<div class="new_login_form">
<form>
<ul>
<li class="new_loggin_users">
<i class="fa fa-user font-16 ml10 color-grey"></i>
<input type="text" class="new_loggin_input" id="lost_psd_input" style="width: 290px;" placeholder="请输入邮箱或手机号">
<i class="fa font-16 mr5" id="user_phone_check"></i>
<div class="new-login-error" style="display: none;">
<p id="user_phone_notice"></p>
</div>
</li>
<li class="pr">
<div id="drag" class="drag_slider"></div>
<div class="new-login-error" style="display: none;">
<p id="user_verification_notice"></p>
</div>
</li>
<li class="pr">
<input type="text" class="new_loggin_input_test fl" id="psd_verification_code" placeholder="请输入收到的验证码">
<a href="javascript:void(0);" class="fr task-btn-ver" onclick="get_psd_verification_code(this)">获取验证码</a>
<input class="none" id="ver_code_type">
<div class="new-login-error" style="display: none;">
<p id="phone_verification_code_notice"></p>
</div>
<div class="cl"></div>
</li>
<p id="send_success_notice" class="none" style="margin-top: -15px; margin-bottom: 10px;"></p>
<li><a href="javascript:void(0)" class="new_login_submit" id="lost_psd_next_a" onclick="lost_psd_next();">下一步</a></li>
</ul>
</form>
<div class="new-loggin-other mt50 none">
<a href="#"><img src="/images/login/img-weixin.png" width="50" height="50" class="task-img-weixin mb10" alt="微信登录"></a><br/>
<span>使用第三方账号</span>
</div>
</div>
</div>
</div><!---BgBox end--->
</div><!---homepageContentContainer end--->
</body>
</html>
</div>
</div>
<script type="text/javascript">
$('#drag').drag();
</script>

View File

@ -0,0 +1,42 @@
<div class="new_login">
<div class="new-login-header clearfix">
<h2 class="fl">找回密码</h2>
<p class="fr mt20 font-16">
<%= link_to '首页', home_path %>
<span class="ml5 mr5">|</span>
<%= link_to "帮助中心", "#{Setting.protocol}://#{Setting.host_name}/forums/1/memos/1168" %>
</p>
</div>
<div class="password-header clearfix">
<h3 class="fl ml15">找回密码</h3>
<span class="fl ml10 mr10 mt3">|</span>
<span class="fl mt3">第二步:设置新密码</span>
</div>
<div class="new_login_con">
<div class="new_login_box clearfix">
<div class="new_login_form">
<%= form_tag(account_reset_psd_path, :remote => true, :method => 'post') do %>
<ul>
<input type="hidden" name="user" value="<%= @user.id %>">
<input type="hidden" id="password_min_length" value="<%= Setting.password_min_length.to_i %>">
<li class="new_loggin_users">
<i class="fa fa-lock font-16 ml10 color-grey"></i>
<input type="password" class="new_loggin_input" name="new_password" id="new_password" placeholder="设置新密码">
<div class="new-login-error" style="display: none;">
<p id="new_password_notice">至少8位由字母或特殊符号和数字结合</p>
</div>
</li>
<li class="new_loggin_users">
<i class="fa fa-lock font-16 ml10 color-grey"></i>
<input type="password" class="new_loggin_input" name="new_password_confirmation" id="new_password_confirmation" placeholder="确认新密码">
<div class="new-login-error none" style="display: none;">
<p id="new_password_confirmation_notice">两次密码输入不一致</p>
</div>
</li>
<li><a href="javascript:void(0)" class="new_login_submit" id="new_psd_submit">完成</a></li>
</ul>
<% end %>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,2 @@
var htmlvalue = "<%= j(render :partial => 'account/reset_psd_notice_box') %>";
pop_box_new(htmlvalue, 552, 500);

View File

@ -1,165 +1,280 @@
<div class="new_register">
<div class="new_register_con ">
<div class="new_login_box ">
<h2 class="new_login_h2">注册<a href="<%= signin_path %>" class="fr mt5">已有账号 请登录</a><div class="cl"></div></h2>
<div class="new_login_form">
<%= form_for :user, :url => register_path,:method=>'post', :html => {:id=>'main_reg_form'} do |f| %>
<%= error_messages_for 'user' %>
<ul >
<li class="new_register_li">
<%= f.text_field :mail, :size => 25, :class => 'new_register_input' , :placeholder => "请输入邮箱地址"%>
<p class="new_login_error" id="mail_req" style="display: none">请输入正确的邮箱</p>
</li>
<li class="new_register_li">
<%= f.password_field :password, :placeholder => "请输入密码", :class => 'new_register_input' %>
<p class="new_login_error" id="passwd_req" style="display: none">请输入8-16位密码区分大小写不能使用空格</p>
</li>
<li class="new_register_li">
<%= f.password_field :password_confirmation, :placeholder => "请再次输入密码", :class=> 'new_register_input' %>
<p class="new_login_error" id="confirm_req" style="display: none">两次密码不一致!</p>
</li>
<li class="new_register_li">
<%= f.text_field :login, :placeholder => "请输入用户登录名", :class => 'new_register_input'%>
<p class="new_login_error" id="login_req" style="display: none">只能使用英文字母和数字必须以字母开头长度不少于4个字符、不超过15个字符</p>
</li>
<li>
<label><input type="checkbox" checked id="read_and_confirm" onchange="changeRegisterBtn(this);" class=" new_login_check">我已阅读并接受<a href="<%= agreement_path %>" >Trustie服务协议条款</a></label>
</li>
<li>
<div id="loginUpButton">
<a href="javascript:void(0);" id="regist_btn" onclick="register();" class ="new_login_submit" style="text-decoration:none;">注册</a>
</div>
</li>
</ul>
<% end %>
<div class="new_login ">
<div class="new-login-header clearfix">
<h2 class="fl">注册</h2>
<p class="fr mt20 font-16">
<%= link_to '首页', home_path %>
<span class="ml5 mr5">|</span>
<%= link_to "帮助中心", "#{Setting.protocol}://#{Setting.host_name}/forums/1/memos/1168" %>
</p>
</div>
<div class="new_login_con">
<div class="new_login_box clearfix">
<ul class="new_login_weixin fl" >
<li id="login_weixin_nav_1" class="login_weixin_nav_hover" onclick="HoverLi(1);">
<a href="javascript:void(0);" class="login_weixin_nav_nomal"><i class="fa fa-mobile-phone font-16 mr10 mt3"></i>手机注册</a>
</li>
<li id="login_weixin_nav_2" onclick="HoverLi(2);" >
<a href="javascript:void(0);" class="login_weixin_nav_nomal"><i class="fa fa-envelope-o font-16 mr10 mt3"></i>邮箱注册</a>
</li>
</ul>
<div id="login_weixin_content_1">
<div class="new_login_form">
<p class="fr mt10 mb10 font-12">已有账号?<a href="<%= signin_path %>" class="ml10">直接登录</a>
</p>
<div class="cl"></div>
<%= form_for :user, :url => register_path,:method=>'post', :html => {:id=>'main_reg_form'} do |f| %>
<%= error_messages_for 'user' %>
<input type="text" name="none_name" style="display: none">
<input type="password" name="none_psw" style="display: none">
<ul >
<li class="new_loggin_users ">
<i class="fa fa-mobile-phone font-16 ml10 color-grey"></i>
<input type="text" id="user_phone_num" name="user[phone]" class="new_loggin_input" autocomplete="off" placeholder="请输入手机号码">
<i class="fa font-16 mr5" id="user_phone_check"></i>
<div class="new-login-error" style="display: none;">
<p id="user_phone_notice"></p>
</div>
</li>
<li class="new_loggin_users">
<i class="fa fa-lock font-16 ml10 color-grey"></i>
<input type="text" onfocus="this.type='password'" class="new_loggin_input" style="width: 292px;" name="user[password]" id="user_password_1" autocomplete="off" placeholder="密码至少由8位由字母或特殊符号和数字结合">
<i class="fa font-16 mr5" id="user_password_1_check"></i>
<div class="new-login-error" style="display: none;">
<p id="user_password_1_notice"></p>
</div>
</li>
<li class="pr">
<div id="drag" class="drag_slider"></div>
<div class="new-login-error" style="display: none;">
<p id="user_verification_notice"></p>
</div>
</li>
<li class="pr">
<input type="text" class="new_loggin_input_test fl" name="code" id="phone_verification_code" placeholder="请输入收到的短信验证码">
<a href="javascript:void(0);" class="fr task-btn-ver" onclick="get_phone_verification_code(this)" id="get_verification_code">获取验证码</a>
<div class="new-login-error" style="display: none;">
<p id="phone_verification_code_notice"></p>
</div>
<div class="cl"></div>
</li>
<li class="pr">
<label><input type="checkbox" checked="checked" id="read_and_confirm_1" class="new_login_check"> 我已阅读并同意<a href="<%= agreement_path %>" target="_blank">服务协议条款</a></label>
<div class="new-login-error" style="display: none;">
<p id="user_aggre_1_notice"></p>
</div>
<div class="cl"></div>
</li>
<li>
<a href="javascript:void(0);" id="regist_btn_phone" onclick="phone_register();" class ="new_login_submit" style="text-decoration:none;">注册</a>
</li>
</ul>
<% end %>
</div>
</div>
<div id="login_weixin_content_2" class="undis">
<div class="new_login_form">
<p class="fr mt10 mb10 font-12">已有账号?<a href="<%= signin_path %>" class="ml10">直接登录</a>
</p>
<div class="cl"></div>
<%= form_for :user, :url => register_path,:method=>'post', :html => {:id=>'main_reg_email_form'} do |f| %>
<%= error_messages_for 'user' %>
<input type="text" style="display: none">
<input type="password" style="display: none">
<ul >
<li class="new_loggin_users">
<i class="fa fa-envelope-o font-16 ml10 color-grey"></i>
<input type="text" class="new_loggin_input" name="user[mail]" id="user_email_addr" style="width: 286px;" autocomplete="off" placeholder="请输入有效的邮箱地址">
<i class="fa font-16 mr5" id="user_email_check"></i>
<div class="new-login-error" style="display: none;">
<p id="user_email_addr_notice"></p>
</div>
</li>
<li class="new_loggin_users">
<i class="fa fa-lock font-16 ml10 color-grey"></i>
<input type="text" onfocus="this.type='password'" class="new_loggin_input" style="width: 292px;" name="user[mail_password]" id="user_password_2" autocomplete="off" placeholder="密码至少由8位由字母或特殊符号和数字结合">
<i class="fa font-16 mr5" id="user_password_2_check"></i>
<div class="new-login-error" style="display: none;">
<p id="user_password_2_notice"></p>
</div>
</li>
<li class="pr">
<label><input type="checkbox" id="read_and_confirm_2" checked="checked" class="new_login_check" > 我已阅读并同意<a href="<%= agreement_path %>" target="_blank">服务协议条款</a></label>
<div class="new-login-error" style="display: none;">
<p id="user_aggre_2_notice"></p>
</div>
<div class="cl"></div>
</li>
<li>
<a href="javascript:void(0);" id="regist_btn_email" onclick="email_register();" class ="new_login_submit" style="text-decoration:none;">注册</a>
</li>
</ul>
<% end %>
</div>
</div>
<div class="cl"></div>
</div>
<div class="cl"></div>
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){
$(".homepageSearchIcon").click(function(){
var val=$('input:radio[name="search_type"]:checked').val();
if(val==null){
$("#navSearchAlert").css({display:"block"});
}
else {
$("#navSearchAlert").css({display:"none"});
}
});
});
$(document).ready(function(){
$(".navHomepageSearchBoxcontainer").mouseover(function(){
$(".navSearchTypeBox").css({display:"block"});
});
$(".navHomepageSearchBoxcontainer").mouseout(function(){
$(".navSearchTypeBox").css({display:"none"});
});
})
$(document).ready(function(){
if(<%= @login%>){
$("#signUpBox").css({display:"none"});
$("#loginInBox").css({display:"block"});
}else{
$("#signUpBox").css({display:"block"});
$("#loginInBox").css({display:"none"});
$('#drag').drag();
function g(o){
return document.getElementById(o);
}
function HoverLi(n){
for(var i=1;i<=2;i++){
g('login_weixin_nav_'+i).className='login_weixin_nav_nomal';
g('login_weixin_content_'+i).className='undis';
}
});
g('login_weixin_nav_'+n).className='login_weixin_nav_hover';
g('login_weixin_content_'+n).className='dis';
}
var $login_correct = false;
var wait = 60;
function get_phone_verification_code(btn) {
if ($phone_correct){
if($('.drag_text').html() == "验证通过") {
$.get(
'<%=account_get_verification_code_path%>',
{ value: $('#user_phone_num').val().trim(),
type: 1},
function (data) {
if (data.status == "2") {
$('#user_phone_notice').html('该手机号已被注册');
$('#user_phone_notice').parent().show();
} else {
$('#user_phone_notice').html('');
$('#user_phone_notice').parent().hide();
time(btn);
}
});
} else{
$("#user_verification_notice").html("请先拖动滑块完成验证");
$('#user_verification_notice').parent().show();
}
}
}
function time(btn){
if (wait==0) {
$(btn).removeClass("rest-btn-ver");
btn.removeAttribute("disabled");
btn.innerHTML = "获取验证码";
wait = 60;
return;
}else{
$(btn).addClass("rest-btn-ver");
btn.setAttribute("disabled", "disabled");
btn.innerHTML = wait + "s后重试";
wait--;
}
setTimeout(function(){
time(btn);
},1000);
}
var $phone_correct = false;
var $mail_correct = false;
var $passwd_correct = false;
var $passwd_comfirm_correct = false;
var $passwd_1_correct = false;
var $passwd_2_correct = false;
jQuery(document).ready(function () {
var $login = $('#user_login')
var $mail = $('#user_mail')
var $password = $('#user_password')
var $password_confirmation = $('#user_password_confirmation')
$login.blur(function (event) {
if ($(this).is('#user_login')) {
if (/^[a-zA-Z][a-zA-Z\d]{3,14}$/.test(this.value) == false){
$('#login_req').html('<span style="color: #2384cd">只能使用英文字母和数字,必须以字母开头</span>');
$('#login_req').show();
return ;
var $phone_num = $('#user_phone_num');
var $mail = $('#user_email_addr');
var $password1 = $('#user_password_1');
var $password2 = $('#user_password_2');
$phone_num.val("");
$mail.val("");
$password1.val("");
$password2.val("");
$phone_num.blur(function (event) {
if ($(this).is('#user_phone_num')) {
if (/^1\d{10}$/.test(this.value) == false){
$('#user_phone_notice').html('请输入有效的11位手机号码');
$('#user_phone_notice').parent().show();
$("#user_phone_check").removeClass("fa-check").removeClass("color-light-green").addClass("fa-times-circle").addClass("color-orenge");
return false;
}
else{
$.get(
'<%=account_valid_ajax_path%>',
{ valid: "login",
{ valid: "phone",
value: this.value },
function (data) {
if (data.valid) {
$('#login_req').html('<span style="color: green">'+data.message+'</span>');
$login_correct = true;
$('#user_phone_notice').html('');
$('#user_phone_notice').parent().hide();
$("#user_phone_check").removeClass("fa-times-circle").removeClass("color-orenge").addClass("fa-check").addClass("color-light-green");
$phone_correct = true;
} else {
$('#login_req').html( '<span style="color: #2384cd">'+data.message+'</span>');
$login_correct = false;
$('#user_phone_notice').html('该手机号已被注册');
$('#user_phone_notice').parent().show();
$("#user_phone_check").removeClass("fa-check").removeClass("color-light-green").addClass("fa-times-circle").addClass("color-orenge");
$phone_correct = false;
}
$('#login_req').css('display','block');
});
}
}
// ;
});
$mail.blur(function (event) {
if (/^[a-zA-Z0-9]+([._\\]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/.test(this.value) == false){
$('#mail_req').html( '<span style="color: #2384cd">邮件格式不对</span>').show();
$('#user_email_addr_notice').html('邮箱地址格式不对');
$('#user_email_addr_notice').parent().show();
$("#user_email_check").removeClass("fa-check").removeClass("color-light-green").addClass("fa-times-circle").addClass("color-orenge");
$mail_correct = false;
return ;
}
if ($(this).is('#user_mail')) {
if ($(this).is('#user_email_addr')) {
$.get('<%=account_valid_ajax_path%>',
{ valid: "mail",
value: this.value },
function (data) {
if (data.valid) {
$('#mail_req').html( '<span style="color: green">'+data.message+'</span>' );
$('#user_email_addr_notice').html('');
$('#user_email_addr_notice').parent().hide();
$("#user_email_check").removeClass("fa-times-circle").removeClass("color-orenge").addClass("fa-check").addClass("color-light-green");
$mail_correct = true;
} else {
$('#mail_req').html( '<span style="color: #2384cd">'+data.message+'</span>' );
$('#user_email_addr_notice').html(data.message);
$('#user_email_addr_notice').parent().show();
$("#user_email_check").removeClass("fa-check").removeClass("color-light-green").addClass("fa-times-circle").addClass("color-orenge");
$mail_correct = false;
}
$('#mail_req').css('display','block');
});
}
;
});
$password.blur(function () {
var pas1 = document.getElementById("user_password").value;
var password_min_length = <%= Setting.password_min_length.to_i %>
$password1.blur(function () {
var pas1 = document.getElementById("user_password_1").value;
var password_min_length = <%= Setting.password_min_length.to_i %>;
if (pas1.length >= password_min_length) {
$('#passwd_req').html('');
$passwd_correct = true;
$('#user_password_1_notice').html('');
$('#user_password_1_notice').parent().hide();
$("#user_password_1_check").removeClass("fa-times-circle").removeClass("color-orenge").addClass("fa-check").addClass("color-light-green");
$passwd_1_correct = true;
}
else {
$('#passwd_req').html( '<span style="color: #2384cd">'+'<%= l(:setting_password_min_length_limit, :count => Setting.password_min_length.to_i) %>'+'</span>');
$passwd_correct = false;
$('#user_password_1_notice').html('<%= l(:setting_password_min_length_limit, :count => Setting.password_min_length.to_i) %>');
$('#user_password_1_notice').parent().show();
$("#user_password_1_check").removeClass("fa-check").removeClass("color-light-green").addClass("fa-times-circle").addClass("color-orenge");
$passwd_1_correct = false;
}
$('#passwd_req').css('display','block');
});
$password_confirmation.blur(function () {
var password_min_length = <%= Setting.password_min_length.to_i %>
var pas1 = document.getElementById("user_password").value;
var pas2 = document.getElementById("user_password_confirmation").value;
if (pas1.length >= password_min_length && pas1 == pas2 ) {
$('#confirm_req').html('<span style="color: green">'+'<%= l(:setting_password_success) %>'+'</span>');
$passwd_comfirm_correct = true;
$password2.blur(function () {
var pas1 = document.getElementById("user_password_2").value;
var password_min_length = <%= Setting.password_min_length.to_i %>;
if (pas1.length >= password_min_length) {
$('#user_password_2_notice').html('');
$('#user_password_2_notice').parent().hide();
$("#user_password_2_check").removeClass("fa-times-circle").removeClass("color-orenge").addClass("fa-check").addClass("color-light-green");
$passwd_2_correct = true;
}
else {
$('#confirm_req').html('<span style="color: #2384cd">'+'<%= l(:setting_password_error) %>'+'</span>');
$passwd_comfirm_correct = false;
$('#user_password_2_notice').html('<%= l(:setting_password_min_length_limit, :count => Setting.password_min_length.to_i) %>');
$('#user_password_2_notice').parent().show();
$("#user_password_2_check").removeClass("fa-check").removeClass("color-light-green").addClass("fa-times-circle").addClass("color-orenge");
$passwd_2_correct = false;
}
$('#confirm_req').css('display','block');
});
});
</script>

View File

@ -12,6 +12,9 @@
</div>
</div>
<script type="text/javascript">
$("#search_course_input").bind('change',function(e){
search_courses(e)
});
function school_submit() {
var checkboxs = $("input[name='school_id[]']:checked");
if(checkboxs.length == 0) {
@ -34,22 +37,9 @@
url: '<%= url_for(:controller => 'admin', :action => 'all_schools') %>'+'?search='+ e.target.value+'&school_id=<%=edit_id %>',
type:'get',
data: {is_observe:true},
success: function(data){ },
success: function(data){ },
beforeSend: function(){ $(this).addClass('ajax-loading'); },
complete: function(){ $(this).removeClass('ajax-loading'); }
});
}
function throttle(method,context,e){
clearTimeout(method.tId);
method.tId=setTimeout(function(){
method.call(context,e);
},500);
}
//查询项目
$("input[name='search']").on('input', function (e) {
throttle(search_courses,window,e);
});
</script>

View File

@ -24,4 +24,4 @@
<a href="javascript:void(0);" class="sendSourceText" onclick="hideModal();">取消</a>
</div>
</div>
<div class="cl"></div>
<div class="cl"></div>

View File

@ -92,15 +92,7 @@
<% end%>
</td>
<td align="center">
<% unless user.user_extensions.nil? %>
<% if user.user_extensions.identity.to_i == 0 %>
<!--优先取school中校名如果校名不存在就取occupation-->
<% occupation = user.user_extensions.school_id.nil? ? "" : (School.where("id =?", user.user_extensions.school_id)).first.try(:name) %>
<%= occupation.blank? ? user.user_extensions.occupation : occupation %>
<% else %>
<%= user.user_extensions.occupation %>
<% end %>
<% end %>
<%= user.user_extensions.school_id.nil? ? "" : (School.find user.user_extensions.school_id).try(:name) %>
</td>
</tr>
<% end %>

View File

@ -0,0 +1,17 @@
<div id="muban_popup_box" style="width:470px;">
<div class="muban_popup_top">
<h3 class="fl">更新成功</h3>
<a href="javascript:void(0);" class="muban_icons_close fr"></a>
<div class="cl"></div>
</div>
<div style='text-align:center;font-family: "微软雅黑","宋体"' class="mt20 f14">
是否保留您设置的延期发布时间:<%= format_time @old_attachment.publish_time %>
</div>
<div style='width:164px; margin:0 auto; margin-top: 15px; text-align:center; font-family: "微软雅黑","宋体"'>
<%=link_to '取消', update_attachment_publish_time_path(@old_attachment, :status => 0),:style => 'margin-left: 25px;', :class => 'sy_btn_grey fl mr5', :remote => true%>
<%=link_to '确认', update_attachment_publish_time_path(@old_attachment, :status => 1), :class => 'sy_btn_blue fl', :remote => true%>
<div class="cl"></div>
</div>
</div>

View File

@ -0,0 +1,2 @@
hideModal();
$(".re_search").submit(); // 为了刷新

View File

@ -1,7 +1,11 @@
<% if @flag %>
hideModal();
alert('更新成功');
$(".re_search").submit(); // 为了刷新
<% if @status == 1 %>
notice_box("更新成功");
$(".re_search").submit(); // 为了刷新
<% else %>
var htmlvalue = "<%=escape_javascript(render :partial => 'update_publish_time_box') %>";
pop_box_new(htmlvalue, 470, 140);
<% end %>
<%else%>
$("#upload_file_count").html('(更新失败)');
<%end %>

View File

@ -126,14 +126,12 @@
<p id="subjectmsg"></p>
</div>
<div id="topic_editor" style="display: none;">
<%if User.current.member_of_contest?(contest) %>
<%if User.current.admin_of_contest?(contest) %>
<div class="mt10">
<% if User.current.id == contest.user_id %>
<%= f.check_box :sticky, :value => topic.sticky %>
<%= label_tag 'message_sticky', l(:label_board_sticky) %>
<%= f.check_box :locked, :value => topic.locked %>
<%= label_tag 'message_locked', l(:label_board_locked) %>
<% end %>
<%= f.check_box :sticky, :value => topic.sticky %>
<%= label_tag 'message_sticky', l(:label_board_sticky) %>
<%= f.check_box :locked, :value => topic.locked %>
<%= label_tag 'message_locked', l(:label_board_locked) %>
<div class="cl"></div>
</div>
<% end %>

View File

@ -122,20 +122,18 @@
<div id="new_course_topic">
<div class="homepagePostBrief c_grey">
<div>
<input type="text" name="message[subject]" id="message_subject" class="InputBox w713" maxlength="128" onfocus="$('#topic_editor').show()" onkeyup="regexTopicSubject();" placeholder="发布帖子,请先输入帖子标题" value="<%= topic.subject%>" >
<input type="text" name="message[subject]" id="message_subject" class="InputBox w713" maxlength="128" onfocus="$('#topic_editor').show()" onkeyup="regexTopicSubject();" placeholder="发布帖子,请先输入帖子标题" value="<%= topic.subject%>" >
<p id="subjectmsg"></p>
</div>
<div id="topic_editor" style="display: none;">
<%if User.current.member_of_course?(course) %>
<div class="mt10">
<% if User.current.id == course.tea_id %>
<%= f.check_box :sticky, :value => topic.sticky %>
<%= label_tag 'message_sticky', l(:label_board_sticky) %>
<%= f.check_box :locked, :value => topic.locked %>
<%= label_tag 'message_locked', l(:label_board_locked) %>
<% end %>
<div class="cl"></div>
</div>
<%if User.current.allowed_to?(:as_teacher, course) %>
<div class="mt10">
<%= f.check_box :sticky, :value => topic.sticky %>
<%= label_tag 'message_sticky', l(:label_board_sticky) %>
<%= f.check_box :locked, :value => topic.locked %>
<%= label_tag 'message_locked', l(:label_board_locked) %>
<div class="cl"></div>
</div>
<% end %>
<div class="mt10">
<div id="message_quote" class="wiki" style="width: 92%;word-break: break-all;word-wrap: break-word;margin-left: 40px;"></div>

View File

@ -6,8 +6,10 @@
function reset_topic(){
$("#message_subject").val("");
$("#subjectmsg").text("");
document.getElementById("message_sticky").checked=false;
document.getElementById("message_locked").checked=false;
if(document.getElementById("message_sticky") && document.getElementById("message_locked")){
document.getElementById("message_sticky").checked=false;
document.getElementById("message_locked").checked=false;
}
$("#topic_attachments").html("<%= escape_javascript(render :partial => 'attachments/form_course', :locals => {:container => Message.new, :isReply => @isReply})%>");
message_content_editor.html("");
$("#topic_editor").toggle();

View File

@ -22,6 +22,7 @@
<div class="cl"></div>
<div class="courseSendCancel mr15" style="float:right;"><a href="javascript:void(0);" class="sendSourceText" onclick="clickCanel();">取消</a></div>
<div class="courseSendSubmit" style="float:right;"><a href="javascript:void(0);" class="sendSourceText" onclick="clickOK()">确定</a></div>
<span class="c_red fl" id="choose_member_notice"></span>
<div class="cl"></div>
</div>
<script type="text/javascript">
@ -82,10 +83,8 @@
}
function delete_student(id) {
$("#choose_member_notice").hide();
$("#choose_student_"+id).remove();
$("#student_"+id).one("click",function choose_student() {
$("#choose_students_list").append("<li id='choose_student_"+id+"' onclick='delete_student("+id+");'>"+$("#student_"+id).html()+"</li>");
});
}
$(document).ready(function(){

View File

@ -2,10 +2,10 @@
<div>
<span class="fl" style="width:280px;" onclick="show_student_work('<%= contestant_work_path(student_work)%>');">
<span class="hidden fl" style="max-width:220px;"><%= student_work.name %></span>
<span class="fontGrey2 ml5 fl">
<% if student_work.work_status %>
<%= get_status student_work.work_status %>
<% end %>
<span class="fontGrey2 ml5 fl">已提交
<%# if student_work.work_status %>
<%#= get_contest_new_status student_work.work_status %>
<%# end %>
</span>
</span>
<a href="javascript:void(0)" class="linkBlue2 fr" onclick="show_student_work('<%= contestant_work_path(student_work)%>');">评分</a>

View File

@ -2,10 +2,10 @@
<div>
<span class="fl" style="width:280px;" onclick="show_student_work('<%= contestant_work_path(student_work)%>');">
<span class="hidden fl" style="max-width:220px;"><%= student_work.name %></span>
<span class="fontGrey2 ml5 fl">
<% if student_work.work_status %>
<%= get_status student_work.work_status %>
<% end %>
<span class="fontGrey2 ml5 fl">已提交
<%# if student_work.work_status %>
<%#= get_contest_new_status student_work.work_status %>
<%# end %>
</span>
</span>
<a href="javascript:void(0)" class="linkBlue2 fr" onclick="show_student_work('<%= contestant_work_path(student_work)%>');">查看</a>

View File

@ -13,8 +13,8 @@
<% my_work = cur_user_works_for_work @contestwork %>
<% if !@is_teacher && !@is_judge && my_work.nil? && User.current.member_of_contest?(@contest) %>
<span class="f12 c_red">您尚未提交作品</span>
<% if @contestwork.work_status == 1 && (@contestwork.work_type != 3 ||(@contestwork.work_type == 3 && !@contestwork.work_detail_group.base_on_project)) %>
<%=link_to "提交作品", new_contestant_work_path(:work => @contestwork.id),:class => 'blueCir ml5 f12' %>
<% if @contestwork.work_type != 3 ||(@contestwork.work_type == 3 && !@contestwork.work_detail_group.base_on_project) %>
<%=link_to @contestwork.work_status == 1 ? "提交作品" : "补交作品", new_contestant_work_path(:work => @contestwork.id),:class => 'blueCir ml5 f12' %>
<% end %>
<% elsif !@is_teacher && !@is_judge && my_work && @contestwork.work_status > 1 && !@stundet_works.empty?%>
<span class="f12 c_red">截止日期已过,已提交且不可修改</span>

View File

@ -12,7 +12,7 @@
<%=get_cw_status(homework).html_safe %>
<div class="cl"></div>
<% if homework.work_type == 3 && homework.work_detail_group.base_on_project %>
<span class="c_red">系统提示:该题目要求各组长<%=link_to "创建项目", new_project_path(:host=>Setting.host_name),:class=>"linkBlue",:title=>"新建项目",:style=>"text-decoration:underline;"%>,组成员加入项目,然后由组长关联项目。谢谢配合!</span>
<span class="c_red">系统提示:该题目要求各组长<%=link_to "创建项目", new_project_path(:host=>Setting.host_name, :contest_id => homework.contest_id),:target => "_blank",:class=>"linkBlue",:title=>"新建项目",:style=>"text-decoration:underline;"%>,组成员加入项目,然后由组长关联项目。谢谢配合!</span>
<% elsif homework.work_type == 3 && !homework.work_detail_group.base_on_project%>
<span class="c_red">系统提示:该题目要求各组长提交作品,提交作品时请添加组成员。谢谢配合!</span>
<% end %>

View File

@ -19,24 +19,39 @@ if(lists.length > 0) {
}
}
}
<% if user.id.to_i != User.current.id.to_i && (@commit_student_ids.find{|e| e.to_i == user.id.to_i}).nil? && user.contestant_of_contest?(@contest) %>
<%# if user.id.to_i != User.current.id.to_i && (@commit_student_ids.find{|e| e.to_i == user.id.to_i}).nil? && user.contestant_of_contest?(@contest) %>
<% if user.id.to_i != User.current.id.to_i && (@commit_student_ids.find{|e| e.to_i == user.id.to_i}).nil? %>
if (str.indexOf(<%=user.id.to_s %>) < 0 && choose_str.indexOf(<%=user.id.to_s %>) < 0) {
$("#student_<%=user.id %>").one("click",function choose_student() {
var li = "<li id='choose_student_<%=user.id %>'";
<% if user.id.to_i != User.current.id.to_i %>
li += " onclick='delete_student(<%=user.id %>);'";
<% end %>
li += ">" + $("#student_<%=user.id %>").html()+"<input name='member_id[]' value='<%=user.id %>' type='hidden'/></li>";
$("#choose_students_list").append(li);
$("#student_<%=user.id %>").on("click",function choose_student() {
if($("#choose_student_<%=user.id %>").length > 0){
$("#choose_member_notice").html("该成员已添加");
$("#choose_member_notice").show();
} else{
$("#choose_member_notice").hide();
var li = "<li id='choose_student_<%=user.id %>'";
<% if user.id.to_i != User.current.id.to_i %>
li += " onclick='delete_student(<%=user.id %>);'";
<% end %>
li += ">" + $("#student_<%=user.id %>").html()+"<input name='member_id[]' value='<%=user.id %>' type='hidden'/></li>";
$("#choose_students_list").append(li);
}
});
}
<% elsif !user.contestant_of_contest?(@contest) %>
if (str.indexOf(<%=user.id.to_s %>) < 0) {
$("#student_<%=user.id %>").attr("title","该项目成员不是本竞赛的参赛者");
}
<%# elsif !user.contestant_of_contest?(@contest) %>
//if (str.indexOf(<%#=user.id.to_s %>) < 0) {
// $("#student_<%#=user.id %>").attr("title","该项目成员不是本竞赛的参赛者");
//}
<% else %>
if (str.indexOf(<%=user.id.to_s %>) < 0) {
$("#student_<%=user.id %>").attr("title","该成员已加入其它分组");
$("#student_<%=user.id %>").on("click",function() {
$("#choose_member_notice").html("该成员已加入其它分组");
$("#choose_member_notice").show();
});
} else{
$("#student_<%=user.id %>").on("click",function() {
$("#choose_member_notice").html("该成员已添加");
$("#choose_member_notice").show();
});
}
<% end %>
<% end %>

View File

@ -1,4 +1,7 @@
<% if @members.count != 0 %>
<div>
<%= link_to "导出作业成绩", export_course_member_excel_course_path(@course, :format => 'xls'), :class => 'link-blue fr mb5'%>
</div>
<table class="muban_table clearfix mb15 t-center" cellpadding="0" cellspacing="0">
<thead>
<tr>

View File

@ -23,6 +23,7 @@
<li><a href="<%= edit_exercise_path(exercise.id) %>" class="postOptionLink" title="编辑试卷">编&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;辑</a></li>
<% end%>
<li><a href="<%= exercise_path(exercise.id) %>" class="postOptionLink" title="查看试卷">查&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;看</a></li>
<li><a href="javascript:void(0)" onclick="send_exercise_to_course();" class="postOptionLink" title="发送到班级">发&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;送</a></li>
<% if exercise.exercise_status == 1 %>
<% end_time_status = exercise.end_time.nil? ? 1 : (exercise.end_time <= Time.now ? 2 : 3) %>
<li><a href="javascript:" class="postOptionLink" onclick="exercise_submit(<%=end_time_status %>,<%= exercise.id%>,<%= exercise.exercise_name.length %>,<%=index.to_i %>);">发布试卷</a></li>
@ -101,4 +102,11 @@
</div>
<% end%>
<% end%>
<% end%>
<script>
function send_exercise_to_course(){
var htmlvalue = "<%= escape_javascript(render :partial => 'exercise/send_to_course', :locals => {:exercise => exercise}) %>";
pop_box_new(htmlvalue, 450, 325);
}
</script>

View File

@ -153,12 +153,14 @@
<%= render :partial => 'exercise/total_questions_score', :locals => {:exercise => exercise, :current_score => current_score} %>
</div>
<div class="ur_buttons" style="width: 220px;">
<div class="ur_buttons" style="width: 297px;">
<%= link_to "返回", exercise_index_path(:course_id => @course.id),:class => "btn_grey_64_width" %>
<a href="javascript:void(0)" onclick="send_exercise_to_course();" class="btn_green_64_width ml10 mr10">发送</a>
<% if exercise.exercise_status == 1 %>
<%= link_to l(:button_edit), edit_exercise_path(exercise.id), :class => "btn_blue_64_width" %>
<a class="btn_green_64_width mr10" onclick="$.get('<%= publish_exercise_exercise_path(@exercise) %>');">立即发布</a>
<%= link_to l(:button_edit), edit_exercise_path(exercise.id), :class => "btn_blue_64_width" %>
<% else %>
<span class="btn_grey_64_width mr10" title="测验已发布">立即发布</span>
<span class="btn_grey_64_width" title="测验已发布,不可再编辑">编辑</span>
<% end %>
</div>

View File

@ -5,13 +5,13 @@
(<%= @exercise_count%>人已答)
</font>
</span>
<%#if @is_teacher || @exercise.exercise_status == 3%>
<!--<div class="hworkSearchBox">
<input type="text" id="course_student_name" value="<%#= @name%>" placeholder="姓名、学号、邮箱" class="hworkSearchInput" onkeypress="SearchByName('<%#= student_work_index_path(:homework => @homework.id)%>',event);"/>
<a class="hworkSearchIcon" id="search_in_student_work" onclick="SearchByName_1('<%#= student_work_index_path(:homework => @homework.id)%>');" href="javascript:void(0)"></a>
</div>-->
<%#= select_tag(:student_work_in_group,options_for_select(course_group_list(@course),@group), {:class => "classSplit"}) unless course_group_list(@course).empty? %>
<%# end%>
<%if @is_teacher || @exercise.exercise_status == 3%>
<div class="hworkSearchBox">
<input type="text" id="course_student_name" value="<%= @name%>" placeholder="姓名、学号、邮箱" class="hworkSearchInput" onkeypress="SearchByName('<%= student_exercise_list_exercise_path(@exercise)%>',event);"/>
<a class="hworkSearchIcon" id="search_in_student_work" onclick="SearchByName_1('<%= student_exercise_list_exercise_path(@exercise)%>');" href="javascript:void(0)"></a>
</div>
<%= select_tag(:student_work_in_group,options_for_select(course_group_list(@course),@select_group), {:class => "classSplit"}) unless course_group_list(@course).empty? %>
<% end %>
<span class="fr c_grey"> <a href="javascript:void(0);" class="linkGrey2" id="homework_info_show" onclick="show_or_hide_info();" style="display: none">[ 显示测验信息 ]</a> </span>
<div class="group_work_tip_box fontGrey2">

View File

@ -47,7 +47,7 @@
<script type="text/javascript">
$(function(){
<% if Time.parse(h(@exercise.end_time)).strftime("%Y-%m-%d-%H-%M-%S") <= Time.now.strftime("%Y-%m-%d-%H-%M-%S") %>
<% if (!@exercise.time.nil? && @exercise.time != -1) || Time.parse(h(@exercise.end_time)).strftime("%Y-%m-%d-%H-%M-%S") <= Time.now.strftime("%Y-%m-%d-%H-%M-%S") %>
$(".student_work_<%= exercise.id%>").mouseenter(function(){
$("#work_click_<%= exercise.id%>").show();
}).mouseleave(function(){

View File

@ -2,5 +2,5 @@
$("#exercises_<%= @exercise.id %>").html("<%= escape_javascript(render :partial => 'exercise',:locals => {:exercise => @exercise,:index =>@index}) %>");
notice_box("发布成功");
<% else %>
notice_box_redirect('<%= exercise_url(@exercise) %>', '发布成功');
notice_box_redirect('<%= exercise_index_path(:course_id => @course.id) %>', '发布成功');
<% end %>

View File

@ -1,5 +1,5 @@
$("#exercises_<%= @exercise.id %>").html("<%= escape_javascript(render :partial => 'exercise',:locals => {:exercise => @exercise,:index => @index}) %>");
var htmlvalue = '<div id="muban_popup_box" style="width:400px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
var htmlvalue = '<div id="muban_popup_box" style="width:300px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
'<div class="clear muban_popup_con"><div class="newupload_conbox newupload_tishi"><p>取消成功</p>' +
'<a href="javascript:void(0);" class="btn btn-blue mt10" onclick="hideModal();">知道了</a></div></div></div>';
pop_box_new(htmlvalue, 400, 152);
pop_box_new(htmlvalue, 300, 152);

View File

@ -114,7 +114,7 @@
<div class="hworkListContainer">
<div class="ctt2">
<div class="dis" id="homework_student_work_list">
<div class="dis" id="exercise_student_work_list">
<%= render :partial => "exercise/student_exercise"%>
</div>
</div>

View File

@ -0,0 +1,2 @@
$("#exercise_student_work_list").html("<%= escape_javascript(render :partial => 'exercise/student_exercise') %>");
$("#export_student_work").replaceWith("<%= escape_javascript( link_to "导出成绩", student_exercise_list_exercise_path(@exercise.id,:course_id => @course.id, :group => @select_group, :name => @name, :format => 'xls'),:class=>'linkBlue', :id => 'export_student_work') %>");

View File

@ -1,23 +1,24 @@
<script src="/javascripts/jquery.datetimepicker.js" type="text/javascript"></script>
<div id="muban_popup_box" style="width:300px;">
<div id="muban_popup_box" style="width:340px;">
<div class="muban_popup_top">
<h3 class="fl">发布设置</h3>
<a href="javascript:void(0);" class="muban_icons_close fr" onclick="$('#datetimepicker_mask').datetimepicker('destroy');"></a>
<div class="cl"></div>
</div>
<div class="muban_popup_con clear mt15" style="margin-left: 47px;">
<div class="muban_popup_con clear mt15" style="margin-left: 37px;">
<%= form_tag(republish_file_course_file_path(@course,@file), :multipart => true,:remote => !ie8?,:name=>"upload_form") do %>
<div class="mb10">
<label class="fl c_dark f14" style="margin-top: 4px;">延期发布:</label>
<div class="calendar_div fl">
<input type="text" name="publish_time" id="datetimepicker_mask" placeholder="发布时间" style="width: 130px;" class="InputBox fl calendar_input" value="<%=format_time(@file.publish_time) %>">
<input type="text" name="publish_time" id="datetimepicker_mask" readonly="readonly" placeholder="发布时间" style="width: 130px;" class="InputBox fl calendar_input" value="<%=format_time(@file.publish_time) %>">
<%#= calendar_for('attachment_publish_time')%>
</div>
<a href="javascript:void(0)" id="reset_time" class="fl sy_btn_grey ml10" style="display: none;" onclick="reset_publish_time();">清空</a>
<span class="fl c_red" style="margin-top: 4px;" id="publish_time_notice"></span>
<div class="cl"></div>
</div>
<a href="javascript:void(0);" class="fr sy_btn_blue" style="margin-right: 95px;" id="submit_file" onclick="submit_republish_file();">确定</a>
<a href="javascript:void(0);" class="fr sy_btn_blue" style="margin-right: 115px;" id="submit_file" onclick="submit_republish_file();">确定</a>
<a href="javascript:void(0);" class="fr sy_btn_grey mr5" onclick="$('#datetimepicker_mask').datetimepicker('destroy');hideModal();">取消</a>
<% end %>
</div>
@ -51,6 +52,11 @@
$('#submit_file').parent().submit();
}
}
function reset_publish_time(){
$("#datetimepicker_mask").val('');
$("#reset_time").hide();
}
$(function(){
$('#datetimepicker_mask').datetimepicker({
allowBlank:true,
@ -58,7 +64,13 @@
format:'Y-m-d H:i',
formatTime:'H:i',
formatDate:'Y-m-d',
validateOnBlur:false
validateOnBlur:false,
onSelectDate:function() {
$("#reset_time").show();
},
onSelectTime:function() {
$("#reset_time").show();
}
});
});
</script>

View File

@ -52,6 +52,7 @@
<div class="calendar_div fl ml10">
<input type="text" name="publish_time" id="datetimepicker_mask" placeholder="发布时间(可选)" style="width: 130px;" class="InputBox fl calendar_input" readonly="readonly">
</div>
<a href="javascript:void(0)" id="reset_time" class="fl sy_btn_grey ml10" style="display: none;" onclick="reset_publish_time();">清空</a>
<div class="cl"></div>
<span class="c_red f12" style="margin-top: 4px;" id="publish_time_notice"></span>
<div class="cl"></div>
@ -109,6 +110,10 @@
$('#submit_resource').parent().submit();
<% end %>
}
function reset_publish_time(){
$("#datetimepicker_mask").val('');
$("#reset_time").hide();
}
$(function(){
$('#datetimepicker_mask').datetimepicker({
allowBlank:true,
@ -116,7 +121,13 @@
format:'Y-m-d H:i',
formatTime:'H:i',
formatDate:'Y-m-d',
validateOnBlur:false
validateOnBlur:false,
onSelectDate:function() {
$("#reset_time").show();
},
onSelectTime:function() {
$("#reset_time").show();
}
});
});
</script>

View File

@ -1,2 +1,2 @@
var htmlvalue = '<%= escape_javascript(render :partial => 'files/hidden_file',:locals => {:course => @course,:course_attachment_type => 1}) %>';
pop_box_new(htmlvalue, 300, 140);
pop_box_new(htmlvalue, 340, 140);

View File

@ -26,8 +26,11 @@
<%= link_to image_tag(url_to_avatar(topic.author), :width => 50,:height => 50,:alt => '贴吧图片'), user_path(topic.author) if topic.author%>
</div>
<div class="postDetailWrap">
<div class="postDetailTitle fl">
<a href="<%= forum_memo_path(topic.forum, topic) %>" class="f14 linkGrey4 fb"><%=topic.subject%></a>
<div class="postDetailTitle" style="display: inline-block;">
<a href="<%= forum_memo_path(topic.forum, topic) %>" class="fl f14 linkGrey4 fb" style="max-width: 550px"><%= topic.subject %></a>
<% if topic.sticky && !params[:id].blank? %>
<span class="fl ml10 red-cir-btn">顶</span>
<% end %>
</div>
<div class="postDetailReply fr">
<a href="<%= forum_memo_path(topic.forum, topic)%>" class="postReplyIcon mr5" target="_blank"></a>

View File

@ -7,7 +7,7 @@
<%= form_for('new_form',:url =>{:controller => 'student_work',:action => 'set_score_rule',:homework => homework.id,:student_path => student_path,:user_activity_id=>user_activity_id,:hw_status=>hw_status},:method => "post", :remote => !student_path) do |f|%>
<div class="muban_popup_con clear">
<div class="clear mt15 ml20">
<ul class="pro_newsetting_con fl">
<ul class="pro_newsetting_con fl" style="max-height: 440px; overflow: auto;">
<li class="mb10 fl">
<label class="pop_box_label fl">迟交扣分&nbsp;&nbsp;:&nbsp;</label>
<input type="text" name="late_penalty" id="late_penalty_num" placeholder="0-50" class="fl w180" value="<%= homework.late_penalty%>" onkeyup="check_late_penalty('late_penalty_num')"/>

View File

@ -7,7 +7,7 @@
<%= form_for('new_form',:url =>{:controller => 'student_work',:action => 'set_score_rule',:homework => homework.id,:student_path => student_path,:user_activity_id=>user_activity_id,:hw_status=>hw_status},:method => "post", :remote => !student_path) do |f|%>
<div class="muban_popup_con clear">
<div class="clear mt15 ml20">
<ul class="pro_newsetting_con fl">
<ul class="pro_newsetting_con fl" style="max-height: 440px; overflow: auto;">
<li class="mb10 fl">
<label class="pop_box_label fl">迟交扣分&nbsp;&nbsp;:&nbsp;</label>
<input type="text" name="late_penalty" id="late_penalty_num" placeholder="0-50" class="fl w180" value="<%= homework.late_penalty%>" onkeyup="check_late_penalty('late_penalty_num')"/>

View File

@ -1,7 +1,7 @@
<% if @homework.homework_type == 2 %>
<% if @homework.anonymous_comment == 0 %>
var htmlvalue = "<%= escape_javascript(render :partial => 'homework_common/set_score_rule_pro',:locals => {:homework => @homework, :student_path => false, :user_activity_id => @user_activity_id,:hw_status => @hw_status}) %>";
pop_box_new(htmlvalue, 630, 772);
pop_box_new(htmlvalue, 630, 500);
<% else %>
var htmlvalue = "<%= escape_javascript(render :partial => 'homework_common/set_score_rule_pro_anon',:locals => {:homework => @homework, :student_path => false, :user_activity_id => @user_activity_id,:hw_status => @hw_status}) %>";
pop_box_new(htmlvalue, 530, 404);
@ -9,7 +9,7 @@
<% else %>
<% if @homework.anonymous_comment == 0 %>
var htmlvalue = "<%= escape_javascript(render :partial => 'homework_common/set_score_rule_non_pro',:locals => {:homework => @homework, :student_path => false, :user_activity_id => @user_activity_id,:hw_status => @hw_status}) %>";
pop_box_new(htmlvalue, 630, 742);
pop_box_new(htmlvalue, 630, 500);
<% else %>
var htmlvalue = "<%= escape_javascript(render :partial => 'homework_common/set_score_rule_none_pro_anon',:locals => {:homework => @homework, :student_path => false, :user_activity_id => @user_activity_id,:hw_status => @hw_status}) %>";
pop_box_new(htmlvalue, 530, 332);

View File

@ -4,7 +4,7 @@
<p class="fl ml10 ">高校教育大数据服务平台</p>
</div>
<a href="<%= user_join_path %>" class="fr new-btn mt10">注册</a>
<a href="<%= signin_url %>" class="fr new-btn new-btn-green mr5 mt10">登录</a>
<a href="<%= signin_url %>" class="fr new-btn new-btn-blue mr5 mt10">登录</a>
<div id="navHomepageSearch">
<% name = name%>
<%= form_tag({controller: :welcome, action: :search },:class=>'navHomepageSearchBox', method: :get) do %>

View File

@ -1,9 +1,9 @@
<footer class="inner-footer">
<footer class="inner-footer" id="new_footer">
<div class="inner-footer_con">
<ul class="clearfix inner-footer-nav">
<li><a href="<%= home_path %>" class="fl" target="_blank">网站首页</a></li>
<li><a href="<%= agreement_path %>" class="fl" target="_blank">服务协议</a></li>
<li><%= link_to l(:label_surpport_group), "#{Setting.protocol}://#{Setting.host_name}/forums/1/memos/1168", :class => "fl", :target=>"_blank" %></li>
<li><%= link_to "支持", "#{Setting.protocol}://#{Setting.host_name}/forums/1/memos/1168", :class => "fl", :target=>"_blank" %></li>
<li><a href="<%= forums_path %>" class="fl" target="_blank">社区</a></li>
</ul>
<div class="cl"></div>
@ -31,4 +31,4 @@
</div>
<div class="cl"></div>
</div>
</footer>
</footer>

View File

@ -12,7 +12,7 @@
<% elsif ma.course_message_type == "Comment" %>
<li><a href="<%=news_path(ma.course_message.commented.id) %>" target="_blank" title="<%=ma.course_message.author.show_name %> 评论了通知:<%=ma.course_message.commented.title%>"><span class="shadowbox_news_user"><%=ma.course_message.author.show_name %> </span>评论了通知:<%= ma.course_message.commented.title%></a></li>
<% elsif ma.course_message_type == "HomeworkCommon" && ma.status.nil? %>
<li><a href="<%= (!User.current.allowed_to?(:as_teacher, ma.course_message.course) && cur_user_works_for_homework(ma.course_message).nil?) ? new_student_work_path(:homework => ma.course_message.id) : student_work_index_path(:homework => ma.course_message.id) %>" target="_blank" title="<%=ma.course_message.user.show_name %>老师 发布了班级作业:作业标题:<%= ma.course_message.name%>"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %>老师 </span>发布了班级作业:作业标题:<%= ma.course_message.name%></a></li>
<li><a href="<%= student_work_index_path(:homework => ma.course_message.id) %>" target="_blank" title="<%=ma.course_message.user.show_name %>老师 发布了班级作业:作业标题:<%= ma.course_message.name%>"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %>老师 </span>发布了班级作业:作业标题:<%= ma.course_message.name%></a></li>
<% elsif ma.course_message_type == "HomeworkCommon" && ma.status == 1 %>
<li><a href="<%= student_work_index_path(:homework => ma.course_message.id) %>" target="_blank" title="<%=ma.course_message.user.show_name %>老师 发布的作业:作业标题:<%= ma.course_message.name%>的截止日期快到了"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %>老师 </span>发布的作业:作业标题:<%= ma.course_message.name%>的截止日期快到了</a></li>
<% elsif ma.course_message_type == "HomeworkCommon" && ma.status == 2 %>
@ -59,7 +59,7 @@
<% if ma.course_message.jour_type == 'Course' %>
<li><a href="<%= course_feedback_path(ma.course_id) %>" target="_blank" title="<%=ma.course_message.user.show_name %> 在班级中留言了:<%= message_content(ma.course_message.notes)%>"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %> </span>在班级中留言了:<%= message_content(ma.course_message.notes)%></a></li>
<% elsif ma.course_message.jour_type == 'HomeworkCommon' %>
<li><a href="<%= homework_common_index_url_in_org(ma.course_id) %>" target="_blank" title="<%=ma.course_message.user.show_name %> <%=ma.course_message.m_parent_id.nil? ? '回复了您的作业:' : '在作业中回复了您:' %><%= message_content(ma.course_message.notes)%>"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %> </span><%=ma.course_message.m_parent_id.nil? ? '回复了您的作业:' : '在作业中回复了您:' %><%= message_content(ma.course_message.notes)%></a></li>
<li><a href="<%= student_work_index_path(:homework => ma.course_message.jour.id) %>" target="_blank" title="<%=ma.course_message.user.show_name %> <%=ma.course_message.m_parent_id.nil? ? '回复了您的作业:' : '在作业中回复了您:' %><%= message_content(ma.course_message.notes)%>"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %> </span><%=ma.course_message.m_parent_id.nil? ? '回复了您的作业:' : '在作业中回复了您:' %><%= message_content(ma.course_message.notes)%></a></li>
<% else %>
<% show_name = ma.course_message.jour.reviewer_role != 3 || ma.course_message.user.allowed_to?(:as_teacher, ma.course) %>
<li><a href="<%= student_work_index_path(:homework => ma.course_message.jour.student_work.homework_common_id,:show_work_id => ma.course_message.jour.student_work_id) %>" target="_blank" title="<%=show_name ? ma.course_message.user.show_name + "#{ma.course_message.user.allowed_to?(:as_teacher, ma.course)?"老师":"同学"}" : "匿名用户" %> 回复了作品评论:<%= message_content(ma.course_message.notes)%>"><span class="shadowbox_news_user"><%=show_name ? ma.course_message.user.show_name + "#{ma.course_message.user.allowed_to?(:as_teacher, ma.course)?"老师":"同学"}" : "匿名用户" %> </span>回复了作品评论:<%= message_content(ma.course_message.notes)%></a></li>
@ -101,11 +101,13 @@
<% elsif ma.contest_message_type == "Comment" %>
<li><a href="<%=news_path(ma.contest_message.commented.id) %>" target="_blank" title="<%=ma.contest_message.author.show_name %> 回复了竞赛通知:<%=ma.contest_message.commented.title%>"><span class="shadowbox_news_user"><%=ma.contest_message.author.show_name %> </span>回复了竞赛通知:<%= ma.contest_message.commented.title%></a></li>
<% elsif ma.contest_message_type == "Work" && ma.status.nil? %>
<li><a href="<%= User.current.contestant_of_contest?(ma.contest_message.contest) && cur_user_works_for_work(ma.contest_message).nil? && ma.contest_message.work_status == 1 ? new_contestant_work_path(:work => ma.contest_message.id) : contestant_works_path(:work => ma.contest_message.id) %>" target="_blank" title="<%=ma.contest_message.user.show_name %> 发布了竞赛题:<%= ma.contest_message.name%>"><span class="shadowbox_news_user"><%=ma.contest_message.user.show_name %> </span>发布了竞赛题:<%= ma.contest_message.name%></a></li>
<li><a href="<%= contestant_works_path(:work => ma.contest_message.id) %>" target="_blank" title="<%=ma.contest_message.user.show_name %> 发布了竞赛题:<%= ma.contest_message.name%>"><span class="shadowbox_news_user"><%=ma.contest_message.user.show_name %> </span>发布了竞赛题:<%= ma.contest_message.name%></a></li>
<% elsif ma.contest_message_type == "Work" && ma.status == 1 %>
<li><a href="<%= contestant_works_path(:work => ma.contest_message.id) %>" target="_blank" title="<%=ma.contest_message.user.show_name %> 发布的竞赛题:<%= ma.contest_message.name%>的截止日期快到了"><span class="shadowbox_news_user"><%=ma.contest_message.user.show_name %> </span>发布的竞赛题:<%= ma.contest_message.name%>的截止时间快到啦</a></li>
<% elsif ma.contest_message_type == "Work" && ma.status == 2 %>
<li><a href="<%= contestant_works_path(:work => ma.contest_message.id) %>" target="_blank" title="<%=ma.contest_message.user.show_name %> 启动了在线评审:<%= ma.contest_message.name%>"><span class="shadowbox_news_user"><%=ma.contest_message.user.show_name %> </span>启动了在线评审:<%= ma.contest_message.name%></a></li>
<% elsif ma.contest_message_type == "Work" && ma.status == 3 %>
<li><a href="<%= contestant_works_path(:work => ma.contest_message.id) %>" target="_blank" title="<%=ma.contest_message.user.show_name %> 关闭了在线评审:<%= ma.contest_message.name%>"><span class="shadowbox_news_user"><%=ma.contest_message.user.show_name %> </span>关闭了在线评审:<%= ma.contest_message.name%></a></li>
<% elsif ma.contest_message_type == "Work" && ma.status == 4 %>
<li><a href="<%= contestant_works_path(:work => ma.contest_message.id) %>" target="_blank" title="<%=ma.contest_message.user.show_name %> 在线评审启动失败(评委数为0或作品数为0)<%= ma.contest_message.name%>"><span class="shadowbox_news_user"><%=ma.contest_message.user.show_name %> </span>在线评审启动失败(评委数为0或作品数为0)<%= ma.contest_message.name%></a></li>
<% elsif ma.contest_message_type == "Work" && ma.status == 5 %>
@ -137,7 +139,10 @@
<li><a href="<%=contest_path(ma.contest) %>" target="_blank" title="<%=User.find(ma.contest_message_id).show_name %> 将您加入了竞赛:<%= ma.contest.name%>"><span class="shadowbox_news_user"><%=User.find(ma.contest_message_id).show_name %> </span>将您加入了竞赛:<%= ma.contest.name%></a></li>
<% elsif ma.contest_message_type == "JoinContest" and ma.status == 1 %>
<li><a href="<%=settings_contest_path(ma.contest_id, :tab=>'member') %>" target="_blank" title="系统提示 您增加了新的竞赛成员:<%= User.find(ma.contest_message_id).login+"("+User.find(ma.contest_message_id).show_name+")"%>"><span class="shadowbox_news_user">系统提示 </span>您增加了新的竞赛成员:<%= User.find(ma.contest_message_id).login+"("+User.find(ma.contest_message_id).show_name+")"%></a></li>
<% elsif ma.contest_message_type == "JoinContest" and ma.status == 1 %>
<% elsif ma.contest_message_type == "JoinContest" and ma.status == 2 %>
<% user = User.find(ma.contest_message_id) %>
<li><a href="<%=contest_path(ma.contest) %>" target="_blank" title="<%=user.show_name %> <%= user.user_extensions.school_id.blank? || user.user_extensions.school.nil? ? '' : '来自'+user.user_extensions.school.name+'' %>以'参赛者'的身份加入了竞赛:<%= ma.contest.name%>"><span class="shadowbox_news_user"><%=user.show_name %> </span><%= user.user_extensions.school_id.blank? || user.user_extensions.school.nil? ? '' : '来自'+user.user_extensions.school.name+'' %>以'参赛者'的身份加入了竞赛:<%= ma.contest.name%></a></li>
<% elsif ma.contest_message_type == "RemoveFromContest" %>
<li><a href="<%=contest_path(ma.contest) %>" target="_blank" title="<%=User.find(ma.contest_message_id).show_name %> 将您移出了竞赛:<%= ma.contest.name%>"><span class="shadowbox_news_user"><%=User.find(ma.contest_message_id).show_name %> </span>将您移出了竞赛:<%= ma.contest.name%></a></li>
<% end %>
<% elsif ma.class == AppliedMessage %>

View File

@ -4,7 +4,7 @@
</div>
<div id="navHomepageSearch">
<% name = name%>
<%= form_tag({controller: :welcome, action: :search },:class=>'navHomepageSearchBox', method: :get) do %>
<%= form_tag({controller: :welcome, action: :search }, method: :get) do %>
<input type="text" name="q" value="<%= name.nil? ? "" : name %>" id="navHomepageSearchInput" class="new-search fl ml10 mr10" placeholder="请输入关键词进行搜索" onkeypress="search_in_header_I(event,$(this));"/>
<input type="hidden" name="search_type" id="type" value="all"/>
<input type="text" style="display: none;"/>
@ -17,7 +17,7 @@
</li>
</ul>
<a href="<%= user_join_path %>" class="fr new-btn mt10">注册</a>
<a href="<%= signin_path %>" class="fr new-btn new-btn-green mr5 mt10">登录</a>
<a href="<%= signin_path %>" class="fr new-btn new-btn-blue mr5 mt10">登录</a>
</div>
<script>

View File

@ -7,7 +7,7 @@
<meta name="keywords" content="issue,bug,tracker" />
<%= csrf_meta_tag %>
<%= favicon %>
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/common', 'css/structure','css/public', 'prettify','css/project','css/courses','css/popup','syllabus','css/moduel', 'css/user', 'css/font-awesome', :media => 'all' %>
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/common', 'css/structure','css/public', 'prettify','css/project','css/courses','css/popup','css/syllabus','css/moduel', 'css/user', 'css/font-awesome', :media => 'all' %>
<%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
<%= javascript_heads %>
<%= javascript_include_tag "bootstrap","avatars","new_user",'attachments','prettify','contest'%>

View File

@ -12,7 +12,7 @@
<%= javascript_heads %>
<%= heads_for_theme %>
<%= call_hook :view_layouts_base_html_head %>
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/common','css/public', 'css/structure','prettify', 'css/courses','css/popup','sy_public','syllabus', 'css/moduel','css/contest', 'css/font-awesome' %>
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/common','css/public', 'css/structure','prettify', 'css/courses','css/popup','sy_public','css/syllabus', 'css/moduel','css/contest', 'css/font-awesome' %>
<%= javascript_include_tag "course","avatars","header","attachments",'prettify','contest' %>
<!-- page specific tags -->
<%= yield :header_tags -%>

View File

@ -7,7 +7,7 @@
<meta name="keywords" content="issue,bug,tracker" />
<%= csrf_meta_tag %>
<%= favicon %>
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/common', 'css/structure','css/public', 'prettify','css/project','css/courses','css/popup','syllabus','css/moduel', 'css/user', 'css/font-awesome', :media => 'all' %>
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/common', 'css/structure','css/public', 'prettify','css/project','css/courses','css/popup','css/syllabus','css/moduel', 'css/user', 'css/font-awesome', :media => 'all' %>
<%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
<%= javascript_heads %>
<%= javascript_include_tag "bootstrap","avatars","new_user",'attachments','prettify'%>

View File

@ -19,7 +19,7 @@
<%= javascript_heads %>
<%= heads_for_theme %>
<%= call_hook :view_layouts_base_html_head %>
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/common','css/public', 'css/structure','prettify', 'css/courses','css/popup','sy_public','css/syllabus', 'css/moduel', 'css/font-awesome','css/contest','css/font-awesome' %>
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/common','css/public', 'css/structure','prettify', 'css/courses','css/popup','sy_public','css/syllabus', 'css/moduel', 'css/font-awesome','css/contest' %>
<%= javascript_include_tag "course","avatars","header","attachments",'prettify' %>
<!-- page specific tags -->
<%= yield :header_tags -%>

View File

@ -7,7 +7,7 @@
<meta name="keywords" content="issue,bug,tracker" />
<%= csrf_meta_tag %>
<%= favicon %>
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/common', 'css/structure','css/public', 'prettify','css/project','css/courses','css/popup','css/syllabus','css/moduel', 'css/user', :media => 'all' %>
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/common', 'css/structure','css/public', 'prettify','css/project','css/courses','css/popup','css/syllabus','css/moduel', 'css/user', 'css/font-awesome', :media => 'all' %>
<%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
<%= javascript_heads %>
<%= javascript_include_tag "bootstrap","avatars","new_user",'attachments','prettify'%>

View File

@ -7,18 +7,21 @@
<meta name="keywords" content="issue,bug,tracker" />
<%= csrf_meta_tag %>
<%= favicon %>
<%= stylesheet_link_tag 'css/login', 'css/font-awesome' %>
<%= stylesheet_link_tag 'css/bigdata-showpage', 'css/font-awesome', 'css/bigdata-common', 'css/bigdata-login', 'css/bigdata-popup' %>
<%#= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
<%= javascript_heads %>
<%= javascript_include_tag "bootstrap" %>
<%= javascript_include_tag "bootstrap", "bigdata" %>
</head>
<body>
<header class="header">
<% if @welcome %>
<header class="header">
<%= render :partial => User.current.logged? ? 'layouts/logined_header' : 'layouts/unlogin_header' %>
<%#= render :partial => 'layouts/bigdata_header' %>
</header>
<% end %>
<div id="Container">
<%= yield %>
</div>
<%= render :partial => 'layouts/footer' %>
</body>
<%= javascript_include_tag 'bigdata' %>
</html>

View File

@ -13,7 +13,7 @@
<%= javascript_heads %>
<%= heads_for_theme %>
<%= call_hook :view_layouts_base_html_head %>
<%= stylesheet_link_tag 'css/common','css/structure', 'css/public', 'css/courses','prettify', 'css/org', 'syllabus', 'css/font-awesome' %>
<%= stylesheet_link_tag 'css/common','css/structure', 'css/public', 'css/courses','prettify', 'css/org', 'css/syllabus', 'css/font-awesome' %>
<%= javascript_include_tag "course","header",'prettify','contest' %>
<!-- page specific tags -->
<%= yield :header_tags -%>

View File

@ -7,7 +7,7 @@
<meta name="keywords" content="issue,bug,tracker" />
<%= csrf_meta_tag %>
<%= favicon %>
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/common', 'css/structure','css/public', 'prettify','css/project','css/courses','css/popup','css/syllabus','css/moduel', 'css/user', 'css/font-awesome.css', :media => 'all' %>
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/common', 'css/structure','css/public', 'prettify','css/project','css/courses','css/popup','css/syllabus','css/moduel', 'css/user','css/font-awesome', :media => 'all' %>
<%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
<%= javascript_heads %>
<%= javascript_include_tag "bootstrap","avatars","new_user",'attachments','prettify'%>
@ -318,6 +318,8 @@
len = t.length;
for(var i=0;i<len;i++){
t[i].href = 'javascript:void(0)';
// 火狐浏览器点击弹开空白页
t[i].target = '_self';
}
// 退出按钮可用
var d = document.getElementById("logout_trustie");

View File

@ -1,4 +1,68 @@
<p><%= l(:mail_body_lost_password) %><br />
<%= link_to h(@url), @url %></p>
<html>
<head>
<meta charset="utf-8">
<title>邮箱验证码发送</title>
<style type="text/css">
/* 邮箱验证链接页面 */
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;}
ol,ul,li{ list-style-type:none}
.new_content{ background:#fff; width: 100%;}
.email-page-link{ }
.email-link-top{ }
.c_white{ color:#fff;}
.email-link-con{ }
.email-link-line{ }
.email-link-footer{ padding:15px; color:#333; line-height: 1.9; }
.c_grey02{ color: #888;}
.fb{ font-weight: normal;}
.f14{ }
</style>
<p><%= l(:field_login) %>: <b><%=h @token.user.login %></b></p>
</head>
<body style="background:#fff;">
<div class="new_content">
<div style="width: 598px; background:#fff; margin:20px auto; font-size:14px; ">
<div style="height:50px; width: 578px; background:#46484c; padding:9px 10px 6px;border:1px solid #ddd; border-bottom:none;">
<a href="www.trustie.net" >
<img src="http://www.trustie.org/images/bigdata/new-logo.png?1485311929" width="45" height="45" style=" float:left;" >
<p style="color:#fff; float:left; margin-top:15px; margin-left:15px;">高校大数据教育平台</p>
</a>
<div style="clear:both; overflow:hidden;"></div>
</div>
<div style="width: 558px; border-left:1px solid #ddd;border-right:1px solid #ddd; background:#fff; padding:50px 20px; color:#333; line-height: 1.9;">
<p style="color:#333; font-size:16px; margin-bottom:15px;">
亲爱的<span style="font-weight:bold;color:#3b94d6; margin-left:5px; margin-right:5px;"><%= @login %></span>,您好!
</p>
<p style="color:#333;">欢迎使用高校大数据教育平台找回密码功能。<br/>
您此次找回密码的验证码如下,请在<span style=" color:#e72c37;"> 10 分钟</span>内在找回密码页输入此验证码,并进行下一步操作。
如非你本人操作,请忽略此邮件。<br/>
</p>
<div style="text-align: center;">
<div style="display:block; height: 45px; line-height:45px;padding:0 30px; width:100px; font-size: 20px; font-weight: bold; background:#ffd9d9; color:#e72c37; margin:30px auto;">
<p><%= @code %></p>
</div>
<span style="font-weight: normal;color:#666;">
此邮件为系统所发,请勿直接回复。<br/>
要解决问题或了解您的帐户详情,您可以访问 <a href="http://www.trustie.org/forums/1/memos/1168" style="font-weight: normal; color:#3b94d6;">帮助中心</a>。
</span>
</div>
<p style="color:#666; margin-top:30px;">
如果您并未发过此请求,则可能是因为其他用户在尝试重设密码时误输了您的邮件地址,而使您收到了这封邮件,那么您可以放心的忽略此邮件,无需进一步采取任何操作。
</p>
</div>
<div style="padding:20px; color:#333; line-height: 1.9;background:#46484c;border:1px solid #ddd; border-top:none; width: 558px;">
<a href="http://www.trustie.org/" style="font-weight: normal; color:#fff;">www.trustie.org</a>
</div>
</div>
</div>
</body>
</html>

View File

@ -29,7 +29,7 @@
</div>
<div style="width: 558px; border-left:1px solid #ddd;border-right:1px solid #ddd; background:#fff; padding:20px; color:#333; line-height: 1.9;">
<p style="font-size: 14px; color:#333;">
<span style="font-weight:bold;color:#3b94d6;"><%= @login %></span>,您好!<br/>
您好!<br/>
您已经成功注册为Trustie用户<br/>
请点击以下链接激活您的帐号:<br/>
<%= link_to h(@url), @url, :style => "font-weight: normal; color:#3b94d6;" %><br/>

View File

@ -6,7 +6,16 @@
<div class="wenba-tiwen-con">
<ul >
<li class="mb10">
<%= f.text_field :subject, :no_label => true, :id => "memo_subject", :maxlength => "50", :style => "width:708px", :onblur => "check_memo_name();", :onfocus => "$('#memo_name_error_tips').hide();", :onmouseover => "this.style.borderColor='#d9d9d9'", :class => "wenba-tiwen-input", :placeholder => "请输入标题" %>
<%= f.text_field :subject,
:no_label => true,
:id => "memo_subject",
:maxlength => "50",
:style => "width:708px",
:onblur => "check_memo_name();",
:onfocus => "$('#memo_name_error_tips').hide();",
:onmouseover => "this.style.borderColor='#d9d9d9'",
:class => "wenba-tiwen-input",
:placeholder => "请输入标题" %>
<p class="c_red" style="display: none" id="memo_name_error_tips"></p>
<script>
var textarea1 = document.getElementById('memo_subject');

View File

@ -34,6 +34,13 @@
<% if @memo.author.id == User.current.id || User.current.admin? %>
<li><a href="<%= edit_forum_memo_path(@memo.forum,@memo)%>" class="postOptionLink">编辑</a></li>
<% end %>
<% if User.current.admin? || User.current == @forum.creator %>
<% if @memo.sticky %>
<li><a href="<%= change_sticky_forum_memo_path(@memo.forum,@memo) %>" class="postOptionLink">取消置顶</a></li>
<% else %>
<li><a href="<%= change_sticky_forum_memo_path(@memo.forum,@memo) %>" class="postOptionLink">置顶</a></li>
<% end %>
<% end %>
<li><a href="javascript:void(0);" class="postOptionLink" onclick="del_confirm();">删除</a></li>
<li style="display: none"><a href="<%= forum_memo_path(@memo.forum, @memo) %>" data-method="delete" id="del_memo_link" ></a></li>
</ul>

View File

@ -1,5 +1,5 @@
<%= content_for(:header_tags) do %>
<%= import_ke(enable_at: false, prettify: false, init_activity: true) %>
<%= import_ke(enable_at: true, prettify: false, init_activity: true) %>
<% end %>
@ -105,11 +105,18 @@
<em class="talkWrapArrow"></em>
<div class="cl"></div>
<div class="talkConIpt ml5 mb10" id="reply<%= @topic.id %>">
<%= form_for @reply, :as => :reply, :url => {:action => 'reply', :id => @topic}, :html => {:multipart => true, :id => 'message_form'} do |f| %>
<%= render :partial => 'form_course', :locals => {:f => f, :replying => true} %>
<%= link_to l(:button_cancel), "javascript:void(0)", :onclick => 'course_board_canel_message_replay();', :class => "grey_btn fr c_white mt10 mr5 ml10" %>
<%= link_to l(:button_submit), "javascript:void(0)", :onclick => 'course_board_submit_message_replay();', :class => "blue_btn fr c_white mt10", :style => "margin-left: 50px;" %>
<% end %>
<div nhname='new_message_<%= @topic.id%>' style="display:none;">
<%= form_for @reply, :as => :reply, :url => {:action => 'reply', :id => @topic}, :html => {:multipart => true, :id => 'message_form'} do |f| %>
<input type="hidden" name="journal_id" value="<%= @topic.id %>"/>
<div nhname='toolbar_container_<%= @topic.id %>' ></div>
<div class="cl"></div>
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= @topic.id%>' name="content"></textarea>
<div class="cl"></div>
<span nhname='contentmsg_<%= @topic.id%>' class="fl"></span>
<a id="new_message_submit_btn_<%= @topic.id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
<div class="cl"></div>
<% end %>
</div>
<div class="cl"></div>
</div>
</div>

View File

@ -32,7 +32,7 @@
<%= content_for(:header_tags) do %>
<%= import_ke(enable_at: false, prettify: false, init_activity: true) %>
<%= import_ke(enable_at: true, prettify: false, init_activity: true) %>
<% end %>
@ -88,7 +88,7 @@
}
}
$(function() {
sd_create_editor_from_data(<%= @topic.id%>,null,"100%", "<%=@topic.class.to_s%>");
sd_create_editor_from_data(<%= @topic.id%>,null,"100%", "<%= @topic.class.to_s %>");
showNormalImage('message_description_<%= @topic.id %>');
});
</script>
@ -165,11 +165,21 @@
<em class="talkWrapArrow"></em>
<div class="cl"></div>
<div class="talkConIpt ml5 mb10" id="reply<%= @topic.id %>">
<%= form_for @reply, :as => :reply, :url => {:action => 'reply', :id => @topic}, :html => {:multipart => true, :id => 'message_form'} do |f| %>
<%= render :partial => 'form_project', :locals => {:f => f, :replying => true} %>
<%= link_to l(:button_cancel), "javascript:void(0)", :onclick => 'project_board_cancel_message_replay();', :class => "grey_btn fr c_white mt10 mr5 ml10" %>
<%= link_to l(:button_submit), "javascript:void(0)", :onclick => 'project_board_submit_message_replay();', :class => "blue_btn fr c_white mt10", :style => "margin-left: 50px;" %>
<% end %>
<div nhname='new_message_<%= @topic.id%>' style="display:none;">
<%= form_for @reply, :as => :reply, :url => {:action => 'reply', :id => @topic}, :html => {:multipart => true, :id => 'message_form'} do |f| %>
<%#= render :partial => 'form_project', :locals => {:f => f, :replying => true} %>
<%#= link_to l(:button_cancel), "javascript:void(0)", :onclick => 'project_board_cancel_message_replay();', :class => "grey_btn fr c_white mt10 mr5 ml10" %>
<%#= link_to l(:button_submit), "javascript:void(0)", :onclick => 'project_board_submit_message_replay();', :class => "blue_btn fr c_white mt10", :style => "margin-left: 50px;" %>
<input type="hidden" name="journal_id" value="<%= @topic.id %>"/>
<div nhname='toolbar_container_<%= @topic.id %>' ></div>
<div class="cl"></div>
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= @topic.id%>' name="content"></textarea>
<div class="cl"></div>
<span nhname='contentmsg_<%= @topic.id%>' class="fl"></span>
<a id="new_message_submit_btn_<%= @topic.id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
<div class="cl"></div>
<% end %>
</div>
<div class="cl"></div>
</div>
</div>

View File

@ -1,15 +1,29 @@
<%if @project%>
<% if params[:is_project] %>
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'projects/act_messages', :locals => {:activity => @topic,:user_activity_id =>@user_activity_id,:is_course=>@is_course,:is_board=>@is_board}) %>");
<% else %>
$("#activity_post_reply_<%= @user_activity_id%>").html("<%= escape_javascript(render :partial => 'users/course_message_post_reply', :locals => {:activity => @topic,:user_activity_id =>@user_activity_id}) %>");
<% end %>
<% if @project %>
<% if params[:is_project] %>
$("#user_activity_<%= @user_activity_id %>").replaceWith("<%= escape_javascript(render :partial => 'projects/act_messages',
:locals => { :activity => @topic,
:user_activity_id => @user_activity_id,
:is_course => @is_course,
:is_board => @is_board}) %>");
// ForgeActivity是具体项目的动态UserActivity是社区的动态
// sd_create_editor_from_data(<%#= @user_activity_id %>, "", "100%", "ForgeActivity");
<% else %>
$("#activity_post_reply_<%= @user_activity_id %>").html("<%= escape_javascript(render :partial => 'users/course_message_post_reply',
:locals => { :activity => @topic,
:user_activity_id => @user_activity_id}) %>");
<%elsif @course%>
$("#activity_post_reply_<%= @user_activity_id%>").html("<%= escape_javascript(render :partial => 'users/course_message_post_reply', :locals => {:activity => @topic,:user_activity_id =>@user_activity_id}) %>");
<%elsif @contest%>
$("#activity_post_reply_<%= @user_activity_id%>").html("<%= escape_javascript(render :partial => 'users/contest_message_post_reply', :locals => {:activity => @topic,:user_activity_id =>@user_activity_id}) %>");
<% end %>
<% elsif @course %>
$("#activity_post_reply_<%= @user_activity_id %>").html("<%= escape_javascript(render :partial => 'users/course_message_post_reply',
:locals => { :activity => @topic,
:user_activity_id => @user_activity_id}) %>");
<% elsif @contest %>
$("#activity_post_reply_<%= @user_activity_id%>").html("<%= escape_javascript(render :partial => 'users/contest_message_post_reply',
:locals => { :activity => @topic,
:user_activity_id => @user_activity_id}) %>");
<% elsif @org_subfield %>
$("#activity_post_reply_<%= @user_activity_id%>").html("<%= escape_javascript(render :partial => 'organizations/org_message_post_reply', :locals => {:activity => @topic,:user_activity_id =>@user_activity_id}) %>");
<%end%>
sd_create_editor_from_data(<%= @user_activity_id %>,"","100%", "UserActivity");
$("#activity_post_reply_<%= @user_activity_id%>").html("<%= escape_javascript(render :partial => 'organizations/org_message_post_reply',
:locals => { :activity => @topic,
:user_activity_id => @user_activity_id}) %>");
<% end %>
sd_create_editor_from_data(<%= @user_activity_id %>, "", "100%", "UserActivity");

View File

@ -40,7 +40,16 @@
<li>&nbsp;&nbsp;</li>
</ul>
<ul class="setting_right ">
<li><%= f.text_field :login,:no_label=>true, :required => true, :style => "color:grey", :nh_required => "1", :name => "login", :class => "w210" %></li>
<li>
<%= f.text_field :login,
:no_label => true,
:required => true,
:style => "color:grey",
:nh_required => "1",
:name => "login",
:class => "w210"
%>
</li>
<% if @force %>
<li><%= f.text_field :mail,:no_label=>true, :required => true,:nh_required => "1",:class=>"w210",:disabled=>'disabled'%></li>
<% else %>

View File

@ -221,6 +221,7 @@
},
success:function(){
if(!$is_exist){
$("#apply_hint").text("");
$.ajax({
url:"<%= apply_subdomain_organization_path %>",
type:'post',

View File

@ -1,3 +1,6 @@
<%= content_for(:header_tags) do %>
<%= import_ke(enable_at: true, prettify: false, init_activity: true) %>
<% end %>
<div class="container-big mt10" id="user_activity_<%= user_activity_id%>">
<div class="pr">
<div class="homepagePostPortrait">

View File

@ -1,10 +1,16 @@
<div class="orig_user fl">
<%= link_to image_tag(url_to_avatar(comment.creator_user), :width => "33", :height => "33"), user_path(comment.creator_user.id), :alt => "用户头像" %>
</div>
<script type="text/javascript">
$(function(){
showNormalImage('reply_content_<%= comment.id %>');
autoUrl('reply_content_<%= comment.id %>');
});
</script>
<div class="orig_right fl" style="width: 93%;" onmouseout="$(this).find('.reply-right').hide();" onmouseover="$(this).find('.reply-right').show();">
<%= link_to comment.creator_user.show_name, user_path(comment.creator_user.id), :class => "content-username" %>
<span class="orig_area"><%= time_from_now(comment.respond_to?(:created_on) ? comment.created_on : comment.created_at) %></span>
<div class="orig_content ">
<div class="orig_content" id="reply_content_<%= comment.id %>">
<% if comment.class == Journal %>
<% if comment.details.any? %>
<% details_to_strings(comment.details).each do |string| %>

View File

@ -1,10 +1,16 @@
<div class="orig_user fl">
<%= link_to image_tag(url_to_avatar(comment.creator_user), :width => "33", :height => "33"), user_path(comment.creator_user.id), :alt => "用户头像" %>
</div>
<script type="text/javascript">
$(function(){
showNormalImage('reply_content_<%= comment.id %>');
autoUrl('reply_content_<%= comment.id %>');
});
</script>
<div class="orig_right fl">
<%= link_to comment.creator_user.show_name, user_path(comment.creator_user.id), :class => "content-username" %>
<span class="orig_area"><%= time_from_now(comment.respond_to?(:created_on) ? comment.created_on : comment.created_at) %></span>
<div class="orig_content ">
<div class="orig_content" id="reply_content_<%= comment.id %>">
<% if comment.class == Journal %>
<% if comment.details.any? %>
<% details_to_strings(comment.details).each do |string| %>

View File

@ -1,10 +1,16 @@
<div class="orig_user fl">
<%= link_to image_tag(url_to_avatar(comment.creator_user), :width => "33", :height => "33"), user_path(comment.creator_user.id), :alt => "用户头像" %>
</div>
<script type="text/javascript">
$(function(){
showNormalImage('reply_content_<%= comment.id %>');
autoUrl('reply_content_<%= comment.id %>');
});
</script>
<div class="orig_right fl" style="width: 93%;" onmouseout="$(this).find('.reply-right').hide();" onmouseover="$(this).find('.reply-right').show();">
<%= link_to comment.creator_user.show_name, user_path(comment.creator_user.id), :class => "content-username" %>
<span class="orig_area"><%= time_from_now(comment.respond_to?(:created_on) ? comment.created_on : comment.created_at) %></span>
<div class="orig_content ">
<div class="orig_content" id="reply_content_<%= comment.id %>">
<% if comment.class == Journal %>
<% if comment.details.any? %>
<% details_to_strings(comment.details).each do |string| %>

View File

@ -57,7 +57,13 @@
</li>
<li class=" ml90" >
<a href="javascript:void(0)" class="blue_btn fl c_white" onclick="submit_new_project();" >提交</a>
<%= link_to "取消",user_activities_path(User.current.id),:class => "grey_btn fl c_white ml10"%>
<% if @course %>
<%= link_to "取消",homework_common_index_path(:course => @course.id),:class => "grey_btn fl c_white ml10"%>
<% elsif @contest %>
<%= link_to "取消",works_path(:contest => @contest.id),:class => "grey_btn fl c_white ml10"%>
<% else %>
<%= link_to "取消",user_activities_path(User.current.id),:class => "grey_btn fl c_white ml10"%>
<% end %>
<div class="cl"></div>
</li>
<% end%>

View File

@ -47,11 +47,6 @@
<input class="fl mt8 ml5" id="project_hidden_repo" name="project[hidden_repo]" type="checkbox" <%= @project.hidden_repo ? "checked" : ""%>>
</li>
<li class="clear">
<% if Member.where(:user_id => User.current.id, :project_id => @project.id).first.try(:roles).to_s.include?("Manager") %>
<%= link_to(l(:button_delete_project), { :controller => 'projects', :action => 'archive', :id => @project, :status => params[:status], :type =>"project" },
:data => {:confirm => l(:text_delete_project_are_you_sure)}, :method => :post, :class => "sy_btn_grey mr5 fl ml15") unless @project.archived? %>
<p class="fl c_grey">(友情提示:删除操作会彻底删除项目的所有信息,一旦删除不能恢复!)</p>
<% end %>
<a href="javascript:void(0)" class="sy_btn_blue mr15 fr" onclick="submit_edit_project(<%= @project.id %>);" >保存</a>
</li>
</ul>

View File

@ -14,7 +14,7 @@
<input type="text" style="display: none"/> <!--阻止表单自动填充 -->
<input type="password" style="display: none"/> <!--阻止表单自动填充 -->
<label class=" fl"><span class="c_red f12">*</span>&nbsp;版本库名称&nbsp;&nbsp;:&nbsp;</label>
<%= f.text_field :identifier, :disabled => @repository.nil? || @repository.identifier_frozen? ? true:false, :label=>"", :no_label => true, :class => "w650 fl", :style => "height: 28px;", :id => "project_setting_repository" %>
<%= f.text_field :identifier, :label=>"", :no_label => true, :class => "w650 fl", :style => "height: 28px;", :id => "project_setting_repository" %>
<span style="display: none" class="c_orange ml100" id="valid_repository_name">版本库名是无效的</span>
</li>
<li class="clear">

View File

@ -22,6 +22,7 @@
<div class="cl"></div>
<div class="courseSendCancel mr15" style="float:right;"><a href="javascript:void(0);" class="sendSourceText" onclick="clickCanel();">取消</a></div>
<div class="courseSendSubmit" style="float:right;"><a href="javascript:void(0);" class="sendSourceText" onclick="clickOK()">确定</a></div>
<span class="c_red fl" id="choose_member_notice"></span>
<div class="cl"></div>
</div>
<script type="text/javascript">
@ -82,10 +83,8 @@
}
function delete_student(id) {
$("#choose_member_notice").hide();
$("#choose_student_"+id).remove();
$("#student_"+id).one("click",function choose_student() {
$("#choose_students_list").append("<li id='choose_student_"+id+"' onclick='delete_student("+id+");'>"+$("#student_"+id).html()+"</li>");
});
}
$(document).ready(function(){

Some files were not shown because too many files have changed in this diff Show More