Merge branch 'szzh' into develop

zh v20141121
sw 11 years ago
commit adb9eb79a7

@ -103,7 +103,7 @@ class AccountController < ApplicationController
def register def register
# @root_path="/home/pdl/redmine-2.3.2-0/apache2/" # @root_path="/home/pdl/redmine-2.3.2-0/apache2/"
# #
@cache_identityy = params[:identity]||"" #身份 #@cache_identityy = params[:identity]||"" #身份
@cache_no = params[:no]||"" #学号 @cache_no = params[:no]||"" #学号
@cache_technical_title = params[:technical_title]||"" #教师职称 @cache_technical_title = params[:technical_title]||"" #教师职称
@cache_province = params[:province]||"" #省份 @cache_province = params[:province]||"" #省份
@ -136,7 +136,7 @@ class AccountController < ApplicationController
session[:auth_source_registration] = nil session[:auth_source_registration] = nil
self.logged_user = @user self.logged_user = @user
flash[:notice] = l(:notice_account_activated) flash[:notice] = l(:notice_account_activated)
redirect_to my_account_url redirect_to my_account_path
end end
else else
@user.login = params[:user][:login] @user.login = params[:user][:login]
@ -144,22 +144,7 @@ class AccountController < ApplicationController
@user.password, @user.password_confirmation = user_params[:password], user_params[:password_confirmation] @user.password, @user.password_confirmation = user_params[:password], user_params[:password_confirmation]
end end
if(@cache_identityy == "")
if params[:identity] == "2"
@user.firstname = firstname_code
@user.lastname = lastname_code
end
flash.now[:error]= l(:label_identity)+l(:'activerecord.errors.messages.empty')
return
end
if(@cache_city == "")
if params[:identity] == "2"
@user.firstname = firstname_code
@user.lastname = lastname_code
end
flash.now[:error]= l(:label_location)+l(:'activerecord.errors.messages.empty')
return
end
case Setting.self_registration case Setting.self_registration
when '1' when '1'
@ -234,6 +219,10 @@ class AccountController < ApplicationController
render :json => req render :json => req
end end
def email_valid
end
private private
def authenticate_user def authenticate_user
@ -363,7 +352,7 @@ class AccountController < ApplicationController
UserStatus.create(:user_id => user.id, :changsets_count => 0, :watchers_count => 0) UserStatus.create(:user_id => user.id, :changsets_count => 0, :watchers_count => 0)
Mailer.register(token).deliver Mailer.register(token).deliver
flash[:notice] = l(:notice_account_register_done) flash[:notice] = l(:notice_account_register_done)
redirect_to signin_url render action: 'email_valid', locals: {:mail => user.mail}
else else
yield if block_given? yield if block_given?
end end

@ -126,7 +126,7 @@ class AdminController < ApplicationController
@status = params[:status] || 1 @status = params[:status] || 1
scope = User.logged.status(@status) scope = User.logged.status(@status)
scope = scope.like(params[:name]) if params[:name].present? scope = scope.like(params[:name],params[:search_by][:id]) if params[:name].present?
@user_count = scope.count @user_count = scope.count
@user_pages = Paginator.new @user_count, @limit, params['page'] @user_pages = Paginator.new @user_count, @limit, params['page']
@user_base_tag = params[:id] ? 'base_users':'base' @user_base_tag = params[:id] ? 'base_users':'base'

@ -141,6 +141,23 @@ class AttachmentsController < ApplicationController
end end
end end
def update_file_dense
@attachment = Attachment.find(params[:attachmentid])
if @attachment != nil
filedense = params[:newtype].to_s
if filedense == "1"
@attachment.is_public = 1
else
@attachment.is_public = 0
end
@attachment.save
@newfiledense = filedense
end
respond_to do |format|
format.js
end
end
def thumbnail def thumbnail
if @attachment.thumbnailable? && thumbnail = @attachment.thumbnail(:size => params[:size]) if @attachment.thumbnailable? && thumbnail = @attachment.thumbnail(:size => params[:size])
if stale?(:etag => thumbnail) if stale?(:etag => thumbnail)
@ -326,6 +343,35 @@ class AttachmentsController < ApplicationController
end end
end end
def add_exist_file_to_courses
file = Attachment.find(params[:file_id])
courses = params[:courses][:course]
courses.each do |course|
c = Course.find(course);
attach_copied_obj = file.copy
attach_copied_obj.tag_list.add(file.tag_list) # tag关联
attach_copied_obj.container = c
attach_copied_obj.created_on = Time.now
attach_copied_obj.author_id = User.current.id
attach_copied_obj.copy_from = file.copy_from.nil? ? file.id : file.copy_from
if attach_copied_obj.attachtype == nil
attach_copied_obj.attachtype = 4
end
@obj = c
@save_flag = attach_copied_obj.save
@save_message = attach_copied_obj.errors.full_messages
end
respond_to do |format|
format.js
end
rescue NoMethodError
@save_flag = false
@save_message = [] << l(:error_attachment_empty)
respond_to do |format|
format.js
end
end
private private
def find_project def find_project
@attachment = Attachment.find(params[:id]) @attachment = Attachment.find(params[:id])

@ -29,7 +29,11 @@ class AutoCompletesController < ApplicationController
@issues += scope.where("LOWER(#{Issue.table_name}.subject) LIKE LOWER(?)", "%#{q}%").order("#{Issue.table_name}.id DESC").limit(10).all @issues += scope.where("LOWER(#{Issue.table_name}.subject) LIKE LOWER(?)", "%#{q}%").order("#{Issue.table_name}.id DESC").limit(10).all
@issues.compact! @issues.compact!
end end
render :layout => false #render :layout => false
render :json => @issues.map {|issue| {
'value' => issue[:subject]
}}
end end

@ -7,6 +7,7 @@ class BidsController < ApplicationController
menu_item :project, :only => [:show_project,:show_results, :new_submit_homework] menu_item :project, :only => [:show_project,:show_results, :new_submit_homework]
menu_item :homework_respond, :only => :homework_respond menu_item :homework_respond, :only => :homework_respond
menu_item :homework_statistics, :only => :homework_statistics menu_item :homework_statistics, :only => :homework_statistics
menu_item :edit, :only => :edit
before_filter :can_show_course,only: [] before_filter :can_show_course,only: []
before_filter :can_show_contest,only: [] before_filter :can_show_contest,only: []
@ -806,6 +807,7 @@ class BidsController < ApplicationController
@bid.is_evaluation = params[:bid][:is_evaluation] @bid.is_evaluation = params[:bid][:is_evaluation]
@bid.proportion = params[:bid][:proportion] @bid.proportion = params[:bid][:proportion]
@bid.evaluation_num = params[:bid][:evaluation_num] @bid.evaluation_num = params[:bid][:evaluation_num]
@bid.open_anonymous_evaluation = params[:bid][:open_anonymous_evaluation]
@bid.reward_type = 3 @bid.reward_type = 3
# @bid.budget = params[:bid][:budget] # @bid.budget = params[:bid][:budget]
@bid.deadline = params[:bid][:deadline] @bid.deadline = params[:bid][:deadline]
@ -862,6 +864,7 @@ class BidsController < ApplicationController
@bid.is_evaluation = params[:bid][:is_evaluation] @bid.is_evaluation = params[:bid][:is_evaluation]
@bid.proportion = params[:bid][:proportion] @bid.proportion = params[:bid][:proportion]
@bid.evaluation_num = params[:bid][:evaluation_num] @bid.evaluation_num = params[:bid][:evaluation_num]
@bid.open_anonymous_evaluation = params[:bid][:open_anonymous_evaluation]
@bid.reward_type = 3 @bid.reward_type = 3
@bid.deadline = params[:bid][:deadline] @bid.deadline = params[:bid][:deadline]
@bid.budget = 0 @bid.budget = 0

@ -8,7 +8,7 @@ class CoursesController < ApplicationController
menu_item :overview menu_item :overview
menu_item :feedback, :only => :feedback menu_item :feedback, :only => :feedback
menu_item :homework, :only => :homework menu_item :homework, :only => :homework
menu_item :new_homework menu_item :new_homework, :only => :new_homework
menu_item l(:label_sort_by_time), :only => :index menu_item l(:label_sort_by_time), :only => :index
menu_item l(:label_sort_by_active), :only => :index menu_item l(:label_sort_by_active), :only => :index
@ -271,8 +271,7 @@ class CoursesController < ApplicationController
@issue_custom_fields = IssueCustomField.sorted.all @issue_custom_fields = IssueCustomField.sorted.all
@trackers = Tracker.sorted.all @trackers = Tracker.sorted.all
if User.current.user_extensions.identity == 0 if @course.save
if @course.save
#unless User.current.admin? #unless User.current.admin?
r = Role.givable.find_by_id(Setting.new_project_user_role_id.to_i) || Role.givable.first r = Role.givable.find_by_id(Setting.new_project_user_role_id.to_i) || Role.givable.first
m = Member.new(:user => User.current, :roles => [r]) m = Member.new(:user => User.current, :roles => [r])
@ -298,15 +297,13 @@ class CoursesController < ApplicationController
} }
format.api { render :action => 'show', :status => :created, :location => url_for(:controller => 'courses', :action => 'show', :id => @course.id) } format.api { render :action => 'show', :status => :created, :location => url_for(:controller => 'courses', :action => 'show', :id => @course.id) }
end end
else else
#@course.destroy #@course.destroy
respond_to do |format| respond_to do |format|
format.html { render :action => 'new', :layout => 'base' } #Added by young format.html { render :action => 'new', :layout => 'base' } #Added by young
format.api { render_validation_errors(@course) } format.api { render_validation_errors(@course) }
end end
end end
end
end end
def course def course
@ -514,6 +511,7 @@ class CoursesController < ApplicationController
def new_homework def new_homework
@homework = Bid.new @homework = Bid.new
@homework.safe_attributes = params[:bid] @homework.safe_attributes = params[:bid]
@homework.open_anonymous_evaluation = 1
if (User.current.logged? && User.current.member_of_course?(Course.find params[:id] )) if (User.current.logged? && User.current.member_of_course?(Course.find params[:id] ))
render :layout => 'base_courses' render :layout => 'base_courses'
else else

@ -22,22 +22,55 @@ class FilesController < ApplicationController
menu_item :files menu_item :files
before_filter :find_project_by_project_id#, :except => [:getattachtype] before_filter :find_project_by_project_id#, :except => [:getattachtype]
before_filter :authorize, :except => [:getattachtype] before_filter :authorize, :except => [:getattachtype,:quote_resource_show,:search]
helper :sort helper :sort
include SortHelper include SortHelper
helper :project_score helper :project_score
def show_attachments obj def show_attachments obj
all_attachments = [] @all_attachments = []
obj.each do |container| obj.each do |container|
all_attachments += container.attachments @all_attachments += container.attachments
end end
@limit = 10 @limit = 10
@feedback_count = all_attachments.count @feedback_count = @all_attachments.count
@feedback_pages = Paginator.new @feedback_count, @limit, params['page'] @feedback_pages = Paginator.new @feedback_count, @limit, params['page']
@offset ||= @feedback_pages.offset @offset ||= @feedback_pages.offset
@curse_attachments = all_attachments[@offset, @limit] @curse_attachments_all = @all_attachments[@offset, @limit]
@curse_attachments = paginateHelper @all_attachments,10
end
def search
begin
@is_remote = true
q = "%#{params[:name].strip}%"
#(redirect_to stores_url, :notice => l(:label_sumbit_empty);return) if params[:name].blank?
if params[:insite]
@result = find_public_attache q
@searched_attach = paginateHelper @result,10
else
@result = find_course_attache q,@course
@searched_attach = paginateHelper @result,10
end
rescue Exception => e
#render 'stores'
redirect_to stores_url
end
end
def find_course_attache keywords,course
resultSet = Attachment.where("attachments.container_type = 'Course' And attachments.container_id = '#{course.id}' AND filename LIKE :like ", like: "%#{keywords}%").
reorder("created_on DESC")
end
def find_public_attache keywords
# StoresController#search 将每条文件都查出来,再次进行判断过滤。---> resultSet.to_a.map
# 此时内容不多速度还可但文件增长每条判断多则进行3-4次表连接。
# 现在还木有思路 药丸
resultSet = Attachment.where("attachments.container_type IS NOT NULL AND filename LIKE :like ", like: "%#{keywords}%").
reorder("created_on DESC")
end end
def index def index
@ -48,7 +81,9 @@ class FilesController < ApplicationController
'size' => "#{Attachment.table_name}.filesize", 'size' => "#{Attachment.table_name}.filesize",
'downloads' => "#{Attachment.table_name}.downloads" 'downloads' => "#{Attachment.table_name}.downloads"
sort = "" sort = ""
@sort = ""
@order = ""
@is_remote = false
if params[:project_id] if params[:project_id]
@isproject = true @isproject = true
@ -113,7 +148,8 @@ class FilesController < ApplicationController
when "created_on" when "created_on"
attribute = "created_on" attribute = "created_on"
end end
@sort = order_by[0]
@order = order_by[1]
if order_by.count == 1 if order_by.count == 1
sort += "#{Attachment.table_name}.#{attribute} asc " sort += "#{Attachment.table_name}.#{attribute} asc "
elsif order_by.count == 2 elsif order_by.count == 2
@ -134,6 +170,10 @@ class FilesController < ApplicationController
end end
def quote_resource_show
@file = Attachment.find(params[:id])
end
def new def new
@versions = @project.versions.sort @versions = @project.versions.sort
@course_tag = @project.project_type @course_tag = @project.project_type
@ -265,6 +305,7 @@ class FilesController < ApplicationController
'size' => "#{Attachment.table_name}.filesize", 'size' => "#{Attachment.table_name}.filesize",
'downloads' => "#{Attachment.table_name}.downloads" 'downloads' => "#{Attachment.table_name}.downloads"
sort='' sort=''
if params[:sort] if params[:sort]
params[:sort].split(",").each do |sort_type| params[:sort].split(",").each do |sort_type|
order_by = sort_type.split(":") order_by = sort_type.split(":")

@ -52,7 +52,7 @@ class ForumsController < ApplicationController
def index def index
@offset, @limit = api_offset_and_limit({:limit => 10}) @offset, @limit = api_offset_and_limit({:limit => 10})
@forums_all = Forum.where('1=1') @forums_all = Forum.reorder("sticky DESC")
@forums_count = @forums_all.count @forums_count = @forums_all.count
@forums_pages = Paginator.new @forums_count, @limit, params['page'] @forums_pages = Paginator.new @forums_count, @limit, params['page']
@ -208,6 +208,8 @@ class ForumsController < ApplicationController
end end
end end
private private

@ -106,7 +106,7 @@ class HomeworkAttachController < ApplicationController
(SELECT stars FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND rater_id = #{User.current.id}) AS m_score (SELECT stars FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND rater_id = #{User.current.id}) AS m_score
FROM homework_attaches FROM homework_attaches
INNER JOIN homework_evaluations ON homework_evaluations.homework_attach_id = homework_attaches.id INNER JOIN homework_evaluations ON homework_evaluations.homework_attach_id = homework_attaches.id
WHERE homework_attaches.bid_id = #{@bid.id} AND homework_evaluations.user_id = #{User.current.id} ORDER BY s_score DESC") WHERE homework_attaches.bid_id = #{@bid.id} AND homework_evaluations.user_id = #{User.current.id} ORDER BY m_score DESC")
@cur_page = params[:page] || 1 @cur_page = params[:page] || 1
@cur_type = 4 @cur_type = 4
@homework_list = paginateHelper all_homework_list,10 @homework_list = paginateHelper all_homework_list,10

@ -17,7 +17,6 @@
class IssuesController < ApplicationController class IssuesController < ApplicationController
layout 'base_projects'#Added by young layout 'base_projects'#Added by young
menu_item :new_issue, :only => [:new, :create]
default_search_scope :issues default_search_scope :issues
before_filter :find_issue, :only => [:show, :edit, :update] before_filter :find_issue, :only => [:show, :edit, :update]
@ -59,8 +58,8 @@ class IssuesController < ApplicationController
sort_init(@query.sort_criteria.empty? ? [['id', 'desc']] : @query.sort_criteria) sort_init(@query.sort_criteria.empty? ? [['id', 'desc']] : @query.sort_criteria)
sort_update(@query.sortable_columns) sort_update(@query.sortable_columns)
@query.sort_criteria = sort_criteria.to_a @query.sort_criteria = sort_criteria.to_a
@project_base_tag = (params[:project_id] || @issue.project) ? 'base_projects':'base'#by young @project_base_tag = (params[:project_id] || @issue.project) ? 'base_projects':'base'
if @query.valid? if @query.valid?
case params[:format] case params[:format]

@ -19,7 +19,7 @@ class MemosController < ApplicationController
@content = "#{ll(Setting.default_language, :text_user_wrote, @memo.author)} <br/> &nbsp; " @content = "#{ll(Setting.default_language, :text_user_wrote, @memo.author)} <br/> &nbsp; "
@content << @memo.content.to_s.strip.gsub(%r{<pre>((.|\s)*?)</pre>}m, '[...]').gsub(/(\r?\n|\r\n?)/, "\n") + "</blockquote>\n\n<br/>" @content << @memo.content.to_s.strip.gsub(%r{<pre>((.|\s)*?)</pre>}m, '[...]').gsub(/(\r?\n|\r\n?)/, "\n") + "</blockquote>\n\n<br/>"
@content = "<blockquote>" << @content @content = "<blockquote style='word-break: break-all;word-wrap: break-word;'>" << @content
#@content = "> #{ll(Setting.default_language, :text_user_wrote, @memo.author)}\n> " #@content = "> #{ll(Setting.default_language, :text_user_wrote, @memo.author)}\n> "
#@content << @memo.content.to_s.strip.gsub(%r{<pre>((.|\s)*?)</pre>}m, '[...]').gsub(/(\r?\n|\r\n?)/, "\n> ") + "\n\n" #@content << @memo.content.to_s.strip.gsub(%r{<pre>((.|\s)*?)</pre>}m, '[...]').gsub(/(\r?\n|\r\n?)/, "\n> ") + "\n\n"
#@content_html = textilizable(@content) #@content_html = textilizable(@content)

@ -91,7 +91,11 @@ class MyController < ApplicationController
end end
@se = @user.extensions @se = @user.extensions
@se.school_id = params[:occupation] if params[:occupation] if params[:occupation].to_i.to_s == params[:occupation]
@se.school_id = params[:occupation]
else
@se.occupation = params[:occupation]
end
@se.gender = params[:gender] @se.gender = params[:gender]
@se.location = params[:province] if params[:province] @se.location = params[:province] if params[:province]
@se.location_city = params[:city] if params[:city] @se.location_city = params[:city] if params[:city]

@ -14,13 +14,14 @@ class TagsController < ApplicationController
include AttachmentsHelper include AttachmentsHelper
include ContestsHelper include ContestsHelper
include ActsAsTaggableOn::TagsHelper include ActsAsTaggableOn::TagsHelper
include TagsHelper
helper :projects helper :projects
helper :courses helper :courses
include TagsHelper
helper :tags helper :tags
include OpenSourceProjectsHelper include OpenSourceProjectsHelper
before_filter :require_admin,:only => [:delete,:show_all] before_filter :require_admin,:only => [:delete,:show_all]
before_filter :require_login,:only => [:tag_save]
# $selected_tags = Array.new # $selected_tags = Array.new
# $related_tags = Array.new # $related_tags = Array.new
@ -188,6 +189,83 @@ class TagsController < ApplicationController
# end # end
end end
end end
# 只删除某个对象的该tag
def remove_tag_new
@obj = nil
@object_flag = nil
if request.get?
# 获取传过来的tag_id taggable_id 和 taggable_type,通过2者确定要删除tag的对象
@tag_name = params[:tag_name]
@tag_id = (ActsAsTaggableOn::Tag.find_by_name(@tag_name)).id
@taggable_id = params[:taggable_id] # 当做参数传时对象会变成字符串
@taggable_type = numbers_to_object_type(params[:taggable_type])
@obj = get_object(@taggable_id,params[:taggable_type])
@object_flag = params[:taggable_type]
# if can_remove_tag?(User.current,@taggable_id,@taggable_type)
@taggings = ActsAsTaggableOn::Tagging.find_by_tag_id_and_taggable_id_and_taggable_type(@tag_id,@taggable_id,@taggable_type)
unless @taggings.nil?
@taggings.delete
end
# 是否还有其他记录 引用了 tag_id
@tagging = ActsAsTaggableOn::Tagging.find_by_tag_id(@tag_id)
# 如果taggings表中记录已经不存在 那么检查tags表 作删除动作
if @tagging.nil?
@tag = ActsAsTaggableOn::Tag.find_by_id(@tag_id)
@tag.delete unless @tag.nil?
end
# end
end
end
def tag_save
@tags = params[:tag_for_save][:name]
@obj_id = params[:tag_for_save][:object_id]
@obj_flag = params[:tag_for_save][:object_flag]
case @obj_flag
when '1' then
@obj = User.find_by_id(@obj_id)
when '2' then
@obj = Project.find_by_id(@obj_id)
when '3' then
@obj = Issue.find_by_id(@obj_id)
when '4' then
@obj = Bid.find_by_id(@obj_id)
when '5' then
@obj = Forum.find_by_id(@obj_id)
when '6'
@obj = Attachment.find_by_id(@obj_id)
when '7' then
@obj = Contest.find_by_id(@obj_id)
when '8'
@obj = OpenSourceProject.find_by_id(@obj_id)
when '9'
@obj = Course.find_by_id(@obj_id)
else
@obj = nil
end
unless @obj.nil?
@obj.tag_list.add(@tags.split(","))
else
return
end
if @obj.save
logger.debug "#{__FILE__}:#{__LINE__} ===> #{@obj.to_json}"
else
logger.error "#{__FILE__}:#{__LINE__} ===> #{@obj.errors.try(:full_messages)}"
end
respond_to do |format|
format.js
format.html
end
end
private private
# 这里用来刷新搜索结果的区域 # 这里用来刷新搜索结果的区域
@ -308,5 +386,7 @@ class TagsController < ApplicationController
return return
end end
end end
end end

@ -374,7 +374,7 @@ class UsersController < ApplicationController
"show_changesets" => true "show_changesets" => true
} }
scope = User.logged.status(@status) scope = User.logged.status(@status)
scope = scope.like(params[:name]) if params[:name].present? scope = scope.like(params[:name],params[:search_by][:id]) if params[:name].present?
@user_count = scope.count @user_count = scope.count
@user_pages = Paginator.new @user_count, @limit, params['page'] @user_pages = Paginator.new @user_count, @limit, params['page']
@user_base_tag = params[:id] ? 'base_users':'users_base' @user_base_tag = params[:id] ? 'base_users':'users_base'
@ -812,7 +812,7 @@ class UsersController < ApplicationController
# 必填自己的工作单位,其实就是学校 # 必填自己的工作单位,其实就是学校
def auth_user_extension def auth_user_extension
if @user == User.current && (@user.user_extensions.nil? || @user.user_extensions.school.nil?) if @user == User.current && @user.user_extensions.nil?
flash[:error] = l(:error_complete_occupation) flash[:error] = l(:error_complete_occupation)
redirect_to my_account_url redirect_to my_account_url
end end

@ -72,7 +72,7 @@ class ZipdownController < ApplicationController
homeattach.attachments.each do |attach| homeattach.attachments.each do |attach|
homeworks_attach_path << attach.diskfile#.to_s.slice((length+1)..-1) homeworks_attach_path << attach.diskfile#.to_s.slice((length+1)..-1)
end end
zipping("#{Time.now.to_i.to_s}_#{homeattach.user.name}_#{homeattach.user.user_extensions.student_id}.zip", homeworks_attach_path, OUTPUT_FOLDER, true) zipping("#{homeattach.user.lastname}#{homeattach.user.firstname}_#{homeattach.user.user_extensions.student_id}_#{Time.now.to_i.to_s}.zip", homeworks_attach_path, OUTPUT_FOLDER, true)
end end

@ -177,6 +177,8 @@ module AttachmentsHelper
s.html_safe s.html_safe
end end
# Modified by Longjun # Modified by Longjun
# 有参数的方法要加() # 有参数的方法要加()
def private_filter(resultSet) def private_filter(resultSet)

@ -328,7 +328,7 @@ module CoursesHelper
#当前用户是不是指定课程的学生 #当前用户是不是指定课程的学生
def is_cur_course_student course def is_cur_course_student course
#course.members.joins(:member_roles).where("member_roles.role_id IN (:role_id) and members.user_id = #{User.current.id}", {:role_id => StudentRoles}).count != 0 #course.members.joins(:member_roles).where("member_roles.role_id IN (:role_id) and members.user_id = #{User.current.id}", {:role_id => StudentRoles}).count != 0
!(User.current.allowed_to?(:as_teacher,course)) User.current.logged? && User.current.member_of_course?(course) && !(User.current.allowed_to?(:as_teacher,course))
#修改:能新建占位且不能新建任务的角色判定为学生 #修改:能新建占位且不能新建任务的角色判定为学生
#is_student = false #is_student = false
#@membership = User.current.memberships.all(:conditions => Project.visible_condition(User.current)) #@membership = User.current.memberships.all(:conditions => Project.visible_condition(User.current))

@ -44,6 +44,16 @@ module FilesHelper
File.new(zipfile_name,'w+') File.new(zipfile_name,'w+')
end end
def courses_check_box_tags(name,courses,current_course)
s = ''
courses.each do |course|
if course.id != current_course.id && is_course_teacher(User.current,course)
s << "<label>#{ check_box_tag name, course.id, false, :id => nil } #{h course.name}</label><br/>"
end
end
s.html_safe
end
# 判断指定的资源时候符合类型 # 判断指定的资源时候符合类型
def isTypeOk(attachment, type, contentType) def isTypeOk(attachment, type, contentType)
result = false result = false

@ -227,6 +227,7 @@ module IssuesHelper
strings = [] strings = []
values_by_field = {} values_by_field = {}
details.each do |detail| details.each do |detail|
unless detail.property == 'attachment'
if detail.property == 'cf' if detail.property == 'cf'
field_id = detail.prop_key field_id = detail.prop_key
field = CustomField.find_by_id(field_id) field = CustomField.find_by_id(field_id)
@ -242,6 +243,7 @@ module IssuesHelper
end end
end end
strings << show_detail(detail, no_html, options) strings << show_detail(detail, no_html, options)
end
end end
values_by_field.each do |field_id, changes| values_by_field.each do |field_id, changes|
detail = JournalDetail.new(:property => 'cf', :prop_key => field_id) detail = JournalDetail.new(:property => 'cf', :prop_key => field_id)

@ -97,7 +97,7 @@ module WatchersHelper
return '' unless user && user.logged? return '' unless user && user.logged?
# modify by nwb # modify by nwb
# 主讲教师不允许退出课程 # 主讲教师不允许退出课程
return '' if user.id == course.tea_id || course.is_public == 0 return '' if user.id == course.tea_id
joined = user.member_of_course?(course) joined = user.member_of_course?(course)
text = joined ? l(:label_exit_course) : l(:label_new_join) text = joined ? l(:label_exit_course) : l(:label_new_join)
url_t = join_path(:object_id => course.id) url_t = join_path(:object_id => course.id)

@ -1,3 +1,4 @@
class Course < ActiveRecord::Base class Course < ActiveRecord::Base
include Redmine::SafeAttributes include Redmine::SafeAttributes
@ -5,7 +6,7 @@ class Course < ActiveRecord::Base
STATUS_CLOSED = 5 STATUS_CLOSED = 5
STATUS_ARCHIVED = 9 STATUS_ARCHIVED = 9
attr_accessible :code, :extra, :name, :state, :tea_id, :time , :location, :state, :term, :password,:is_public,:description,:class_period attr_accessible :code, :extra, :name, :state, :tea_id, :time , :location, :state, :term, :password,:is_public,:description,:class_period, :open_student
belongs_to :project, :class_name => 'Course', :foreign_key => :extra, primary_key: :identifier belongs_to :project, :class_name => 'Course', :foreign_key => :extra, primary_key: :identifier
belongs_to :teacher, :class_name => 'User', :foreign_key => :tea_id # 定义一个方法teacher该方法通过tea_id来调用User表 belongs_to :teacher, :class_name => 'User', :foreign_key => :tea_id # 定义一个方法teacher该方法通过tea_id来调用User表
belongs_to :school, :class_name => 'School', :foreign_key => :school_id #定义一个方法school该方法通过school_id来调用School表 belongs_to :school, :class_name => 'School', :foreign_key => :school_id #定义一个方法school该方法通过school_id来调用School表
@ -33,10 +34,10 @@ class Course < ActiveRecord::Base
acts_as_attachable :view_permission => :view_files, acts_as_attachable :view_permission => :view_files,
:delete_permission => :manage_files :delete_permission => :manage_files
validates :password, presence: true validates_presence_of :password, :term,:name,:description
validates :term, presence: true validates_format_of :class_period, :with =>/^[1-9]\d*$/
validates :name, presence: true validates_format_of :name,:with =>/^[a-zA-Z0-9_\u4e00-\u9fa5]+$/
validates :class_period, presence: true,format: {:with =>/^\d*$/} validates_length_of :description, :maximum => 10000
before_save :self_validate before_save :self_validate
after_create :create_board_sync after_create :create_board_sync
before_destroy :delete_all_members before_destroy :delete_all_members
@ -52,7 +53,8 @@ class Course < ActiveRecord::Base
'term', 'term',
'is_public', 'is_public',
'description', 'description',
'class_period' 'class_period',
'open_student'
acts_as_customizable acts_as_customizable
@ -308,3 +310,5 @@ class Course < ActiveRecord::Base
# read_attribute('name') || Project.find_by_identifier(self.extra).try(:name) # read_attribute('name') || Project.find_by_identifier(self.extra).try(:name)
#end #end
end end

@ -8,7 +8,9 @@ class Forum < ActiveRecord::Base
'topic_count', 'topic_count',
'memo_count', 'memo_count',
'last_memo_id', 'last_memo_id',
'creator_id' 'creator_id',
'sticky',
'locked'
validates_presence_of :name, :creator_id, :description validates_presence_of :name, :creator_id, :description
validates_length_of :name, maximum: 50 validates_length_of :name, maximum: 50
#validates_length_of :description, maximum: 255 #validates_length_of :description, maximum: 255
@ -28,7 +30,7 @@ class Forum < ActiveRecord::Base
def destroyable_by? user def destroyable_by? user
# user && user.logged? && Forum.find(self.forum_id).creator_id == user.id || user.admin? # user && user.logged? && Forum.find(self.forum_id).creator_id == user.id || user.admin?
user.admin? self.creator == user || user.admin?
end end
# Updates topic_count, memo_count and last_memo_id attributes for +board_id+ # Updates topic_count, memo_count and last_memo_id attributes for +board_id+

@ -1359,7 +1359,7 @@ class Issue < ActiveRecord::Base
# Callback on file attachment # Callback on file attachment
def attachment_added(obj) def attachment_added(obj)
if @current_journal && !obj.new_record? if @current_journal && !obj.new_record? && @current_journal.journalized_id == obj.author_id
@current_journal.details << JournalDetail.new(:property => 'attachment', :prop_key => obj.id, :value => obj.filename) @current_journal.details << JournalDetail.new(:property => 'attachment', :prop_key => obj.id, :value => obj.filename)
end end
end end

@ -88,11 +88,11 @@ class Memo < ActiveRecord::Base
def editable_by? user def editable_by? user
# user && user.logged? || (self.author == usr && usr.allowed_to?(:edit_own_messages, project)) # user && user.logged? || (self.author == usr && usr.allowed_to?(:edit_own_messages, project))
user.admin? user.admin? || self.author == user
end end
def destroyable_by? user def destroyable_by? user
(user && user.logged? && (Forum.find(self.forum_id).creator_id == user.id) ) || user.admin? (user && self.author == user) || user.admin?
#self.author == user || user.admin? #self.author == user || user.admin?
end end

@ -78,9 +78,13 @@ class Message < ActiveRecord::Base
safe_attributes 'subject', 'content' safe_attributes 'subject', 'content'
safe_attributes 'locked', 'sticky', 'board_id', safe_attributes 'board_id','locked', 'sticky',
:if => lambda {|message, user| :if => lambda {|message, user|
user.allowed_to?(:edit_messages, message.project) if message.project
user.allowed_to?(:edit_messages, message.project)
else
user.allowed_to?(:edit_messages, message.course)
end
} }
def visible?(user=User.current) def visible?(user=User.current)
@ -158,6 +162,7 @@ class Message < ActiveRecord::Base
#更新用户分数 -by zjc #更新用户分数 -by zjc
def be_user_score def be_user_score
#新建message且无parent的为发帖 #新建message且无parent的为发帖
if self.parent_id.nil? && !self.board.project.nil? if self.parent_id.nil? && !self.board.project.nil?
UserScore.joint(:post_message, self.author,nil,self, { message_id: self.id }) UserScore.joint(:post_message, self.author,nil,self, { message_id: self.id })
update_memo_number(self.author,1) update_memo_number(self.author,1)

@ -29,6 +29,7 @@ class News < ActiveRecord::Base
validates_presence_of :title, :description validates_presence_of :title, :description
validates_length_of :title, :maximum => 60 validates_length_of :title, :maximum => 60
validates_length_of :summary, :maximum => 255 validates_length_of :summary, :maximum => 255
validates_length_of :description, :maximum => 10000
acts_as_attachable :delete_permission => :manage_news acts_as_attachable :delete_permission => :manage_news
acts_as_searchable :columns => ['title', 'summary', "#{table_name}.description"], :include => :project acts_as_searchable :columns => ['title', 'summary', "#{table_name}.description"], :include => :project

@ -41,7 +41,7 @@ class Project < ActiveRecord::Base
has_many :principals, :through => :member_principals, :source => :principal has_many :principals, :through => :member_principals, :source => :principal
has_many :enabled_modules, :dependent => :delete_all has_many :enabled_modules, :dependent => :delete_all
has_and_belongs_to_many :trackers, :order => "#{Tracker.table_name}.position" has_and_belongs_to_many :trackers, :order => "#{Tracker.table_name}.position"
has_many :issues, :dependent => :destroy, :include => [:status, :tracker] has_many :issues, :dependent => :destroy, :include => [:status, :tracker],:order => "id ASC"
has_many :issue_changes, :through => :issues, :source => :journals has_many :issue_changes, :through => :issues, :source => :journals
has_many :versions, :dependent => :destroy, :order => "#{Version.table_name}.effective_date DESC, #{Version.table_name}.name DESC" has_many :versions, :dependent => :destroy, :order => "#{Version.table_name}.effective_date DESC, #{Version.table_name}.name DESC"
has_many :time_entries, :dependent => :delete_all has_many :time_entries, :dependent => :delete_all
@ -1151,3 +1151,4 @@ class Project < ActiveRecord::Base
end end

@ -199,13 +199,19 @@ class User < Principal
} }
scope :sorted, lambda { order(*User.fields_for_order_statement)} scope :sorted, lambda { order(*User.fields_for_order_statement)}
scope :like, lambda {|arg| scope :like, lambda {|arg, type|
if arg.blank? if arg.blank?
where(nil) where(nil)
else else
pattern = "%#{arg.to_s.strip.downcase}%" pattern = "%#{arg.to_s.strip.downcase}%"
#where(" LOWER(concat(lastname, firstname)) LIKE :p ", :p => pattern) #where(" LOWER(concat(lastname, firstname)) LIKE :p ", :p => pattern)
where(" LOWER(login) LIKE :p ", :p => pattern) if type == "0"
where(" LOWER(login) LIKE :p ", :p => pattern)
elsif type == "1"
where(" LOWER(concat(lastname, firstname)) LIKE :p ", :p => pattern)
else
where(" LOWER(mail) LIKE :p ", :p => pattern)
end
end end
} }

@ -3,6 +3,6 @@ class WebFooterCompany < ActiveRecord::Base
validates :name, presence: true, length: { maximum: 500 } validates :name, presence: true, length: { maximum: 500 }
validates :url, length: { maximum: 500 }, validates :url, length: { maximum: 500 },
format: { with: /(http|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&amp;:\/~\+#]*[\w\-\@?^=%&amp;\/~\+#])?/, format: { with: /(http|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&amp;:\/~\+#]*[\w\-\@?^=%&amp;\/~\+#])?/,
message: l(:is_not_url_error) message: :invalid
} }
end end

@ -0,0 +1,53 @@
<head>
<meta charset="utf-8">
<title>注册帐号</title>
<style type="text/css">
#jihuo {
background-image: url("./images/jingtanhao.JPG");
}
</style>
</head>
<body>
<% email = @user.mail.split("@")[1] %>
<div style="border: 1px solid #c0c0c0 ; width:850px;" >
<h3 style=" padding-bottom: 8px; margin-top:5px; border-bottom: 1px solid #c0c0c0;color:black; ">
<span id = "jihuo" style=" margin-left: 4%;"></span>邮箱激活</h3>
<div style="margin-left:auto; margin-right:auto">
<center>
<div >
<h4 style="font-size: 18px;margin-top: 10px; margin-bottom: 10px;">请在24小时内点击邮件中的链接继续完成注册</h4>
<div class="to-email">
<span class="summary">邮件已发送到邮箱</span>
<a href="#" class="f-blue"><%= @user.mail %></a>
</div>
<p>
<a href="http://mail.<%= email %>" style="background: #15bccf;margin: auto;
color: #fff;
font-size: 13px;
border: none;
padding: 10px 16px;
line-height: 1.33;" target="_blank">立即查收邮件</a></p>
<span class="tracking-ad" >
<a href="javascript:void(0);" >没收到邮件?</a>
</span>
<div style = "margin-top: 10px; margin-bottom:10px;">
<span style="font-size: 16px">请先检查是否在垃圾邮件中</span>
</div>
</div>
</center>
</div>
</div>
</body>

@ -3,287 +3,9 @@
@nav_dispaly_main_project_label = 1 @nav_dispaly_main_project_label = 1
@nav_dispaly_main_contest_label = 1 %> @nav_dispaly_main_contest_label = 1 %>
<% @nav_dispaly_forum_label = 1%> <% @nav_dispaly_forum_label = 1%>
<!-- added by bai 增加地区-->
<script type="text/javascript" language="javascript">
function showcity(province, cityField) {
switch (province) {
case "北京" :
var cityOptions = new Array(
"东城", "西城", "朝阳", "丰台", "石景山", "海淀", "门头沟",
"房山", "通州", "顺义", "昌平", "大兴", "平谷", "怀柔", "密云", "延庆");
break;
case "上海" :
var cityOptions = new Array(
"崇明", "黄浦", "卢湾", "徐汇", "长宁", "静安", "普陀", "闸北", "虹口", "杨浦", "闵行",
"宝山", "嘉定", "浦东", "金山", "松江", "青浦", "南汇", "奉贤");
break;
case "广东" :
var cityOptions = new Array(
"广州", "深圳", "珠海", "东莞", "中山", "佛山", "惠州", "河源", "潮州", "江门", "揭阳", "茂名",
"梅州", "清远", "汕头", "汕尾", "韶关", "顺德", "阳江", "云浮", "湛江", "肇庆");
break;
case "江苏" :
var cityOptions = new Array(
"南京", "常熟", "常州", "海门", "淮安", "江都", "江阴", "昆山", "连云港", "南通",
"启东", "沭阳", "宿迁", "苏州", "太仓", "泰州", "同里", "无锡", "徐州", "盐城",
"扬州", "宜兴", "仪征", "张家港", "镇江", "周庄");
break;
case "重庆" :
var cityOptions = new Array(
"万州", "涪陵", "渝中", "大渡口", "江北", "沙坪坝", "九龙坡", "南岸", "北碚", "万盛",
"双挢", "渝北", "巴南", "黔江", "长寿", "綦江", "潼南", "铜梁", "大足", "荣昌", "壁山",
"梁平", "城口", "丰都", "垫江", "武隆", "忠县", "开县", "云阳", "奉节", "巫山", "巫溪",
"石柱", "秀山", "酉阳", "彭水", "江津", "合川", "永川", "南川");
break;
case "安徽" :
var cityOptions = new Array(
"合肥", "安庆", "蚌埠", "亳州", "巢湖", "滁州", "阜阳", "贵池", "淮北", "淮化", "淮南",
"黄山", "九华山", "六安", "马鞍山", "宿州", "铜陵", "屯溪", "芜湖", "宣城");
break;
case "福建" :
var cityOptions = new Array(
"福州", "厦门", "泉州", "漳州", "龙岩", "南平", "宁德", "莆田", "三明");
break;
case "甘肃" :
var cityOptions = new Array(
"兰州", "白银", "定西", "敦煌", "甘南", "金昌", "酒泉", "临夏", "平凉", "天水",
"武都", "武威", "西峰", "张掖");
break;
case "广西" :
var cityOptions = new Array(
"南宁", "百色", "北海", "桂林", "防城港", "贵港", "河池", "贺州", "柳州", "钦州", "梧州", "玉林");
break;
case "贵州" :
var cityOptions = new Array(
"贵阳", "安顺", "毕节", "都匀", "凯里", "六盘水", "铜仁", "兴义", "玉屏", "遵义");
break;
case "海南" :
var cityOptions = new Array(
"海口", "儋县", "陵水", "琼海", "三亚", "通什", "万宁");
break;
case "河北" :
var cityOptions = new Array(
"石家庄", "保定", "北戴河", "沧州", "承德", "丰润", "邯郸", "衡水", "廊坊", "南戴河", "秦皇岛",
"唐山", "新城", "邢台", "张家口");
break;
case "黑龙江" :
var cityOptions = new Array(
"哈尔滨", "北安", "大庆", "大兴安岭", "鹤岗", "黑河", "佳木斯", "鸡西", "牡丹江", "齐齐哈尔",
"七台河", "双鸭山", "绥化", "伊春");
break;
case "河南" :
var cityOptions = new Array(
"郑州", "安阳", "鹤壁", "潢川", "焦作", "济源", "开封", "漯河", "洛阳", "南阳", "平顶山",
"濮阳", "三门峡", "商丘", "新乡", "信阳", "许昌", "周口", "驻马店");
break;
case "香港" :
var cityOptions = new Array(
"香港", "九龙", "新界");
break;
case "湖北" :
var cityOptions = new Array(
"武汉", "恩施", "鄂州", "黄冈", "黄石", "荆门", "荆州", "潜江", "十堰", "随州", "武穴",
"仙桃", "咸宁", "襄阳", "襄樊", "孝感", "宜昌");
break;
case "湖南" :
var cityOptions = new Array(
"长沙", "常德", "郴州", "衡阳", "怀化", "吉首", "娄底", "邵阳", "湘潭", "益阳", "岳阳",
"永州", "张家界", "株洲");
break;
case "江西" :
var cityOptions = new Array(
"南昌", "抚州", "赣州", "吉安", "景德镇", "井冈山", "九江", "庐山", "萍乡",
"上饶", "新余", "宜春", "鹰潭");
break;
case "吉林" :
var cityOptions = new Array(
"长春", "吉林", "白城", "白山", "珲春", "辽源", "梅河", "四平", "松原", "通化", "延吉");
break;
case "辽宁" :
var cityOptions = new Array(
"沈阳", "鞍山", "本溪", "朝阳", "大连", "丹东", "抚顺", "阜新", "葫芦岛", "锦州",
"辽阳", "盘锦", "铁岭", "营口");
break;
case "澳门" :
var cityOptions = new Array("澳门");
break;
case "内蒙古" :
var cityOptions = new Array(
"呼和浩特", "阿拉善盟", "包头", "赤峰", "东胜", "海拉尔", "集宁", "临河", "通辽", "乌海",
"乌兰浩特", "锡林浩特");
break;
case "宁夏" :
var cityOptions = new Array(
"银川", "固源", "石嘴山", "吴忠");
break;
case "青海" :
var cityOptions = new Array(
"西宁", "德令哈", "格尔木", "共和", "海东", "海晏", "玛沁", "同仁", "玉树");
break;
case "山东" :
var cityOptions = new Array(
"济南", "滨州", "兖州", "德州", "东营", "菏泽", "济宁", "莱芜", "聊城", "临沂",
"蓬莱", "青岛", "曲阜", "日照", "泰安", "潍坊", "威海", "烟台", "枣庄", "淄博");
break;
case "山西" :
var cityOptions = new Array(
"太原", "长治", "大同", "候马", "晋城", "离石", "临汾", "宁武", "朔州", "忻州",
"阳泉", "榆次", "运城");
break;
case "陕西" :
var cityOptions = new Array(
"西安", "安康", "宝鸡", "汉中", "渭南", "商州", "绥德", "铜川", "咸阳", "延安", "榆林");
break;
case "四川" :
var cityOptions = new Array(
"成都", "巴中", "达川", "德阳", "都江堰", "峨眉山", "涪陵", "广安", "广元", "九寨沟",
"康定", "乐山", "泸州", "马尔康", "绵阳", "眉山", "南充", "内江", "攀枝花", "遂宁",
"汶川", "西昌", "雅安", "宜宾", "自贡", "资阳");
break;
case "台湾" :
var cityOptions = new Array(
"台北", "基隆", "台南", "台中", "高雄", "屏东", "南投", "云林", "新竹", "彰化", "苗栗",
"嘉义", "花莲", "桃园", "宜兰", "台东", "金门", "马祖", "澎湖");
break;
case "天津" :
var cityOptions = new Array(
"天津", "和平", "东丽", "河东", "西青", "河西", "津南", "南开", "北辰", "河北", "武清", "红挢",
"塘沽", "汉沽", "大港", "宁河", "静海", "宝坻", "蓟县");
break;
case "新疆" :
var cityOptions = new Array(
"乌鲁木齐", "阿克苏", "阿勒泰", "阿图什", "博乐", "昌吉", "东山", "哈密", "和田", "喀什",
"克拉玛依", "库车", "库尔勒", "奎屯", "石河子", "塔城", "吐鲁番", "伊宁");
break;
case "西藏" :
var cityOptions = new Array(
"拉萨", "阿里", "昌都", "林芝", "那曲", "日喀则", "山南");
break;
case "云南" :
var cityOptions = new Array(
"昆明", "大理", "保山", "楚雄", "大理", "东川", "个旧", "景洪", "开远", "临沧", "丽江",
"六库", "潞西", "曲靖", "思茅", "文山", "西双版纳", "玉溪", "中甸", "昭通");
break;
case "浙江" :
var cityOptions = new Array(
"杭州", "安吉", "慈溪", "定海", "奉化", "海盐", "黄岩", "湖州", "嘉兴", "金华", "临安",
"临海", "丽水", "宁波", "瓯海", "平湖", "千岛湖", "衢州", "江山", "瑞安", "绍兴", "嵊州",
"台州", "温岭", "温州", "余姚", "舟山");
break;
case "海外" :
var cityOptions = new Array(
"美国", "日本", "英国", "法国", "德国", "其他");
break;
default:
var cityOptions = new Array("");
break;
}
cityField.options.length = 0;
for (var i = 0; i < cityOptions.length; i++) {
cityField.options[i] = new Option(cityOptions[i], cityOptions[i]);
/*
if (cityField.options[i].value==city)
{
//alert("here put City ok!");
document.oblogform["city"].selectedIndex = i;
}*/
}
}
</script>
<script type="text/javascript" language="javascript">
window.onload = function(){
var identity = "<%= @cache_identityy %>";
var no = "<%= @cache_no %>";
var technical_title = "<%= @cache_technical_title %>";
var province = "<%= @cache_province %>";
var city = "<%= @cache_city %>";
var enterprise_name = "<%= @cache_enterprise_name %>";
//还原身份
if(identity!=null&&identity!=""){
$('#userIdentity').children("option[value='"+identity+"']").attr("selected","selected");
showtechnical_title(identity, document.getElementById('userTechnical_title'));
if(identity=="0"){
//还原教师职称
$('#userTechnical_title').children("option[value='"+technical_title+"']").attr("selected","selected");
}else if(identity=="1"){
//还原学号
$("input[id='no']").attr("value",no);
}
}
//还原地区
if(province!=null&&province!=""){
$("#userProvince").children("option[value='"+province+"']").attr("selected","selected");
showcity(province, document.getElementById('userCity'));
$("select[id='userCity']").children("option[value='"+city+"']").attr("selected","selected");
}
//还原企业名
if(enterprise_name!=null&&enterprise_name!=""){
$("input[id='enterprise_name']").attr("value",enterprise_name);
}
}
function showtechnical_title(identity, technical_titleField) {
var technical_titleOptions = null;
switch (identity) {
case '0' :
$('#technical_title').show()
$('#no').hide()
$('#name').show()
$('#enterprise').hide()
$('#gender').show()
technical_titleOptions = new Array(
"<%= l(:label_technicl_title_professor) %>", "<%= l(:label_technicl_title_associate_professor) %>", "<%= l(:label_technicl_title_lecturer) %>", "<%= l(:label_technicl_title_teaching_assistant) %>");
break;
case '1' :
$('#technical_title').hide()
$('#no').show()
$('#name').show()
$('#enterprise').hide()
$('#gender').show()
var titleOptions = new Array("");
break;
case '2' :
$('#technical_title').hide()
$('#no').hide()
$('#name').hide()
$('#enterprise').show()
$('#gender').hide()
var titleOptions = new Array("");
break;
default:
$('#technical_title').hide()
$('#no').hide()
$('#name').show()
$('#enterprise').hide()
$('#gender').show()
var titleOptions = new Array("");
break;
}
technical_titleField.options.length = 0;
if(technical_titleOptions == null){
return;
}
for (var i = 0; i < technical_titleOptions.length; i++) {
technical_titleField.options[i] = new Option(technical_titleOptions[i], technical_titleOptions[i]);
/*
if (cityField.options[i].value==city)
{
//alert("here put City ok!");
document.oblogform["city"].selectedIndex = i;
}
*/
}
}
</script>
<!-- end --> <!-- end -->
@ -292,145 +14,30 @@
<%= labelled_form_for @user, :url => register_path do |f| %> <%= labelled_form_for @user, :url => register_path do |f| %>
<%= error_messages_for 'user' %> <%= error_messages_for 'user' %>
<div class="box tabular"> <div class="box tabular">
<p>
<table>
<tr>
<td class="info" align="right" style="width: 90px">
<strong><%= l(:label_identity) %><span class="required"> *</span></strong></td>
<td class="info" style="width: 10px">
<select onchange="showtechnical_title(this.value, document.getElementById('userTechnical_title'));" name="identity" id="userIdentity" class="location">
<option value="">--请选择身份--</option>
<option value="0"><%= l(:label_teacher) %></option>
<option value="1"><%= l(:label_student) %></option>
<option value="2"><%= l(:label_enterprise) %></option>
<option value="3"><%= l(:label_account_developer) %></option>
</select>
</td>
<td>
<span id='technical_title' style='display:none'>
<select name="technical_title" id="userTechnical_title"></select>
</span>
<span id='no' style='display:none'>
<strong>
<%= l(:label_bidding_user_studentcode) %>
<span class="required"> *</span>
</strong>
<% unless User.current.user_extensions.nil? %>
<%= text_field_tag :no, User.current.user_extensions.student_id, :placeholder => "请输入学号" %>
<% else %>
<%= text_field_tag :no, nil, :placeholder => "请输入学号" %>
<% end %>
</span>
</td>
</tr>
</table>
</p>
<% if @user.auth_source_id.nil? %> <% if @user.auth_source_id.nil? %>
<p><%= f.text_field :login, :size => 25, :required => true %><span id="valid_user_login"></span> <p><%= f.text_field :login, :size => 25, :required => true %><span id="valid_user_login"></span>
<em class="info"><%= l(:label_max_number) %></em> <em class="info" style="color: #acaeb1"><%= l(:label_max_number) %></em>
</p> </p>
<p><%= f.password_field :password, :size => 25, :required => true %> <p><%= f.password_field :password, :size => 25, :required => true %>
<em class="info"><%= l(:text_caracters_minimum, :count => Setting.password_min_length) %></em> <em class="info" style="color: #acaeb1"><%= l(:text_caracters_minimum, :count => Setting.password_min_length) %></em>
</p> </p>
<p><%= f.password_field :password_confirmation, :size => 25, :required => true %></p> <p><%= f.password_field :password_confirmation, :size => 25, :required => true %><span id="valid_password" style="padding-left: 10px;"></span></p>
<% end %> <% end %>
<span id='name' style='display:none'>
<p style="color: #ff0000"><%= l(:name_can_be_empty) %></p>
<p><%= f.text_field :firstname, :required => false %></p>
<p><%= f.text_field :lastname, :required => false %></p>
</span>
<span id='enterprise' style='display:none'>
<p>
<table>
<tr>
<td class="info" align="right" style="width: 90px">
<strong>企业名
<span class="required"> *</span>
</strong>
</td>
<td class="info" style="width: 10px">
<%= text_field_tag :enterprise_name %>
</td>
</tr>
</table>
</p>
</span>
<p> <p>
<%= f.text_field :mail, :required => true %> <%= f.text_field :mail,:size => 25, :required => true %>
<span id="valid_user_mail"></span> <span id="valid_user_mail" ></span>
</p> </p>
<p> <p>
<em class="info"><%= "#{l(:label_mail_attention)} " %></em> <em class="info" style="color: #acaeb1">
<p><%= "#{l(:label_mail_attention)} " %></p>
<p><%= "#{l(:label_mail_attention1)} " %></p>
</em>
</p> </p>
<p><%= f.select :language, lang_options_for_select, :required => true %></p>
<!-- added by bai 增加了身份、性别和地区-->
<span id='gender' style='display:none'>
<p>
<table>
<tr>
<td class="info" align="right" style="width: 90px">
<strong><%= l(:label_gender) %><span class="required"> &nbsp;</span></strong></td>
<td class="info" style="width: 10px">
<%= select_tag 'gender', "<option value = '0'>#{l(:label_gender_male)}</option>
<option value = '1'>#{l(:label_gender_female)}</option>".html_safe %>
</td>
</tr>
</table>
</p>
</span>
<p>
<table>
<tr>
<td class="info" align="right" style="width: 90px">
<strong><%= l(:label_location) %><span class="required"> *</span></strong>
</td>
<td class="info" style="width: 80px">
<select onchange="showcity(this.value, document.getElementById('userCity'));" name="province" id="userProvince">
<option value="">--请选择省份--</option>
<option value="北京">北京</option>
<option value="上海">上海</option>
<option value="广东">广东</option>
<option value="江苏">江苏</option>
<option value="浙江">浙江</option>
<option value="重庆">重庆</option>
<option value="安徽">安徽</option>
<option value="福建">福建</option>
<option value="甘肃">甘肃</option>
<option value="广西">广西</option>
<option value="贵州">贵州</option>
<option value="海南">海南</option>
<option value="河北">河北</option>
<option value="黑龙江">黑龙江</option>
<option value="河南">河南</option>
<option value="湖北">湖北</option>
<option value="湖南">湖南</option>
<option value="江西">江西</option>
<option value="吉林">吉林</option>
<option value="辽宁">辽宁</option>
<option value="内蒙古">内蒙古</option>
<option value="宁夏">宁夏</option>
<option value="青海">青海</option>
<option value="山东">山东</option>
<option value="山西">山西</option>
<option value="陕西">陕西</option>
<option value="四川">四川</option>
<option value="天津">天津</option>
<option value="新疆">新疆</option>
<option value="西藏">西藏</option>
<option value="云南">云南</option>
<option value="香港">香港特别行政区</option>
<option value="澳门">澳门特别行政区</option>
<option value="台湾">台湾</option>
<option value="海外">海外</option>
</select>
</td>
<td class="info" style="width: 100px">
<select name="city" id="userCity"></select>
</td>
</tr>
</table>
</p>
<!-- end --> <!-- end -->
</div> </div>
@ -453,7 +60,7 @@
jQuery(document).ready(function () { jQuery(document).ready(function () {
var $login = $('#user_login') var $login = $('#user_login')
var $mail = $('#user_mail') var $mail = $('#user_mail')
var $password_confirmation = $('#user_password_confirmation')
$login.blur(function (event) { $login.blur(function (event) {
if ($(this).is('#user_login')) { if ($(this).is('#user_login')) {
$.get( $.get(
@ -485,6 +92,19 @@
}); });
} }
; ;
});
$password_confirmation.blur(function () {
var pas1 = document.getElementById("user_password").value;
var pas2 = document.getElementById("user_password_confirmation").value;
if (pas1 == pas2) {
$('#valid_password').html('<span class="green">' + "<%= l(:setting_password_success) %>"+ "</span>");
}
else {
$('#valid_password').html('<span class="red">' + "<%= l(:setting_password_error) %>" + "</span>");
}
}); });
}); });
</script> </script>

@ -17,7 +17,10 @@
<label for='group_id'><%= l(:label_group) %>:</label> <label for='group_id'><%= l(:label_group) %>:</label>
<%= select_tag 'group_id', content_tag('option') + options_from_collection_for_select(@groups, :id, :name, params[:group_id].to_i), :onchange => "this.form.submit(); return false;" %> <%= select_tag 'group_id', content_tag('option') + options_from_collection_for_select(@groups, :id, :name, params[:group_id].to_i), :onchange => "this.form.submit(); return false;" %>
<% end %> <% end %>
<label for="user_browse_label"><%= l(:label_user_search_type) %></label>
<%= select "search_by", "id",
{ l(:label_search_by_login) => "0", l(:label_search_by_name) => "1", l(:label_search_by_email) => "2" },
:size => 20 %>
<label for='name'><%= l(:label_user) %>:</label> <label for='name'><%= l(:label_user) %>:</label>
<%= text_field_tag 'name', params[:name], :size => 30 %> <%= text_field_tag 'name', params[:name], :size => 30 %>
<%= submit_tag l(:label_search), :class => "small", :name => nil %> <%= submit_tag l(:label_search), :class => "small", :name => nil %>
@ -51,7 +54,7 @@
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="created_on" align="center" title='<%=format_time(user.created_on)%>'><%= format_time(user.created_on) %></td> <td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="created_on" align="center" title='<%=format_time(user.created_on)%>'><%= format_time(user.created_on) %></td>
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="last_login_on" align="center" title='<%= format_time(user.last_login_on)%>'><%= format_time(user.last_login_on) unless user.last_login_on.nil? %></td> <td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="last_login_on" align="center" title='<%= format_time(user.last_login_on)%>'><%= format_time(user.last_login_on) unless user.last_login_on.nil? %></td>
<td class="buttons"> <%= change_status_link(user) %> <td class="buttons"> <%= change_status_link(user) %>
<%= delete_link user_path(user, :back_url => admin_users_path(params)) unless User.current == user %> </td> <%= delete_link user_path(user, :back_url => admin_search_path(params)) unless User.current == user %> </td>
</tr> </tr>
<% end -%> <% end -%>
</tbody> </tbody>

@ -17,7 +17,10 @@
<label for='group_id'><%= l(:label_group) %>:</label> <label for='group_id'><%= l(:label_group) %>:</label>
<%= select_tag 'group_id', content_tag('option') + options_from_collection_for_select(@groups, :id, :name, params[:group_id].to_i), :onchange => "this.form.submit(); return false;" %> <%= select_tag 'group_id', content_tag('option') + options_from_collection_for_select(@groups, :id, :name, params[:group_id].to_i), :onchange => "this.form.submit(); return false;" %>
<% end %> <% end %>
<label for="user_browse_label"><%= l(:label_user_search_type) %></label>
<%= select "search_by", "id",
{ l(:label_search_by_login) => "0", l(:label_search_by_name) => "1", l(:label_search_by_email) => "2" },
:size => 20 %>
<label for='name'><%= l(:label_user) %>:</label> <label for='name'><%= l(:label_user) %>:</label>
<%= text_field_tag 'name', params[:name], :size => 30 %> <%= text_field_tag 'name', params[:name], :size => 30 %>
<%= submit_tag l(:label_search), :class => "small", :name => nil %><!--Modified by young--> <%= submit_tag l(:label_search), :class => "small", :name => nil %><!--Modified by young-->

@ -0,0 +1,5 @@
<% if !@save_flag%>
$("#error_show").html("<%= @save_message.join(', ') %>");
<% else %>
closeModal();
<% end %>

@ -0,0 +1,2 @@
$("#is_public_<%= @attachment.id %>").html("<%= escape_javascript(link_to (@attachment.is_public? ? "公开":"私有"), update_file_dense_attachments_path(:attachmentid=>@attachment.id,:newtype=>(@attachment.is_public? ? 0:1)),
:remote=>true,:class=>"f_l re_open",:method => :post) %>");

@ -14,7 +14,7 @@
/* 匿名评分弹框 */ /* 匿名评分弹框 */
.anonymos{width:480px;height:180px;position:absolute;z-index:100;left:50%;top:50%;margin:-215px 0 0 -300px; background:#fff; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px; box-shadow:0px 0px 8px #194a81; overflow:auto;} .anonymos{width:480px;height:180px;position:fixed;z-index:100;left:50%;top:50%;margin:-215px 0 0 -300px; background:#fff; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px; box-shadow:0px 0px 8px #194a81; overflow:auto;}
.ni_con { width:425px; margin:25px 30px;} .ni_con { width:425px; margin:25px 30px;}
.ni_con h2{ display:block; height:40px; width:425px; text-align:center; color:#3a3a3a;} .ni_con h2{ display:block; height:40px; width:425px; text-align:center; color:#3a3a3a;}
.ni_con p{ color:#808181; } .ni_con p{ color:#808181; }

@ -1,4 +1,38 @@
<!--modified by huang--> <!--modified by huang-->
<script type="text/javascript">
function ShowCountDown(year,month,day,divname)
{
var now = new Date();
var endDate = new Date(year, month-1, day);
var leftTime=endDate.getTime()-now.getTime();
var leftsecond = parseInt(leftTime/1000);
var day1=Math.floor(leftsecond/(60*60*24));
var hour=Math.floor((leftsecond-day1*24*60*60)/3600);
var minute=Math.floor((leftsecond-day1*24*60*60-hour*3600)/60);
var second=Math.floor(leftsecond-day1*24*60*60-hour*3600-minute*60);
$("#"+divname).html("<span style='color: #acaeb1;'>作业提交还剩&nbsp;:</span>&nbsp;<span style='color: red;'>"
+day1+"&nbsp;</span><span style='color: #acaeb1;'>天</span><span style='color: red;'>&nbsp;"
+hour+"&nbsp;</span><span style='color: #acaeb1;'>时</span><span style='color: red;'>&nbsp;"
+minute+"&nbsp;</span><span style='color: #acaeb1;'>分</span><span style='color: red;'>&nbsp;"
+second+"&nbsp;</span><span style='color: #acaeb1;'>秒</span>");
}
</script>
<style>
.span_wping{}
.span_wping a{
margin-top: 18px;
margin-bottom: 3px;
width: 43px;
height: 23px;
background: #15bccf;
color: #fff;
text-align: center;
padding-top: 3px;
padding-left: 3px;
}
.span_wping a:hover{ background-color:#03a1b3;}
</style>
<% if bids.blank? %> <% if bids.blank? %>
<%#= l(:label_uncommit_homework) %> <%#= l(:label_uncommit_homework) %>
暂无作业! 暂无作业!
@ -26,7 +60,15 @@
<% if User.current.logged? && is_cur_course_student(@course) %> <% if User.current.logged? && is_cur_course_student(@course) %>
<% cur_user_homework = cur_user_homework_for_bid(bid) %> <% cur_user_homework = cur_user_homework_for_bid(bid) %>
<% if cur_user_homework!= nil && cur_user_homework.empty? %> <% if cur_user_homework!= nil && cur_user_homework.empty? %>
<%= link_to l(:label_commit_homework),new_exercise_book_path(bid) %> <% if bid.comment_status == 0 || bid.comment_status == 2%>
<span class="span_wping">
<%= link_to l(:label_commit_homework),new_exercise_book_path(bid) %>
</span>
<% else %>
<span title="匿评阶段不可提交作业!" class="span_wping">
<a style="width:80px; margin:20px 0 0 350px;background:#8e8e8e;">提交作业</a>
</span>
<% end %>
<% else %> <% else %>
<span style="color: green; float: right"> <span style="color: green; float: right">
<%= l(:lable_has_commit_homework)%> <%= l(:lable_has_commit_homework)%>
@ -34,7 +76,8 @@
<% end %> <% end %>
<% end %> <% end %>
<% if (User.current.admin?||User.current.id==bid.author_id) %> <% if (User.current.admin?||User.current.id==bid.author_id) %>
<span id="<%=bid.id %>_anonymous_comment"> <% if bid.open_anonymous_evaluation == 1%>
<span id="<%=bid.id %>_anonymous_comment" class="span_wping">
<% case bid.comment_status %> <% case bid.comment_status %>
<% when 0 %> <% when 0 %>
<%= link_to '启动匿评', alert_anonymous_comment_bid_path(bid), id: "#{bid.id}_start_anonymous_comment", remote: true, disable_with: '加载中...' %> <%= link_to '启动匿评', alert_anonymous_comment_bid_path(bid), id: "#{bid.id}_start_anonymous_comment", remote: true, disable_with: '加载中...' %>
@ -44,11 +87,13 @@
匿评结束 匿评结束
<% end %> <% end %>
</span> </span>
<%= link_to( <%end%>
<span class="span_wping">
<%= link_to(
l(:button_edit), l(:button_edit),
{:action => 'edit', :controller=>'bids', :course_id =>@course.id, :bid_id => bid.id}, {:action => 'edit', :controller=>'bids', :course_id =>@course.id, :bid_id => bid.id}
:class => 'icon icon-edit'
) %> ) %>
</span>
<%#= link_to( <%#= link_to(
l(:button_delete), l(:button_delete),
{:action => 'homework_destroy', :controller=>'bids', :course_id => bid.id}, {:action => 'homework_destroy', :controller=>'bids', :course_id => bid.id},
@ -94,19 +139,6 @@
</strong> </strong>
) )
</span> </span>
<span style="float: right">
<% if betweentime(bid.deadline) < 0 %>
<span style="color: red; float: right">
<%= l(:label_commit_limit)%>
</span>
<% else %>
<% if betweentime(bid.deadline) < 3 %>
<span style="color: red">
<%= l(:label_commit_ar) %>
</span>
<% end %>
<% end %>
</span>
</td> </td>
</tr> </tr>
<tr> <tr>
@ -146,10 +178,18 @@
<%=format_time bid.created_on %> <%=format_time bid.created_on %>
</span> </span>
<span style="float: right"> <span style="float: right">
<%= l(:field_deadline) %> <% if betweentime(bid.deadline) < 0 %>
:&nbsp; <span style="color: red; float: right">
<%=bid.deadline %> <%= l(:label_commit_limit)%>
</span> </span>
<% else %>
<script type="text/javascript">
window.setInterval(function(){ShowCountDown(<%= bid.deadline.year%>,<%= bid.deadline.month%>,<%= bid.deadline.day + 1%>,"show_deadtime_span_<%= bid.id%>");},1000)
</script>
<span id="show_deadtime_span_<%= bid.id%>" style="float: right">
</span>
<% end %>
</span>
</td> </td>
<td></td> <td></td>
</tr> </tr>

@ -43,9 +43,9 @@
<% end %> <% end %>
<% unless @is_teacher%> <% unless @is_teacher%>
<% if @bid.comment_status == 0%> <% if @bid.comment_status == 0 && @bid.open_anonymous_evaluation == 1%>
$("#my_homework").click(); $("#my_homework").click();
<% elsif @bid.comment_status == 2%> <% elsif @bid.comment_status == 2 || @bid.open_anonymous_evaluation == 0%>
$("#all_homeworks").click(); $("#all_homeworks").click();
<% end %> <% end %>
<% end %> <% end %>

@ -44,6 +44,10 @@
<%= f.select :proportion, proportion_option %> <%= f.select :proportion, proportion_option %>
</p> </p>
<p> <p>
<%= f.check_box :open_anonymous_evaluation, :style => "margin-left:10px;" %>
<span>未开启匿评作业将直接进入众评点赞阶段</span>
</p>
<p id="evaluation_num_p">
<%= f.text_field :evaluation_num, :required => true, :size => 60, :style => "width:150px;", :onblur => "regexEvaluationNum();" , :maxlength => 4%> <%= f.text_field :evaluation_num, :required => true, :size => 60, :style => "width:150px;", :onblur => "regexEvaluationNum();" , :maxlength => 4%>
<span id="bid_evaluation_num_span">匿评分配数量不宜太大,否则会影响开启匿评速度</span> <span id="bid_evaluation_num_span">匿评分配数量不宜太大,否则会影响开启匿评速度</span>
</p> </p>

@ -28,14 +28,17 @@
</ul> </ul>
<% else %> <% else %>
<ul> <ul>
<li id="tb_5" class="hovertab"> <% if @bid.open_anonymous_evaluation == 1%>
<%= link_to @bid.comment_status == 2 ? "已评作品" : "待评作品", get_student_batch_homework_homework_attach_index_path(:bid_id => @bid.id), {id: 'student_batch_homework',:remote => true}%> <li id="tb_5" class="hovertab">
</li> <!-- 开启了匿评才能看到匿评列表 -->
<%= link_to @bid.comment_status == 2 ? "已评作品" : "待评作品", get_student_batch_homework_homework_attach_index_path(:bid_id => @bid.id), {id: 'student_batch_homework',:remote => true}%>
</li>
<% end %>
<li id="tb_6" class="normaltab"> <li id="tb_6" class="normaltab">
<%= link_to "我的作品", get_my_homework_homework_attach_index_path(:bid_id => @bid.id), {id: 'my_homework',:remote => true}%> <%= link_to "我的作品", get_my_homework_homework_attach_index_path(:bid_id => @bid.id), {id: 'my_homework',:remote => true}%>
</li> </li>
<% if @bid.comment_status == 2 %> <% if @bid.comment_status == 2 || @bid.open_anonymous_evaluation == 0%>
<!-- 匿评结束后才能看到全部作业列表 --> <!-- 匿评结束后或者未开启匿评才能看到全部作业列表 -->
<li id="tb_7" class="normaltab"> <li id="tb_7" class="normaltab">
<%= link_to "所有作品", get_homeworks_homework_attach_index_path(:bid_id => @bid.id), {id: 'all_homeworks',:remote => true}%> <%= link_to "所有作品", get_homeworks_homework_attach_index_path(:bid_id => @bid.id), {id: 'all_homeworks',:remote => true}%>
</li> </li>

@ -43,35 +43,66 @@
{ {
var evaluation_num = $.trim($("#bid_evaluation_num").val()); var evaluation_num = $.trim($("#bid_evaluation_num").val());
var regex = /^\d+$/; var regex = /^\d+$/;
if(evaluation_num=="") if($("#bid_open_anonymous_evaluation").attr("checked") == "checked")
{ {
$("#bid_evaluation_num_span").text("匿评分配数量不能为空"); if(evaluation_num=="")
$("#bid_evaluation_num_span").css('color','#ff0000');
return false;
}
else if(regex.test(evaluation_num))
{
if(evaluation_num > 0)
{ {
$("#bid_evaluation_num_span").text("填写正确"); $("#bid_evaluation_num_span").text("匿评分配数量不能为空");
$("#bid_evaluation_num_span").css('color','#008000'); $("#bid_evaluation_num_span").css('color','#ff0000');
return true; return false;
}
else if(regex.test(evaluation_num))
{
if(evaluation_num > 0)
{
$("#bid_evaluation_num_span").text("填写正确");
$("#bid_evaluation_num_span").css('color','#008000');
return true;
}
else
{
$("#bid_evaluation_num_span").text("匿评分配数量必须为大于0");
$("#bid_evaluation_num_span").css('color','#ff0000');
return false;
}
} }
else else
{ {
$("#bid_evaluation_num_span").text("匿评分配数量必须为大于0"); $("#bid_evaluation_num_span").text("匿评分配数量只能为数字");
$("#bid_evaluation_num_span").css('color','#ff0000'); $("#bid_evaluation_num_span").css('color','#ff0000');
return false; return false;
} }
} }
else else
{ {
$("#bid_evaluation_num_span").text("匿评分配数量只能为数字"); return true;
$("#bid_evaluation_num_span").css('color','#ff0000');
return false;
} }
} }
$(function(){
$("#bid_open_anonymous_evaluation").click(function(){
if($("#bid_open_anonymous_evaluation").attr("checked") == "checked")
{
$("#evaluation_num_p").slideDown();
}
else
{
$("#evaluation_num_p").slideUp();
}
});
});
$(function(){
if($("#bid_open_anonymous_evaluation").attr("checked") == "checked")
{
$("#evaluation_num_p").show();
}
else
{
$("#evaluation_num_p").hide();
}
});
function submitHomework(id) function submitHomework(id)
{ {
if(regexDeadLine()&&regexName()&&regexEvaluationNum()) if(regexDeadLine()&&regexName()&&regexEvaluationNum())

@ -24,7 +24,7 @@
<% end %> <% end %>
<% if reply_allow %> <% if reply_allow %>
<%= link_to l(:label_bid_respond_quote),'', <%= link_to l(:label_bid_respond_quote),'',
{:focus => 'project_respond', :onclick => "toggleAndSettingWordsVal($('##{ids}'), $('##{ids} textarea'), '#{l(:label_reply_plural)} #{journal.user.name}: '); $('##{ids} textarea') ;return false;"} %> {:focus => 'project_respond', :onclick => "toggleAndSettingWordsVal($('##{ids}'), $('##{ids} textarea')); $('##{ids} textarea') ;return false;"} %>
<%= link_to(l(:button_quote), contests_path(:id => contest, <%= link_to(l(:button_quote), contests_path(:id => contest,
:journal_id => journal), :journal_id => journal),
:remote => true, :remote => true,

@ -1,23 +1,8 @@
<!-- fq --> <!-- fq -->
<script type="text/javascript" language="javascript"> <div style="width: 80%; margin-left:10%;">
function clearInfo(id, content) { <%= form_for('contest_message',
var text = $('#' + id); :remote => true, :method => :post,
if (text.val() == content) { :url => {:controller => 'contests',
$('#' + id).val('');
}
}
function showInfo(id, content) {
var text = $('#' + id);
if (text.val() == '') {
$('#' + id).val(content);
}
}
</script>
<%= form_for('contest_message',
:remote => true, :method => :post,
:url => {:controller => 'contests',
:action => 'create', :action => 'create',
:id => contest, :id => contest,
:sta => sta} :sta => sta}
@ -28,52 +13,24 @@
</div> </div>
<% if User.current.logged? %> <% if User.current.logged? %>
<table border="0" width="525px" align="center" >
<tr>
<!-- modified by longjun 修改格式 -->
<td>
<%= f.text_area 'message', <%= f.text_area 'message',
:rows => 3, :rows => 3,
:cols => 65, :cols => 65,
:placeholder => l(:label_my_respond), :placeholder => l(:label_my_respond),
:style => "resize: none;", :style => "resize: none; width: 98%",
:class => 'noline' :class => 'noline',
:maxlength => 250
%> %>
</td>
<!-- end longjun -->
</tr>
</table>
<%= f.text_field :reference_user_id, :style=>"display:none"%> <!--what function?--> <%= f.text_field :reference_user_id, :style=>"display:none"%>
<%= submit_tag l(:button_leave_meassge), :name => nil , :class => "enterprise" , :style => "display: block; float: right; margin-right: 1%; margin-top: 1px;"%>
<!-- modified by bai -->
<table border="0" width="525px" align="center">
<tr>
<!-- modified by longjun 修改格式 -->
<td align="right">
<%= submit_tag l(:button_leave_meassge),
:name => nil ,
:class => "contest_btn",
:onmouseout => "this.style.backgroundPosition = 'left top'",
:onmouseover => "this.style.backgroundPosition = 'left -31px'"
%>
<%= submit_tag l(:button_clear_meassge),
:name => nil,
:onclick => "clearMessage('contest_message_message');",
:type => 'button', :class => "bid_btn",
:onmouseout => "this.style.backgroundPosition = 'left top'",
:onmouseover => "this.style.backgroundPosition = 'left -31px'"
%>
</td>
<!-- end longjun -->
</tr>
</table>
<!-- end -->
<% else %> <% else %>
<div style="font-size: 14px;margin:10px;padding-left: 13px"> <div style="font-size: 14px;margin:10px;padding-left: 13px">
<%= l(:label_user_login_tips) %> <%= l(:label_user_login_tips) %>
<%= link_to l(:label_user_login_new), signin_path %> <%= link_to l(:label_user_login_new), signin_path %>
</div> </div>
<% end %> <% end %>
<% end %> <% end %>
<div class="cl"></div>
</div>

@ -165,7 +165,7 @@
:onblur => 'regexDevelopers();' :onblur => 'regexDevelopers();'
%> %>
<span style="font-size: 10px" id="span_softapplication_application_developers"> <span style="font-size: 10px; " id="span_softapplication_application_developers">
(<%= l(:label_workdescription_lengthlimit) %>) (<%= l(:label_workdescription_lengthlimit) %>)
</span> </span>
</tr> </tr>

@ -1,315 +1,316 @@
<style> <style>
input[type="submit"].contest_btn { input[type="submit"].contest_btn {
vertical-align: middle; vertical-align: middle;
width: 60px; width: 60px;
height: 30px; height: 30px;
line-height: 18px; line-height: 18px;
font-size: 14px; font-size: 14px;
color: rgb(0, 0, 0); color: rgb(0, 0, 0);
background: url("/images/button/bg103.jpg") no-repeat scroll left top transparent; background: url("/images/button/bg103.jpg") no-repeat scroll left top transparent;
padding: 0px 0px 4px 0px; padding: 0px 0px 4px 0px;
border-radius: 2px; border-radius: 2px;
border: 1px solid rgb(148, 148, 148); border: 1px solid rgb(148, 148, 148);
box-shadow: none; box-shadow: none;
text-shadow: none; text-shadow: none;
margin-top: -10px; margin-top: -10px;
/*margin-right: -4px;*/ /*margin-right: -4px;*/
} }
input[type="button"].contest_btn { input[type="button"].contest_btn {
width: 60px; width: 60px;
height: 30px; height: 30px;
line-height: 18px; line-height: 18px;
font-size: 14px; font-size: 14px;
color: rgb(0, 0, 0); color: rgb(0, 0, 0);
background: url("/images/button/bg103.jpg") no-repeat scroll left top transparent; background: url("/images/button/bg103.jpg") no-repeat scroll left top transparent;
padding: 0px 0px 4px 0px; padding: 0px 0px 4px 0px;
border-radius: 2px; border-radius: 2px;
border: 1px solid rgb(148, 148, 148); border: 1px solid rgb(148, 148, 148);
box-shadow: none; box-shadow: none;
text-shadow: none; text-shadow: none;
margin-top: -10px; margin-top: -10px;
margin-right: -2px; margin-right: -2px;
} }
textarea:focus { textarea:focus {
border: #d5dee9 1px solid; border: #d5dee9 1px solid;
} }
</style> </style>
<script type="text/javascript" language="javascript"> <script type="text/javascript" language="javascript">
function clearInfo(id, content) { function clearInfo(id, content) {
var text = $('#' + id); var text = $('#' + id);
if (text.val() == content) { if (text.val() == content) {
$('#' + id).val(''); $('#' + id).val('');
} }
} }
function showInfo(id, content) { function showInfo(id, content) {
var text = $('#' + id); var text = $('#' + id);
if (text.val() == '') { if (text.val() == '') {
$('#' + id).val(content); $('#' + id).val(content);
} }
} }
function cancel() { function cancel() {
$("#put-bid-form").hide(); $("#put-bid-form").hide();
} }
function cancel() { function cancel() {
$("#put-project-form").hide(); $("#put-project-form").hide();
} }
function selectChange(obj) function selectChange(obj)
{ {
if(obj.value=="其他") if(obj.value=="其他")
{ {
//document.getElementById("a").style.display = "" //document.getElementById("a").style.display = ""
$("#other_span").show(); $("#other_span").show();
} }
else else
{ {
$("#other_span").hide(); $("#other_span").hide();
$("#other_input").val(""); $("#other_input").val("");
//document.getElementById("a").style.display = "none" //document.getElementById("a").style.display = "none"
} }
} }
</script> </script>
<%= render_flash_messages %> <%= render_flash_messages %>
<!--参赛步骤--> <!--参赛步骤-->
<div style="padding-left: 23px; padding-bottom: 10px; color: grey; font-size: 12px"> <div style="padding-left: 23px; padding-bottom: 10px; color: grey; font-size: 12px">
<div> <div>
<%= l(:label_wellmeaning_intimation_contentone) %> <%= l(:label_wellmeaning_intimation_contentone) %>
</div> </div>
<div style="margin-left: 59px; padding-top: 2px"> <div style="margin-left: 59px; padding-top: 2px">
1) <%= l(:label_wellmeaning_intimation_contenttwo) %> 1) <%= l(:label_wellmeaning_intimation_contenttwo) %>
</div> </div>
<div style="margin-left: 59px; padding-top: 2px"> <div style="margin-left: 59px; padding-top: 2px">
2) <%= l(:label_wellmeaning_intimation_contentthree) %> 2) <%= l(:label_wellmeaning_intimation_contentthree) %>
</div> </div>
</div> </div>
<% if User.current.logged? %> <% if User.current.logged? %>
<div style="padding-bottom: 10px; line-height: 15px"> <div style="padding-bottom: 10px; line-height: 15px">
<div style="padding-left: 82px; font-size: 14px"> <div style="padding-left: 82px; font-size: 14px">
<span><strong><%= l(:label_attending_contest) %></strong></span> <span><strong><%= l(:label_attending_contest) %></strong></span>
<span> <span>
<%= link_to l(:label_new_attendingcontest_work), <%= link_to l(:label_new_attendingcontest_work),
"javascript:void(0);", "javascript:void(0);",
onclick: "$('#put-project-form').slideToggle();" onclick: "$('#put-project-form').slideToggle();"
%> %>
</span> </span>
</div> </div>
</div> </div>
<div id="put-project-form" style=" padding-left: 83px; width: 88%"> <div id="put-project-form" style=" padding-left: 83px; width: 88%">
<%= render "new_softapplication" %> <%= render "new_softapplication" %>
</div> </div>
<% else %> <% else %>
<div style="font-size: 14px;margin:10px;padding-left: 73px"> <div style="font-size: 14px;margin:10px;padding-left: 73px">
<%= l(:label_user_login_attending_contest) %> <%= l(:label_user_login_attending_contest) %>
<%= link_to l(:label_user_login_new), signin_path %> <%= link_to l(:label_user_login_new), signin_path %>
</div> </div>
<% end %> <% end %>
<div class="underline-contests_three"></div> <div class="underline-contests_three"></div>
<!--参赛作品列表,通过判断竞赛的id为2,3,6的显示参赛作品为提交的项目否则显示参赛的应用--> <!--参赛作品列表,通过判断竞赛的id为2,3,6的显示参赛作品为提交的项目否则显示参赛的应用-->
<% if @contest.id == 2 or @contest.id == 3 or @contest.id == 6 %> <% if @contest.id == 2 or @contest.id == 3 or @contest.id == 6 %>
<% @contesting_project.sort.reverse.each do |c_project| %> <% @contesting_project.sort.reverse.each do |c_project| %>
<% if c_project.project %> <% if c_project.project %>
<div style="padding-left: 18px"> <div style="padding-left: 18px">
<div style="font-size: 15px"> <div style="font-size: 15px">
<div> <div>
<div><strong><%= l(:label_contest_work) %> <div><strong><%= l(:label_contest_work) %>
: <%= link_to(c_project.project.name, project_path(c_project.project), :target => '_blank') %> </strong> : <%= link_to(c_project.project.name, project_path(c_project.project), :target => '_blank') %> </strong>
<div style="float: right"> <div style="float: right">
<td style="color: #ec6300;" align="right" valign="0.1em" width="16%"> <td style="color: #ec6300;" align="right" valign="0.1em" width="16%">
<strong> <strong>
<span id="reward_result_<%= c_project.id %>"> <!-- 调用js进行刷新 --> <span id="reward_result_<%= c_project.id %>"> <!-- 调用js进行刷新 -->
<% if get_prize(c_project).nil? or get_prize(c_project) == "" %> <% if get_prize(c_project).nil? or get_prize(c_project) == "" %>
<% if @contest.deadline < Date.today %> <% if @contest.deadline < Date.today %>
<span style="color: red"><%= l(:label_noawards) %></span> <span style="color: red"><%= l(:label_noawards) %></span>
<% else %> <% else %>
<span style="color: red"><%= l(:label_noawards_current) %></span> <span style="color: red"><%= l(:label_noawards_current) %></span>
<% end %> <% end %>
<% else %> <% else %>
<% case get_prize(c_project) %> <% case get_prize(c_project) %>
<% when '-1' %> <% when '-1' %>
<%= image_tag("/images/bid/special_reward.png") %> <%= image_tag("/images/bid/special_reward.png") %>
<% when '0' %> <% when '0' %>
<%= image_tag("/images/bid/first_reward.png") %> <%= image_tag("/images/bid/first_reward.png") %>
<% when '1' %> <% when '1' %>
<%= image_tag("/images/bid/second_reward.png") %> <%= image_tag("/images/bid/second_reward.png") %>
<% when '2' %> <% when '2' %>
<%= image_tag("/images/bid/third_reward.png") %> <%= image_tag("/images/bid/third_reward.png") %>
<% when '3' %> <% when '3' %>
<%= image_tag("/images/bid/forth_reward.png") %> <%= image_tag("/images/bid/forth_reward.png") %>
<% when '4' %> <% when '4' %>
<%= image_tag("/images/bid/fifth_reward.png") %> <%= image_tag("/images/bid/fifth_reward.png") %>
<% when '5' %> <% when '5' %>
<%= image_tag("/images/bid/qualified.png") %> <%= image_tag("/images/bid/qualified.png") %>
<% end %> <% end %>
<% end %> <% end %>
</span> </span>
</strong> </strong>
</td> </td>
<!-- 评价显隐控制按钮--> <!-- 评价显隐控制按钮-->
<% if ((User.current.id == @contest.author_id) && (@contest.deadline > Date.today))||User.current.admin %> <% if ((User.current.id == @contest.author_id) && (@contest.deadline > Date.today))||User.current.admin %>
<td valign="top" align="right" width="10%"> <td valign="top" align="right" width="10%">
<span> <%= toggle_link l(:label_reward), c_project.id.to_s %></span> <span> <%= toggle_link l(:label_reward), c_project.id.to_s %></span>
<!-- 评价应标项目的表单 --> <!-- 评价应标项目的表单 -->
<span style="display: none; vertical-align: top " id='<%= c_project.id %>'> <span style="display: none; vertical-align: top " id='<%= c_project.id %>'>
<%= form_for "set_reward_project", :remote => true, :url => set_reward_project_contest_path do |f| %> <%= form_for "set_reward_project", :remote => true, :url => set_reward_project_contest_path do |f| %>
<%= f.text_field :c_id, :style => "display:none", :value => c_project.id, :size => "0" %> <%= f.text_field :c_id, :style => "display:none", :value => c_project.id, :size => "0" %>
<%= f.select :reward, "<option value = '-1'>#{l(:label_special_reward)}</option> <%= f.select :reward, "<option value = '-1'>#{l(:label_special_reward)}</option>
<option value = '0'>#{l(:label_first_reward)}</option> <option value = '0'>#{l(:label_first_reward)}</option>
<option value = '1'>#{l(:label_second_reward)}</option> <option value = '1'>#{l(:label_second_reward)}</option>
<option value = '2'>#{l(:label_third_reward)}</option> <option value = '2'>#{l(:label_third_reward)}</option>
<option value = '3'>#{l(:label_fourth_reward)}</option> <option value = '3'>#{l(:label_fourth_reward)}</option>
<option value = '4'>#{l(:label_fifth_reward)}</option> <option value = '4'>#{l(:label_fifth_reward)}</option>
<option value = '5'>#{l(:label_comfort_reward)}</option>".html_safe %> <option value = '5'>#{l(:label_comfort_reward)}</option>".html_safe %>
<%= f.submit :value => l(:button_submit), :class => "submit" %> <%= f.submit :value => l(:button_submit), :class => "submit" %>
<% end %> <% end %>
</span> </span>
</td> </td>
<% end %> <% end %>
</div> </div>
</div> </div>
</div> </div>
</br> </br>
</div> </div>
<div style="padding-left: 68px"> <div style="padding-left: 68px">
<tr> <tr>
<td><%= l(:label_profile) %>:</td> <td><%= l(:label_profile) %>:</td>
<td> <td>
<%#= c_project.project.description.truncate(90, omission: '...') %> <%#= c_project.project.description.truncate(90, omission: '...') %>
<%= c_project.project.description %> <%= c_project.project.description %>
</td> </td>
</tr> </tr>
</br> </br>
</div> </div>
<div style="padding-left: 68px; padding-bottom: 8px"> <div style="padding-left: 68px; padding-bottom: 8px">
<span><strong><%= l(:label_attendingcontest_time) %> <span><strong><%= l(:label_attendingcontest_time) %>
</strong><%= format_time c_project.created_at %></span> </strong><%= format_time c_project.created_at %></span>
<span style="padding-left: 240px"><strong><%= l(:label_attendingcontest_spoksman) %> <span style="padding-left: 240px"><strong><%= l(:label_attendingcontest_spoksman) %>
<!-- modified by zjc 添加超链接 --> <!-- modified by zjc 添加超链接 -->
<% unless c_project.nil? || c_project.user.nil? %> <% unless c_project.nil? || c_project.user.nil? %>
</strong><%= link_to c_project.user.name,user_path(c_project.user) %></span> </strong><%= link_to c_project.user.name,user_path(c_project.user) %></span>
<% end %> <% end %>
</div> </div>
<div style="padding-left: 68px"> <div style="padding-left: 68px">
</div> </div>
</div> </div>
<% end %> <% end %>
<div class="underline-contests_three"></div> <div class="underline-contests_three"></div>
<% end %> <% end %>
<% else %> <% else %>
<% @contesting_softapplication.each do |c_softapplication| %> <% @contesting_softapplication.each do |c_softapplication| %>
<% if c_softapplication.softapplication %> <% if c_softapplication.softapplication %>
<div style="padding-left: 18px"> <div style="padding-left: 18px">
<div style="font-size: 15px"> <div style="font-size: 15px">
<tr> <tr>
<td><strong><%= l(:label_contest_work) %>: </strong></td> <td><strong><%= l(:label_contest_work) %>: </strong></td>
<td> <%= link_to(c_softapplication.softapplication.name, softapplication_path(c_softapplication.softapplication), :target => '_blank') %> </td> <td> <%= link_to(c_softapplication.softapplication.name, softapplication_path(c_softapplication.softapplication), :target => '_blank') %> </td>
</tr> </tr>
</br> </br>
</div> </div>
<div style="padding-left: 68px; padding-top: 5px;word-break:break-all;word-wrap: break-word;"> <div style="padding-left: 68px; padding-top: 5px;word-break:break-all;word-wrap: break-word;">
<tr> <tr>
<td><strong><%= l(:label_profile) %>:</strong></td> <td><strong><%= l(:label_profile) %>:</strong></td>
<td> <td>
<%#= c_softapplication.softapplication.description.truncate(90, omission: '...') %> <%#= c_softapplication.softapplication.description.truncate(90, omission: '...') %>
<%= c_softapplication.softapplication.description %> <%= c_softapplication.softapplication.description %>
</td> </td>
</tr> </tr>
</br> </br>
</div> </div>
<div style="padding-left: 68px; pading-bottom: 8px"> <div style="padding-left: 68px; pading-bottom: 8px">
<span><strong><%= l(:label_attendingcontest_time) %> <span><strong><%= l(:label_attendingcontest_time) %>
</strong><%= format_time c_softapplication.created_at %></span> </strong><%= format_time c_softapplication.created_at %></span>
<span style="padding-left: 240px"><strong><%= l(:label_attendingcontest_spoksman) %> <span style="padding-left: 240px"><strong><%= l(:label_attendingcontest_spoksman) %>
<!-- modified by zjc 添加超链接 --> <!-- modified by zjc 添加超链接 -->
<% unless c_softapplication.nil? || c_softapplication.softapplication.nil? || c_softapplication.softapplication.user.nil? %> <% unless c_softapplication.nil? || c_softapplication.softapplication.nil? || c_softapplication.softapplication.user.nil? %>
</strong><%= link_to c_softapplication.softapplication.user.name,user_path(c_softapplication.softapplication.user) %></span> </strong><%= link_to c_softapplication.softapplication.user.name,user_path(c_softapplication.softapplication.user) %></span>
<% end %> <% end %>
</div> </div>
<!--获奖及教师评奖--> <!--获奖及教师评奖-->
<div style="padding-left: 18px; padding-bottom: 5px"> <div style="padding-left: 18px; padding-bottom: 5px">
<% score = c_softapplication.softapplication.average(:quality).try(:avg).try(:round, 2).to_f %> <% score = c_softapplication.softapplication.average(:quality).try(:avg).try(:round, 2).to_f %>
<span style="padding-left: 50px"><strong><%= l(:label_final_scores) %> <span style="padding-left: 50px"><strong><%= l(:label_final_scores) %>
</strong></span><span style="color: red"><%= format("%.2f" , score) %> </strong></span><span style="color: red"><%= format("%.2f" , score) %>
分</span> 分</span>
<span style="padding-left: 334px"> <span style="padding-left: 334px">
<td> <td>
<strong> <strong>
<span id="reward_result_<%= c_softapplication.id %>"> <!-- 调用js进行刷新 --> <span id="reward_result_<%= c_softapplication.id %>"> <!-- 调用js进行刷新 -->
<% if get_prize(c_softapplication).nil? or get_prize(c_softapplication) == "" %> <% if get_prize(c_softapplication).nil? or get_prize(c_softapplication) == "" %>
<% if @contest.deadline < Date.today %> <% if @contest.deadline < Date.today %>
<span style="color: red"><%= l(:label_noawards) %></span> <span style="color: red"><%= l(:label_noawards) %></span>
<% else %> <% else %>
<span style="color: red"><%= l(:label_noawards_current) %></span> <span style="color: red"><%= l(:label_noawards_current) %></span>
<% end %> <% end %>
<% else %> <% else %>
<% case get_prize(c_softapplication) %> <% case get_prize(c_softapplication) %>
<% when '-1' %> <% when '-1' %>
<%= image_tag("/images/bid/special_reward.png") %> <%= image_tag("/images/bid/special_reward.png") %>
<% when '0' %> <% when '0' %>
<%= image_tag("/images/bid/first_reward.png") %> <%= image_tag("/images/bid/first_reward.png") %>
<% when '1' %> <% when '1' %>
<%= image_tag("/images/bid/second_reward.png") %> <%= image_tag("/images/bid/second_reward.png") %>
<% when '2' %> <% when '2' %>
<%= image_tag("/images/bid/third_reward.png") %> <%= image_tag("/images/bid/third_reward.png") %>
<% when '3' %> <% when '3' %>
<%= image_tag("/images/bid/forth_reward.png") %> <%= image_tag("/images/bid/forth_reward.png") %>
<% when '4' %> <% when '4' %>
<%= image_tag("/images/bid/fifth_reward.png") %> <%= image_tag("/images/bid/fifth_reward.png") %>
<% when '5' %> <% when '5' %>
<%= image_tag("/images/bid/qualified.png") %> <%= image_tag("/images/bid/qualified.png") %>
<% end %> <% end %>
<% end %> <% end %>
</span> </span>
</strong> </strong>
</td> </td>
<!-- 评价显隐控制按钮--> <!-- 评价显隐控制按钮-->
<% if ((User.current.id == @contest.author_id) && (@contest.deadline > Date.today))||User.current.admin %> <% if ((User.current.id == @contest.author_id) && (@contest.deadline > Date.today))||User.current.admin %>
<div style="text-align: right;width: 100%;"> <div style="text-align: right;width: 100%;">
<span style="padding-right: 5px; padding-top: 1px"> <%= toggle_link '评奖', c_softapplication.id.to_s %></span> <span style="padding-right: 5px; padding-top: 1px"> <%= toggle_link '评奖', c_softapplication.id.to_s %></span>
<!-- 评价应标项目的表单 --> <!-- 评价应标项目的表单 -->
<span style="display: none; vertical-align: top " id='<%= c_softapplication.id %>'> <span style="display: none; vertical-align: top " id='<%= c_softapplication.id %>'>
<%= form_for "set_reward_softapplication", :remote => true, :url => set_reward_softapplication_contest_path do |f| %> <%= form_for "set_reward_softapplication", :remote => true, :url => set_reward_softapplication_contest_path do |f| %>
<%= f.text_field :c_id, :style => "display:none", :value => c_softapplication.id, :size => "0" %> <%= f.text_field :c_id, :style => "display:none", :value => c_softapplication.id, :size => "0" %>
<%= f.select :reward, "<option value = '-1'>#{l(:label_special_reward)}</option> <%= f.select :reward, "<option value = '-1'>#{l(:label_special_reward)}</option>
<option value = '0'>#{l(:label_first_reward)}</option> <option value = '0'>#{l(:label_first_reward)}</option>
<option value = '1'>#{l(:label_second_reward)}</option> <option value = '1'>#{l(:label_second_reward)}</option>
<option value = '2'>#{l(:label_third_reward)}</option> <option value = '2'>#{l(:label_third_reward)}</option>
<option value = '3'>#{l(:label_fourth_reward)}</option> <option value = '3'>#{l(:label_fourth_reward)}</option>
<option value = '4'>#{l(:label_fifth_reward)}</option> <option value = '4'>#{l(:label_fifth_reward)}</option>
<option value = '5'>#{l(:label_comfort_reward)}</option>".html_safe %> <option value = '5'>#{l(:label_comfort_reward)}</option>".html_safe %>
<%= f.submit :value => l(:button_submit), :class => "submit" %> <%= f.submit :value => l(:button_submit), :class => "submit" %>
<% end %> <% end %>
</span> </span>
</div> </div>
<% end %> <% end %>
</span> </span>
</div> </div>
</div> </div>
<% end %> <% end %>
<div class="underline-contests_three"></div> <div class="underline-contests_three"></div>
<% end %> <% end %>
<% end %> <% end %>
<div class="pagination"> <div class="pagination">
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false %> <%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false %>
</div> </div>
<% html_title(l(:label_contest_joincontest)) -%> <% html_title(l(:label_contest_joincontest)) -%>

@ -4,5 +4,41 @@
<%= render :partial => 'contest_jours', <%= render :partial => 'contest_jours',
:locals => { :contest => @contest, :journals => @jour, :state => false} :locals => { :contest => @contest, :journals => @jour, :state => false}
%> %>
<script>
var W3CDOM = document.createElement && document.getElementsByTagName;
window.onload = setMaxLength;
function setMaxLength() {
if (!W3CDOM) return;
var textareas = document.getElementsByTagName('textarea');
for (var i=0;i<textareas.length;i++) {
var textarea = textareas[i];
setMaxLengthItem(textareas[i]);
}
}
function setMaxLengthItem(textarea){
if (textarea.getAttribute('maxlength')) {
var counter = document.createElement('div');
counter.className = 'counter';
var counterClone = counter.cloneNode(true);
counterClone.innerHTML = '<span>0</span>/'+textarea.getAttribute('maxlength');
textarea.parentNode.insertBefore(counterClone,textarea.nextSibling);
textarea.relatedElement = counterClone.getElementsByTagName('span')[0];
textarea.onkeyup = textarea.onchange = checkMaxLength;
textarea.onkeyup();
}
}
function checkMaxLength() {
var maxLength = this.getAttribute('maxlength');
var currentLength = this.value.length;
if (currentLength > maxLength)
this.relatedElement.className = 'toomuch';
else
this.relatedElement.className = '';
this.relatedElement.firstChild.nodeValue = currentLength;
}
</script>
<% html_title(l(:label_user_response)) -%> <% html_title(l(:label_user_response)) -%>

@ -0,0 +1,54 @@
<div id="floatpoint" class="course_ad" >
<table border=0>
<tr>
<td align=center bgcolor=#15bccf >
<span class="ad_title"><%= l(:label_contact_us) %></span>
</td>
</tr>
<tr><td><p class="ad_content"><%= l(:label_course_ad_description) %></p></td></tr>
<tr>
<td align=center bgcolor="#ececec" >
<%= l(:label_course_adcolick) %><a href="http://user.trustie.net/users/12/user_newfeedback">黄井泉</a><br>
</td>
</tr>
<tr>
<td align=center bgcolor="#ececec" >
Tel:15388083362<br>
</td>
<tr>
<td align=center bgcolor="#ececec" >
<%= l(:label_course_adcolick) %><a href="http://user.trustie.net/users/6/user_newfeedback">王林春</a><br>
</td>
</tr>
<tr>
<td align=center bgcolor="#ececec" >
Tel:13467631747<br>
</td>
</tr>
</table>
</div>
<script type="text/javascript">
var xstep=1; // 移动步长此参数越小移动越平滑最小值为1
var delay_time=60; // 每步的时间间隔,此参数越小,移动速度越快
var YY=0;
window.setInterval(function(){move();},delay_time);
function move()
{
var screen_height = $(window).height(); //浏览器当前窗口文档的高度
var floatpoint_height = $("#floatpoint").height();
YY += xstep;
if(YY <= 0){xstep = 1; YY = 0;} //如果浮动层超出了上界,则设定移动方向为向下;并设定层的位置为正好在上界处
if(YY >= (screen_height-floatpoint_height)) //如果浮动层超出了下界,则设定移动方向为向上;并设定层的位置为正好在下界处
{
xstep = -1;
YY=(screen_height-floatpoint_height);
}
$("#floatpoint").css("margin-top",YY);
}
function change_size(){var screen_width = $(window).width();var body_width = $("#top-menu").width(); $("#floatpoint").css("left",screen_width/2+body_width/2+10).css("position", "fixed");}
$(document).ready(function(){change_size();});
$(window).resize(function(){change_size();});
</script>

@ -43,6 +43,7 @@
<span class="info" style="width: 10px;"> <span class="info" style="width: 10px;">
<%= text_field_tag :class_period, @course.class_period, :placeholder => "#{l(:lable_input_class)}", :maxlength => 5 %> <%= text_field_tag :class_period, @course.class_period, :placeholder => "#{l(:lable_input_class)}", :maxlength => 5 %>
</span> </span>
<span>&nbsp;<strong><%= l(:label_class_hour) %></strong></span>
<span>&nbsp; <span>&nbsp;
<strong> <strong>
<%= l(:label_class_hour) %> <%= l(:label_class_hour) %>
@ -58,15 +59,26 @@
<tr> <tr>
<td> <td>
<span class="info" align="right" style="width: 90px; font-weight: bold ;margin-left:22px"> <span class="info" align="right" style="width: 90px; font-weight: bold ;margin-left:22px">
<%= l(:label_class_period) %> <%= l(:label_class_period) %>
<span class="required"> *&nbsp;&nbsp;</span> <span class="info" align="right" style="width: 90px; font-weight: bold ;margin-left:22px">
</span> <%= l(:label_class_period) %>
<span class="info" style="width: 10px;"> <span class="required">
<%= text_field_tag :class_period, nil, :placeholder => "#{l(:lable_input_class)}", :maxlength => 5 %> *&nbsp;&nbsp;
</span>
</span>
<span class="info" align="right" style="width: 90px; font-weight: bold ;margin-left:22px">
<%= l(:label_class_period) %>
<span class="required">
*&nbsp;&nbsp;
</span>
</span>
<span class="info" style="width: 10px;">
<%= text_field_tag :class_period, nil, :placeholder => "#{l(:lable_input_class)}", :maxlength => 5 %>
</span>
<strong>
<%= l(:label_class_hour) %>
</strong>
</span> </span>
<strong>
<%= l(:label_class_hour) %>
</strong>
</td> </td>
</tr> </tr>
</table> </table>
@ -124,12 +136,19 @@
<%= f.check_box :is_public, :style => "margin-left:10px;" %> <%= f.check_box :is_public, :style => "margin-left:10px;" %>
<%= l(:label_course_public_info) %> <%= l(:label_course_public_info) %>
</em> </em>
</p><!-- modified by bai --> </p>
<p style="margin-left:-10px;">
<em style="color: #888888;display: block;font-size: 90%;font-style: normal;">
<%= f.check_box :open_student, :style => "margin-left:10px;" %>
<%= l(:label_course_open_student_info) %>
</em>
</p>
<p style="display:none;"> <p style="display:none;">
<%= f.text_field :course_type, :value => 1 %> <%= f.text_field :course_type, :value => 1 %>
</p> </p>
<%= wikitoolbar_for 'course_description' %> <%= wikitoolbar_for 'course_description' %>
<% @course.custom_field_values.each do |value| %> <% @course.custom_field_values.each do |value| %>
<p><%= custom_field_tag_with_label :course, value %></p>
<p> <p>
<%= custom_field_tag_with_label :course, value %> <%= custom_field_tag_with_label :course, value %>
</p> </p>

@ -17,13 +17,14 @@
<%= f.text_area 'course_message', :rows => 3, :cols => 65, <%= f.text_area 'course_message', :rows => 3, :cols => 65,
:placeholder => "#{l(:label_welcome_my_respond)}", :placeholder => "#{l(:label_welcome_my_respond)}",
:style => "resize: none; width: 98%", :style => "resize: none; width: 98%",
:class => 'noline'%> :class => 'noline',:maxlength => 250%>
<%= submit_tag l(:button_leave_meassge), :name => nil , :class => "enterprise" , :style => "display: block; float: right; margin-right: 1%; margin-top: 1px;"%> <%= submit_tag l(:button_leave_meassge), :name => nil , :class => "enterprise" , :style => "display: block; float: right; margin-right: 1%; margin-top: 1px;"%>
<% end %> <% end %>
</div> </div>
<% end %> <% end %>
<div class="cl"></div>
</div> </div>
<div id="history"> <div id="history">
<%= render :partial => 'history',:locals => { :contest => @contest, :journals => @jour, :state => false} %> <%= render :partial => 'history',:locals => { :contest => @contest, :journals => @jour, :state => false} %>
</div> </div>

@ -24,7 +24,7 @@
<% end %> <% end %>
<% if reply_allow %> <% if reply_allow %>
<%= link_to l(:label_bid_respond_quote),'', <%= link_to l(:label_bid_respond_quote),'',
{:focus => 'project_respond', :onclick => "toggleAndSettingWordsVal($('##{ids}'), $('##{ids} textarea'), '#{l(:label_reply_plural)} #{journal.user.name}: '); $('##{ids} textarea') ;return false;"} %> {:focus => 'project_respond', :onclick => "toggleAndSettingWordsVal($('##{ids}'), $('##{ids} textarea')); $('##{ids} textarea') ;return false;"} %>
<% end %> <% end %>
</span> </span>

@ -49,6 +49,10 @@
<%= f.select :proportion, proportion_option %> <%= f.select :proportion, proportion_option %>
</p> </p>
<p> <p>
<%= f.check_box :open_anonymous_evaluation, :style => "margin-left:10px;" %>
<span>未开启匿评作业将直接进入众评点赞阶段</span>
</p>
<p id="evaluation_num_p">
<%= f.text_field :evaluation_num, :required => true, :size => 60, :style => "width:150px;", :onblur => "regexEvaluationNum();" , :maxlength => 4%> <%= f.text_field :evaluation_num, :required => true, :size => 60, :style => "width:150px;", :onblur => "regexEvaluationNum();" , :maxlength => 4%>
<span id="bid_evaluation_num_span">匿评分配数量不宜太大,否则会影响开启匿评速度</span> <span id="bid_evaluation_num_span">匿评分配数量不宜太大,否则会影响开启匿评速度</span>
</p> </p>

@ -62,8 +62,8 @@
<input class=" width190" type="password" name="course_password" id="course_password" value="" > <input class=" width190" type="password" name="course_password" id="course_password" value="" >
</li> </li>
<li> <li>
<a href="#" class="btn" onclick="submit_form(this);"><%= l(:label_new_join) %></a> <a href="#" class="btn" style="margin-left: 50px;" onclick="submit_form(this);"><%= l(:label_new_join) %></a>
<a href="#" onclick="hideModal(this);"><%= l(:button_cancel)%></a> <a href="#" class="btn" style="margin-left: 20px;" onclick="hideModal(this);"><%= l(:button_cancel)%></a>
</li> </li>
</ul> </ul>
<% end%> <% end%>

@ -5,11 +5,12 @@
</style> </style>
<%= javascript_include_tag 'attachments' %> <%= javascript_include_tag 'attachments' %>
<!-- fq --> <!-- fq -->
<!--modified by huang-->
<div class="content-title-top"> <div class="content-title-top">
<% if User.current.logged? && (User.current.admin? || (!Member.where('user_id = ? and course_id = ?', User.current.id, @course.id).first.nil? && (Member.where('user_id = ? and course_id = ?', User.current.id, @course.id).first.roles&Role.where(id: [3, 4, 7, 9] )).size >0))%> <% if User.current.logged? && (User.current.admin? || (!Member.where('user_id = ? and course_id = ?', User.current.id, @course.id).first.nil? && (Member.where('user_id = ? and course_id = ?', User.current.id, @course.id).first.roles&Role.where(id: [3, 4, 7, 9] )).size >0))%>
<%= link_to(l(:label_course_homework_new), {:controller => 'courses', :action => 'new_homework'}, :class => 'icon icon-add') %> <%= link_to(l(:label_course_homework_new), {:controller => 'courses', :action => 'new_homework'}, :class => 'icon icon-add') %>
<% end %> <% else %>
<span class="font_lighter"><%= l(:label_coursejoin_tip) %></span>
<% end %>
</div> </div>
<div id="bid-show"> <div id="bid-show">
<%= render :partial => 'bids/bid_homework_show', :locals => {:bids => @bids, :bid_pages => @bid_pages} %> <%= render :partial => 'bids/bid_homework_show', :locals => {:bids => @bids, :bid_pages => @bid_pages} %>

@ -43,35 +43,55 @@
{ {
var evaluation_num = $.trim($("#bid_evaluation_num").val()); var evaluation_num = $.trim($("#bid_evaluation_num").val());
var regex = /^\d+$/; var regex = /^\d+$/;
if(evaluation_num=="") if($("#bid_open_anonymous_evaluation").attr("checked") == "checked")
{ {
$("#bid_evaluation_num_span").text("匿评分配数量不能为空"); if(evaluation_num=="")
$("#bid_evaluation_num_span").css('color','#ff0000'); {
return false; $("#bid_evaluation_num_span").text("匿评分配数量不能为空");
} $("#bid_evaluation_num_span").css('color','#ff0000');
else if(regex.test(evaluation_num)) return false;
{ }
if(evaluation_num > 0) else if(regex.test(evaluation_num))
{ {
$("#bid_evaluation_num_span").text("填写正确"); if(evaluation_num > 0)
$("#bid_evaluation_num_span").css('color','#008000'); {
return true; $("#bid_evaluation_num_span").text("填写正确");
$("#bid_evaluation_num_span").css('color','#008000');
return true;
}
else
{
$("#bid_evaluation_num_span").text("匿评分配数量必须为大于0");
$("#bid_evaluation_num_span").css('color','#ff0000');
return false;
}
} }
else else
{ {
$("#bid_evaluation_num_span").text("匿评分配数量必须为大于0"); $("#bid_evaluation_num_span").text("匿评分配数量只能为数字");
$("#bid_evaluation_num_span").css('color','#ff0000'); $("#bid_evaluation_num_span").css('color','#ff0000');
return false; return false;
} }
} }
else else
{ {
$("#bid_evaluation_num_span").text("匿评分配数量只能为数字"); return true;
$("#bid_evaluation_num_span").css('color','#ff0000');
return false;
} }
} }
$(function(){
$("#bid_open_anonymous_evaluation").click(function(){
if($("#bid_open_anonymous_evaluation").attr("checked") == "checked")
{
$("#evaluation_num_p").slideDown();
}
else
{
$("#evaluation_num_p").slideUp();
}
});
});
function submitHomework() function submitHomework()
{ {
if(regexDeadLine()&&regexName()&&regexEvaluationNum()) if(regexDeadLine()&&regexName()&&regexEvaluationNum())

@ -20,8 +20,8 @@
<% members.each do |member| %> <% members.each do |member| %>
<% next if member.new_record? %> <% next if member.new_record? %>
<tr id="member-<%= member.id %>" class="<%= cycle 'odd', 'even' %> member"> <tr id="member-<%= member.id %>" class="<%= cycle 'odd', 'even' %> member">
<td class="<%= member.principal.class.name.downcase %>"><%= link_to_user member.principal %></td> <td class="<%= member.principal.class.name.downcase %>" style="text-align: center"><%= link_to_user member.principal %></td>
<td class="roles"> <td class="roles" style="text-align: center">
<span id="member-<%= member.id %>-roles"> <span id="member-<%= member.id %>-roles">
<%= h member.roles.sort.collect(&:to_s).join(', ') %> <%= h member.roles.sort.collect(&:to_s).join(', ') %>
</span> </span>

@ -1,3 +1,4 @@
<% if @events_by_day != nil && @events_by_day.size >0 %> <% if @events_by_day != nil && @events_by_day.size >0 %>
<div class="content-title-top-avtive"> <div class="content-title-top-avtive">
<p class="subtitle"> <p class="subtitle">
@ -98,8 +99,6 @@
</table> </table>
</div> </div>
<% end %> <% end %>
</div> </div>
<%else%> <%else%>
<div class="font_description"> <div class="font_description">

@ -0,0 +1,10 @@
<!-- sort: @sort,order:@order,current:"created_on" -->
<% if sort == current %>
<% if order =="asc" %>
<% elsif order == "desc" %>
<% else %>
<% end %>
<% end %>

@ -0,0 +1,46 @@
<div>
<span id="attachments_fields" xmlns="http://www.w3.org/1999/html">
<% if defined?(container) && container && container.saved_attachments %>
<% container.attachments.each_with_index do |attachment, i| %>
<span id="attachments_p<%= i %>" class="attachment">
<%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename readonly', :readonly=>'readonly')%>
<%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 254, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") %>
<span class="ispublic-label"><%= l(:field_is_public)%>:</span>
<%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public,attachment.is_public == 1 ? true : false,:class => 'is_public')%>
<%= if attachment.id.nil?
#待补充代码
else
link_to('&nbsp;'.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload')
end
%>
<%#= render :partial => 'tags/tag', :locals => {:obj => attachment, :object_flag => "6"} %>
<%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %>
</span>
<% end %>
<% end %>
</span>
</div>
<button name="button" class="f_l ml10" onclick="_file.click()" onmouseover="this.focus()" type="button" style="width:80px; height:26px;">上传文件</button>
<%= file_field_tag 'attachments[dummy][file]',
:id => '_file',
:class => 'file_selector',
:multiple => true,
:onchange => 'addInputFiles(this);',
:style => 'display:none',
:data => {
:max_file_size => Setting.attachment_max_size.to_i.kilobytes,
:max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)),
:max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i,
:upload_path => uploads_path(:format => 'js'),
:description_placeholder => l(:label_optional_description)
} %>
<!--<input type="submit" name="" value="上传文件" class="f_l ml10" style="width:80px; height:26px;">-->
<label class="f_l ml10 c_grey">
<span id="upload_file_count">
<%= l(:label_no_file_uploaded)%>
</span>
(<%= l(:label_max_size) %>:
<%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>)
</label>

@ -1,82 +1,44 @@
<% attachmenttypes = @course.attachmenttypes %> <% attachmenttypes = @course.attachmenttypes %>
<% sufixtypes = @course.contenttypes %> <% sufixtypes = @course.contenttypes %>
<span class="borad-title"><%= t(:label_user_course) %>资源共享区</span>
<div class="content-title-top">
<%#= link_to(l(:label_attachment_new), 'javascript:void(0);', :onclick=>"$('#file_buttons').slideToggle();", :class => 'icon icon-add') if User.current.allowed_to?(:manage_files, @course) %>
<div class="clearfix"></div>
<div id="file_buttons" class="nhidden">
<%= link_to(l(:label_upload_files), 'javascript:void(0);', :class => 'icon m5p5 button_submit', :onclick => "$('#relation_file_div').slideUp();$('#upload_file_div').slideToggle('slow');") if User.current.allowed_to?(:manage_files, @course) %>
<%= link_to(l(:label_relation_files), 'javascript:void(0);', :onclick => "$('#upload_file_div').slideUp();$('#relation_file_div').slideToggle();", :class => 'icon m5p5 button_submit') if User.current.allowed_to?(:manage_files, @course) %>
<p></p>
<div id="upload_file_div" class="relation_file_div hidden">
<%= render :partial => 'course_new', locals: {course: @course} %>
</div>
<div id="relation_file_div" class="relation_file_div hidden"> <%= stylesheet_link_tag 'resource', :media => 'all' %>
<fieldset> <script>
<legend>搜索</legend> function show_upload()
<%= form_tag( {
attachments_autocomplete_path(:format => 'js'), $('#ajax-modal').html('<%= escape_javascript(render :partial => 'upload_show',:locals => {:course => @course}) %>');
:remote => true, showModal('ajax-modal', '513px');
:method => :post) do %> $('#ajax-modal').siblings().remove();
<%= label_tag(:attach_search, "按关键字搜索:") %> $('#ajax-modal').before("<span style='float: right;cursor:pointer;padding-left: 513px;'><a href='javascript:void(0)' onclick='closeModal()'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
<%= text_field_tag(:attach_search) %> $('#ajax-modal').parent().css("top","5").css("left","511");
<%#= submit_tag("Search") %> }
<% end -%>
<%= form_tag course_attach_relation_path(:format => 'js'), function closeModal()
method: :post, {
remote: true, hideModal($("#popbox_upload"));
id: "relation_file_form", }
:class => 'hidden' do %>
<%= hidden_field_tag(:class_name, 'course') %> </script>
<%= hidden_field_tag(:class_id, params[:course_id]) %>
<div id="relation_file"> <div class="container">
</div> <div class="resource"><!--资源库内容开始--->
<div class="kclearfix" style='margin-top: 10px;'> <div class="re_top">
<%= submit_tag(l(:button_add)) -%> <%= form_tag( search_course_files_path(@course), method: 'get',:class => "re_search f_l",:remote=>true) do %>
</div> <%= text_field_tag 'name', params[:name], name: "name", :class => 're_schbox',:style=>"padding: 0px"%>
<% end -%> <%= submit_tag "课内搜索", :class => "re_schbtn b_dblue",:name => "incourse"%>
</fieldset> <%= submit_tag "全站搜索", :class => "re_schbtn b_lblue",:name => "insite" %>
<div class="line_under" style="margin:20px 0px;"></div> <% end %>
</div> <% if is_course_teacher(User.current,@course) %>
</div> <a href="javascript:void(0)" class="re_fabu f_r b_lblue" onclick="show_upload()">上传资源</a>
<div class="box" id="files-box"> <% end %>
<label for="files-box" style="font-weight:bold;">&nbsp;&nbsp;<%= l(:label_files_filter) %></label> </div><!---re_top end-->
<% if attachmenttypes.any? %> <div class="cl"></div>
&nbsp; &nbsp; &nbsp;
<label for="attachment_browse_label"><%= l(:attachment_browse) %></label> <div class="re_con" id="course_list">
<%= select_tag "attachment_browse", content_tag(:option, l(:attachment_all), :value => '0') +options_from_collection_for_select(attachmenttypes, "id", "typeName"), <%= render :partial => 'course_list',:locals => {course: @course,all_attachments: @all_attachments,sort:@sort,order:@order,curse_attachments:@curse_attachments} %>
:onchange => "course_attachmenttypes_searchex(this.value)" %> </div><!---re_con end-->
<% end %>
<% if sufixtypes.any? %>
&nbsp;
<label for="attach_sufix_browse_label"><%= l(:attachment_sufix_browse) %></label>
<%= select_tag "attach_sufix_browse", content_tag(:option, l(:attachment_all), :value => '0') +options_for_select(sufixtypes),
:onchange => "course_attachment_contenttypes_searchex(this.value)" %>
<% end %>
</div>
</div> </div>
<%= javascript_tag "observeSearchfield('attach_search', null, '#{ escape_javascript attachments_autocomplete_path(:course_id => @course.id, :format => 'js') }')" %>
<% delete_allowed = User.current.allowed_to?(:manage_files, @course) %>
<div id="all_browse_div" class="all_browse_div">
<%#= render :partial => 'course_show_all_attachment' %>
<% if (@attachtype==0 && @contenttype=='0') || (@attachtype.nil? && @contenttype.nil?) %>
<%= render partial: "course_show_all_attachment"%>
<%else%>
<%= render partial: "course_sort_by_attachtypel"%>
<%end%>
</div> </div>
<% html_title(l(:label_attachment_plural)) -%> <% html_title(l(:label_attachment_plural)) -%>

@ -0,0 +1,51 @@
<% delete_allowed = User.current.allowed_to?(:manage_files, course) %>
<div class="re_con_top">
<p class="f_l c_blue f_b f_14">共有&nbsp;<%= User.current.member_of_course?(course) ? all_attachments.count : 0 %>&nbsp;个资源</p>
<!-- <p class="f_r">
<#% if @order == "asc" %>
按&nbsp;<#%= link_to "时间",course_files_path(course,:sort=>"created_on:desc"),:class => "f_b c_grey" %><#%= render partial: 'arrow_show',locals: { sort: sort,order:order,current:"created_on"} %>&nbsp;/&nbsp;
<#%= link_to "下载次数",course_files_path(course,:sort=>"downloads:desc"),:class => "f_b c_grey" %><#%= render partial: 'arrow_show',locals: { sort: sort,order:order,current:"downloads"} %>&nbsp;/&nbsp;
<a href="#" class="f_b c_grey">引用次数</a>&nbsp;排序
<#%else%>
按&nbsp;<#%= link_to "时间",course_files_path(course,:sort=>"created_on:asc"),:class => "f_b c_grey" %><#%= render partial: 'arrow_show',locals: { sort: sort,order:order,current:"created_on"} %>&nbsp;/&nbsp;
<#%= link_to "下载次数",course_files_path(course,:sort=>"downloads:asc"),:class => "f_b c_grey" %><#%= render partial: 'arrow_show',locals: { sort: sort,order:order,current:"downloads"} %>&nbsp;/&nbsp;
<a href="#" class="f_b c_grey">引用次数</a>&nbsp;排序
<#% end %>
</p>-->
</div>
<div class="cl"></div>
<% curse_attachments.each do |file| %>
<%if file.is_public == 0 && !User.current.member_of_course?(@course)%>
<%next%>
<%end%>
<div class="re_con_box">
<div class=" ">
<%= link_to_attachment file, :download => true, :title => file.filename+"\n"+file.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;",:class => "c_dblue f_14 f_b f_l" %>
<% if is_course_teacher(User.current,@course) %>
<%= link_to "选入我的课程",quote_resource_show_course_file_path(@course,file),:class => "f_l re_select",:remote => true %>
<span id="is_public_<%= file.id %>">
<%= link_to (file.is_public? ? "公开":"私有"), update_file_dense_attachments_path(:attachmentid=>file.id,:newtype=>(file.is_public? ? 0:1)),:remote=>true,:class=>"f_l re_open",:method => :post %>
</span>
<% else %>
<%= link_to (file.is_public? ? "公开":"私有"),"javascript:void(0)",:class=>"f_l re_open" %>
<% end %>
</div>
<div class="cl"></div>
<div class="">
<p class="f_l c_grey02">文件大小:<%= number_to_human_size(file.filesize) %></p>
<%= link_to( l(:button_delete), attachment_path(file),
:data => {:confirm => l(:text_are_you_sure)}, :method => :delete,:class => "f_r re_de") if delete_allowed %>
<p class="f_r c_grey02" ><%= time_tag(file.created_on).html_safe %><%= l(:label_bids_published_ago) %>&nbsp;&nbsp;|&nbsp;&nbsp;下载<%= file.downloads %>&nbsp;&nbsp;|&nbsp;&nbsp;引用0 </p>
</div>
<div class="cl"></div>
<div class="tag_h">
<%= render :partial => 'tags/tag_new', :locals => {:obj => file, :object_flag => "6"} %>
<%= render :partial => 'tags/tag_add', :locals => {:obj => file, :object_flag => "6"} %>
</div>
<div class="cl"></div>
</div><!---re_con_box end-->
<% end %>
<ul class="wlist">
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => @is_remote, :flag => true%>
</ul>
<div class="cl"></div>

@ -52,7 +52,7 @@
<% if attachmenttypes.any? %> <% if attachmenttypes.any? %>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
<label for="attachment_browse_label"><%= l(:attachment_browse) %></label> <label for="attachment_browse_label"><%= l(:attachment_browse) %></label>
<%= select_tag "attachment_browse", content_tag(:option, l(:attachment_all), :value => '0') +options_from_collection_for_select(attachmenttypes, "id", "typeName"), <%= select_tag "attachment_browse", content_tag(:option, l(:attachment_all), :value => '0') +options_from_collection_for_select(attachmenttypes, "id", "typeName",params[:type]),
:onchange => "attachmenttypes_searchex(this.value)" %> :onchange => "attachmenttypes_searchex(this.value)" %>
<% end %> <% end %>
<% if sufixtypes.any? %> <% if sufixtypes.any? %>

@ -0,0 +1,24 @@
<div id="popbox_upload" style="margin-top: -30px;margin-left: -20px;margin-right: -10px;">
<div class="upload_con">
<div id="error_show"></div>
<h2>将此课件引入我的课程资源库</h2>
<div class="upload_box">
<%= form_tag course_attach_relations_path,
method: :post,
remote: true,
id: "relation_file_form" do %>
<%= hidden_field_tag(:file_id, file.id) %>
<%= content_tag('div', courses_check_box_tags('courses[course][]', User.current.courses,course), :id => 'courses')%>
<a id="submit_quote" href="javascript:void(0)" class="upload_btn" onclick="submit_quote();">引&nbsp;&nbsp;用</a><a href="javascript:void(0)" class="upload_btn upload_btn_grey" onclick="closeModal();">取&nbsp;&nbsp;消</a>
<% end -%>
</div>
</div>
</div>
<script>
function submit_quote()
{
$('#submit_quote').parent().submit();
}
</script>

@ -0,0 +1,26 @@
<div id="popbox_upload" style="margin-top: -30px;margin-left: -20px;margin-right: -10px;">
<div class="upload_con">
<h2>上传资源</h2>
<div class="upload_box">
<%= error_messages_for 'attachment' %>
<div id="network_issue" style="color: red; display: none;">上传出现错误,请您检查您的网络环境,并刷新页面重新上传。</div>
<%= form_tag(course_files_path(course), :multipart => true,:remote => true,:method => :post,:name=>"upload_form") do %>
<label style="margin-top:3px;">文件浏览:</label>
<%= render :partial => 'attachement_list',:locals => {:course => course} %>
<div class="cl"></div>
<a id="submit_resource" href="javascript:void(0);" class="upload_btn" onclick="submit_resource();">上传资源</a><a href="javascript:void(0);" class="upload_btn upload_btn_grey" onclick="closeModal();">取&nbsp;&nbsp;消</a>
<% end %>
</div>
</div>
<% content_for :header_tags do %>
<%= javascript_include_tag 'attachments' %>
<% end %>
</div>
<script>
function submit_resource()
{
$('#submit_resource').parent().submit();
}
</script>

@ -27,6 +27,8 @@ $('#upload_file_div').slideToggle('slow');
$("#all_browse_div").html('<%= j(render partial: "show_all_attachment")%>'); $("#all_browse_div").html('<%= j(render partial: "show_all_attachment")%>');
<%elsif @course%> <%elsif @course%>
$("#all_browse_div").html('<%= j(render partial: "course_show_all_attachment")%>'); $("#all_browse_div").html('<%= j(render partial: "course_show_all_attachment")%>');
closeModal();
$("#resource_list").html('<%= j(render partial: "course_file" ,locals: {course: @course}) %>');
<%end%> <%end%>
<% end %> <% end %>

@ -1,10 +1,11 @@
<!-- <h3> --><!-- %=l(:label_attachment_plural)%></h3 --> <!-- <h3> --><!-- %=l(:label_attachment_plural)%></h3 -->
<div id="resource_list">
<% if @isproject %> <% if @isproject %>
<%= render :partial => 'project_file', locals: {project: @project} %> <%= render :partial => 'project_file', locals: {project: @project} %>
<% else %> <% else %>
<%= render :partial => 'course_file', locals: {course: @course} %> <%= render :partial => 'course_file', locals: {course: @course} %>
<% end %> <% end %>
</div>
<script type='text/javascript'> <script type='text/javascript'>
var slideHeight = 29; var slideHeight = 29;

@ -0,0 +1,5 @@
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'show_quote_resource',:locals => {:course => @course,:file => @file}) %>');
showModal('ajax-modal', '513px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').before("<span style='float: right;cursor:pointer;padding-left: 513px;'><a href='javascript:void(0)' onclick='closeModal()'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
$('#ajax-modal').parent().css("top","5").css("left","511");

@ -0,0 +1 @@
$("#course_list").html("<%= escape_javascript(render :partial => 'course_list',:locals => {course: @course,all_attachments: @result,sort:"create_on",order:"",curse_attachments:@searched_attach})%>");

@ -0,0 +1,10 @@
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'upload_show',:locals => {}) %>');
showModal('ajax-modal', '513px');
$('#ajax-modal').css('height','569px');
$('#ajax-modal').siblings().remove();
//$('#ajax-modal').before("<span style='float: right;cursor:pointer;padding-left: 513px;'>" +
// "<a href='#' onclick='hidden_homework_atert_form("+
// <#%= @cur_page%> + "," + <#%= @cur_type%> +
// ");'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
$('#ajax-modal').parent().css("top","").css("left","");
$('#ajax-modal').parent().addClass("alert_box");

@ -15,7 +15,19 @@
<% end %> <% end %>
<div style="width: 120%;"> <div style="width: 120%;">
<div class="field"> <div class="field">
<%= f.text_field :name, :required => true, :style => 'width: 100%;', :class => 'create-share' %> <%= f.text_field :name, :required => true, :style => 'width: 100%;', :class => 'create-share', :maxlength => 50%>
</div>
<div>
<% if User.current.logged? && User.current.admin? %>
<% if @forum.safe_attribute? 'sticky' %>
<%= f.check_box :sticky %>
<%= label_tag 'message_sticky', l(:label_board_sticky) %>
<% end %>
<% if @forum.safe_attribute? 'locked' %>
<%= f.check_box :locked %>
<%= label_tag 'message_locked', l(:label_board_locked) %>
<% end %>
<% end %>
</div> </div>
<div> <div>
<script src="http://<%= Setting.host_name%>/javascripts/ckeditor/ckeditor.js?1404953555" type="text/javascript"></script> <script src="http://<%= Setting.host_name%>/javascripts/ckeditor/ckeditor.js?1404953555" type="text/javascript"></script>
@ -24,7 +36,9 @@
</p> </p>
<script type="text/javascript">var ckeditor=CKEDITOR.replace('editor01');</script> <script type="text/javascript">var ckeditor=CKEDITOR.replace('editor01');</script>
<p style="color: #ff0000">(<%= l(:label_forums_max_length) %>)</p> <p style="color: #ff0000">
(<%= l(:label_forums_max_length) %>)
</p>
</div> </div>
<div class="actions" style=" padding-top: 10px; float:right"> <div class="actions" style=" padding-top: 10px; float:right">
<%= submit_tag l(:button_submit) %> <%= submit_tag l(:button_submit) %>

@ -4,18 +4,54 @@
<% forums.each do |forum| %> <% forums.each do |forum| %>
<div class="forums-index"> <div class="forums-index">
<div class="forums-inex-avatar"> <div class="forums-inex-avatar">
<%= forum.creator.nil? ? (link_to image_tag(url_to_avatar(forum.creator), :class => "avatar")) : (link_to image_tag(url_to_avatar(forum.creator), :class => "avatar"), user_path(forum.creator)) %> <%= forum.creator.nil? ? (link_to image_tag(url_to_avatar(forum.creator), :class => "avatar")) : (link_to image_tag(url_to_avatar(forum.creator), :class => "avatar"), user_path(forum.creator)) %>
</div> </div>
<div class="forums-index-content"> <div class="forums-index-content">
<p ><%= link_to h(forum.name), forum_path(forum) %></p> <table class="content-text-list" style="table-layout: fixed;">
<p ><%= textAreailizable forum.description%></p> <tr>
<p ><%= authoring forum.created_at, forum.creator %></p></div> <td valign="top" width="500px" class=" <%= forum.sticky? ? 'sticky' : '' %><%= forum.locked? ? 'locked' : '' %>" style="word-break: break-all;word-wrap: break-word;">
<p >
<%= link_to h(forum.name), forum_path(forum) %>
</p>
</td>
</tr>
<tr>
<td style="word-break: break-all;word-wrap: break-word;">
<p>
<%= textAreailizable forum.description%>
</p>
</td>
</tr>
<tr>
<td style="word-break: break-all;word-wrap: break-word;">
<p >
<%= authoring forum.created_at, forum.creator %>
</p>
</td>
</tr>
</table>
</div>
<div class="forums-index-count"> <div class="forums-index-count">
<table class="forums-count-color"><tr class="forums-count-color" align="center"><td><%= link_to (forum.memo_count), forum_path(forum) %></td><td><%= link_to (forum.topic_count), forum_path(forum) %></td></tr> <table class="forums-count-color">
<tr align="center"><td>回答</td><td>帖子</td></tr></table></div> <tr class="forums-count-color" align="center">
<td>
<%= link_to (forum.memo_count), forum_path(forum) %>
</td>
<td>
<%= link_to (forum.topic_count), forum_path(forum) %>
</td>
</tr>
<tr align="center">
<td>回答</td>
<td>帖子</td>
</tr>
</table>
</div>
</div> </div>
<% end %> <% end %>
<div class="pagination"><%= pagination_links_full @forums_pages, @forums_count %></div> <div class="pagination">
<%= pagination_links_full @forums_pages, @forums_count %>
</div>
<% else %> <% else %>
<% end %> <% end %>
</div> </div>

@ -7,11 +7,15 @@
<table width="940px"> <table width="940px">
<tr> <tr>
<td class="info_font" style="width: 220px; color: #15bccf">公共贴吧 </td> <td class="info_font" style="width: 220px; color: #15bccf">公共贴吧 </td>
<td class="location-list"><strong><%= l(:label_user_location) %> :</strong></td> <td class="location-list">
<strong>
<%= l(:label_user_location) %> :
</strong>
</td>
<td rowspan="2"> <td rowspan="2">
<% if User.current.logged? %> <% if User.current.logged? %>
<%= link_to( l(:label_forum_new), new_forum_path, :class => 'icon icon-add') %> <%= link_to( l(:label_forum_new), new_forum_path, :class => 'icon icon-add') %>
<% end %> <% end %>
</td> </td>
<td rowspan="2" width="250px" > <td rowspan="2" width="250px" >
<div class="top-content-search"> <div class="top-content-search">
@ -23,8 +27,15 @@
</td> </td>
</tr> </tr>
<tr> <tr>
<td style="padding-left: 8px"><a><%= link_to request.host()+"/forums", forums_path %> </a></td> <td style="padding-left: 8px">
<td ><%= link_to l(:field_homepage), home_path %> > <%= link_to "公共贴吧", forums_path %></td> <a>
<%= link_to request.host()+"/forums", forums_path %>
</a>
</td>
<td >
<%= link_to l(:field_homepage), home_path %> >
<%= link_to "公共贴吧", forums_path %>
</td>
</tr> </tr>
</table> </table>
</div> </div>

@ -1,16 +1,25 @@
<!-- added by fq --> <!-- added by fq -->
<div id="add-memo" class='lz' style="<% unless @memo.errors.any?%>display: none;<% end %> padding: 20px;"> <div id="add-memo" class='lz' style="<% unless @memo.errors.any?%>display: none;<% end %> padding: 20px;">
<h3><%=l(:label_memo_new)%></h3> <h3>
<%=l(:label_memo_new)%>
</h3>
<% if User.current.logged? %> <% if User.current.logged? %>
<%= labelled_form_for(@memo, :url => create_memo_forum_path(@forum), :html => {:multipart => true} ) do |f| %> <%= labelled_form_for(@memo, :url => create_memo_forum_path(@forum), :html => {:multipart => true} ) do |f| %>
<div class="actions" style="max-width:680px"> <div class="actions" style="max-width:680px">
<p><%= f.text_field :subject, :required => true%></p> <p>
<p style="max-width:680px"><%= f.text_area :content, :required => true, :id => 'editor02' %></p> <%= f.text_field :subject, :required => true, :maxlength => 50%>
</p>
<p style="max-width:680px">
<%= f.text_area :content, :required => true, :id => 'editor02' %>
</p>
<script type="text/javascript">var ckeditor=CKEDITOR.replace('editor02');</script> <script type="text/javascript">var ckeditor=CKEDITOR.replace('editor02');</script>
<p style="color: #ff0000">(<%= l(:label_memos_max_length) %>)</p> <p style="color: #ff0000">
(<%= l(:label_memos_max_length) %>)
</p>
<p> <p>
<%= l(:label_attachment_plural) %><br /> <%= l(:label_attachment_plural) %>
<%= render :partial => 'attachments/form', :locals => {:container => @memo} %> <br />
<%= render :partial => 'attachments/form', :locals => {:container => @memo} %>
</p> </p>
<%= f.submit :value => l(:label_memo_create) %> <%= f.submit :value => l(:label_memo_create) %>
<%= link_to l(:button_cancel), "#", :onclick => '$("#add-memo").hide(); return false;' %> <%= link_to l(:button_cancel), "#", :onclick => '$("#add-memo").hide(); return false;' %>

@ -69,7 +69,9 @@
<% if User.current.logged? %> <% if User.current.logged? %>
<%= f.text_area 'user_message', :rows => 3, :cols => 65, <%= f.text_area 'user_message', :rows => 3, :cols => 65,
:style => "resize: none;", :class => 'noline', :placeholder => l(:text_caracters_maximum,:count=>250)%> :style => "resize: none;", :class => 'noline', :placeholder => l(:text_caracters_maximum,:count=>250),
:maxlength => 250
%>
<%= f.text_field :reference_user_id, :style=>"display:none"%> <%= f.text_field :reference_user_id, :style=>"display:none"%>
<div style="float:right"> <div style="float:right">
<a href="#" class="ping_sub1" id="jours_submit" onclick="submit1();"><%= l(:label_submit_comments) %></a> <a href="#" class="ping_sub1" id="jours_submit" onclick="submit1();"><%= l(:label_submit_comments) %></a>

@ -35,13 +35,13 @@
</span> </span>
</li> </li>
<li class="c_red" style="margin:25px 0 0 20px;"> 您还没交作业,请创建作业!</li> <li class="c_red" style="margin:25px 0 0 20px;"> 您还没交作业,请创建作业!</li>
<% if @bid.comment_status == 0 %> <% if @bid.comment_status == 0 || @bid.comment_status == 1%>
<!-- 老师布置的作业在创建和开启匿评这段时间才允许创建作品 --> <!-- 老师布置的作业在创建和开启匿评这段时间才允许创建作品 -->
<li class="wping"> <li class="wping">
<%= link_to "提交作业", new_exercise_book_path(@bid), :style => "width:80px; margin:20px 0 0 350px;" %> <%= link_to "提交作业", new_exercise_book_path(@bid), :style => "width:80px; margin:20px 0 0 350px;" %>
</li> </li>
<% else %> <% else %>
<li class="wping" title="只有开启匿评之前才能创建作业哦"> <li class="wping" title="匿评阶段不可提交作业">
<a style="width:80px; margin:20px 0 0 350px;background:#8e8e8e;">提交作业</a> <a style="width:80px; margin:20px 0 0 350px;background:#8e8e8e;">提交作业</a>
</li> </li>
<% end %> <% end %>

@ -1,6 +1,42 @@
<% reply_allow = JournalsForMessage.create_by_user? User.current %> <% reply_allow = JournalsForMessage.create_by_user? User.current %>
<script type="text/javascript" language="javascript"> <script type="text/javascript" language="javascript">
var W3CDOM = document.createElement && document.getElementsByTagName;
// window.onload = setMaxLength;
$(document).ready(setMaxLength());
function setMaxLength() {
if (!W3CDOM) return;
var textareas = document.getElementsByTagName('textarea');
for (var i=0;i<textareas.length;i++) {
var textarea = textareas[i];
setMaxLengthItem(textareas[i]);
}
}
function setMaxLengthItem(textarea){
if (textarea.getAttribute('maxlength')) {
var counter = document.createElement('div');
counter.className = 'counter';
var counterClone = counter.cloneNode(true);
counterClone.innerHTML = '<span>0</span>/'+textarea.getAttribute('maxlength');
textarea.parentNode.insertBefore(counterClone,textarea.nextSibling);
textarea.relatedElement = counterClone.getElementsByTagName('span')[0];
textarea.onkeyup = textarea.onchange = checkMaxLength;
textarea.onkeyup();
}
}
function checkMaxLength() {
var maxLength = this.getAttribute('maxlength');
var currentLength = this.value.length;
if (currentLength > maxLength)
this.relatedElement.className = 'toomuch';
else
this.relatedElement.className = '';
this.relatedElement.firstChild.nodeValue = currentLength;
}
function test(){alert('test');}
//<!CDATA[ //<!CDATA[
function g(o){return document.getElementById(o);} function g(o){return document.getElementById(o);}
function HoverLi(n){ function HoverLi(n){
@ -74,4 +110,4 @@
<%= render :partial => 'histoey_new' %> <%= render :partial => 'histoey_new' %>
</div> </div>
</div> </div>

@ -30,8 +30,13 @@
<% if @issue.safe_attribute? 'subject' %> <% if @issue.safe_attribute? 'subject' %>
<p><%= f.text_field :subject, :size => 80, :maxlength => 255, :required => true, :style => "font-size:small" %></p> <p><%= f.text_field :subject, :size => 80, :maxlength => 255, :required => true, :style => "font-size:small" %></p>
<!--Added by young--> <!--Added by young-->
<%= javascript_tag "observeAutocompleteField('issue_subject', '#{escape_javascript auto_complete_issues_path(:project_id => @project, :scope => (Setting.cross_project_issue_relations? ? 'all' : nil))}')" %> <%= javascript_tag do %>
<!--Ended by young--> observeAutocompleteField('issue_subject', '<%= escape_javascript auto_complete_issues_path(:project_id => @project,:scope => (Setting.cross_project_issue_relations? ? 'all' : nil)) %>',
{ select: function(event, ui) {
$('input#issue_subject').val(ui.item.value);
}
});
<% end %>
<% end %> <% end %>

@ -41,9 +41,9 @@
<% end %> <% end %>
</div> </div>
<%= submit_tag l(:button_create) %> <%= submit_tag l(:button_create), :class => "ButtonAddTags"%>
<%= submit_tag l(:button_create_and_continue), :name => 'continue' %> <%= submit_tag l(:button_create_and_continue), :class => 'ButtonAddTags' %>
<%= preview_link preview_new_issue_path(:project_id => @project), 'issue-form' %> <%= preview_link preview_new_issue_path(:project_id => @project), 'issue-form','preview',{:class => "ButtonColor"}%>
<%= javascript_tag "$('#issue_subject').focus();" %> <%= javascript_tag "$('#issue_subject').focus();" %>
<% end %> <% end %>

@ -38,7 +38,6 @@
</div> </div>
</div> </div>
</div> </div>
</div>
<div class="debug"> <div class="debug">
<%= debug(params) if Rails.env.development? %> <%= debug(params) if Rails.env.development? %>
<div class="hidden"> <div class="hidden">

@ -74,13 +74,13 @@
<script type="text/javascript"> <script type="text/javascript">
function setMessageCount () { function setMessageCount () {
var mes = $('#loggedas .my-message') var mes = $('#loggedas .my-message');
mes.html(mes.html()+ '(' + <%=User.current.count_new_jour.to_s%> + ")") mes.html(mes.html()+ '(' + <%=User.current.count_new_jour.to_s%> + ")");
} }
function addSlipMenu () { function addSlipMenu () {
var loggedas = $('#loggedas ul li:first') var loggedas = $('#loggedas ul li:first');
var sub_menu = $('.sub_menu') var sub_menu = $('.sub_menu');
loggedas.mouseenter(function(event) { loggedas.mouseenter(function(event) {
sub_menu.show(); sub_menu.show();
}); });
@ -90,9 +90,9 @@
} }
function addProjectSlipMenu () { function addProjectSlipMenu () {
var loggedas = $('#project_loggedas_li') var loggedas = $('#project_loggedas_li');
var project_sub_menu = $('.project_sub_menu') var project_sub_menu = $('.project_sub_menu');
var course_sub_menu = $('.course_sub_menu') var course_sub_menu = $('.course_sub_menu');
loggedas.mouseenter(function(event) { loggedas.mouseenter(function(event) {
course_sub_menu.hide(); course_sub_menu.hide();
project_sub_menu.show(); project_sub_menu.show();
@ -102,9 +102,9 @@
}); });
} }
function addCourseSlipMenu () { function addCourseSlipMenu () {
var loggedas = $('#course_loggedas_li') var loggedas = $('#course_loggedas_li');
var project_sub_menu = $('.project_sub_menu') var project_sub_menu = $('.project_sub_menu');
var course_sub_menu = $('.course_sub_menu') var course_sub_menu = $('.course_sub_menu');
loggedas.mouseenter(function(event) { loggedas.mouseenter(function(event) {
project_sub_menu.hide(); project_sub_menu.hide();
course_sub_menu.show(); course_sub_menu.show();
@ -114,6 +114,18 @@
}); });
} }
function homeworkSlipMenuOver(id)
{
$('.project_sub_menu').hide();
$('#course_loggedas_li').show();
$("#homework_loggedas_ul_" + id).show();
}
function homeworkSlipMenuOut(id)
{
$("#homework_loggedas_ul_" + id).hide();
}
$(document).ready(function () { $(document).ready(function () {
addSlipMenu(); addSlipMenu();
addProjectSlipMenu (); addProjectSlipMenu ();

@ -67,11 +67,18 @@ end
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><%=User.current%> <b class="caret"></b></a> <a href="#" class="dropdown-toggle" data-toggle="dropdown"><%=User.current%> <b class="caret"></b></a>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
<li> <li>
<%=link_to l(:label_my_message)+'('+User.current.count_new_jour.to_s+')', { :controller => 'users', :action => 'user_newfeedback', id: User.current.id, host: Setting.user_domain }, {:class => 'my-message'} if User.current.logged? -%></li> <%=link_to l(:label_my_message)+'('+User.current.count_new_jour.to_s+')', { :controller => 'users', :action => 'user_newfeedback', id: User.current.id, host: Setting.user_domain }, {:class => 'my-message'} if User.current.logged? -%>
<li><%=link_to l(:label_my_course), {:controller => 'users', :action => 'user_courses', id: User.current.id, host: Setting.course_domain} %></li> </li>
<li><%=link_to l(:label_my_projects),{:controller => 'users', :action => 'user_projects', id: User.current.id, host: Setting.project_domain} %></li> <li>
<%=link_to l(:label_my_course), {:controller => 'users', :action => 'user_courses', id: User.current.id, host: Setting.course_domain} %>
</li>
<li>
<%=link_to l(:label_my_projects),{:controller => 'users', :action => 'user_projects', id: User.current.id, host: Setting.project_domain} %>
</li>
<li class="divider"></li> <li class="divider"></li>
<li><%=link_to l(:label_user_edit), {:controller => 'my', :action=> 'account', host: Setting.user_domain}%></li> <li>
<%=link_to l(:label_user_edit), {:controller => 'my', :action=> 'account', host: Setting.user_domain}%>
</li>
</ul> </ul>
</li> </li>
<%= bootstrap_render_menu :account_menu -%> <%= bootstrap_render_menu :account_menu -%>

@ -1,12 +1,12 @@
<% if hasCourse %> <% if hasCourse %>
<li id="course_loggedas_li" style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;"> <li id="course_loggedas_li" style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">
<%=link_to l(:label_my_course), {:controller => 'users', :action => 'user_courses', id: User.current.id} %> <%=link_to l(:label_my_course), user_courses_user_path(User.current.id) %>
<ul class="course_sub_menu"> <ul class="course_sub_menu">
<% course_index = 0 %>
<% User.current.courses.each do |course| %> <% User.current.courses.each do |course| %>
<% if !course_endTime_timeout?(course) %> <% if !course_endTime_timeout?(course) %>
<li style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;" title="<%=course.name%>"> <%= render :partial => 'layouts/user_homework_list', :locals => {:course => course,:course_index => course_index} %>
<%= link_to course.name, {:controller => 'courses',:action => 'show',id:course.id} %> <% course_index += 1 %>
</li>
<% end %> <% end %>
<% end %> <% end %>
</ul> </ul>

@ -0,0 +1,12 @@
<% if course %>
<li id="homework_loggedas_li" style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" title="<%=course.name%>" onmouseover="homeworkSlipMenuOver(<%= course.id%>);" onmouseout="homeworkSlipMenuOut(<%= course.id%>);">
<%= link_to course.name, course_path(course.id, host: Setting.host_course) %>
<ul class="homework_sub_menu" id="homework_loggedas_ul_<%= course.id%>" style="top:<%= course_index * 28.1%>px;">
<% course.homework_for_courses.map(&:bid).each do |bid| %>
<li style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;" title="<%=bid.name%>">
<%= link_to bid.name, course_for_bid_path(bid, host: Setting.host_course), :target => "_blank" %>
</li>
<% end %>
</ul>
</li>
<% end %>

@ -24,6 +24,7 @@
</head> </head>
<!--add by huang--> <!--add by huang-->
<body class="<%= h body_css_classes %>"> <body class="<%= h body_css_classes %>">
<!-- <#%= render :partial => 'courses/course_ad' %> -->
<div id="wrapper"> <div id="wrapper">
<div id="wrapper2"> <div id="wrapper2">
<div id="wrapper3"> <div id="wrapper3">
@ -121,7 +122,7 @@
<% end%> <% end%>
</td> </td>
<td class="font_index"> <td class="font_index">
<% if User.current.member_of_course?(@course) %> <% if (User.current.logged? && @course.open_student == 1) || (User.current.member_of_course?(@course)) %>
<%= link_to "#{studentCount(@course)}", course_member_path(@course, :role => 2), :course => '1' %> <%= link_to "#{studentCount(@course)}", course_member_path(@course, :role => 2), :course => '1' %>
<% else %> <% else %>
<span> <span>
@ -272,7 +273,7 @@
<%= link_to l(:label_course_overview), course_path(@course), :class => link_class(:overview) %> <%= link_to l(:label_course_overview), course_path(@course), :class => link_class(:overview) %>
</li> </li>
<li> <li>
<%= link_to l(:label_homework), homework_course_path(@course), :class => link_class(:homework), :course_type => 1 %> <%= link_to l(:label_homework), homework_course_path(@course), :class => link_class([:homework,:new_homework,:edit]), :course_type => 1 %>
</li> </li>
<li> <li>
<%= link_to l(:label_course_file), course_files_path(@course), :class => link_class(:files) %> <%= link_to l(:label_course_file), course_files_path(@course), :class => link_class(:files) %>

@ -106,6 +106,7 @@
<% if (User.current.admin?||User.current.id==@bid.author_id) %> <% if (User.current.admin?||User.current.id==@bid.author_id) %>
<tr> <tr>
<td valign="top" style="padding-left: 8px; font-size: 15px" colspan="2"> <td valign="top" style="padding-left: 8px; font-size: 15px" colspan="2">
<% if @bid.open_anonymous_evaluation == 1%>
<span id="<%=@bid.id %>_anonymous_comment"> <span id="<%=@bid.id %>_anonymous_comment">
<% case @bid.comment_status %> <% case @bid.comment_status %>
<% when 0 %> <% when 0 %>
@ -116,6 +117,7 @@
匿评结束 匿评结束
<% end %> <% end %>
</span> </span>
<%end%>
</td> </td>
</tr> </tr>
<% end %> <% end %>

@ -95,7 +95,7 @@
<td align="center" width="70px"> <%= l(:label_member) %></td> <td align="center" width="70px"> <%= l(:label_member) %></td>
<td align="center" width="100px"><%= l(:label_user_watchered) %></td> <td align="center" width="100px"><%= l(:label_user_watchered) %></td>
<td align="center" width="70px"> <%= l(:label_project_issues) %></td> <td align="center" width="70px"> <%= l(:label_project_issues) %></td>
<!-- <td align="center" width="58px"><%= l(:label_attachment) %></td> --> <!-- <td align="center" width="58px"><%#= l(:label_attachment) %></td> -->
</tr> </tr>
</table> </table>
<div class="user_underline"></div> <div class="user_underline"></div>
@ -133,7 +133,7 @@
</div> </div>
<div id="content"> <div id="content">
<div class="tabs_new"> <div class="tabs_new">
<%= render_main_menu(@project) %> <%= render_main_menu(@project) %>
</div> </div>
<%= render_flash_messages %> <%= render_flash_messages %>
<%= yield %> <%= yield %>

@ -21,6 +21,9 @@
<%= call_hook :view_layouts_base_html_head %> <%= call_hook :view_layouts_base_html_head %>
<!-- page specific tags --> <!-- page specific tags -->
<%= yield :header_tags -%> <%= yield :header_tags -%>
<% title1 = @user.user_extensions.technical_title %>
<% language1 = @user.language %>
<script type="text/javascript"> <script type="text/javascript">
function startXMLHttp() function startXMLHttp()
{ {
@ -36,11 +39,55 @@
{ {
setInterval("startXMLHttp()",5000); setInterval("startXMLHttp()",5000);
} }
function init_title() {
var title = "<%= "#{title1}" %>"
var language = "<%= "#{language1}" %>"
if(language == 'zh') {
switch (title) {
case 'Professor' :
title1 = '教授';
break;
case 'Associate professor' :
title1 = '副教授';
break;
case 'Lecturer' :
title1 = '讲师';
break;
case 'Teaching assistant' :
title1 = '助教';
break;
default :
title1 = title;
break;
}
}
else {
switch (title) {
case '教授' :
title1 = 'Professor';
break;
case '副教授' :
title1 = 'Associate professor';
break;
case '讲师' :
title1 = 'Lecturer';
break;
case '助教' :
title1 = 'Teaching assistant';
break;
default :
title1 = title;
break;
}
}
document.getElementById('td_tech_title').innerHTML = title1;
}
</script> </script>
</head> </head>
<!--加上 onload="Javascript:t()" 开始定时刷新分数 --> <!--加上 onload="Javascript:t()" 开始定时刷新分数 -->
<body class="<%= h body_css_classes %>"> <body class="<%= h body_css_classes %>" onload="init_title()" >
<div id="wrapper"> <div id="wrapper">
<div id="wrapper2"> <div id="wrapper2">
<div id="wrapper3"> <div id="wrapper3">
@ -176,7 +223,7 @@
</td> </td>
</tr> </tr>
<% unless @user.user_extensions.nil? %> <% unless @user.user_extensions.nil? %>
<% unless @user.user_extensions.identity == 2 %> <% if @user.user_extensions.identity == 0 || @user.user_extensions.identity == 1 %>
<tr> <tr>
<td style="padding-left: 5px" width="70px"><%= l(:field_occupation) %></td><td class="font_lighter_sidebar" style="padding-left: 0px" width="170px"> <td style="padding-left: 5px" width="70px"><%= l(:field_occupation) %></td><td class="font_lighter_sidebar" style="padding-left: 0px" width="170px">
<% unless @user.user_extensions.school.nil? %> <% unless @user.user_extensions.school.nil? %>
@ -184,38 +231,66 @@
<% end %> <% end %>
</td> </td>
</tr> </tr>
<% end %> <% elsif @user.user_extensions.identity == 3 %>
<tr>
<td style="padding-left: 5px" width="70px"><%= l(:field_occupation) %></td>
<td class="font_lighter_sidebar" style="padding-left: 0px" width="170px">
<%= @user.user_extensions.occupation %>
</td>
</tr>
<% elsif @user.user_extensions.identity == 2 %>
<tr>
<td style="padding-left: 18px" width="70px"><%= l(:label_company_name) %></td>
<td class="font_lighter_sidebar" style="padding-left: 0px" width="170px">
<%= @user.firstname %>
</td>
</tr>
<% end %>
<tr> <tr>
<td style="padding-left: 5px" width="76px"><%= l(:label_location) %>:</td><td class="font_lighter_sidebar" style="padding-left: 0px" width="170px"><%= @user.user_extensions.location %><%= @user.user_extensions.location_city %></td> <td style="padding-left: 31px" width="76px"><%= l(:label_location) %></td><td class="font_lighter_sidebar" style="padding-left: 0px" width="170px"><%= @user.user_extensions.location %><%= @user.user_extensions.location_city %></td>
</tr> </tr>
<tr> <tr>
<% if @user.user_extensions.identity == 0 %> <% if @user.user_extensions.identity == 0 %>
<td style="padding-left: 5px" width="76px"> <td style="padding-left: 31px" width="76px" >
<%= l(:label_technical_title) %>: <%= l(:label_technical_title) %>
</td> </td>
<td class="font_lighter_sidebar" style="padding-left: 0px" width="170px"> <td class="font_lighter_sidebar" style="padding-left: 0px" width="170px">
<%= @user.user_extensions.technical_title %> <span id = "td_tech_title"></span>
</td> </td>
<% end %> <% end %>
</tr> </tr>
<% if( (@user.user_extensions.identity == 1) && (is_watching?(@user) ) )%> <% if @user.user_extensions.identity == 1 %>
<% if(is_watching?(@user) ) %>
<tr> <tr>
<td style="padding-left: 8px" width="70px"> <td style="padding-left: 31px" width="70px" >
<%= l(:label_bidding_user_studentcode)%>: <%= l(:label_bidding_user_studentcode)%>
</td> </td>
<td class="font_lighter_sidebar" style="padding-left: 0px" width="170px"> <td class="font_lighter_sidebar" style="padding-left: 0px" width="170px">
<%= @user.user_extensions.student_id %> <%= @user.user_extensions.student_id %>
</td> </td>
</tr> </tr>
<% end %> <% else %>
<% else%> <tr>
<tr> <td style="padding-left: 31px" width="70px" >
<td style="padding-left: 8px" width="70px"><%= l(:field_occupation) %>:</td> <%= l(:label_identity)%>
</tr> </td>
<td class="font_lighter_sidebar" style="padding-left: 0px" width="170px">
<%= l(:label_account_student) %>
</td>
</tr>
<% end %>
<% elsif @user.user_extensions.identity == 3 %>
<tr> <tr>
<td style="padding-left: 8px" width="70px"><%= l(:label_location) %>:</td> <td style="padding-left: 31px" width="70px" >
<%= l(:label_identity)%>
</td>
<td class="font_lighter_sidebar" style="padding-left: 0px" width="170px">
<%= l(:label_account_developer) %>
</td>
</tr> </tr>
<% end %> <% end %>
<% end %>
<!-- end --> <!-- end -->
</table> </table>
</div> </div>

@ -1,3 +1,3 @@
<%= error_messages_for 'bid' %> <%= error_messages_for 'bid' %>
<p><%= f.text_field :content, :required => true, :size => 60, :style => "width:150px;" %></p> <p><%= f.text_field :content, :required => true, :size => 60, :style => "width:150px;" %></p>
<p><%= hidden_field_tag 'subject', ||=@memo.subject %> <p><%= hidden_field_tag 'subject'||=@memo.subject %>

@ -1,5 +1,5 @@
<%= form_for(@memo_new, url: forum_memos_path, :html => {:multipart => true}) do |f| %> <%= form_for(@memo_new, url: forum_memos_path, :html => {:multipart => true}) do |f| %>
<%= f.hidden_field :subject, :required => true, value: "RE: "+@memo.subject %> <%= f.hidden_field :subject, :required => true, value: @memo.subject %>
<%= f.hidden_field :forum_id, :required => true, value: @memo.forum_id %> <%= f.hidden_field :forum_id, :required => true, value: @memo.forum_id %>
<%= f.hidden_field :parent_id, :required => true, value: @memo.id %> <%= f.hidden_field :parent_id, :required => true, value: @memo.id %>
<div id="message_quote" class="wiki"></div> <div id="message_quote" class="wiki"></div>
@ -7,11 +7,12 @@
<%= hidden_field_tag :quote,"",:required => false,:style => 'display:none' %> <%= hidden_field_tag :quote,"",:required => false,:style => 'display:none' %>
<%= label_tag(l(:label_reply_plural)) %>: <%= label_tag(l(:label_reply_plural)) %>:
<!-- <p> < %= f.text_area :content, :required => true, :size => "75%", :resize => "none", id: 'editor01' %> </p> --> <!-- <p> < %= f.text_area :content, :required => true, :size => "75%", :resize => "none", id: 'editor01' %> </p> -->
<%= f.text_area :content, :cols => 80, :rows => 15, :class => 'wiki-edit', :id => 'editor01', :value => @content %></p> <%= f.text_area :content, :cols => 80, :rows => 15, :class => 'wiki-edit', :id => 'editor01', :value => @content %>
<script type="text/javascript">var ckeditor=CKEDITOR.replace('editor01');</script> <script type="text/javascript">var ckeditor=CKEDITOR.replace('editor01');</script>
<p><%= l(:label_attachment_plural) %><br /> <p>
<%= render :partial => 'attachments/form' %> <%= l(:label_attachment_plural) %>
<br />
<%= render :partial => 'attachments/form' %>
</p> </p>
<%= f.submit value: l(:label_reply_plural), class: "replies" %> <%= f.submit value: l(:label_reply_plural), class: "replies" %>
<% end %> <% end %>

@ -4,30 +4,43 @@
<%= labelled_form_for(@memo, :url => forum_memo_path(@memo.forum_id, @memo)) do |f| %> <%= labelled_form_for(@memo, :url => forum_memo_path(@memo.forum_id, @memo)) do |f| %>
<% if @memo.errors.any? %> <% if @memo.errors.any? %>
<div id="error_explanation"> <div id="error_explanation">
<h2><%= pluralize(@memo.errors.count, "error") %> prohibited this memo from being saved:</h2> <h2>
<%= pluralize(@memo.errors.count, "error") %>
prohibited this memo from being saved:
</h2>
<ul> <ul>
<% @memo.errors.full_messages.each do |msg| %> <% @memo.errors.full_messages.each do |msg| %>
<li><%= msg %></li> <li>
<%= msg %>
</li>
<% end %> <% end %>
</ul> </ul>
</div> </div>
<% end %> <% end %>
<div class="actions"> <div class="actions">
<p><%= f.text_field :subject, :required => true, :size => 96 ,:readonly => @replying%></p>
<p> <p>
<% unless @replying %> <%= f.text_field :subject, :required => true, :size => 96 ,:readonly => @replying, :maxlength => 50%>
<% if @memo.safe_attribute? 'sticky' %> </p>
<%= f.check_box :sticky %> <%= label_tag 'memo_sticky', l(:label_board_sticky) %> <% if User.current.admin?%>
<% end %> <p>
<% if @memo.safe_attribute? 'lock' %> <% unless @replying %>
<%= f.check_box :lock %> <%= label_tag 'memo_locked', l(:label_board_locked) %> <% if @memo.safe_attribute? 'sticky' %>
<% end %> <%= f.check_box :sticky %>
<% end %> <%= label_tag 'memo_sticky', l(:label_board_sticky) %>
<% end %>
<% if @memo.safe_attribute? 'lock' %>
<%= f.check_box :lock %> <%= label_tag 'memo_locked', l(:label_board_locked) %>
<% end %>
<% end %>
</p>
<% end %>
<p>
<%= f.text_area :content, :required => true, :size => 80, id: 'editor01' %>
</p> </p>
<p><%= f.text_area :content, :required => true, :size => 80, id: 'editor01' %></p>
<script type="text/javascript">var ckeditor=CKEDITOR.replace('editor01');</script> <script type="text/javascript">var ckeditor=CKEDITOR.replace('editor01');</script>
<p> <p>
<%= l(:label_attachment_plural) %><br /> <%= l(:label_attachment_plural) %>
<br />
<%= render :partial => 'attachments/form', :locals => {:container => @memo} %> <%= render :partial => 'attachments/form', :locals => {:container => @memo} %>
</p> </p>
<br/> <br/>

@ -1,3 +1,9 @@
<style type="text/css">
.reply_content p {
margin-top: 13px;
margin-bottom: 13px;
}
</style>
<div class="lz"> <div class="lz">
<!-- 在这里添加赞和踩--> <!-- 在这里添加赞和踩-->
<span id="praise_tread" style="float: right"> <%= render :partial => "/praise_tread/praise_tread",:locals => {:obj => @memo,:show_flag => true,:user_id =>User.current.id,:horizontal => true}%> </span> <span id="praise_tread" style="float: right"> <%= render :partial => "/praise_tread/praise_tread",:locals => {:obj => @memo,:show_flag => true,:user_id =>User.current.id,:horizontal => true}%> </span>
@ -111,28 +117,34 @@
</div> </div>
<br/> <br/>
<table class="borad-text-list"> <table class="borad-text-list" style="table-layout: fixed;">
<tr> <tr>
<td rowspan="3" valign="top" width="60px"> <td rowspan="3" valign="top" width="60px">
<%= link_to image_tag(url_to_avatar(reply.author), :class => "avatar"), user_path(reply.author) %> <%= link_to image_tag(url_to_avatar(reply.author), :class => "avatar"), user_path(reply.author) %>
</td> </td>
<td class="comments"> <td class="comments" style="word-wrap: break-word;word-break: break-all;">
<div class="reply_content" ><%=h sanitize(reply.content.html_safe) %></div> <div class="reply_content" >
<%=h sanitize(reply.content.html_safe) %>
</div>
<p> <p>
<% if reply.attachments.any?%> <% if reply.attachments.any?%>
<% options = {:author => true, :deletable => reply.deleted_attach_able_by?(User.current) } %> <% options = {:author => true, :deletable => reply.deleted_attach_able_by?(User.current) } %>
<%= render :partial => 'attachments/links', :locals => {:attachments => reply.attachments, :options => options} %> <%= render :partial => 'attachments/links', :locals => {:attachments => reply.attachments, :options => options} %>
<% end %> <% end %>
</p> </p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="font_lighter" style="float:right"><%= authoring reply.created_at, reply.author %></td> <td class="font_lighter" style="float:right">
<%= authoring reply.created_at, reply.author %>
</td>
</tr> </tr>
</table> </table>
</div> </div>
<% end %> <% end %>
<div class="pagination"><%= pagination_links_full @reply_pages, @reply_count, :per_page_links => false %></div> <div class="pagination">
<%= pagination_links_full @reply_pages, @reply_count, :per_page_links => false %>
</div>
</div> </div>
<% if User.current.login? %> <% if User.current.login? %>

@ -106,7 +106,11 @@
<%= authoring @topic.created_on, @topic.author %> <%= authoring @topic.created_on, @topic.author %>
</div> </div>
<div style="float: right"> <div style="float: right">
<%= toggle_link l(:button_reply), "reply", :focus => 'message_content' %> <% if User.current.logged? %>
<%= toggle_link l(:button_reply), "reply", :focus => 'message_content' %>
<% else %>
<%= link_to l(:button_reply), signin_path %>
<% end %>
</div> </div>
</div> </div>
</div> </div>

@ -111,7 +111,11 @@
<%= authoring @topic.created_on, @topic.author %> <%= authoring @topic.created_on, @topic.author %>
</div> </div>
<div style="float: right"> <div style="float: right">
<%= toggle_link l(:button_reply), "reply", :focus => 'message_content' %> <% if User.current.logged? %>
<%= toggle_link l(:button_reply), "reply", :focus => 'message_content' %>
<% else %>
<%= link_to l(:button_reply), signin_path %>
<% end %>
</div> </div>
</div> </div>
</div> </div>

@ -3,11 +3,53 @@
@nav_dispaly_main_project_label = 1 @nav_dispaly_main_project_label = 1
@nav_dispaly_main_contest_label = 1 %> @nav_dispaly_main_contest_label = 1 %>
<% @nav_dispaly_forum_label = 1%> <% @nav_dispaly_forum_label = 1%>
<script type="text/javascript"> <script type="text/javascript">
$(document).ready( $(document).ready(
function () { function () {
$("#province").attr("href", "#WOpenWindow") $("#province").attr("href", "#WOpenWindow")
$("#province").leanModal({top: 100, closeButton: ".modal_close"}); $("#province").leanModal({top: 100, closeButton: ".modal_close"});
var $lastname = $('#user_lastname')
var $firstname = $('#user_firstname')
var $enterprise = $('#enterprise_name')
$lastname.blur(function () {
var pas1 = document.getElementById("user_lastname").value;
if (pas1 == "") {
$('#valid_lastname').html('<span class="red">' + "<%= l(:lastname_empty) %>"+ "</span>");
$('#lastname_limit').hide();
}
else {
$('#valid_lastname').html('<span class="red">' + "</span>");
$('#lastname_limit').show();
}
});
$firstname.blur(function () {
var pas1 = document.getElementById("user_firstname").value;
if (pas1 == "") {
$('#valid_firstname').html('<span class="red">' + "<%= l(:firstname_empty) %>"+ "</span>");
$('#firstname_limit').hide();
}
else {
$('#valid_firstname').html('<span class="red">' + "</span>");
$('#firstname_limit').show();
}
});
$enterprise.blur(function () {
var pas1 = document.getElementById("enterprise_name").value;
if (pas1 == "") {
$('#valid_companyname').html('<span class="red">' + "<%= l(:enterprise_empty) %>"+ "</span>");
}
else {
$('#valid_lastname').html('<span class="red">' + "</span>");
}
});
} }
); );
</script> </script>
@ -43,6 +85,7 @@
<%= labelled_form_for :user, @user, <%= labelled_form_for :user, @user,
:url => {:action => "account"}, :url => {:action => "account"},
:html => {:id => 'my_account_form', :html => {:id => 'my_account_form',
:method => :post} do |f| %> :method => :post} do |f| %>
<fieldset class="collapsible collapsed" style="width:800px;margin-left: 10px;"> <fieldset class="collapsible collapsed" style="width:800px;margin-left: 10px;">
<legend onclick="toggleFieldset(this);"> <legend onclick="toggleFieldset(this);">
@ -59,70 +102,129 @@
<%= l(:label_information_plural) %> <%= l(:label_information_plural) %>
</legend> </legend>
<div>
<!-- 昵称 --> <!-- 昵称 -->
<p style="width:630px;padding-left: 26px;"> <p style="width:630px;padding-left: 40px;">
<%= f.text_field :login, :required => true, :name => "login"%> <%= f.text_field :login, :required => true, :size => 25, :name => "login", :readonly => true %>
<span class='font_lighter'><%= l(:label_max_number) %></span> <span class='font_lighter'><%= l(:label_max_number) %></span>
<br/> <br/>
</p> </p>
<div> <p style="width:400px;padding-left: 52px;">
<label style="margin-right: 1px;">
<%= l(:label_identity) %><span style="color: #bb0000;"> *</span></label>
<select onchange="showtechnical_title(this.value, $('#userTechnical_title'));" name="identity" id="userIdentity" class="location" style="margin: 0px;">
<option value="">
<%= l(:label_account_identity_choose) %>
</option>
<option value="0">
<%= l(:label_account_identity_teacher) %>
</option>
<option value="1">
<%= l(:label_account_identity_student) %>
</option>
<option value="2">
<%= l(:label_account_identity_enterprise) %>
</option>
<option value="3">
<%= l(:label_account_identity_developer) %>
</option>
</select>
<span id='technical_title' style='display:none'>
<select name="technical_title" id="userTechnical_title"></select>
</span>
<span id='no' style='display:none'>
<!-- modified by fq -->
<% if !User.current.user_extensions.nil? && !User.current.user_extensions.student_id.nil? %>
<%= text_field_tag :no, User.current.user_extensions.student_id, :placeholder => "请输入学号" %>
<% else %>
<%= text_field_tag :no, nil, :placeholder => "请输入学号" %></span>
<% end %>
<!-- end -->
</span>
</p>
<span id='name' style='display:none'> <span id='name' style='display:none'>
<p style="width:530px;padding-left: 26px;"> <p style="width:530px;padding-left: 53px;">
<%= f.text_field :lastname, :required => true %> <%= f.text_field :lastname, :size => 25, :required => true %>
<span class='font_lighter'> <span class='font_lighter' id="lastname_limit">
<%= l(:field_lastname_eg) %> <%= l(:field_lastname_eg) %>
</span> </span>
<span id="valid_lastname"></span>
</p> </p>
<p style="width:530px;padding-left: 26px;"> <p style="width:530px;padding-left: 53px;">
<%= f.text_field :firstname, :required => true %> <%= f.text_field :firstname, :size => 25, :required => true %>
<span class='font_lighter'> <span class='font_lighter' id="firstname_limit">
<%= l(:field_firstname_eg) %> <%= l(:field_firstname_eg) %>
</span> </span>
<span id="valid_firstname"></span>
</p> </p>
</span> </span>
<span id='enterprise' style='display:none'> <span id='enterprise' style='display:none'>
<p style="width:400px;padding-left: 26px;"> <p style="width:400px;padding-left: 39px;">
<%= l(:label_company_name)%> <%= l(:label_company_name)%><span style="color: #bb0000"> *</span>
<%= text_field_tag :enterprise_name, @user.firstname %> <%= text_field_tag :enterprise_name, @user.firstname %>
<span id="valid_companyname"></span>
</p> </p>
</span> </span>
<!-- added by bai 增加账户里的性别--> <!-- added by bai 增加账户里的性别-->
<span id='gender' style='display:none'> <span id='gender' style='display:none'>
<% if @user.user_extensions.nil? %> <% if @user.user_extensions.nil? %>
<p style="width:400px;padding-left: 26px;"> <p style="width:400px;padding-left: 54px;">
<%= l(:label_gender) %>&nbsp;&nbsp; <%= l(:label_gender) %>&nbsp;&nbsp;
<%= select_tag 'gender', "<option value = '0'>#{l(:label_gender_male)}</option><option value = '1'>#{l(:label_gender_female)}</option>".html_safe, :class => 'gender' %> <%= select_tag 'gender', "<option value = '0'>#{l(:label_gender_male)}</option><option value = '1'>#{l(:label_gender_female)}</option>".html_safe, :class => 'gender' %>
</p> </p>
<% else %> <% else %>
<% if @user.user_extensions.gender == 0 %><!-- label_gender_male --> <% if @user.user_extensions.gender == 0 %><!-- label_gender_male -->
<p style="width:400px;padding-left: 26px;"> <p style="width:400px;padding-left: 54px;">
<%= l(:label_gender) %>&nbsp;&nbsp; <%= l(:label_gender) %>&nbsp;&nbsp;
<%= select_tag 'gender', "<option value = '0'>#{l(:label_gender_male)}</option><option value = '1'>#{l(:label_gender_female)}</option>".html_safe, :class => 'gender' %> <%= select_tag 'gender', "<option value = '0'>#{l(:label_gender_male)}</option><option value = '1'>#{l(:label_gender_female)}</option>".html_safe, :class => 'gender' %>
</p> </p>
<% else %> <% else %>
<p style="width:400px;padding-left: 26px;"> <p style="width:400px;padding-left: 54px;">
<%= l(:label_gender) %>&nbsp;&nbsp; <%= l(:label_gender) %>&nbsp;&nbsp;
<%= select_tag 'gender', "<option value = '0'>#{l(:label_gender_male)}</option><option value = '1' selected='selected'>#{l(:label_gender_female)}</option>".html_safe, :class => 'gender' %> <%= select_tag 'gender', "<option value = '0'>#{l(:label_gender_male)}</option><option value = '1' selected='selected'>#{l(:label_gender_female)}</option>".html_safe, :class => 'gender' %>
</p> </p>
<% end %> <% end %>
<% end %> <% end %>
</span> </span>
<!-- added by Wen --> <!-- added by Wen -->
<p style="padding-left: 26px;"> <p id="occupation_detail" style="padding-left: 24px; display: none">
<% if User.current.user_extensions.school.nil? %>
<%= l(:field_occupation) %>&nbsp; <%= l(:field_occupation) %>
<span class="required">*</span> <span class="required">&nbsp;</span>
<input id="province" name="province" type="text" value="请单击选择省份及学校" readonly> <% if User.current.user_extensions.nil? %>
<input id="occupation" name="occupation" type="hidden"/> <input id="province" name="province" style="display: none" type="text" value="请单击选择省份及学校" readonly>
<input id="occupation_name" type="text" readonly/> <input id="occupation" name="occupation" style="display: none" type="text" value="" />
<input id="occupation_name" type="text" style="display: none" readonly/>
<% else %> <% else %>
<%= l(:field_occupation) %>&nbsp;<span class="required">*</span> <% if User.current.user_extensions.identity == 3 || User.current.user_extensions.identity == 2 %>
<input id="province" name="province" type="text" value="<%= User.current.user_extensions.school.province %>" readonly/>
<input id="occupation" name="occupation" type="hidden" value="<%= User.current.user_extensions.school.id %>"/> <input id="province" name="province" style="display: none" type="text" value="请单击选择省份及学校" readonly>
<input id="occupation_name" type="text" value="<%= User.current.user_extensions.school.name %>" readonly="true" style="background-color: #E2E2E2;"/> <input id="occupation" name="occupation" style="display: none" type="text" value="<%= @user.user_extensions.occupation %>" />
<input id="occupation_name" type="text" style="display: none" readonly/>
<% elsif User.current.user_extensions.school.nil? %>
<input id="province" name="province" style="display: none" type="text" value="请单击选择省份及学校" readonly>
<input id="occupation" name="occupation" style="display: none" type="text" />
<input id="occupation_name" type="text" style="display: none" readonly/>
<% else %>
<input id="province" name="province" style="display: none" type="text" value="<%= User.current.user_extensions.school.province %>" readonly/>
<input id="occupation" name="occupation" type="text" style="display: none" value="<%= User.current.user_extensions.school.id %>"/>
<input id="occupation_name" type="text" style="display: none" value="<%= User.current.user_extensions.school.name %>" readonly="true" style="background-color: #E2E2E2;"/>
<% end %>
<% end %> <% end %>
</p> </p>
@ -164,21 +266,31 @@
<!-- end --> <!-- end -->
<p style="width:357px;padding-left: 26px;"> <p style="width:357px;padding-left: 27px;">
<%= f.text_field :mail, :required => true %> <%= f.text_field :mail, :required => true %>
</p> </p>
<p style="width:426px;padding-left:26px;"> <p style="width:426px;padding-left:54px;">
<%= f.select :language, :Chinese => :zh, :English => :en %> <%= f.select :language, :Chinese => :zh, :English => :en %>
</p> </p>
<% if !User.current.user_extensions.nil? %>
<% province = User.current.user_extensions.location %> <% province = User.current.user_extensions.location %>
<% city = User.current.user_extensions.location_city %> <% city = User.current.user_extensions.location_city %>
<% identity = User.current.user_extensions.identity %> <% identity = User.current.user_extensions.identity %>
<% title = User.current.user_extensions.technical_title %> <% occupation1 = User.current.user_extensions.occupation %>
<% language = User.current.language %> <% occupation = User.current.user_extensions.occupation %>
<% title = User.current.user_extensions.technical_title %>
<% language = User.current.language %>
<% else %>
<% province = "湖南省" %>
<% city = "长沙"%>
<% identity = ""%>
<% occupation1 = ""%>
<% title = "" %>
<% language = ""%>
<% end %>
<script type="text/javascript" language="javascript"> <script type="text/javascript" language="javascript">
$().ready(function () { $().ready(function () {
var province = "<%= "#{province}" %>" var province = "<%= "#{province}" %>"
@ -187,12 +299,14 @@
var identity = "<%= "#{identity}" %>" var identity = "<%= "#{identity}" %>"
var title = "<%= "#{title}" %>" var title = "<%= "#{title}" %>"
var language = "<%= "#{language}" %>" var language = "<%= "#{language}" %>"
var occupation1 = "<%= "#{occupation}" %>"
init_identity_and_title(document.getElementById('userIdentity'), identity, document.getElementById('userTechnical_title'), title, language); init_identity_and_title(document.getElementById('userIdentity'), identity, document.getElementById('userTechnical_title'), title, language);
}); });
</script> </script>
<p style="width:400px;padding-left: 26px;"><%= l(:label_location) %> <p style="width:400px;padding-left: 57px;"><label style="margin-right: 5px;"><%= l(:label_location) %></label>
<select onchange="showcity(this.value, document.getElementById('userCity'));" name="province" id="userProvince" class="location"> <select onchange="showcity(this.value, document.getElementById('userCity'));" name="province" id="userProvince" class="location">
<option value="">--请选择省份--</option> <option value="">--请选择省份--</option>
<option value="北京">北京</option> <option value="北京">北京</option>
@ -236,60 +350,7 @@
<% unless @user.user_extensions.identity == 2 %>
<p style="width:400px;padding-left: 26px;">
<%= l(:label_identity) %>
<select onchange="showtechnical_title(this.value, $('#userTechnical_title'));" name="identity" id="userIdentity" class="location">
<option value="">
<%= l(:label_account_identity_choose) %>
</option>
<option value="0">
<%= l(:label_account_identity_teacher) %>
</option>
<option value="1">
<%= l(:label_account_identity_student) %>
</option>
<option value="3">
<%= l(:label_account_identity_developer) %>
</option>
</select>
<span id='technical_title' style='display:none'>
<select name="technical_title" id="userTechnical_title"></select>
</span>
<span id='no' style='display:none'>
<!-- modified by fq -->
<% unless User.current.user_extensions.student_id.nil? %>
<%= text_field_tag :no, User.current.user_extensions.student_id, :placeholder => "请输入学号" %>
<% else %>
<%= text_field_tag :no, nil, :placeholder => "请输入学号" %></span>
<% end %>
<!-- end -->
</span>
</p>
<% else %>
<p>
<span style="display:none">
<select onchange="showtechnical_title(this.value, document.getElementById('userTechnical_title'));" name="identity" id="userIdentity" class="location">
<option value="">
<%= l(:label_account_identity_choose) %>
</option>
<option value="0">
<%= l(:label_account_identity_teacher) %>
</option>
<option value="1">
<%= l(:label_account_identity_student) %>
</option>
<option value="2">
<%= l(:label_account_identity_enterprise) %>
</option>
<option value="3">
<%= l(:label_account_identity_developer) %>
</option>
</select>
</span>
</p>
<% end %>
</div> </div>
@ -528,6 +589,7 @@
} }
} }
} }
function init_identity_and_title(pField, identity, cField, title, language) { function init_identity_and_title(pField, identity, cField, title, language) {
for (var i = 0; i < pField.options.length; i++) { for (var i = 0; i < pField.options.length; i++) {
if (pField.options[i].value == identity) { if (pField.options[i].value == identity) {
@ -590,6 +652,11 @@
$('#name').show() $('#name').show()
$('#enterprise').hide() $('#enterprise').hide()
$('#gender').show() $('#gender').show()
$('#occupation_detail').show()
$('input#province').show()
$('input#occupation_name').show()
$('input#occupation').hide()
var technical_titleOptions = new Array( var technical_titleOptions = new Array(
"<%= l(:label_technicl_title_professor) %>", "<%= l(:label_technicl_title_associate_professor) %>", "<%= l(:label_technicl_title_lecturer) %>", "<%= l(:label_technicl_title_teaching_assistant) %>"); "<%= l(:label_technicl_title_professor) %>", "<%= l(:label_technicl_title_associate_professor) %>", "<%= l(:label_technicl_title_lecturer) %>", "<%= l(:label_technicl_title_teaching_assistant) %>");
break; break;
@ -600,7 +667,14 @@
$('#name').show() $('#name').show()
$('#enterprise').hide() $('#enterprise').hide()
$('#gender').show() $('#gender').show()
var titleOptions = new Array(""); $('#occupation_detail').show()
$('input#province').show()
$('input#occupation_name').show()
$('input#occupation').hide()
var technical_titleOptions = new Array(
"<%= l(:label_technicl_title_professor) %>", "<%= l(:label_technicl_title_associate_professor) %>", "<%= l(:label_technicl_title_lecturer) %>", "<%= l(:label_technicl_title_teaching_assistant) %>");
break; break;
case '2' : case '2' :
@ -609,7 +683,25 @@
$('#name').hide() $('#name').hide()
$('#enterprise').show() $('#enterprise').show()
$('#gender').hide() $('#gender').hide()
var titleOptions = new Array(""); $('#occupation_detail').hide()
var technical_titleOptions = new Array(
"<%= l(:label_technicl_title_professor) %>", "<%= l(:label_technicl_title_associate_professor) %>", "<%= l(:label_technicl_title_lecturer) %>", "<%= l(:label_technicl_title_teaching_assistant) %>");
break;
case '3':
$('#technical_title').hide()
$('#no').hide()
$('#name').show()
$('#enterprise').hide()
$('#gender').show()
$('#occupation_detail').show()
$('input#province').hide()
$('input#occupation_name').hide()
$('input#occupation').show()
// document.getElementById("occupation").value = "";
var technical_titleOptions = new Array(
"<%= l(:label_technicl_title_professor) %>", "<%= l(:label_technicl_title_associate_professor) %>", "<%= l(:label_technicl_title_lecturer) %>", "<%= l(:label_technicl_title_teaching_assistant) %>");
break; break;
default: default:
$('#technical_title').hide() $('#technical_title').hide()
@ -617,7 +709,10 @@
$('#name').show() $('#name').show()
$('#enterprise').hide() $('#enterprise').hide()
$('#gender').show() $('#gender').show()
var titleOptions = new Array(""); $('#occupation_detail').hide()
var technical_titleOptions = new Array(
"<%= l(:label_technicl_title_professor) %>", "<%= l(:label_technicl_title_associate_professor) %>", "<%= l(:label_technicl_title_lecturer) %>", "<%= l(:label_technicl_title_teaching_assistant) %>");
break; break;

@ -11,11 +11,13 @@
</ul> </ul>
</div> </div>
--> -->
<p class="small"><%= link_to l(:label_issue_view_all), :controller => 'issues', <p class="small">
:action => 'index', <%#= link_to l(:label_issue_view_all), :controller => 'issues',
:set_filter => 1, :action => 'index',
:assigned_to_id => 'me', :set_filter => 1,
:sort => 'priority:desc,updated_on:desc' %></p> :assigned_to_id => 'me',
:sort => 'priority:desc,updated_on:desc' %>
</p>
<% end %> <% end %>
<% content_for :header_tags do %> <% content_for :header_tags do %>
<%= auto_discovery_link_tag(:atom, <%= auto_discovery_link_tag(:atom,

@ -3,7 +3,7 @@
<% reported_issues = issuesreportedbyme_items %> <% reported_issues = issuesreportedbyme_items %>
<%= render :partial => 'issues/list_simple', :locals => { :issues => reported_issues } %> <%= render :partial => 'issues/list_simple', :locals => { :issues => reported_issues } %>
<% if reported_issues.length > 0 %> <% if reported_issues.length > 0 %>
<p class="small"><%= link_to l(:label_issue_view_all), :controller => 'issues', <p class="small"><%#= link_to l(:label_issue_view_all), :controller => 'issues',
:action => 'index', :action => 'index',
:set_filter => 1, :set_filter => 1,
:status_id => '*', :status_id => '*',

@ -3,7 +3,7 @@
<%= render :partial => 'issues/list_simple', :locals => { :issues => watched_issues } %> <%= render :partial => 'issues/list_simple', :locals => { :issues => watched_issues } %>
<% if watched_issues.length > 0 %> <% if watched_issues.length > 0 %>
<p class="small"><%= link_to l(:label_issue_view_all), :controller => 'issues', <p class="small"><%#= link_to l(:label_issue_view_all), :controller => 'issues',
:action => 'index', :action => 'index',
:set_filter => 1, :set_filter => 1,
:watcher_id => 'me', :watcher_id => 'me',

@ -74,10 +74,10 @@
<%= labelled_form_for @news, :url => course_news_index_path(@course), <%= labelled_form_for @news, :url => course_news_index_path(@course),
:html => {:id => 'news-form', :multipart => true} do |f| %> :html => {:id => 'news-form', :multipart => true} do |f| %>
<%= render :partial => 'news/course_form', :locals => {:f => f, :is_new => true} %> <%= render :partial => 'news/course_form', :locals => {:f => f, :is_new => true} %>
<%= link_to l(:button_create), "#", :onclick => 'submitNews();', :onmouseover => 'submitFocus(this);', :class => 'whiteButton m3p10' %> <%= link_to l(:button_create), "#", :onclick => 'submitNews();', :onmouseover => 'submitFocus(this);', :class => 'ButtonColor m3p10' %>
<%#= preview_link preview_news_path, 'news-form', target='preview', {:class => 'whiteButton m3p10'} %> <%#= preview_link preview_news_path, 'news-form', target='preview', {:class => 'whiteButton m3p10'} %>
<%= link_to l(:button_cancel), "#", :onclick => '$("#add-news").hide()', :class => 'whiteButton m3p10' %> <%= link_to l(:button_cancel), "#", :onclick => '$("#add-news").hide()', :class => 'ButtonColor m3p10' %>
<% end if @course %> <% end if @course %>
<div id="preview" class="wiki"></div> <div id="preview" class="wiki"></div>
</div> </div>

@ -24,7 +24,7 @@
<% end %> <% end %>
<% if reply_allow %> <% if reply_allow %>
<%= link_to l(:label_bid_respond_quote),'', <%= link_to l(:label_bid_respond_quote),'',
{:focus => 'project_respond', :onclick => "toggleAndSettingWordsVal($('##{ids}'), $('##{ids} textarea'), '#{l(:label_reply_plural)} #{journal.user.name}: '); $('##{ids} textarea') ;return false;"} %> {:focus => 'project_respond', :onclick => "toggleAndSettingWordsVal($('##{ids}'), $('##{ids} textarea')); $('##{ids} textarea') ;return false;"} %>
<% end %> <% end %>
</span> </span>

@ -17,12 +17,12 @@
<%= f.text_area 'project_message', :rows => 3, :cols => 65, <%= f.text_area 'project_message', :rows => 3, :cols => 65,
:placeholder => "#{l(:label_welcome_my_respond)}", :placeholder => "#{l(:label_welcome_my_respond)}",
:style => "resize: none; width: 98%", :style => "resize: none; width: 98%",
:class => 'noline'%> :class => 'noline',:maxlength => 250%>
<%= submit_tag l(:button_leave_meassge), :name => nil , :class => "enterprise" , :style => "display: block; float: right; margin-right: 1%; margin-top: 1px;"%> <%= submit_tag l(:button_leave_meassge), :name => nil , :class => "enterprise" , :style => "display: block; float: right; margin-right: 1%; margin-top: 1px;"%>
<% end %> <% end %>
</div> </div>
<% end %> <% end %>
<div class="cl"></div>
</div> </div>
<div id="history"> <div id="history">
<%= render :partial => 'history',:locals => { :journals => @jour, :state => false} %> <%= render :partial => 'history',:locals => { :journals => @jour, :state => false} %>

@ -11,6 +11,9 @@
<% if @project.enabled_modules.where("name = 'wiki'").count > 0 %> <% if @project.enabled_modules.where("name = 'wiki'").count > 0 %>
<li style="background: url('http://<%= Setting.host_name %>/images/sidebar/tool_tag_alpha.png') no-repeat scroll 10px 30% transparent;"><%= link_to l(:project_module_wiki), project_wiki_path(@project) %></li> <li style="background: url('http://<%= Setting.host_name %>/images/sidebar/tool_tag_alpha.png') no-repeat scroll 10px 30% transparent;"><%= link_to l(:project_module_wiki), project_wiki_path(@project) %></li>
<% end %> <% end %>
<% if @project.enabled_modules.where("name = 'code_review'").count > 0 %>
<li style="background: url('http://<%= Setting.host_name %>/images/sidebar/tool_tag_alpha.png') no-repeat scroll 10px 30% transparent;"><%= link_to l(:project_module_code_review), {controller: 'code_review', action: 'index', id: @project.id} %></li>
<% end %>
</ul> </ul>
<ul><h3>进度跟踪</h3> <ul><h3>进度跟踪</h3>
<% if @project.enabled_modules.where("name = 'calendar'").count > 0 %> <% if @project.enabled_modules.where("name = 'calendar'").count > 0 %>

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

Loading…
Cancel
Save