Merge branch 'szzh' into develop
This commit is contained in:
commit
adb9eb79a7
|
@ -103,7 +103,7 @@ class AccountController < ApplicationController
|
|||
def register
|
||||
# @root_path="/home/pdl/redmine-2.3.2-0/apache2/"
|
||||
#
|
||||
@cache_identityy = params[:identity]||"" #身份
|
||||
#@cache_identityy = params[:identity]||"" #身份
|
||||
@cache_no = params[:no]||"" #学号
|
||||
@cache_technical_title = params[:technical_title]||"" #教师职称
|
||||
@cache_province = params[:province]||"" #省份
|
||||
|
@ -136,7 +136,7 @@ class AccountController < ApplicationController
|
|||
session[:auth_source_registration] = nil
|
||||
self.logged_user = @user
|
||||
flash[:notice] = l(:notice_account_activated)
|
||||
redirect_to my_account_url
|
||||
redirect_to my_account_path
|
||||
end
|
||||
else
|
||||
@user.login = params[:user][:login]
|
||||
|
@ -144,22 +144,7 @@ class AccountController < ApplicationController
|
|||
@user.password, @user.password_confirmation = user_params[:password], user_params[:password_confirmation]
|
||||
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
|
||||
when '1'
|
||||
|
@ -234,6 +219,10 @@ class AccountController < ApplicationController
|
|||
render :json => req
|
||||
end
|
||||
|
||||
def email_valid
|
||||
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def authenticate_user
|
||||
|
@ -363,7 +352,7 @@ class AccountController < ApplicationController
|
|||
UserStatus.create(:user_id => user.id, :changsets_count => 0, :watchers_count => 0)
|
||||
Mailer.register(token).deliver
|
||||
flash[:notice] = l(:notice_account_register_done)
|
||||
redirect_to signin_url
|
||||
render action: 'email_valid', locals: {:mail => user.mail}
|
||||
else
|
||||
yield if block_given?
|
||||
end
|
||||
|
|
|
@ -126,7 +126,7 @@ class AdminController < ApplicationController
|
|||
|
||||
@status = params[:status] || 1
|
||||
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_pages = Paginator.new @user_count, @limit, params['page']
|
||||
@user_base_tag = params[:id] ? 'base_users':'base'
|
||||
|
|
|
@ -141,6 +141,23 @@ class AttachmentsController < ApplicationController
|
|||
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
|
||||
if @attachment.thumbnailable? && thumbnail = @attachment.thumbnail(:size => params[:size])
|
||||
if stale?(:etag => thumbnail)
|
||||
|
@ -326,6 +343,35 @@ class AttachmentsController < ApplicationController
|
|||
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
|
||||
def find_project
|
||||
@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.compact!
|
||||
end
|
||||
render :layout => false
|
||||
#render :layout => false
|
||||
render :json => @issues.map {|issue| {
|
||||
'value' => issue[:subject]
|
||||
|
||||
}}
|
||||
|
||||
end
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@ class BidsController < ApplicationController
|
|||
menu_item :project, :only => [:show_project,:show_results, :new_submit_homework]
|
||||
menu_item :homework_respond, :only => :homework_respond
|
||||
menu_item :homework_statistics, :only => :homework_statistics
|
||||
menu_item :edit, :only => :edit
|
||||
|
||||
before_filter :can_show_course,only: []
|
||||
before_filter :can_show_contest,only: []
|
||||
|
@ -806,6 +807,7 @@ class BidsController < ApplicationController
|
|||
@bid.is_evaluation = params[:bid][:is_evaluation]
|
||||
@bid.proportion = params[:bid][:proportion]
|
||||
@bid.evaluation_num = params[:bid][:evaluation_num]
|
||||
@bid.open_anonymous_evaluation = params[:bid][:open_anonymous_evaluation]
|
||||
@bid.reward_type = 3
|
||||
# @bid.budget = params[:bid][:budget]
|
||||
@bid.deadline = params[:bid][:deadline]
|
||||
|
@ -862,6 +864,7 @@ class BidsController < ApplicationController
|
|||
@bid.is_evaluation = params[:bid][:is_evaluation]
|
||||
@bid.proportion = params[:bid][:proportion]
|
||||
@bid.evaluation_num = params[:bid][:evaluation_num]
|
||||
@bid.open_anonymous_evaluation = params[:bid][:open_anonymous_evaluation]
|
||||
@bid.reward_type = 3
|
||||
@bid.deadline = params[:bid][:deadline]
|
||||
@bid.budget = 0
|
||||
|
|
|
@ -8,7 +8,7 @@ class CoursesController < ApplicationController
|
|||
menu_item :overview
|
||||
menu_item :feedback, :only => :feedback
|
||||
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_active), :only => :index
|
||||
|
@ -271,7 +271,6 @@ class CoursesController < ApplicationController
|
|||
@issue_custom_fields = IssueCustomField.sorted.all
|
||||
@trackers = Tracker.sorted.all
|
||||
|
||||
if User.current.user_extensions.identity == 0
|
||||
if @course.save
|
||||
#unless User.current.admin?
|
||||
r = Role.givable.find_by_id(Setting.new_project_user_role_id.to_i) || Role.givable.first
|
||||
|
@ -307,8 +306,6 @@ class CoursesController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
def course
|
||||
@school_id = params[:school_id]
|
||||
per_page_option = 10
|
||||
|
@ -514,6 +511,7 @@ class CoursesController < ApplicationController
|
|||
def new_homework
|
||||
@homework = Bid.new
|
||||
@homework.safe_attributes = params[:bid]
|
||||
@homework.open_anonymous_evaluation = 1
|
||||
if (User.current.logged? && User.current.member_of_course?(Course.find params[:id] ))
|
||||
render :layout => 'base_courses'
|
||||
else
|
||||
|
|
|
@ -22,22 +22,55 @@ class FilesController < ApplicationController
|
|||
menu_item :files
|
||||
|
||||
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
|
||||
include SortHelper
|
||||
helper :project_score
|
||||
|
||||
def show_attachments obj
|
||||
all_attachments = []
|
||||
@all_attachments = []
|
||||
obj.each do |container|
|
||||
all_attachments += container.attachments
|
||||
@all_attachments += container.attachments
|
||||
end
|
||||
@limit = 10
|
||||
@feedback_count = all_attachments.count
|
||||
@feedback_count = @all_attachments.count
|
||||
@feedback_pages = Paginator.new @feedback_count, @limit, params['page']
|
||||
@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
|
||||
|
||||
def index
|
||||
|
@ -48,7 +81,9 @@ class FilesController < ApplicationController
|
|||
'size' => "#{Attachment.table_name}.filesize",
|
||||
'downloads' => "#{Attachment.table_name}.downloads"
|
||||
sort = ""
|
||||
|
||||
@sort = ""
|
||||
@order = ""
|
||||
@is_remote = false
|
||||
if params[:project_id]
|
||||
@isproject = true
|
||||
|
||||
|
@ -113,7 +148,8 @@ class FilesController < ApplicationController
|
|||
when "created_on"
|
||||
attribute = "created_on"
|
||||
end
|
||||
|
||||
@sort = order_by[0]
|
||||
@order = order_by[1]
|
||||
if order_by.count == 1
|
||||
sort += "#{Attachment.table_name}.#{attribute} asc "
|
||||
elsif order_by.count == 2
|
||||
|
@ -134,6 +170,10 @@ class FilesController < ApplicationController
|
|||
|
||||
end
|
||||
|
||||
def quote_resource_show
|
||||
@file = Attachment.find(params[:id])
|
||||
end
|
||||
|
||||
def new
|
||||
@versions = @project.versions.sort
|
||||
@course_tag = @project.project_type
|
||||
|
@ -265,6 +305,7 @@ class FilesController < ApplicationController
|
|||
'size' => "#{Attachment.table_name}.filesize",
|
||||
'downloads' => "#{Attachment.table_name}.downloads"
|
||||
sort=''
|
||||
|
||||
if params[:sort]
|
||||
params[:sort].split(",").each do |sort_type|
|
||||
order_by = sort_type.split(":")
|
||||
|
|
|
@ -52,7 +52,7 @@ class ForumsController < ApplicationController
|
|||
|
||||
def index
|
||||
@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_pages = Paginator.new @forums_count, @limit, params['page']
|
||||
|
||||
|
@ -208,6 +208,8 @@ class ForumsController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
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
|
||||
FROM homework_attaches
|
||||
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_type = 4
|
||||
@homework_list = paginateHelper all_homework_list,10
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
|
||||
class IssuesController < ApplicationController
|
||||
layout 'base_projects'#Added by young
|
||||
menu_item :new_issue, :only => [:new, :create]
|
||||
default_search_scope :issues
|
||||
|
||||
before_filter :find_issue, :only => [:show, :edit, :update]
|
||||
|
@ -60,7 +59,7 @@ class IssuesController < ApplicationController
|
|||
sort_update(@query.sortable_columns)
|
||||
@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?
|
||||
case params[:format]
|
||||
|
|
|
@ -19,7 +19,7 @@ class MemosController < ApplicationController
|
|||
|
||||
@content = "#{ll(Setting.default_language, :text_user_wrote, @memo.author)} <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 << @memo.content.to_s.strip.gsub(%r{<pre>((.|\s)*?)</pre>}m, '[...]').gsub(/(\r?\n|\r\n?)/, "\n> ") + "\n\n"
|
||||
#@content_html = textilizable(@content)
|
||||
|
|
|
@ -91,7 +91,11 @@ class MyController < ApplicationController
|
|||
end
|
||||
|
||||
@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.location = params[:province] if params[:province]
|
||||
@se.location_city = params[:city] if params[:city]
|
||||
|
|
|
@ -14,13 +14,14 @@ class TagsController < ApplicationController
|
|||
include AttachmentsHelper
|
||||
include ContestsHelper
|
||||
include ActsAsTaggableOn::TagsHelper
|
||||
include TagsHelper
|
||||
helper :projects
|
||||
helper :courses
|
||||
include TagsHelper
|
||||
helper :tags
|
||||
include OpenSourceProjectsHelper
|
||||
|
||||
before_filter :require_admin,:only => [:delete,:show_all]
|
||||
before_filter :require_login,:only => [:tag_save]
|
||||
|
||||
# $selected_tags = Array.new
|
||||
# $related_tags = Array.new
|
||||
|
@ -189,6 +190,83 @@ class TagsController < ApplicationController
|
|||
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
|
||||
# 这里用来刷新搜索结果的区域
|
||||
# 函数的返回值 前2字段用来处理获取其他tag和分页 ,另外4个返回值为过滤结果
|
||||
|
@ -309,4 +387,6 @@ class TagsController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
end
|
||||
|
|
|
@ -374,7 +374,7 @@ class UsersController < ApplicationController
|
|||
"show_changesets" => true
|
||||
}
|
||||
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_pages = Paginator.new @user_count, @limit, params['page']
|
||||
@user_base_tag = params[:id] ? 'base_users':'users_base'
|
||||
|
@ -812,7 +812,7 @@ class UsersController < ApplicationController
|
|||
|
||||
# 必填自己的工作单位,其实就是学校
|
||||
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)
|
||||
redirect_to my_account_url
|
||||
end
|
||||
|
|
|
@ -72,7 +72,7 @@ class ZipdownController < ApplicationController
|
|||
homeattach.attachments.each do |attach|
|
||||
homeworks_attach_path << attach.diskfile#.to_s.slice((length+1)..-1)
|
||||
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
|
||||
|
||||
|
||||
|
|
|
@ -177,6 +177,8 @@ module AttachmentsHelper
|
|||
s.html_safe
|
||||
end
|
||||
|
||||
|
||||
|
||||
# Modified by Longjun
|
||||
# 有参数的方法要加()
|
||||
def private_filter(resultSet)
|
||||
|
|
|
@ -328,7 +328,7 @@ module CoursesHelper
|
|||
#当前用户是不是指定课程的学生
|
||||
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
|
||||
!(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
|
||||
#@membership = User.current.memberships.all(:conditions => Project.visible_condition(User.current))
|
||||
|
|
|
@ -44,6 +44,16 @@ module FilesHelper
|
|||
File.new(zipfile_name,'w+')
|
||||
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)
|
||||
result = false
|
||||
|
|
|
@ -227,6 +227,7 @@ module IssuesHelper
|
|||
strings = []
|
||||
values_by_field = {}
|
||||
details.each do |detail|
|
||||
unless detail.property == 'attachment'
|
||||
if detail.property == 'cf'
|
||||
field_id = detail.prop_key
|
||||
field = CustomField.find_by_id(field_id)
|
||||
|
@ -243,6 +244,7 @@ module IssuesHelper
|
|||
end
|
||||
strings << show_detail(detail, no_html, options)
|
||||
end
|
||||
end
|
||||
values_by_field.each do |field_id, changes|
|
||||
detail = JournalDetail.new(:property => 'cf', :prop_key => field_id)
|
||||
if changes[:added].any?
|
||||
|
|
|
@ -97,7 +97,7 @@ module WatchersHelper
|
|||
return '' unless user && user.logged?
|
||||
# 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)
|
||||
text = joined ? l(:label_exit_course) : l(:label_new_join)
|
||||
url_t = join_path(:object_id => course.id)
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
|
||||
class Course < ActiveRecord::Base
|
||||
include Redmine::SafeAttributes
|
||||
|
||||
|
@ -5,7 +6,7 @@ class Course < ActiveRecord::Base
|
|||
STATUS_CLOSED = 5
|
||||
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 :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表
|
||||
|
@ -33,10 +34,10 @@ class Course < ActiveRecord::Base
|
|||
acts_as_attachable :view_permission => :view_files,
|
||||
:delete_permission => :manage_files
|
||||
|
||||
validates :password, presence: true
|
||||
validates :term, presence: true
|
||||
validates :name, presence: true
|
||||
validates :class_period, presence: true,format: {:with =>/^\d*$/}
|
||||
validates_presence_of :password, :term,:name,:description
|
||||
validates_format_of :class_period, :with =>/^[1-9]\d*$/
|
||||
validates_format_of :name,:with =>/^[a-zA-Z0-9_\u4e00-\u9fa5]+$/
|
||||
validates_length_of :description, :maximum => 10000
|
||||
before_save :self_validate
|
||||
after_create :create_board_sync
|
||||
before_destroy :delete_all_members
|
||||
|
@ -52,7 +53,8 @@ class Course < ActiveRecord::Base
|
|||
'term',
|
||||
'is_public',
|
||||
'description',
|
||||
'class_period'
|
||||
'class_period',
|
||||
'open_student'
|
||||
|
||||
acts_as_customizable
|
||||
|
||||
|
@ -308,3 +310,5 @@ class Course < ActiveRecord::Base
|
|||
# read_attribute('name') || Project.find_by_identifier(self.extra).try(:name)
|
||||
#end
|
||||
end
|
||||
|
||||
|
||||
|
|
|
@ -8,7 +8,9 @@ class Forum < ActiveRecord::Base
|
|||
'topic_count',
|
||||
'memo_count',
|
||||
'last_memo_id',
|
||||
'creator_id'
|
||||
'creator_id',
|
||||
'sticky',
|
||||
'locked'
|
||||
validates_presence_of :name, :creator_id, :description
|
||||
validates_length_of :name, maximum: 50
|
||||
#validates_length_of :description, maximum: 255
|
||||
|
@ -28,7 +30,7 @@ class Forum < ActiveRecord::Base
|
|||
|
||||
def destroyable_by? user
|
||||
# user && user.logged? && Forum.find(self.forum_id).creator_id == user.id || user.admin?
|
||||
user.admin?
|
||||
self.creator == user || user.admin?
|
||||
end
|
||||
|
||||
# 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
|
||||
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)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -88,11 +88,11 @@ class Memo < ActiveRecord::Base
|
|||
|
||||
def editable_by? user
|
||||
# user && user.logged? || (self.author == usr && usr.allowed_to?(:edit_own_messages, project))
|
||||
user.admin?
|
||||
user.admin? || self.author == user
|
||||
end
|
||||
|
||||
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?
|
||||
end
|
||||
|
||||
|
|
|
@ -78,9 +78,13 @@ class Message < ActiveRecord::Base
|
|||
|
||||
|
||||
safe_attributes 'subject', 'content'
|
||||
safe_attributes 'locked', 'sticky', 'board_id',
|
||||
safe_attributes 'board_id','locked', 'sticky',
|
||||
:if => lambda {|message, user|
|
||||
if message.project
|
||||
user.allowed_to?(:edit_messages, message.project)
|
||||
else
|
||||
user.allowed_to?(:edit_messages, message.course)
|
||||
end
|
||||
}
|
||||
|
||||
def visible?(user=User.current)
|
||||
|
@ -158,6 +162,7 @@ class Message < ActiveRecord::Base
|
|||
#更新用户分数 -by zjc
|
||||
def be_user_score
|
||||
#新建message且无parent的为发帖
|
||||
|
||||
if self.parent_id.nil? && !self.board.project.nil?
|
||||
UserScore.joint(:post_message, self.author,nil,self, { message_id: self.id })
|
||||
update_memo_number(self.author,1)
|
||||
|
|
|
@ -29,6 +29,7 @@ class News < ActiveRecord::Base
|
|||
validates_presence_of :title, :description
|
||||
validates_length_of :title, :maximum => 60
|
||||
validates_length_of :summary, :maximum => 255
|
||||
validates_length_of :description, :maximum => 10000
|
||||
|
||||
acts_as_attachable :delete_permission => :manage_news
|
||||
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 :enabled_modules, :dependent => :delete_all
|
||||
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 :versions, :dependent => :destroy, :order => "#{Version.table_name}.effective_date DESC, #{Version.table_name}.name DESC"
|
||||
has_many :time_entries, :dependent => :delete_all
|
||||
|
@ -1151,3 +1151,4 @@ class Project < ActiveRecord::Base
|
|||
|
||||
|
||||
end
|
||||
|
||||
|
|
|
@ -199,13 +199,19 @@ class User < Principal
|
|||
}
|
||||
scope :sorted, lambda { order(*User.fields_for_order_statement)}
|
||||
|
||||
scope :like, lambda {|arg|
|
||||
scope :like, lambda {|arg, type|
|
||||
if arg.blank?
|
||||
where(nil)
|
||||
else
|
||||
pattern = "%#{arg.to_s.strip.downcase}%"
|
||||
#where(" LOWER(concat(lastname, firstname)) 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
|
||||
}
|
||||
|
||||
|
|
|
@ -3,6 +3,6 @@ class WebFooterCompany < ActiveRecord::Base
|
|||
validates :name, presence: true, length: { maximum: 500 }
|
||||
validates :url, length: { maximum: 500 },
|
||||
format: { with: /(http|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&:\/~\+#]*[\w\-\@?^=%&\/~\+#])?/,
|
||||
message: l(:is_not_url_error)
|
||||
message: :invalid
|
||||
}
|
||||
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_contest_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 -->
|
||||
|
||||
|
@ -292,145 +14,30 @@
|
|||
<%= labelled_form_for @user, :url => register_path do |f| %>
|
||||
<%= error_messages_for 'user' %>
|
||||
<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? %>
|
||||
<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><%= 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><%= 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 %>
|
||||
<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>
|
||||
<%= f.text_field :mail, :required => true %>
|
||||
<span id="valid_user_mail"></span>
|
||||
</p>
|
||||
<p>
|
||||
<em class="info"><%= "#{l(:label_mail_attention)} " %></em>
|
||||
</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"> </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>
|
||||
<%= f.text_field :mail,:size => 25, :required => true %>
|
||||
<span id="valid_user_mail" ></span>
|
||||
</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>
|
||||
<em class="info" style="color: #acaeb1">
|
||||
<p><%= "#{l(:label_mail_attention)} " %></p>
|
||||
<p><%= "#{l(:label_mail_attention1)} " %></p>
|
||||
</em>
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
<!-- end -->
|
||||
</div>
|
||||
|
||||
|
@ -453,7 +60,7 @@
|
|||
jQuery(document).ready(function () {
|
||||
var $login = $('#user_login')
|
||||
var $mail = $('#user_mail')
|
||||
|
||||
var $password_confirmation = $('#user_password_confirmation')
|
||||
$login.blur(function (event) {
|
||||
if ($(this).is('#user_login')) {
|
||||
$.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>
|
|
@ -17,7 +17,10 @@
|
|||
<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;" %>
|
||||
<% 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>
|
||||
<%= text_field_tag 'name', params[:name], :size => 30 %>
|
||||
<%= 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="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) %>
|
||||
<%= 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>
|
||||
<% end -%>
|
||||
</tbody>
|
||||
|
|
|
@ -17,7 +17,10 @@
|
|||
<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;" %>
|
||||
<% 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>
|
||||
<%= text_field_tag 'name', params[:name], :size => 30 %>
|
||||
<%= 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 h2{ display:block; height:40px; width:425px; text-align:center; color:#3a3a3a;}
|
||||
.ni_con p{ color:#808181; }
|
||||
|
|
|
@ -1,4 +1,38 @@
|
|||
<!--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;'>作业提交还剩 :</span> <span style='color: red;'>"
|
||||
+day1+" </span><span style='color: #acaeb1;'>天</span><span style='color: red;'> "
|
||||
+hour+" </span><span style='color: #acaeb1;'>时</span><span style='color: red;'> "
|
||||
+minute+" </span><span style='color: #acaeb1;'>分</span><span style='color: red;'> "
|
||||
+second+" </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? %>
|
||||
<%#= l(:label_uncommit_homework) %>
|
||||
暂无作业!
|
||||
|
@ -26,7 +60,15 @@
|
|||
<% if User.current.logged? && is_cur_course_student(@course) %>
|
||||
<% cur_user_homework = cur_user_homework_for_bid(bid) %>
|
||||
<% if cur_user_homework!= nil && cur_user_homework.empty? %>
|
||||
<% 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 %>
|
||||
<span style="color: green; float: right">
|
||||
<%= l(:lable_has_commit_homework)%>
|
||||
|
@ -34,7 +76,8 @@
|
|||
<% end %>
|
||||
<% end %>
|
||||
<% 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 %>
|
||||
<% when 0 %>
|
||||
<%= link_to '启动匿评', alert_anonymous_comment_bid_path(bid), id: "#{bid.id}_start_anonymous_comment", remote: true, disable_with: '加载中...' %>
|
||||
|
@ -44,11 +87,13 @@
|
|||
匿评结束
|
||||
<% end %>
|
||||
</span>
|
||||
<%end%>
|
||||
<span class="span_wping">
|
||||
<%= link_to(
|
||||
l(:button_edit),
|
||||
{:action => 'edit', :controller=>'bids', :course_id =>@course.id, :bid_id => bid.id},
|
||||
:class => 'icon icon-edit'
|
||||
{:action => 'edit', :controller=>'bids', :course_id =>@course.id, :bid_id => bid.id}
|
||||
) %>
|
||||
</span>
|
||||
<%#= link_to(
|
||||
l(:button_delete),
|
||||
{:action => 'homework_destroy', :controller=>'bids', :course_id => bid.id},
|
||||
|
@ -94,19 +139,6 @@
|
|||
</strong>
|
||||
)
|
||||
</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>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -146,9 +178,17 @@
|
|||
<%=format_time bid.created_on %>
|
||||
</span>
|
||||
<span style="float: right">
|
||||
<%= l(:field_deadline) %>
|
||||
:
|
||||
<%=bid.deadline %>
|
||||
<% if betweentime(bid.deadline) < 0 %>
|
||||
<span style="color: red; float: right">
|
||||
<%= l(:label_commit_limit)%>
|
||||
</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>
|
||||
|
|
|
@ -43,9 +43,9 @@
|
|||
<% end %>
|
||||
|
||||
<% unless @is_teacher%>
|
||||
<% if @bid.comment_status == 0%>
|
||||
<% if @bid.comment_status == 0 && @bid.open_anonymous_evaluation == 1%>
|
||||
$("#my_homework").click();
|
||||
<% elsif @bid.comment_status == 2%>
|
||||
<% elsif @bid.comment_status == 2 || @bid.open_anonymous_evaluation == 0%>
|
||||
$("#all_homeworks").click();
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
|
|
@ -44,6 +44,10 @@
|
|||
<%= f.select :proportion, proportion_option %>
|
||||
</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%>
|
||||
<span id="bid_evaluation_num_span">匿评分配数量不宜太大,否则会影响开启匿评速度</span>
|
||||
</p>
|
||||
|
|
|
@ -28,14 +28,17 @@
|
|||
</ul>
|
||||
<% else %>
|
||||
<ul>
|
||||
<% if @bid.open_anonymous_evaluation == 1%>
|
||||
<li id="tb_5" class="hovertab">
|
||||
<!-- 开启了匿评才能看到匿评列表 -->
|
||||
<%= 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">
|
||||
<%= link_to "我的作品", get_my_homework_homework_attach_index_path(:bid_id => @bid.id), {id: 'my_homework',:remote => true}%>
|
||||
</li>
|
||||
<% if @bid.comment_status == 2 %>
|
||||
<!-- 匿评结束后才能看到全部作业列表 -->
|
||||
<% if @bid.comment_status == 2 || @bid.open_anonymous_evaluation == 0%>
|
||||
<!-- 匿评结束后或者未开启匿评才能看到全部作业列表 -->
|
||||
<li id="tb_7" class="normaltab">
|
||||
<%= link_to "所有作品", get_homeworks_homework_attach_index_path(:bid_id => @bid.id), {id: 'all_homeworks',:remote => true}%>
|
||||
</li>
|
||||
|
|
|
@ -43,6 +43,8 @@
|
|||
{
|
||||
var evaluation_num = $.trim($("#bid_evaluation_num").val());
|
||||
var regex = /^\d+$/;
|
||||
if($("#bid_open_anonymous_evaluation").attr("checked") == "checked")
|
||||
{
|
||||
if(evaluation_num=="")
|
||||
{
|
||||
$("#bid_evaluation_num_span").text("匿评分配数量不能为空");
|
||||
|
@ -71,6 +73,35 @@
|
|||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
$(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)
|
||||
{
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
<% end %>
|
||||
<% if reply_allow %>
|
||||
<%= 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,
|
||||
:journal_id => journal),
|
||||
:remote => true,
|
||||
|
|
|
@ -1,21 +1,6 @@
|
|||
<!-- fq -->
|
||||
<script type="text/javascript" language="javascript">
|
||||
function clearInfo(id, content) {
|
||||
var text = $('#' + id);
|
||||
if (text.val() == content) {
|
||||
$('#' + id).val('');
|
||||
}
|
||||
}
|
||||
|
||||
function showInfo(id, content) {
|
||||
var text = $('#' + id);
|
||||
if (text.val() == '') {
|
||||
$('#' + id).val(content);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<%= form_for('contest_message',
|
||||
<div style="width: 80%; margin-left:10%;">
|
||||
<%= form_for('contest_message',
|
||||
:remote => true, :method => :post,
|
||||
:url => {:controller => 'contests',
|
||||
:action => 'create',
|
||||
|
@ -28,52 +13,24 @@
|
|||
</div>
|
||||
|
||||
<% if User.current.logged? %>
|
||||
<table border="0" width="525px" align="center" >
|
||||
<tr>
|
||||
|
||||
<!-- modified by longjun 修改格式 -->
|
||||
<td>
|
||||
<%= f.text_area 'message',
|
||||
:rows => 3,
|
||||
:cols => 65,
|
||||
:placeholder => l(:label_my_respond),
|
||||
:style => "resize: none;",
|
||||
:class => 'noline'
|
||||
:style => "resize: none; width: 98%",
|
||||
:class => 'noline',
|
||||
:maxlength => 250
|
||||
%>
|
||||
</td>
|
||||
<!-- end longjun -->
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<%= f.text_field :reference_user_id, :style=>"display:none"%> <!--what function?-->
|
||||
|
||||
<!-- 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 -->
|
||||
<%= 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;"%>
|
||||
<% else %>
|
||||
<div style="font-size: 14px;margin:10px;padding-left: 13px">
|
||||
<%= l(:label_user_login_tips) %>
|
||||
<%= link_to l(:label_user_login_new), signin_path %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
|
@ -165,7 +165,7 @@
|
|||
: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) %>)
|
||||
</span>
|
||||
</tr>
|
||||
|
|
|
@ -313,3 +313,4 @@
|
|||
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false %>
|
||||
</div>
|
||||
<% html_title(l(:label_contest_joincontest)) -%>
|
||||
|
||||
|
|
|
@ -4,5 +4,41 @@
|
|||
<%= render :partial => 'contest_jours',
|
||||
: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)) -%>
|
||||
|
|
|
@ -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;">
|
||||
<%= text_field_tag :class_period, @course.class_period, :placeholder => "#{l(:lable_input_class)}", :maxlength => 5 %>
|
||||
</span>
|
||||
<span> <strong><%= l(:label_class_hour) %></strong></span>
|
||||
<span>
|
||||
<strong>
|
||||
<%= l(:label_class_hour) %>
|
||||
|
@ -59,7 +60,17 @@
|
|||
<td>
|
||||
<span class="info" align="right" style="width: 90px; font-weight: bold ;margin-left:22px">
|
||||
<%= l(:label_class_period) %>
|
||||
<span class="required"> * </span>
|
||||
<span class="info" align="right" style="width: 90px; font-weight: bold ;margin-left:22px">
|
||||
<%= l(:label_class_period) %>
|
||||
<span class="required">
|
||||
*
|
||||
</span>
|
||||
</span>
|
||||
<span class="info" align="right" style="width: 90px; font-weight: bold ;margin-left:22px">
|
||||
<%= l(:label_class_period) %>
|
||||
<span class="required">
|
||||
*
|
||||
</span>
|
||||
</span>
|
||||
<span class="info" style="width: 10px;">
|
||||
<%= text_field_tag :class_period, nil, :placeholder => "#{l(:lable_input_class)}", :maxlength => 5 %>
|
||||
|
@ -67,6 +78,7 @@
|
|||
<strong>
|
||||
<%= l(:label_class_hour) %>
|
||||
</strong>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
@ -124,12 +136,19 @@
|
|||
<%= f.check_box :is_public, :style => "margin-left:10px;" %>
|
||||
<%= l(:label_course_public_info) %>
|
||||
</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;">
|
||||
<%= f.text_field :course_type, :value => 1 %>
|
||||
</p>
|
||||
<%= wikitoolbar_for 'course_description' %>
|
||||
<% @course.custom_field_values.each do |value| %>
|
||||
<p><%= custom_field_tag_with_label :course, value %></p>
|
||||
<p>
|
||||
<%= custom_field_tag_with_label :course, value %>
|
||||
</p>
|
||||
|
|
|
@ -17,13 +17,14 @@
|
|||
<%= f.text_area 'course_message', :rows => 3, :cols => 65,
|
||||
:placeholder => "#{l(:label_welcome_my_respond)}",
|
||||
: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;"%>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
||||
<div id="history">
|
||||
<%= render :partial => 'history',:locals => { :contest => @contest, :journals => @jour, :state => false} %>
|
||||
</div>
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
<% end %>
|
||||
<% if reply_allow %>
|
||||
<%= 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 %>
|
||||
</span>
|
||||
|
|
|
@ -49,6 +49,10 @@
|
|||
<%= f.select :proportion, proportion_option %>
|
||||
</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%>
|
||||
<span id="bid_evaluation_num_span">匿评分配数量不宜太大,否则会影响开启匿评速度</span>
|
||||
</p>
|
||||
|
|
|
@ -62,8 +62,8 @@
|
|||
<input class=" width190" type="password" name="course_password" id="course_password" value="" >
|
||||
</li>
|
||||
<li>
|
||||
<a href="#" class="btn" 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: 50px;" onclick="submit_form(this);"><%= l(:label_new_join) %></a>
|
||||
<a href="#" class="btn" style="margin-left: 20px;" onclick="hideModal(this);"><%= l(:button_cancel)%></a>
|
||||
</li>
|
||||
</ul>
|
||||
<% end%>
|
||||
|
|
|
@ -5,10 +5,11 @@
|
|||
</style>
|
||||
<%= javascript_include_tag 'attachments' %>
|
||||
<!-- fq -->
|
||||
<!--modified by huang-->
|
||||
<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))%>
|
||||
<%= link_to(l(:label_course_homework_new), {:controller => 'courses', :action => 'new_homework'}, :class => 'icon icon-add') %>
|
||||
<% else %>
|
||||
<span class="font_lighter"><%= l(:label_coursejoin_tip) %></span>
|
||||
<% end %>
|
||||
</div>
|
||||
<div id="bid-show">
|
||||
|
|
|
@ -43,6 +43,8 @@
|
|||
{
|
||||
var evaluation_num = $.trim($("#bid_evaluation_num").val());
|
||||
var regex = /^\d+$/;
|
||||
if($("#bid_open_anonymous_evaluation").attr("checked") == "checked")
|
||||
{
|
||||
if(evaluation_num=="")
|
||||
{
|
||||
$("#bid_evaluation_num_span").text("匿评分配数量不能为空");
|
||||
|
@ -71,6 +73,24 @@
|
|||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
$(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()
|
||||
{
|
||||
|
|
|
@ -20,8 +20,8 @@
|
|||
<% members.each do |member| %>
|
||||
<% next if member.new_record? %>
|
||||
<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="roles">
|
||||
<td class="<%= member.principal.class.name.downcase %>" style="text-align: center"><%= link_to_user member.principal %></td>
|
||||
<td class="roles" style="text-align: center">
|
||||
<span id="member-<%= member.id %>-roles">
|
||||
<%= h member.roles.sort.collect(&:to_s).join(', ') %>
|
||||
</span>
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
|
||||
<% if @events_by_day != nil && @events_by_day.size >0 %>
|
||||
<div class="content-title-top-avtive">
|
||||
<p class="subtitle">
|
||||
|
@ -98,8 +99,6 @@
|
|||
</table>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
|
||||
</div>
|
||||
<%else%>
|
||||
<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(' '.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 %>
|
||||
<% sufixtypes = @course.contenttypes %>
|
||||
|
||||
<span class="borad-title"><%= t(:label_user_course) %>资源共享区</span>
|
||||
|
||||
<div class="content-title-top">
|
||||
<%= stylesheet_link_tag 'resource', :media => 'all' %>
|
||||
<script>
|
||||
function show_upload()
|
||||
{
|
||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'upload_show',:locals => {:course => @course}) %>');
|
||||
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");
|
||||
}
|
||||
|
||||
<%#= 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>
|
||||
function closeModal()
|
||||
{
|
||||
hideModal($("#popbox_upload"));
|
||||
}
|
||||
|
||||
<div id="relation_file_div" class="relation_file_div hidden">
|
||||
<fieldset>
|
||||
<legend>搜索</legend>
|
||||
<%= form_tag(
|
||||
attachments_autocomplete_path(:format => 'js'),
|
||||
:remote => true,
|
||||
:method => :post) do %>
|
||||
<%= label_tag(:attach_search, "按关键字搜索:") %>
|
||||
<%= text_field_tag(:attach_search) %>
|
||||
<%#= submit_tag("Search") %>
|
||||
<% end -%>
|
||||
<%= form_tag course_attach_relation_path(:format => 'js'),
|
||||
method: :post,
|
||||
remote: true,
|
||||
id: "relation_file_form",
|
||||
:class => 'hidden' do %>
|
||||
<%= hidden_field_tag(:class_name, 'course') %>
|
||||
<%= hidden_field_tag(:class_id, params[:course_id]) %>
|
||||
<div id="relation_file">
|
||||
</div>
|
||||
<div class="kclearfix" style='margin-top: 10px;'>
|
||||
<%= submit_tag(l(:button_add)) -%>
|
||||
</div>
|
||||
<% end -%>
|
||||
</fieldset>
|
||||
<div class="line_under" style="margin:20px 0px;"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box" id="files-box">
|
||||
<label for="files-box" style="font-weight:bold;"> <%= l(:label_files_filter) %></label>
|
||||
<% if attachmenttypes.any? %>
|
||||
|
||||
<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"),
|
||||
:onchange => "course_attachmenttypes_searchex(this.value)" %>
|
||||
</script>
|
||||
|
||||
<div class="container">
|
||||
<div class="resource"><!--资源库内容开始--->
|
||||
<div class="re_top">
|
||||
<%= form_tag( search_course_files_path(@course), method: 'get',:class => "re_search f_l",:remote=>true) do %>
|
||||
<%= text_field_tag 'name', params[:name], name: "name", :class => 're_schbox',:style=>"padding: 0px"%>
|
||||
<%= submit_tag "课内搜索", :class => "re_schbtn b_dblue",:name => "incourse"%>
|
||||
<%= submit_tag "全站搜索", :class => "re_schbtn b_lblue",:name => "insite" %>
|
||||
<% end %>
|
||||
<% if sufixtypes.any? %>
|
||||
|
||||
<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)" %>
|
||||
<% if is_course_teacher(User.current,@course) %>
|
||||
<a href="javascript:void(0)" class="re_fabu f_r b_lblue" onclick="show_upload()">上传资源</a>
|
||||
<% end %>
|
||||
</div>
|
||||
</div><!---re_top end-->
|
||||
<div class="cl"></div>
|
||||
|
||||
<div class="re_con" id="course_list">
|
||||
<%= render :partial => 'course_list',:locals => {course: @course,all_attachments: @all_attachments,sort:@sort,order:@order,curse_attachments:@curse_attachments} %>
|
||||
</div><!---re_con end-->
|
||||
|
||||
</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>
|
||||
|
||||
<% 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">共有 <%= User.current.member_of_course?(course) ? all_attachments.count : 0 %> 个资源</p>
|
||||
<!-- <p class="f_r">
|
||||
<#% if @order == "asc" %>
|
||||
按 <#%= 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"} %> /
|
||||
<#%= 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"} %> /
|
||||
<a href="#" class="f_b c_grey">引用次数</a> 排序
|
||||
<#%else%>
|
||||
按 <#%= 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"} %> /
|
||||
<#%= 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"} %> /
|
||||
<a href="#" class="f_b c_grey">引用次数</a> 排序
|
||||
<#% 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) %> | 下载<%= file.downloads %> | 引用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? %>
|
||||
|
||||
<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)" %>
|
||||
<% end %>
|
||||
<% 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();">引 用</a><a href="javascript:void(0)" class="upload_btn upload_btn_grey" onclick="closeModal();">取 消</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();">取 消</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")%>');
|
||||
<%elsif @course%>
|
||||
$("#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 %>
|
||||
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
<!-- <h3> --><!-- %=l(:label_attachment_plural)%></h3 -->
|
||||
<div id="resource_list">
|
||||
<% if @isproject %>
|
||||
<%= render :partial => 'project_file', locals: {project: @project} %>
|
||||
<% else %>
|
||||
<%= render :partial => 'course_file', locals: {course: @course} %>
|
||||
<% end %>
|
||||
|
||||
</div>
|
||||
|
||||
<script type='text/javascript'>
|
||||
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 %>
|
||||
<div style="width: 120%;">
|
||||
<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>
|
||||
<script src="http://<%= Setting.host_name%>/javascripts/ckeditor/ckeditor.js?1404953555" type="text/javascript"></script>
|
||||
|
@ -24,7 +36,9 @@
|
|||
</p>
|
||||
<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 class="actions" style=" padding-top: 10px; float:right">
|
||||
<%= submit_tag l(:button_submit) %>
|
||||
|
|
|
@ -7,15 +7,51 @@
|
|||
<%= 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 class="forums-index-content">
|
||||
<p ><%= link_to h(forum.name), forum_path(forum) %></p>
|
||||
<p ><%= textAreailizable forum.description%></p>
|
||||
<p ><%= authoring forum.created_at, forum.creator %></p></div>
|
||||
<table class="content-text-list" style="table-layout: fixed;">
|
||||
<tr>
|
||||
<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">
|
||||
<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>
|
||||
<tr align="center"><td>回答</td><td>帖子</td></tr></table></div>
|
||||
<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>
|
||||
<tr align="center">
|
||||
<td>回答</td>
|
||||
<td>帖子</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="pagination"><%= pagination_links_full @forums_pages, @forums_count %></div>
|
||||
<div class="pagination">
|
||||
<%= pagination_links_full @forums_pages, @forums_count %>
|
||||
</div>
|
||||
<% else %>
|
||||
<% end %>
|
||||
</div>
|
|
@ -7,7 +7,11 @@
|
|||
<table width="940px">
|
||||
<tr>
|
||||
<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">
|
||||
<% if User.current.logged? %>
|
||||
<%= link_to( l(:label_forum_new), new_forum_path, :class => 'icon icon-add') %>
|
||||
|
@ -23,8 +27,15 @@
|
|||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding-left: 8px"><a><%= link_to request.host()+"/forums", forums_path %> </a></td>
|
||||
<td ><%= link_to l(:field_homepage), home_path %> > <%= link_to "公共贴吧", forums_path %></td>
|
||||
<td style="padding-left: 8px">
|
||||
<a>
|
||||
<%= link_to request.host()+"/forums", forums_path %>
|
||||
</a>
|
||||
</td>
|
||||
<td >
|
||||
<%= link_to l(:field_homepage), home_path %> >
|
||||
<%= link_to "公共贴吧", forums_path %>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
|
|
@ -1,15 +1,24 @@
|
|||
<!-- added by fq -->
|
||||
<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? %>
|
||||
<%= labelled_form_for(@memo, :url => create_memo_forum_path(@forum), :html => {:multipart => true} ) do |f| %>
|
||||
<div class="actions" style="max-width:680px">
|
||||
<p><%= f.text_field :subject, :required => true%></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>
|
||||
<p style="color: #ff0000">(<%= l(:label_memos_max_length) %>)</p>
|
||||
<p>
|
||||
<%= l(:label_attachment_plural) %><br />
|
||||
<%= 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>
|
||||
<p style="color: #ff0000">
|
||||
(<%= l(:label_memos_max_length) %>)
|
||||
</p>
|
||||
<p>
|
||||
<%= l(:label_attachment_plural) %>
|
||||
<br />
|
||||
<%= render :partial => 'attachments/form', :locals => {:container => @memo} %>
|
||||
</p>
|
||||
<%= f.submit :value => l(:label_memo_create) %>
|
||||
|
|
|
@ -69,7 +69,9 @@
|
|||
|
||||
<% if User.current.logged? %>
|
||||
<%= 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"%>
|
||||
<div style="float:right">
|
||||
<a href="#" class="ping_sub1" id="jours_submit" onclick="submit1();"><%= l(:label_submit_comments) %></a>
|
||||
|
|
|
@ -35,13 +35,13 @@
|
|||
</span>
|
||||
</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">
|
||||
<%= link_to "提交作业", new_exercise_book_path(@bid), :style => "width:80px; margin:20px 0 0 350px;" %>
|
||||
</li>
|
||||
<% else %>
|
||||
<li class="wping" title="只有开启匿评之前才能创建作业哦!">
|
||||
<li class="wping" title="匿评阶段不可提交作业!">
|
||||
<a style="width:80px; margin:20px 0 0 350px;background:#8e8e8e;">提交作业</a>
|
||||
</li>
|
||||
<% end %>
|
||||
|
|
|
@ -1,6 +1,42 @@
|
|||
<% reply_allow = JournalsForMessage.create_by_user? User.current %>
|
||||
|
||||
|
||||
<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[
|
||||
function g(o){return document.getElementById(o);}
|
||||
function HoverLi(n){
|
||||
|
|
|
@ -30,8 +30,13 @@
|
|||
<% if @issue.safe_attribute? 'subject' %>
|
||||
<p><%= f.text_field :subject, :size => 80, :maxlength => 255, :required => true, :style => "font-size:small" %></p>
|
||||
<!--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))}')" %>
|
||||
<!--Ended by young-->
|
||||
<%= javascript_tag do %>
|
||||
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 %>
|
||||
|
||||
|
|
|
@ -41,9 +41,9 @@
|
|||
<% end %>
|
||||
</div>
|
||||
|
||||
<%= submit_tag l(:button_create) %>
|
||||
<%= submit_tag l(:button_create_and_continue), :name => 'continue' %>
|
||||
<%= preview_link preview_new_issue_path(:project_id => @project), 'issue-form' %>
|
||||
<%= submit_tag l(:button_create), :class => "ButtonAddTags"%>
|
||||
<%= submit_tag l(:button_create_and_continue), :class => 'ButtonAddTags' %>
|
||||
<%= preview_link preview_new_issue_path(:project_id => @project), 'issue-form','preview',{:class => "ButtonColor"}%>
|
||||
|
||||
<%= javascript_tag "$('#issue_subject').focus();" %>
|
||||
<% end %>
|
||||
|
|
|
@ -38,7 +38,6 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="debug">
|
||||
<%= debug(params) if Rails.env.development? %>
|
||||
<div class="hidden">
|
||||
|
|
|
@ -74,13 +74,13 @@
|
|||
|
||||
<script type="text/javascript">
|
||||
function setMessageCount () {
|
||||
var mes = $('#loggedas .my-message')
|
||||
mes.html(mes.html()+ '(' + <%=User.current.count_new_jour.to_s%> + ")")
|
||||
var mes = $('#loggedas .my-message');
|
||||
mes.html(mes.html()+ '(' + <%=User.current.count_new_jour.to_s%> + ")");
|
||||
}
|
||||
|
||||
function addSlipMenu () {
|
||||
var loggedas = $('#loggedas ul li:first')
|
||||
var sub_menu = $('.sub_menu')
|
||||
var loggedas = $('#loggedas ul li:first');
|
||||
var sub_menu = $('.sub_menu');
|
||||
loggedas.mouseenter(function(event) {
|
||||
sub_menu.show();
|
||||
});
|
||||
|
@ -90,9 +90,9 @@
|
|||
}
|
||||
|
||||
function addProjectSlipMenu () {
|
||||
var loggedas = $('#project_loggedas_li')
|
||||
var project_sub_menu = $('.project_sub_menu')
|
||||
var course_sub_menu = $('.course_sub_menu')
|
||||
var loggedas = $('#project_loggedas_li');
|
||||
var project_sub_menu = $('.project_sub_menu');
|
||||
var course_sub_menu = $('.course_sub_menu');
|
||||
loggedas.mouseenter(function(event) {
|
||||
course_sub_menu.hide();
|
||||
project_sub_menu.show();
|
||||
|
@ -102,9 +102,9 @@
|
|||
});
|
||||
}
|
||||
function addCourseSlipMenu () {
|
||||
var loggedas = $('#course_loggedas_li')
|
||||
var project_sub_menu = $('.project_sub_menu')
|
||||
var course_sub_menu = $('.course_sub_menu')
|
||||
var loggedas = $('#course_loggedas_li');
|
||||
var project_sub_menu = $('.project_sub_menu');
|
||||
var course_sub_menu = $('.course_sub_menu');
|
||||
loggedas.mouseenter(function(event) {
|
||||
project_sub_menu.hide();
|
||||
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 () {
|
||||
addSlipMenu();
|
||||
addProjectSlipMenu ();
|
||||
|
|
|
@ -67,11 +67,18 @@ end
|
|||
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><%=User.current%> <b class="caret"></b></a>
|
||||
<ul class="dropdown-menu">
|
||||
<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>
|
||||
<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>
|
||||
<%=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>
|
||||
<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><%=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>
|
||||
</li>
|
||||
<%= bootstrap_render_menu :account_menu -%>
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
<% if hasCourse %>
|
||||
<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">
|
||||
<% course_index = 0 %>
|
||||
<% User.current.courses.each do |course| %>
|
||||
<% if !course_endTime_timeout?(course) %>
|
||||
<li style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;" title="<%=course.name%>">
|
||||
<%= link_to course.name, {:controller => 'courses',:action => 'show',id:course.id} %>
|
||||
</li>
|
||||
<%= render :partial => 'layouts/user_homework_list', :locals => {:course => course,:course_index => course_index} %>
|
||||
<% course_index += 1 %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</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>
|
||||
<!--add by huang-->
|
||||
<body class="<%= h body_css_classes %>">
|
||||
<!-- <#%= render :partial => 'courses/course_ad' %> -->
|
||||
<div id="wrapper">
|
||||
<div id="wrapper2">
|
||||
<div id="wrapper3">
|
||||
|
@ -121,7 +122,7 @@
|
|||
<% end%>
|
||||
</td>
|
||||
<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' %>
|
||||
<% else %>
|
||||
<span>
|
||||
|
@ -272,7 +273,7 @@
|
|||
<%= link_to l(:label_course_overview), course_path(@course), :class => link_class(:overview) %>
|
||||
</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>
|
||||
<%= 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) %>
|
||||
<tr>
|
||||
<td valign="top" style="padding-left: 8px; font-size: 15px" colspan="2">
|
||||
<% if @bid.open_anonymous_evaluation == 1%>
|
||||
<span id="<%=@bid.id %>_anonymous_comment">
|
||||
<% case @bid.comment_status %>
|
||||
<% when 0 %>
|
||||
|
@ -116,6 +117,7 @@
|
|||
匿评结束
|
||||
<% end %>
|
||||
</span>
|
||||
<%end%>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
|
|
|
@ -95,7 +95,7 @@
|
|||
<td align="center" width="70px"> <%= l(:label_member) %></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="58px"><%= l(:label_attachment) %></td> -->
|
||||
<!-- <td align="center" width="58px"><%#= l(:label_attachment) %></td> -->
|
||||
</tr>
|
||||
</table>
|
||||
<div class="user_underline"></div>
|
||||
|
|
|
@ -21,6 +21,9 @@
|
|||
<%= call_hook :view_layouts_base_html_head %>
|
||||
<!-- page specific tags -->
|
||||
<%= yield :header_tags -%>
|
||||
<% title1 = @user.user_extensions.technical_title %>
|
||||
<% language1 = @user.language %>
|
||||
|
||||
<script type="text/javascript">
|
||||
function startXMLHttp()
|
||||
{
|
||||
|
@ -36,11 +39,55 @@
|
|||
{
|
||||
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>
|
||||
|
||||
</head>
|
||||
<!--加上 onload="Javascript:t()" 开始定时刷新分数 -->
|
||||
<body class="<%= h body_css_classes %>">
|
||||
<body class="<%= h body_css_classes %>" onload="init_title()" >
|
||||
<div id="wrapper">
|
||||
<div id="wrapper2">
|
||||
<div id="wrapper3">
|
||||
|
@ -176,45 +223,73 @@
|
|||
</td>
|
||||
</tr>
|
||||
<% unless @user.user_extensions.nil? %>
|
||||
<% unless @user.user_extensions.identity == 2 %>
|
||||
<% if @user.user_extensions.identity == 0 || @user.user_extensions.identity == 1 %>
|
||||
<tr>
|
||||
<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? %>
|
||||
<a href="http://course.trustie.net/?school_id=<%= @user.user_extensions.school.id%>"><%= @user.user_extensions.school.name %></a>
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
<% 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>
|
||||
<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>
|
||||
<% if @user.user_extensions.identity == 0 %>
|
||||
<td style="padding-left: 5px" width="76px">
|
||||
<%= l(:label_technical_title) %>:
|
||||
<td style="padding-left: 31px" width="76px" >
|
||||
<%= l(:label_technical_title) %>:
|
||||
</td>
|
||||
<td class="font_lighter_sidebar" style="padding-left: 0px" width="170px">
|
||||
<%= @user.user_extensions.technical_title %>
|
||||
<span id = "td_tech_title"></span>
|
||||
</td>
|
||||
<% end %>
|
||||
</tr>
|
||||
<% if( (@user.user_extensions.identity == 1) && (is_watching?(@user) ) )%>
|
||||
<% if @user.user_extensions.identity == 1 %>
|
||||
<% if(is_watching?(@user) ) %>
|
||||
<tr>
|
||||
<td style="padding-left: 8px" width="70px">
|
||||
<%= l(:label_bidding_user_studentcode)%>:
|
||||
<td style="padding-left: 31px" width="70px" >
|
||||
<%= l(:label_bidding_user_studentcode)%>:
|
||||
</td>
|
||||
<td class="font_lighter_sidebar" style="padding-left: 0px" width="170px">
|
||||
<%= @user.user_extensions.student_id %>
|
||||
</td>
|
||||
</tr>
|
||||
<% else %>
|
||||
<tr>
|
||||
<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_student) %>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<% end %>
|
||||
<% else%>
|
||||
<% elsif @user.user_extensions.identity == 3 %>
|
||||
<tr>
|
||||
<td style="padding-left: 8px" width="70px"><%= l(:field_occupation) %>:</td>
|
||||
</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>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<!-- end -->
|
||||
</table>
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
<%= error_messages_for 'bid' %>
|
||||
<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| %>
|
||||
<%= 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 :parent_id, :required => true, value: @memo.id %>
|
||||
<div id="message_quote" class="wiki"></div>
|
||||
|
@ -7,10 +7,11 @@
|
|||
<%= hidden_field_tag :quote,"",:required => false,:style => 'display:none' %>
|
||||
<%= label_tag(l(:label_reply_plural)) %>:
|
||||
<!-- <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>
|
||||
<p><%= l(:label_attachment_plural) %><br />
|
||||
<p>
|
||||
<%= l(:label_attachment_plural) %>
|
||||
<br />
|
||||
<%= render :partial => 'attachments/form' %>
|
||||
</p>
|
||||
<%= f.submit value: l(:label_reply_plural), class: "replies" %>
|
||||
|
|
|
@ -4,30 +4,43 @@
|
|||
<%= labelled_form_for(@memo, :url => forum_memo_path(@memo.forum_id, @memo)) do |f| %>
|
||||
<% if @memo.errors.any? %>
|
||||
<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>
|
||||
<% @memo.errors.full_messages.each do |msg| %>
|
||||
<li><%= msg %></li>
|
||||
<li>
|
||||
<%= msg %>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="actions">
|
||||
<p><%= f.text_field :subject, :required => true, :size => 96 ,:readonly => @replying%></p>
|
||||
<p>
|
||||
<%= f.text_field :subject, :required => true, :size => 96 ,:readonly => @replying, :maxlength => 50%>
|
||||
</p>
|
||||
<% if User.current.admin?%>
|
||||
<p>
|
||||
<% unless @replying %>
|
||||
<% if @memo.safe_attribute? 'sticky' %>
|
||||
<%= f.check_box :sticky %> <%= label_tag 'memo_sticky', l(:label_board_sticky) %>
|
||||
<%= f.check_box :sticky %>
|
||||
<%= 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>
|
||||
<p><%= f.text_area :content, :required => true, :size => 80, id: 'editor01' %></p>
|
||||
<% end %>
|
||||
<p>
|
||||
<%= f.text_area :content, :required => true, :size => 80, id: 'editor01' %>
|
||||
</p>
|
||||
<script type="text/javascript">var ckeditor=CKEDITOR.replace('editor01');</script>
|
||||
<p>
|
||||
<%= l(:label_attachment_plural) %><br />
|
||||
<%= l(:label_attachment_plural) %>
|
||||
<br />
|
||||
<%= render :partial => 'attachments/form', :locals => {:container => @memo} %>
|
||||
</p>
|
||||
<br/>
|
||||
|
|
|
@ -1,3 +1,9 @@
|
|||
<style type="text/css">
|
||||
.reply_content p {
|
||||
margin-top: 13px;
|
||||
margin-bottom: 13px;
|
||||
}
|
||||
</style>
|
||||
<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>
|
||||
|
@ -111,13 +117,15 @@
|
|||
|
||||
</div>
|
||||
<br/>
|
||||
<table class="borad-text-list">
|
||||
<table class="borad-text-list" style="table-layout: fixed;">
|
||||
<tr>
|
||||
<td rowspan="3" valign="top" width="60px">
|
||||
<%= link_to image_tag(url_to_avatar(reply.author), :class => "avatar"), user_path(reply.author) %>
|
||||
</td>
|
||||
<td class="comments">
|
||||
<div class="reply_content" ><%=h sanitize(reply.content.html_safe) %></div>
|
||||
<td class="comments" style="word-wrap: break-word;word-break: break-all;">
|
||||
<div class="reply_content" >
|
||||
<%=h sanitize(reply.content.html_safe) %>
|
||||
</div>
|
||||
<p>
|
||||
<% if reply.attachments.any?%>
|
||||
<% options = {:author => true, :deletable => reply.deleted_attach_able_by?(User.current) } %>
|
||||
|
@ -127,12 +135,16 @@
|
|||
</td>
|
||||
</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>
|
||||
</table>
|
||||
</div>
|
||||
<% 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>
|
||||
|
||||
<% if User.current.login? %>
|
||||
|
|
|
@ -106,7 +106,11 @@
|
|||
<%= authoring @topic.created_on, @topic.author %>
|
||||
</div>
|
||||
<div style="float: right">
|
||||
<% 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>
|
||||
|
|
|
@ -111,7 +111,11 @@
|
|||
<%= authoring @topic.created_on, @topic.author %>
|
||||
</div>
|
||||
<div style="float: right">
|
||||
<% 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>
|
||||
|
|
|
@ -3,11 +3,53 @@
|
|||
@nav_dispaly_main_project_label = 1
|
||||
@nav_dispaly_main_contest_label = 1 %>
|
||||
<% @nav_dispaly_forum_label = 1%>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(
|
||||
function () {
|
||||
$("#province").attr("href", "#WOpenWindow")
|
||||
$("#province").leanModal({top: 100, closeButton: ".modal_close"});
|
||||
var $lastname = $('#user_lastname')
|
||||
var $firstname = $('#user_firstname')
|
||||
var $enterprise = $('#enterprise_name')
|
||||
$lastname.blur(function () {
|
||||
var pas1 = document.getElementById("user_lastname").value;
|
||||
|
||||
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>
|
||||
|
@ -43,6 +85,7 @@
|
|||
<%= labelled_form_for :user, @user,
|
||||
:url => {:action => "account"},
|
||||
:html => {:id => 'my_account_form',
|
||||
|
||||
:method => :post} do |f| %>
|
||||
<fieldset class="collapsible collapsed" style="width:800px;margin-left: 10px;">
|
||||
<legend onclick="toggleFieldset(this);">
|
||||
|
@ -59,70 +102,129 @@
|
|||
<%= l(:label_information_plural) %>
|
||||
</legend>
|
||||
|
||||
|
||||
<div>
|
||||
<!-- 昵称 -->
|
||||
<p style="width:630px;padding-left: 26px;">
|
||||
<%= f.text_field :login, :required => true, :name => "login"%>
|
||||
<p style="width:630px;padding-left: 40px;">
|
||||
<%= f.text_field :login, :required => true, :size => 25, :name => "login", :readonly => true %>
|
||||
<span class='font_lighter'><%= l(:label_max_number) %></span>
|
||||
<br/>
|
||||
</p>
|
||||
|
||||
<div>
|
||||
<span id='name' style='display:none'>
|
||||
<p style="width:530px;padding-left: 26px;">
|
||||
<%= f.text_field :lastname, :required => true %>
|
||||
<span class='font_lighter'>
|
||||
<%= l(:field_lastname_eg) %>
|
||||
<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>
|
||||
<p style="width:530px;padding-left: 26px;">
|
||||
<%= f.text_field :firstname, :required => true %>
|
||||
<span class='font_lighter'>
|
||||
<span id='name' style='display:none'>
|
||||
<p style="width:530px;padding-left: 53px;">
|
||||
<%= f.text_field :lastname, :size => 25, :required => true %>
|
||||
<span class='font_lighter' id="lastname_limit">
|
||||
<%= l(:field_lastname_eg) %>
|
||||
</span>
|
||||
<span id="valid_lastname"></span>
|
||||
</p>
|
||||
<p style="width:530px;padding-left: 53px;">
|
||||
<%= f.text_field :firstname, :size => 25, :required => true %>
|
||||
<span class='font_lighter' id="firstname_limit">
|
||||
<%= l(:field_firstname_eg) %>
|
||||
</span>
|
||||
<span id="valid_firstname"></span>
|
||||
</p>
|
||||
</span>
|
||||
|
||||
<span id='enterprise' style='display:none'>
|
||||
<p style="width:400px;padding-left: 26px;">
|
||||
<%= l(:label_company_name)%>
|
||||
<p style="width:400px;padding-left: 39px;">
|
||||
<%= l(:label_company_name)%><span style="color: #bb0000"> *</span>
|
||||
<%= text_field_tag :enterprise_name, @user.firstname %>
|
||||
<span id="valid_companyname"></span>
|
||||
</p>
|
||||
</span>
|
||||
|
||||
<!-- added by bai 增加账户里的性别-->
|
||||
<span id='gender' style='display:none'>
|
||||
<% if @user.user_extensions.nil? %>
|
||||
<p style="width:400px;padding-left: 26px;">
|
||||
<p style="width:400px;padding-left: 54px;">
|
||||
<%= l(:label_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>
|
||||
<% else %>
|
||||
<% 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) %>
|
||||
<%= select_tag 'gender', "<option value = '0'>#{l(:label_gender_male)}</option><option value = '1'>#{l(:label_gender_female)}</option>".html_safe, :class => 'gender' %>
|
||||
</p>
|
||||
<% else %>
|
||||
<p style="width:400px;padding-left: 26px;">
|
||||
<p style="width:400px;padding-left: 54px;">
|
||||
<%= l(:label_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>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- added by Wen -->
|
||||
<p style="padding-left: 26px;">
|
||||
<% if User.current.user_extensions.school.nil? %>
|
||||
<%= l(:field_occupation) %>
|
||||
<span class="required">*</span>
|
||||
<input id="province" name="province" type="text" value="请单击选择省份及学校" readonly>
|
||||
<input id="occupation" name="occupation" type="hidden"/>
|
||||
<input id="occupation_name" type="text" readonly/>
|
||||
<p id="occupation_detail" style="padding-left: 24px; display: none">
|
||||
|
||||
<%= l(:field_occupation) %>
|
||||
<span class="required"> </span>
|
||||
<% if User.current.user_extensions.nil? %>
|
||||
<input id="province" name="province" style="display: none" type="text" value="请单击选择省份及学校" readonly>
|
||||
<input id="occupation" name="occupation" style="display: none" type="text" value="" />
|
||||
<input id="occupation_name" type="text" style="display: none" readonly/>
|
||||
<% else %>
|
||||
<%= l(:field_occupation) %> <span class="required">*</span>
|
||||
<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="occupation_name" type="text" value="<%= User.current.user_extensions.school.name %>" readonly="true" style="background-color: #E2E2E2;"/>
|
||||
<% if User.current.user_extensions.identity == 3 || User.current.user_extensions.identity == 2 %>
|
||||
|
||||
<input id="province" name="province" style="display: none" type="text" value="请单击选择省份及学校" readonly>
|
||||
<input id="occupation" name="occupation" style="display: none" type="text" value="<%= @user.user_extensions.occupation %>" />
|
||||
<input id="occupation_name" type="text" style="display: none" readonly/>
|
||||
<% elsif User.current.user_extensions.school.nil? %>
|
||||
|
||||
<input id="province" name="province" style="display: none" type="text" value="请单击选择省份及学校" readonly>
|
||||
<input id="occupation" name="occupation" style="display: none" type="text" />
|
||||
<input id="occupation_name" type="text" style="display: none" readonly/>
|
||||
<% else %>
|
||||
|
||||
<input id="province" name="province" style="display: none" type="text" value="<%= User.current.user_extensions.school.province %>" readonly/>
|
||||
<input id="occupation" name="occupation" type="text" style="display: none" value="<%= User.current.user_extensions.school.id %>"/>
|
||||
<input id="occupation_name" type="text" style="display: none" value="<%= User.current.user_extensions.school.name %>" readonly="true" style="background-color: #E2E2E2;"/>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</p>
|
||||
|
||||
|
@ -164,21 +266,31 @@
|
|||
|
||||
<!-- end -->
|
||||
|
||||
<p style="width:357px;padding-left: 26px;">
|
||||
<p style="width:357px;padding-left: 27px;">
|
||||
<%= f.text_field :mail, :required => true %>
|
||||
</p>
|
||||
|
||||
<p style="width:426px;padding-left:26px;">
|
||||
<p style="width:426px;padding-left:54px;">
|
||||
<%= f.select :language, :Chinese => :zh, :English => :en %>
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
<% if !User.current.user_extensions.nil? %>
|
||||
<% province = User.current.user_extensions.location %>
|
||||
<% city = User.current.user_extensions.location_city %>
|
||||
<% identity = User.current.user_extensions.identity %>
|
||||
<% occupation1 = User.current.user_extensions.occupation %>
|
||||
<% occupation = User.current.user_extensions.occupation %>
|
||||
<% title = User.current.user_extensions.technical_title %>
|
||||
<% language = User.current.language %>
|
||||
<% else %>
|
||||
<% province = "湖南省" %>
|
||||
<% city = "长沙"%>
|
||||
<% identity = ""%>
|
||||
<% occupation1 = ""%>
|
||||
<% title = "" %>
|
||||
<% language = ""%>
|
||||
<% end %>
|
||||
<script type="text/javascript" language="javascript">
|
||||
$().ready(function () {
|
||||
var province = "<%= "#{province}" %>"
|
||||
|
@ -187,12 +299,14 @@
|
|||
var identity = "<%= "#{identity}" %>"
|
||||
var title = "<%= "#{title}" %>"
|
||||
var language = "<%= "#{language}" %>"
|
||||
var occupation1 = "<%= "#{occupation}" %>"
|
||||
|
||||
init_identity_and_title(document.getElementById('userIdentity'), identity, document.getElementById('userTechnical_title'), title, language);
|
||||
|
||||
});
|
||||
</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">
|
||||
<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>
|
||||
|
||||
|
||||
|
@ -528,6 +589,7 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
function init_identity_and_title(pField, identity, cField, title, language) {
|
||||
for (var i = 0; i < pField.options.length; i++) {
|
||||
if (pField.options[i].value == identity) {
|
||||
|
@ -590,6 +652,11 @@
|
|||
$('#name').show()
|
||||
$('#enterprise').hide()
|
||||
$('#gender').show()
|
||||
$('#occupation_detail').show()
|
||||
$('input#province').show()
|
||||
$('input#occupation_name').show()
|
||||
$('input#occupation').hide()
|
||||
|
||||
var technical_titleOptions = new Array(
|
||||
"<%= l(:label_technicl_title_professor) %>", "<%= l(:label_technicl_title_associate_professor) %>", "<%= l(:label_technicl_title_lecturer) %>", "<%= l(:label_technicl_title_teaching_assistant) %>");
|
||||
break;
|
||||
|
@ -600,7 +667,14 @@
|
|||
$('#name').show()
|
||||
$('#enterprise').hide()
|
||||
$('#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;
|
||||
|
||||
case '2' :
|
||||
|
@ -609,7 +683,25 @@
|
|||
$('#name').hide()
|
||||
$('#enterprise').show()
|
||||
$('#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;
|
||||
default:
|
||||
$('#technical_title').hide()
|
||||
|
@ -617,7 +709,10 @@
|
|||
$('#name').show()
|
||||
$('#enterprise').hide()
|
||||
$('#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;
|
||||
|
||||
|
|
|
@ -11,11 +11,13 @@
|
|||
</ul>
|
||||
</div>
|
||||
-->
|
||||
<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',
|
||||
:set_filter => 1,
|
||||
:assigned_to_id => 'me',
|
||||
:sort => 'priority:desc,updated_on:desc' %></p>
|
||||
:sort => 'priority:desc,updated_on:desc' %>
|
||||
</p>
|
||||
<% end %>
|
||||
<% content_for :header_tags do %>
|
||||
<%= auto_discovery_link_tag(:atom,
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<% reported_issues = issuesreportedbyme_items %>
|
||||
<%= render :partial => 'issues/list_simple', :locals => { :issues => reported_issues } %>
|
||||
<% 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',
|
||||
:set_filter => 1,
|
||||
:status_id => '*',
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
<%= render :partial => 'issues/list_simple', :locals => { :issues => watched_issues } %>
|
||||
<% 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',
|
||||
:set_filter => 1,
|
||||
:watcher_id => 'me',
|
||||
|
|
|
@ -74,10 +74,10 @@
|
|||
<%= labelled_form_for @news, :url => course_news_index_path(@course),
|
||||
:html => {:id => 'news-form', :multipart => true} do |f| %>
|
||||
<%= 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'} %>
|
||||
|
||||
<%= 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 %>
|
||||
<div id="preview" class="wiki"></div>
|
||||
</div>
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
<% end %>
|
||||
<% if reply_allow %>
|
||||
<%= 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 %>
|
||||
</span>
|
||||
|
|
|
@ -17,12 +17,12 @@
|
|||
<%= f.text_area 'project_message', :rows => 3, :cols => 65,
|
||||
:placeholder => "#{l(:label_welcome_my_respond)}",
|
||||
: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;"%>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div id="history">
|
||||
<%= render :partial => 'history',:locals => { :journals => @jour, :state => false} %>
|
||||
|
|
|
@ -11,6 +11,9 @@
|
|||
<% 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>
|
||||
<% 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><h3>进度跟踪</h3>
|
||||
<% 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…
Reference in New Issue