Conflicts: app/controllers/application_controller.rb app/views/attachments/upload.js.erb app/views/courses/_homework_form.html.erb app/views/layouts/base_courses.html.erb app/views/users/_my_joinedcourse.html.erb db/schema.rb lib/redmine.rb lib/redmine/access_control.rbCourseModify
commit
099e8a0912
@ -0,0 +1,2 @@
|
|||||||
|
// Place all the behaviors and hooks related to the matching controller here.
|
||||||
|
// All this logic will automatically be available in application.js.
|
@ -0,0 +1,3 @@
|
|||||||
|
# Place all the behaviors and hooks related to the matching controller here.
|
||||||
|
# All this logic will automatically be available in application.js.
|
||||||
|
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
|
@ -0,0 +1,4 @@
|
|||||||
|
/*
|
||||||
|
Place all the styles related to the matching controller here.
|
||||||
|
They will automatically be included in application.css.
|
||||||
|
*/
|
@ -0,0 +1,3 @@
|
|||||||
|
// Place all the styles related to the notificationcomments controller here.
|
||||||
|
// They will automatically be included in application.css.
|
||||||
|
// You can use Sass (SCSS) here: http://sass-lang.com/
|
@ -0,0 +1,187 @@
|
|||||||
|
class ContestnotificationsController < ApplicationController
|
||||||
|
# GET /contestnotifications
|
||||||
|
# GET /contestnotifications.json
|
||||||
|
layout 'base_newcontest'
|
||||||
|
default_search_scope :contestnotifications
|
||||||
|
model_object Contestnotification
|
||||||
|
# before_filter :find_model_object, :except => [:new, :create, :index]
|
||||||
|
# before_filter :find_contest_from_association, :except => [:new, :create, :index]
|
||||||
|
before_filter :find_contest_by_contest_id, :only => [:new, :create]
|
||||||
|
before_filter :find_contest
|
||||||
|
before_filter :find_author
|
||||||
|
# before_filter :authorize, :except => [:index]
|
||||||
|
before_filter :find_optional_contest, :only => [:index]
|
||||||
|
accept_rss_auth :index
|
||||||
|
accept_api_auth :index
|
||||||
|
|
||||||
|
before_filter :access_edit_destroy, only: [:edit ,:update, :destroy]
|
||||||
|
|
||||||
|
def find_author
|
||||||
|
@user = @contest.author
|
||||||
|
render_404 if @user.nil?
|
||||||
|
end
|
||||||
|
def find_contest
|
||||||
|
@contest = Contest.find(params[:contest_id])
|
||||||
|
render_404 if @contest.nil?
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
def index
|
||||||
|
|
||||||
|
# @contestnotifications = Contestnotification.all
|
||||||
|
#
|
||||||
|
# respond_to do |format|
|
||||||
|
# format.html # index.html.erb
|
||||||
|
# format.json { render json: @contestnotifications }
|
||||||
|
# end
|
||||||
|
|
||||||
|
### begin ###
|
||||||
|
case params[:format]
|
||||||
|
when 'xml', 'json'
|
||||||
|
@offset, @limit = api_offset_and_limit
|
||||||
|
else
|
||||||
|
@limit = 10
|
||||||
|
end
|
||||||
|
|
||||||
|
scope = @contest ? @contest.contestnotifications.visible : Contestnotifications.visible
|
||||||
|
|
||||||
|
@contestnotifications_count = scope.count
|
||||||
|
@contestnotifications_pages = Paginator.new @contestnotifications_count, @limit, params['page']
|
||||||
|
@offset ||= @contestnotifications_pages.offset
|
||||||
|
@contestnotificationss = scope.all(:include => [:author, :contest],
|
||||||
|
:order => "#{Contestnotification.table_name}.created_at DESC",
|
||||||
|
:offset => @offset,
|
||||||
|
:limit => @limit)
|
||||||
|
|
||||||
|
respond_to do |format|
|
||||||
|
format.html {
|
||||||
|
@contestnotification = Contestnotification.new # for adding news inline
|
||||||
|
render :layout => 'base_newcontest'
|
||||||
|
}
|
||||||
|
format.api
|
||||||
|
format.atom { render_feed(@contestnotificationss, :title => (@contest ? @contest.name : Setting.app_title) + ": #{l(:label_contest_notification)}") }
|
||||||
|
end
|
||||||
|
### end ###
|
||||||
|
end
|
||||||
|
|
||||||
|
# GET /contestnotifications/1
|
||||||
|
# GET /contestnotifications/1.json
|
||||||
|
def show
|
||||||
|
@contestnotification = Contestnotification.find(params[:id])
|
||||||
|
|
||||||
|
#
|
||||||
|
# respond_to do |format|
|
||||||
|
# format.html # show.html.erb
|
||||||
|
# format.json { render json: @contestnotification }
|
||||||
|
# end
|
||||||
|
@notificationcomments = @contestnotification.notificationcomments
|
||||||
|
@notificationcomments.reverse! if User.current.wants_notificationcomments_in_reverse_order?
|
||||||
|
render :layout => 'base_newcontest'
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
# GET /contestnotifications/new
|
||||||
|
# GET /contestnotifications/new.json
|
||||||
|
def new
|
||||||
|
# @contestnotification = Contestnotification.new
|
||||||
|
#
|
||||||
|
# respond_to do |format|
|
||||||
|
# format.html # new.html.erb
|
||||||
|
# format.json { render json: @contestnotification }
|
||||||
|
# end
|
||||||
|
@contestnotification = Contestnotification.new(:contest => @contest, :author => User.current)
|
||||||
|
render :layout => 'base_newcontest'
|
||||||
|
end
|
||||||
|
|
||||||
|
# GET /contestnotifications/1/edit
|
||||||
|
def edit
|
||||||
|
@contestnotification = Contestnotification.find(params[:id])
|
||||||
|
end
|
||||||
|
|
||||||
|
# POST /contestnotifications
|
||||||
|
# POST /contestnotifications.json
|
||||||
|
def create
|
||||||
|
# @contestnotification = Contestnotification.new(params[:contestnotification])
|
||||||
|
#
|
||||||
|
# respond_to do |format|
|
||||||
|
# if @contestnotification.save
|
||||||
|
# format.html { redirect_to @contestnotification, notice: 'Contestnotification was successfully created.' }
|
||||||
|
# format.json { render json: @contestnotification, status: :created, location: @contestnotification }
|
||||||
|
# else
|
||||||
|
# format.html { render action: "new" }
|
||||||
|
# format.json { render json: @contestnotification.errors, status: :unprocessable_entity }
|
||||||
|
# end
|
||||||
|
# end
|
||||||
|
@contestnotification = Contestnotification.new(:contest => @contest, :author => User.current)
|
||||||
|
@contestnotification.safe_attributes = params[:contestnotification]
|
||||||
|
@contestnotification.save_attachments(params[:attachments])
|
||||||
|
if @contestnotification.save
|
||||||
|
render_attachment_warning_if_needed(@contestnotification)
|
||||||
|
flash[:notice] = l(:notice_successful_create)
|
||||||
|
redirect_to contest_contestnotifications_path(@contest)
|
||||||
|
else
|
||||||
|
layout_file = 'base_newcontest'
|
||||||
|
render :action => 'new', :layout => layout_file
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# PUT /contestnotifications/1
|
||||||
|
# PUT /contestnotifications/1.json
|
||||||
|
def update
|
||||||
|
# @contestnotification = Contestnotification.find(params[:id])
|
||||||
|
#
|
||||||
|
# respond_to do |format|
|
||||||
|
# if @contestnotification.update_attributes(params[:contestnotification])
|
||||||
|
# format.html { redirect_to @contestnotification, notice: 'Contestnotification was successfully updated.' }
|
||||||
|
# format.json { head :no_content }
|
||||||
|
# else
|
||||||
|
# format.html { render action: "edit" }
|
||||||
|
# format.json { render json: @contestnotification.errors, status: :unprocessable_entity }
|
||||||
|
# end
|
||||||
|
# end
|
||||||
|
@contestnotification = Contestnotification.find(params[:id])
|
||||||
|
@contestnotification.safe_attributes = params[:contestnotification]
|
||||||
|
@contestnotification.save_attachments(params[:attachments])
|
||||||
|
if @contestnotification.save
|
||||||
|
render_attachment_warning_if_needed(@contestnotification)
|
||||||
|
flash[:notice] = l(:notice_successful_update)
|
||||||
|
redirect_to contest_contestnotification_path(@contestnotification.contest, @contestnotification)
|
||||||
|
else
|
||||||
|
render :action => 'edit'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# DELETE /contestnotifications/1
|
||||||
|
# DELETE /contestnotifications/1.json
|
||||||
|
def destroy
|
||||||
|
# @contestnotification = Contestnotification.find(params[:id])
|
||||||
|
# @contestnotification.destroy
|
||||||
|
#
|
||||||
|
# respond_to do |format|
|
||||||
|
# format.html { redirect_to contestnotifications_url }
|
||||||
|
# format.json { head :no_content }
|
||||||
|
# end
|
||||||
|
@contestnotification = Contestnotification.find(params[:id])
|
||||||
|
@contestnotification.destroy
|
||||||
|
redirect_to contest_contestnotifications_path(@contest)
|
||||||
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def find_optional_contest
|
||||||
|
return true unless params[:id]
|
||||||
|
@contest = Contest.find(params[:id])
|
||||||
|
# authorize
|
||||||
|
rescue ActiveRecord::RecordNotFound
|
||||||
|
render_404
|
||||||
|
end
|
||||||
|
|
||||||
|
def access_edit_destroy
|
||||||
|
if (User.current.admin? && User.current.logged? )||(User.current == @contest.author && User.current.logged?)
|
||||||
|
return true
|
||||||
|
else
|
||||||
|
render_403
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
@ -1,3 +1,14 @@
|
|||||||
class HomeworkUsersController < ApplicationController
|
class HomeworkUsersController < ApplicationController
|
||||||
|
#新增数据
|
||||||
|
def create option
|
||||||
|
user = HomeworkUser.new option
|
||||||
|
user.save
|
||||||
|
user
|
||||||
|
end
|
||||||
|
#删除数据
|
||||||
|
def destory homework_user
|
||||||
|
user = HomeworkUser.find homework_user
|
||||||
|
user.destroy
|
||||||
|
user
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
@ -0,0 +1,27 @@
|
|||||||
|
class NotificationcommentsController < ApplicationController
|
||||||
|
# default_search_scope :contestnotifications
|
||||||
|
# model_object Contestnotifications
|
||||||
|
# before_filter :authorize
|
||||||
|
|
||||||
|
def create
|
||||||
|
#raise Unauthorized unless @contestnotifications.notificationcommentable?
|
||||||
|
@contest = Contest.find(params[:contest_id])
|
||||||
|
@contestnotification = Contestnotification.find(params[:contestnotification_id])
|
||||||
|
|
||||||
|
# @notificaioncomment = Notificationcomment.new
|
||||||
|
# @notificaioncomment.safe_attributes = params[:notificationcomment]
|
||||||
|
# @notificaioncomment.author = User.current
|
||||||
|
comment = @contestnotification.notificationcomments.new(params[:notificationcomment].merge(author_id: User.current.id))
|
||||||
|
if comment.save
|
||||||
|
flash[:notice] = l(:label_comment_added)
|
||||||
|
end
|
||||||
|
|
||||||
|
redirect_to contest_contestnotification_path(@contest, @contestnotification)
|
||||||
|
end
|
||||||
|
|
||||||
|
def destroy
|
||||||
|
@contestnotifications.notificaioncomments.find(params[:notificaioncomment_id]).destroy
|
||||||
|
redirect_to contest_contestnotification_path(@contestnotifications)
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
@ -0,0 +1,2 @@
|
|||||||
|
module ContestnotificationsHelper
|
||||||
|
end
|
@ -1,10 +1,57 @@
|
|||||||
module HomeworkAttachHelper
|
module HomeworkAttachHelper
|
||||||
|
#判断是否具有删除的权限
|
||||||
def attach_delete(project)
|
def attach_delete(project)
|
||||||
if User.current.logged? && (User.current.admin? || (!Member.where('user_id = ? and project_id = ?', User.current.id, project.bid.courses.first.id).first.nil? && (Member.where('user_id = ? and project_id = ?', User.current.id, project.bid.courses.first.id).first.roles&Role.where('id = ? or id = ?', 3, 7)).size >0) || project.user_id == User.current.id)
|
if User.current.logged? && (User.current.admin? || (!Member.where('user_id = ? and project_id = ?', User.current.id, project.bid.courses.first.id).first.nil? && (Member.where('user_id = ? and project_id = ?', User.current.id, project.bid.courses.first.id).first.roles&Role.where('id = ? or id = ?', 3, 7)).size >0) || project.user_id == User.current.id)
|
||||||
true
|
true
|
||||||
else
|
else
|
||||||
false
|
false
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
#作业添加、编辑界面的tab页
|
||||||
|
def homework_settings_tabs f
|
||||||
|
@f = f
|
||||||
|
tabs = [{:name => 'info', :partial => 'homework_attach/edit_homework', :label => :label_information_plural},
|
||||||
|
{:name => 'members', :partial => 'homework_attach/homework_member', :label => :label_member_plural}
|
||||||
|
]
|
||||||
|
end
|
||||||
|
|
||||||
|
#作业可选成员列表分页
|
||||||
|
def render_new_members_for_homework members
|
||||||
|
#scope = Principal.active.sorted.not_member_of(project).like(params[:q])
|
||||||
|
#scope = project.members
|
||||||
|
#principals = paginateHelper members,10
|
||||||
|
#principals = members
|
||||||
|
#principal_count = members.count
|
||||||
|
#limit = 10
|
||||||
|
#principal_pages = Redmine::Pagination::Paginator.new principal_count, limit, params['page'] #by young
|
||||||
|
#offset ||= principal_pages.offset
|
||||||
|
#principals = members[offset, limit]
|
||||||
|
users = members.map(&:user)
|
||||||
|
s = content_tag('div', member_check_box_tags_ex('membership[user_ids][]', users), :id => 'principals')
|
||||||
|
links = pagination_links_full(@obj_pages, @obj_count, :per_page_links => false) {|text, parameters, options|
|
||||||
|
link_to text, get_homework_member_list_homework_attach_index_path( parameters.merge(:q => params[:q], bid_id: params[:id]||@homework)), :remote => true }
|
||||||
|
return s + content_tag('div', content_tag('ul', links), :class => 'pagination_new')
|
||||||
|
end
|
||||||
|
|
||||||
|
#扩展的checkbox生成
|
||||||
|
def member_check_box_tags_ex(name, principals)
|
||||||
|
s = ''
|
||||||
|
principals.each do |member|
|
||||||
|
s << "<label>#{ check_box_tag name, member.id, false, :id => nil } #{h member.name }</label><br/>"
|
||||||
|
end
|
||||||
|
s.html_safe
|
||||||
|
end
|
||||||
|
|
||||||
|
def paginateHelper obj, pre_size=20
|
||||||
|
@obj_count = obj.count
|
||||||
|
@obj_pages = Redmine::Pagination::Paginator.new @obj_count, pre_size, params['page']
|
||||||
|
if obj.kind_of? ActiveRecord::Base or obj.kind_of? ActiveRecord::Relation
|
||||||
|
obj.limit(@obj_pages.per_page).offset(@obj_pages.offset)
|
||||||
|
elsif obj.kind_of? Array
|
||||||
|
obj[@obj_pages.offset, @obj_pages.per_page]
|
||||||
|
else
|
||||||
|
logger.error "[ApplicationController] Error : application_controller#paginateHelper ===> unknow category: #{obj.class}"
|
||||||
|
raise RuntimeError, 'unknow type, Please input you type into this helper.'
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
@ -0,0 +1,2 @@
|
|||||||
|
module NotificationcommentsHelper
|
||||||
|
end
|
@ -0,0 +1,63 @@
|
|||||||
|
class Contestnotification < ActiveRecord::Base
|
||||||
|
#attr_accessible :author_id, :notificationcomments_count, :contest_id, :description, :summary, :title
|
||||||
|
|
||||||
|
include Redmine::SafeAttributes
|
||||||
|
#Contestnotification::Notificationcomment
|
||||||
|
belongs_to :contest
|
||||||
|
belongs_to :author, :class_name => 'User', :foreign_key => 'author_id'
|
||||||
|
has_many :notificationcomments, as: :notificationcommented, :dependent => :delete_all, :order => "created_at"
|
||||||
|
# fq
|
||||||
|
has_many :acts, :class_name => 'Activity', :as => :act, :dependent => :destroy
|
||||||
|
|
||||||
|
validates_presence_of :title, :description
|
||||||
|
validates_length_of :title, :maximum => 60
|
||||||
|
validates_length_of :summary, :maximum => 255
|
||||||
|
|
||||||
|
acts_as_attachable :delete_permission => :manage_contestnotifications
|
||||||
|
acts_as_searchable :columns => ['title', 'summary', "#{table_name}.description"], :include => :contest
|
||||||
|
acts_as_event :url => Proc.new {|o| {:controller => 'contestnotifications', :action => 'show', :id => o.id}}
|
||||||
|
acts_as_activity_provider :find_options => {:include => [:contest, :author]},
|
||||||
|
:author_key => :author_id
|
||||||
|
acts_as_watchable
|
||||||
|
|
||||||
|
after_create :add_author_as_watcher
|
||||||
|
|
||||||
|
after_create :act_as_activity
|
||||||
|
|
||||||
|
|
||||||
|
scope :visible, lambda {|*args|
|
||||||
|
nil
|
||||||
|
#includes(:contest).where(Contest.allowed_to_condition(args.shift || User.current, :view_contestnotifications, *args))
|
||||||
|
}
|
||||||
|
|
||||||
|
safe_attributes 'title', 'summary', 'description'
|
||||||
|
|
||||||
|
def visible?(user=User.current)
|
||||||
|
!user.nil? && user.allowed_to?(:view_contestnotifications, contest)
|
||||||
|
end
|
||||||
|
|
||||||
|
# Returns true if the news can be commented by user
|
||||||
|
def notificationcommentable?(user=User.current)
|
||||||
|
user.allowed_to?(:notificationcomment_contestnotifications, contest)
|
||||||
|
end
|
||||||
|
|
||||||
|
def recipients
|
||||||
|
#contest.users.select {|user| user.notify_about?(self)}.map(&:mail)
|
||||||
|
end
|
||||||
|
|
||||||
|
# returns latest news for contests visible by user
|
||||||
|
def self.latest(user = User.current, count = 5)
|
||||||
|
visible(user).includes([:author, :contest]).order("#{Contestnotification.table_name}.created_at DESC").limit(count).all
|
||||||
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def add_author_as_watcher
|
||||||
|
#Watcher.create(:watchable => self, :user => author)
|
||||||
|
end
|
||||||
|
## fq
|
||||||
|
def act_as_activity
|
||||||
|
self.acts << Activity.new(:user_id => self.author_id)
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
@ -1,6 +1,6 @@
|
|||||||
class HomeworkUser < ActiveRecord::Base
|
class HomeworkUser < ActiveRecord::Base
|
||||||
attr_accessible :homework_attach_id, :user_id
|
attr_accessible :homework_attach_id, :user_id
|
||||||
|
|
||||||
belongs_to :homework_attach
|
belongs_to :homework_attach, :foreign_key => :homework_attach_id
|
||||||
belongs_to :user
|
belongs_to :user
|
||||||
end
|
end
|
||||||
|
@ -0,0 +1,11 @@
|
|||||||
|
class Notificationcomment < ActiveRecord::Base
|
||||||
|
attr_accessible :author_id, :notificationcommented_id, :notificationcommented_type, :notificationcomments
|
||||||
|
|
||||||
|
include Redmine::SafeAttributes
|
||||||
|
belongs_to :notificationcommented, :polymorphic => true#, :counter_cache => true
|
||||||
|
belongs_to :author, :class_name => 'User', :foreign_key => 'author_id'
|
||||||
|
|
||||||
|
validates_presence_of :notificationcommented, :author, :notificationcomments
|
||||||
|
|
||||||
|
# safe_attributes 'notificationcomments'
|
||||||
|
end
|
@ -0,0 +1,5 @@
|
|||||||
|
#用户等级类 - by zjc
|
||||||
|
class UserLevels < ActiveRecord::Base
|
||||||
|
attr_accessible :user_id, :level
|
||||||
|
belongs_to :user
|
||||||
|
end
|
@ -1,409 +1,447 @@
|
|||||||
<!-- added by bai 增加地区-->
|
<!-- added by bai 增加地区-->
|
||||||
<script type="text/javascript" language="javascript">
|
<script type="text/javascript" language="javascript">
|
||||||
function showcity(province, cityField) {
|
function showcity(province, cityField) {
|
||||||
switch (province) {
|
switch (province) {
|
||||||
case "北京" :
|
case "北京" :
|
||||||
var cityOptions = new Array(
|
var cityOptions = new Array(
|
||||||
"东城","西城","朝阳","丰台","石景山","海淀","门头沟",
|
"东城", "西城", "朝阳", "丰台", "石景山", "海淀", "门头沟",
|
||||||
"房山","通州","顺义","昌平","大兴","平谷","怀柔","密云","延庆");
|
"房山", "通州", "顺义", "昌平", "大兴", "平谷", "怀柔", "密云", "延庆");
|
||||||
break;
|
break;
|
||||||
case "上海" :
|
case "上海" :
|
||||||
var cityOptions = new Array(
|
var cityOptions = new Array(
|
||||||
"崇明","黄浦","卢湾","徐汇","长宁","静安","普陀","闸北","虹口","杨浦","闵行",
|
"崇明", "黄浦", "卢湾", "徐汇", "长宁", "静安", "普陀", "闸北", "虹口", "杨浦", "闵行",
|
||||||
"宝山","嘉定","浦东","金山","松江","青浦","南汇","奉贤");
|
"宝山", "嘉定", "浦东", "金山", "松江", "青浦", "南汇", "奉贤");
|
||||||
break;
|
break;
|
||||||
case "广东" :
|
case "广东" :
|
||||||
var cityOptions = new Array(
|
var cityOptions = new Array(
|
||||||
"广州","深圳","珠海","东莞","中山","佛山","惠州","河源","潮州","江门","揭阳","茂名",
|
"广州", "深圳", "珠海", "东莞", "中山", "佛山", "惠州", "河源", "潮州", "江门", "揭阳", "茂名",
|
||||||
"梅州","清远","汕头","汕尾","韶关","顺德","阳江","云浮","湛江","肇庆");
|
"梅州", "清远", "汕头", "汕尾", "韶关", "顺德", "阳江", "云浮", "湛江", "肇庆");
|
||||||
break;
|
break;
|
||||||
case "江苏" :
|
case "江苏" :
|
||||||
var cityOptions = new Array(
|
var cityOptions = new Array(
|
||||||
"南京","常熟","常州","海门","淮安","江都","江阴","昆山","连云港","南通",
|
"南京", "常熟", "常州", "海门", "淮安", "江都", "江阴", "昆山", "连云港", "南通",
|
||||||
"启东","沭阳","宿迁","苏州","太仓","泰州","同里","无锡","徐州","盐城",
|
"启东", "沭阳", "宿迁", "苏州", "太仓", "泰州", "同里", "无锡", "徐州", "盐城",
|
||||||
"扬州","宜兴","仪征","张家港","镇江","周庄");
|
"扬州", "宜兴", "仪征", "张家港", "镇江", "周庄");
|
||||||
break;
|
break;
|
||||||
case "重庆" :
|
case "重庆" :
|
||||||
var cityOptions = new Array(
|
var cityOptions = new Array(
|
||||||
"万州","涪陵","渝中","大渡口","江北","沙坪坝","九龙坡","南岸","北碚","万盛",
|
"万州", "涪陵", "渝中", "大渡口", "江北", "沙坪坝", "九龙坡", "南岸", "北碚", "万盛",
|
||||||
"双挢","渝北","巴南","黔江","长寿","綦江","潼南","铜梁","大足","荣昌","壁山",
|
"双挢", "渝北", "巴南", "黔江", "长寿", "綦江", "潼南", "铜梁", "大足", "荣昌", "壁山",
|
||||||
"梁平","城口","丰都","垫江","武隆","忠县","开县","云阳","奉节","巫山","巫溪",
|
"梁平", "城口", "丰都", "垫江", "武隆", "忠县", "开县", "云阳", "奉节", "巫山", "巫溪",
|
||||||
"石柱","秀山","酉阳","彭水","江津","合川","永川","南川");
|
"石柱", "秀山", "酉阳", "彭水", "江津", "合川", "永川", "南川");
|
||||||
break;
|
break;
|
||||||
case "安徽" :
|
case "安徽" :
|
||||||
var cityOptions = new Array(
|
var cityOptions = new Array(
|
||||||
"合肥","安庆","蚌埠","亳州","巢湖","滁州","阜阳","贵池","淮北","淮化","淮南",
|
"合肥", "安庆", "蚌埠", "亳州", "巢湖", "滁州", "阜阳", "贵池", "淮北", "淮化", "淮南",
|
||||||
"黄山","九华山","六安","马鞍山","宿州","铜陵","屯溪","芜湖","宣城");
|
"黄山", "九华山", "六安", "马鞍山", "宿州", "铜陵", "屯溪", "芜湖", "宣城");
|
||||||
break;
|
break;
|
||||||
case "福建" :
|
case "福建" :
|
||||||
var cityOptions = new Array(
|
var cityOptions = new Array(
|
||||||
"福州","厦门","泉州","漳州","龙岩","南平","宁德","莆田","三明");
|
"福州", "厦门", "泉州", "漳州", "龙岩", "南平", "宁德", "莆田", "三明");
|
||||||
break;
|
break;
|
||||||
case "甘肃" :
|
case "甘肃" :
|
||||||
var cityOptions = new Array(
|
var cityOptions = new Array(
|
||||||
"兰州","白银","定西","敦煌","甘南","金昌","酒泉","临夏","平凉","天水",
|
"兰州", "白银", "定西", "敦煌", "甘南", "金昌", "酒泉", "临夏", "平凉", "天水",
|
||||||
"武都","武威","西峰","张掖");
|
"武都", "武威", "西峰", "张掖");
|
||||||
break;
|
break;
|
||||||
case "广西" :
|
case "广西" :
|
||||||
var cityOptions = new Array(
|
var cityOptions = new Array(
|
||||||
"南宁","百色","北海","桂林","防城港","贵港","河池","贺州","柳州","钦州","梧州","玉林");
|
"南宁", "百色", "北海", "桂林", "防城港", "贵港", "河池", "贺州", "柳州", "钦州", "梧州", "玉林");
|
||||||
break;
|
break;
|
||||||
case "贵州" :
|
case "贵州" :
|
||||||
var cityOptions = new Array(
|
var cityOptions = new Array(
|
||||||
"贵阳","安顺","毕节","都匀","凯里","六盘水","铜仁","兴义","玉屏","遵义");
|
"贵阳", "安顺", "毕节", "都匀", "凯里", "六盘水", "铜仁", "兴义", "玉屏", "遵义");
|
||||||
break;
|
break;
|
||||||
case "海南" :
|
case "海南" :
|
||||||
var cityOptions = new Array(
|
var cityOptions = new Array(
|
||||||
"海口","儋县","陵水","琼海","三亚","通什","万宁");
|
"海口", "儋县", "陵水", "琼海", "三亚", "通什", "万宁");
|
||||||
break;
|
break;
|
||||||
case "河北" :
|
case "河北" :
|
||||||
var cityOptions = new Array(
|
var cityOptions = new Array(
|
||||||
"石家庄","保定","北戴河","沧州","承德","丰润","邯郸","衡水","廊坊","南戴河","秦皇岛",
|
"石家庄", "保定", "北戴河", "沧州", "承德", "丰润", "邯郸", "衡水", "廊坊", "南戴河", "秦皇岛",
|
||||||
"唐山","新城","邢台","张家口");
|
"唐山", "新城", "邢台", "张家口");
|
||||||
break;
|
break;
|
||||||
case "黑龙江" :
|
case "黑龙江" :
|
||||||
var cityOptions = new Array(
|
var cityOptions = new Array(
|
||||||
"哈尔滨","北安","大庆","大兴安岭","鹤岗","黑河","佳木斯","鸡西","牡丹江","齐齐哈尔",
|
"哈尔滨", "北安", "大庆", "大兴安岭", "鹤岗", "黑河", "佳木斯", "鸡西", "牡丹江", "齐齐哈尔",
|
||||||
"七台河","双鸭山","绥化","伊春");
|
"七台河", "双鸭山", "绥化", "伊春");
|
||||||
break;
|
break;
|
||||||
case "河南" :
|
case "河南" :
|
||||||
var cityOptions = new Array(
|
var cityOptions = new Array(
|
||||||
"郑州","安阳","鹤壁","潢川","焦作","济源","开封","漯河","洛阳","南阳","平顶山",
|
"郑州", "安阳", "鹤壁", "潢川", "焦作", "济源", "开封", "漯河", "洛阳", "南阳", "平顶山",
|
||||||
"濮阳","三门峡","商丘","新乡","信阳","许昌","周口","驻马店");
|
"濮阳", "三门峡", "商丘", "新乡", "信阳", "许昌", "周口", "驻马店");
|
||||||
break;
|
break;
|
||||||
case "香港" :
|
case "香港" :
|
||||||
var cityOptions = new Array(
|
var cityOptions = new Array(
|
||||||
"香港","九龙","新界");
|
"香港", "九龙", "新界");
|
||||||
break;
|
break;
|
||||||
case "湖北" :
|
case "湖北" :
|
||||||
var cityOptions = new Array(
|
var cityOptions = new Array(
|
||||||
"武汉","恩施","鄂州","黄冈","黄石","荆门","荆州","潜江","十堰","随州","武穴",
|
"武汉", "恩施", "鄂州", "黄冈", "黄石", "荆门", "荆州", "潜江", "十堰", "随州", "武穴",
|
||||||
"仙桃","咸宁","襄阳","襄樊","孝感","宜昌");
|
"仙桃", "咸宁", "襄阳", "襄樊", "孝感", "宜昌");
|
||||||
break;
|
break;
|
||||||
case "湖南" :
|
case "湖南" :
|
||||||
var cityOptions = new Array(
|
var cityOptions = new Array(
|
||||||
"长沙","常德","郴州","衡阳","怀化","吉首","娄底","邵阳","湘潭","益阳","岳阳",
|
"长沙", "常德", "郴州", "衡阳", "怀化", "吉首", "娄底", "邵阳", "湘潭", "益阳", "岳阳",
|
||||||
"永州","张家界","株洲");
|
"永州", "张家界", "株洲");
|
||||||
break;
|
break;
|
||||||
case "江西" :
|
case "江西" :
|
||||||
var cityOptions = new Array(
|
var cityOptions = new Array(
|
||||||
"南昌","抚州","赣州","吉安","景德镇","井冈山","九江","庐山","萍乡",
|
"南昌", "抚州", "赣州", "吉安", "景德镇", "井冈山", "九江", "庐山", "萍乡",
|
||||||
"上饶","新余","宜春","鹰潭");
|
"上饶", "新余", "宜春", "鹰潭");
|
||||||
break;
|
break;
|
||||||
case "吉林" :
|
case "吉林" :
|
||||||
var cityOptions = new Array(
|
var cityOptions = new Array(
|
||||||
"长春","吉林","白城","白山","珲春","辽源","梅河","四平","松原","通化","延吉");
|
"长春", "吉林", "白城", "白山", "珲春", "辽源", "梅河", "四平", "松原", "通化", "延吉");
|
||||||
break;
|
break;
|
||||||
case "辽宁" :
|
case "辽宁" :
|
||||||
var cityOptions = new Array(
|
var cityOptions = new Array(
|
||||||
"沈阳","鞍山","本溪","朝阳","大连","丹东","抚顺","阜新","葫芦岛","锦州",
|
"沈阳", "鞍山", "本溪", "朝阳", "大连", "丹东", "抚顺", "阜新", "葫芦岛", "锦州",
|
||||||
"辽阳","盘锦","铁岭","营口");
|
"辽阳", "盘锦", "铁岭", "营口");
|
||||||
break;
|
break;
|
||||||
case "澳门" :
|
case "澳门" :
|
||||||
var cityOptions = new Array("澳门");
|
var cityOptions = new Array("澳门");
|
||||||
break;
|
break;
|
||||||
case "内蒙古" :
|
case "内蒙古" :
|
||||||
var cityOptions = new Array(
|
var cityOptions = new Array(
|
||||||
"呼和浩特","阿拉善盟","包头","赤峰","东胜","海拉尔","集宁","临河","通辽","乌海",
|
"呼和浩特", "阿拉善盟", "包头", "赤峰", "东胜", "海拉尔", "集宁", "临河", "通辽", "乌海",
|
||||||
"乌兰浩特","锡林浩特");
|
"乌兰浩特", "锡林浩特");
|
||||||
break;
|
break;
|
||||||
case "宁夏" :
|
case "宁夏" :
|
||||||
var cityOptions = new Array(
|
var cityOptions = new Array(
|
||||||
"银川","固源","石嘴山","吴忠");
|
"银川", "固源", "石嘴山", "吴忠");
|
||||||
break;
|
break;
|
||||||
case "青海" :
|
case "青海" :
|
||||||
var cityOptions = new Array(
|
var cityOptions = new Array(
|
||||||
"西宁","德令哈","格尔木","共和","海东","海晏","玛沁","同仁","玉树");
|
"西宁", "德令哈", "格尔木", "共和", "海东", "海晏", "玛沁", "同仁", "玉树");
|
||||||
break;
|
break;
|
||||||
case "山东" :
|
case "山东" :
|
||||||
var cityOptions = new Array(
|
var cityOptions = new Array(
|
||||||
"济南","滨州","兖州","德州","东营","菏泽","济宁","莱芜","聊城","临沂",
|
"济南", "滨州", "兖州", "德州", "东营", "菏泽", "济宁", "莱芜", "聊城", "临沂",
|
||||||
"蓬莱","青岛","曲阜","日照","泰安","潍坊","威海","烟台","枣庄","淄博");
|
"蓬莱", "青岛", "曲阜", "日照", "泰安", "潍坊", "威海", "烟台", "枣庄", "淄博");
|
||||||
break;
|
break;
|
||||||
case "山西" :
|
case "山西" :
|
||||||
var cityOptions = new Array(
|
var cityOptions = new Array(
|
||||||
"太原","长治","大同","候马","晋城","离石","临汾","宁武","朔州","忻州",
|
"太原", "长治", "大同", "候马", "晋城", "离石", "临汾", "宁武", "朔州", "忻州",
|
||||||
"阳泉","榆次","运城");
|
"阳泉", "榆次", "运城");
|
||||||
break;
|
break;
|
||||||
case "陕西" :
|
case "陕西" :
|
||||||
var cityOptions = new Array(
|
var cityOptions = new Array(
|
||||||
"西安","安康","宝鸡","汉中","渭南","商州","绥德","铜川","咸阳","延安","榆林");
|
"西安", "安康", "宝鸡", "汉中", "渭南", "商州", "绥德", "铜川", "咸阳", "延安", "榆林");
|
||||||
break;
|
break;
|
||||||
case "四川" :
|
case "四川" :
|
||||||
var cityOptions = new Array(
|
var cityOptions = new Array(
|
||||||
"成都","巴中","达川","德阳","都江堰","峨眉山","涪陵","广安","广元","九寨沟",
|
"成都", "巴中", "达川", "德阳", "都江堰", "峨眉山", "涪陵", "广安", "广元", "九寨沟",
|
||||||
"康定","乐山","泸州","马尔康","绵阳","眉山","南充","内江","攀枝花","遂宁",
|
"康定", "乐山", "泸州", "马尔康", "绵阳", "眉山", "南充", "内江", "攀枝花", "遂宁",
|
||||||
"汶川","西昌","雅安","宜宾","自贡","资阳");
|
"汶川", "西昌", "雅安", "宜宾", "自贡", "资阳");
|
||||||
break;
|
break;
|
||||||
case "台湾" :
|
case "台湾" :
|
||||||
var cityOptions = new Array(
|
var cityOptions = new Array(
|
||||||
"台北","基隆","台南","台中","高雄","屏东","南投","云林","新竹","彰化","苗栗",
|
"台北", "基隆", "台南", "台中", "高雄", "屏东", "南投", "云林", "新竹", "彰化", "苗栗",
|
||||||
"嘉义","花莲","桃园","宜兰","台东","金门","马祖","澎湖");
|
"嘉义", "花莲", "桃园", "宜兰", "台东", "金门", "马祖", "澎湖");
|
||||||
break;
|
break;
|
||||||
case "天津" :
|
case "天津" :
|
||||||
var cityOptions = new Array(
|
var cityOptions = new Array(
|
||||||
"天津","和平","东丽","河东","西青","河西","津南","南开","北辰","河北","武清","红挢",
|
"天津", "和平", "东丽", "河东", "西青", "河西", "津南", "南开", "北辰", "河北", "武清", "红挢",
|
||||||
"塘沽","汉沽","大港","宁河","静海","宝坻","蓟县");
|
"塘沽", "汉沽", "大港", "宁河", "静海", "宝坻", "蓟县");
|
||||||
break;
|
break;
|
||||||
case "新疆" :
|
case "新疆" :
|
||||||
var cityOptions = new Array(
|
var cityOptions = new Array(
|
||||||
"乌鲁木齐","阿克苏","阿勒泰","阿图什","博乐","昌吉","东山","哈密","和田","喀什",
|
"乌鲁木齐", "阿克苏", "阿勒泰", "阿图什", "博乐", "昌吉", "东山", "哈密", "和田", "喀什",
|
||||||
"克拉玛依","库车","库尔勒","奎屯","石河子","塔城","吐鲁番","伊宁");
|
"克拉玛依", "库车", "库尔勒", "奎屯", "石河子", "塔城", "吐鲁番", "伊宁");
|
||||||
break;
|
break;
|
||||||
case "西藏" :
|
case "西藏" :
|
||||||
var cityOptions = new Array(
|
var cityOptions = new Array(
|
||||||
"拉萨","阿里","昌都","林芝","那曲","日喀则","山南");
|
"拉萨", "阿里", "昌都", "林芝", "那曲", "日喀则", "山南");
|
||||||
break;
|
break;
|
||||||
case "云南" :
|
case "云南" :
|
||||||
var cityOptions = new Array(
|
var cityOptions = new Array(
|
||||||
"昆明","大理","保山","楚雄","大理","东川","个旧","景洪","开远","临沧","丽江",
|
"昆明", "大理", "保山", "楚雄", "大理", "东川", "个旧", "景洪", "开远", "临沧", "丽江",
|
||||||
"六库","潞西","曲靖","思茅","文山","西双版纳","玉溪","中甸","昭通");
|
"六库", "潞西", "曲靖", "思茅", "文山", "西双版纳", "玉溪", "中甸", "昭通");
|
||||||
break;
|
break;
|
||||||
case "浙江" :
|
case "浙江" :
|
||||||
var cityOptions = new Array(
|
var cityOptions = new Array(
|
||||||
"杭州","安吉","慈溪","定海","奉化","海盐","黄岩","湖州","嘉兴","金华","临安",
|
"杭州", "安吉", "慈溪", "定海", "奉化", "海盐", "黄岩", "湖州", "嘉兴", "金华", "临安",
|
||||||
"临海","丽水","宁波","瓯海","平湖","千岛湖","衢州","江山","瑞安","绍兴","嵊州",
|
"临海", "丽水", "宁波", "瓯海", "平湖", "千岛湖", "衢州", "江山", "瑞安", "绍兴", "嵊州",
|
||||||
"台州","温岭","温州","余姚","舟山");
|
"台州", "温岭", "温州", "余姚", "舟山");
|
||||||
break;
|
break;
|
||||||
case "海外" :
|
case "海外" :
|
||||||
var cityOptions = new Array(
|
var cityOptions = new Array(
|
||||||
"美国","日本","英国","法国","德国","其他");
|
"美国", "日本", "英国", "法国", "德国", "其他");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
var cityOptions = new Array("");
|
var cityOptions = new Array("");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
cityField.options.length = 0;
|
cityField.options.length = 0;
|
||||||
for(var i = 0; i < cityOptions.length; i++) {
|
for (var i = 0; i < cityOptions.length; i++) {
|
||||||
cityField.options[i]=new Option(cityOptions[i],cityOptions[i]);
|
cityField.options[i] = new Option(cityOptions[i], cityOptions[i]);
|
||||||
/*
|
/*
|
||||||
if (cityField.options[i].value==city)
|
if (cityField.options[i].value==city)
|
||||||
{
|
{
|
||||||
//alert("here put City ok!");
|
//alert("here put City ok!");
|
||||||
document.oblogform["city"].selectedIndex = i;
|
document.oblogform["city"].selectedIndex = i;
|
||||||
}*/
|
}*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script type="text/javascript" language="javascript">
|
<script type="text/javascript" language="javascript">
|
||||||
function showtechnical_title(identity, technical_titleField) {
|
function showtechnical_title(identity, technical_titleField) {
|
||||||
switch (identity) {
|
switch (identity) {
|
||||||
|
|
||||||
case '0' :
|
case '0' :
|
||||||
$('#technical_title').show()
|
$('#technical_title').show()
|
||||||
$('#no').hide()
|
$('#no').hide()
|
||||||
$('#name').show()
|
$('#name').show()
|
||||||
$('#enterprise').hide()
|
$('#enterprise').hide()
|
||||||
$('#gender').show()
|
$('#gender').show()
|
||||||
var technical_titleOptions = new Array(
|
var technical_titleOptions = new Array(
|
||||||
"<%= l(:label_technicl_title_professor) %>","<%= l(:label_technicl_title_associate_professor) %>","<%= l(:label_technicl_title_lecturer) %>","<%= l(:label_technicl_title_teaching_assistant) %>");
|
"<%= l(:label_technicl_title_professor) %>", "<%= l(:label_technicl_title_associate_professor) %>", "<%= l(:label_technicl_title_lecturer) %>", "<%= l(:label_technicl_title_teaching_assistant) %>");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case '1' :
|
case '1' :
|
||||||
$('#technical_title').hide()
|
$('#technical_title').hide()
|
||||||
$('#no').show()
|
$('#no').show()
|
||||||
$('#name').show()
|
$('#name').show()
|
||||||
$('#enterprise').hide()
|
$('#enterprise').hide()
|
||||||
$('#gender').show()
|
$('#gender').show()
|
||||||
var titleOptions = new Array("");
|
var titleOptions = new Array("");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case '2' :
|
case '2' :
|
||||||
$('#technical_title').hide()
|
$('#technical_title').hide()
|
||||||
$('#no').hide()
|
$('#no').hide()
|
||||||
$('#name').hide()
|
$('#name').hide()
|
||||||
$('#enterprise').show()
|
$('#enterprise').show()
|
||||||
$('#gender').hide()
|
$('#gender').hide()
|
||||||
var titleOptions = new Array("");
|
var titleOptions = new Array("");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$('#technical_title').hide()
|
$('#technical_title').hide()
|
||||||
$('#no').hide()
|
$('#no').hide()
|
||||||
$('#name').show()
|
$('#name').show()
|
||||||
$('#enterprise').hide()
|
$('#enterprise').hide()
|
||||||
$('#gender').show()
|
$('#gender').show()
|
||||||
var titleOptions = new Array("");
|
var titleOptions = new Array("");
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
technical_titleField.options.length = 0;
|
technical_titleField.options.length = 0;
|
||||||
for(var i = 0; i < technical_titleOptions.length; i++) {
|
for (var i = 0; i < technical_titleOptions.length; i++) {
|
||||||
technical_titleField.options[i]=new Option(technical_titleOptions[i],technical_titleOptions[i]);
|
technical_titleField.options[i] = new Option(technical_titleOptions[i], technical_titleOptions[i]);
|
||||||
/*
|
/*
|
||||||
if (cityField.options[i].value==city)
|
if (cityField.options[i].value==city)
|
||||||
{
|
{
|
||||||
//alert("here put City ok!");
|
//alert("here put City ok!");
|
||||||
document.oblogform["city"].selectedIndex = i;
|
document.oblogform["city"].selectedIndex = i;
|
||||||
}*/
|
}*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<!-- end -->
|
<!-- end -->
|
||||||
|
|
||||||
<h3><%=l(:label_register)%> <%=link_to l(:label_login_with_open_id_option), signin_url if Setting.openid? %></h3>
|
<h3><%= l(:label_register) %> <%= link_to l(:label_login_with_open_id_option), signin_url if Setting.openid? %></h3>
|
||||||
|
|
||||||
<%= labelled_form_for @user, :url => register_path do |f| %>
|
<%= labelled_form_for @user, :url => register_path do |f| %>
|
||||||
<%= error_messages_for 'user' %>
|
<%= error_messages_for 'user' %>
|
||||||
|
|
||||||
<div class="box tabular">
|
<div class="box tabular">
|
||||||
<p><table><tr><td class="info" align="right" style="width: 90px"><strong><%= l(:label_identity) %><span class="required"> *</span></strong></td>
|
<p>
|
||||||
<td class="info" style="width: 10px">
|
<table>
|
||||||
<select onchange="showtechnical_title(this.value, document.getElementById('userTechnical_title'));" name="identity" id="userIdentity" class="location">
|
<tr>
|
||||||
<option value="">--请选择身份--</option>
|
<td class="info" align="right" style="width: 90px">
|
||||||
<option value="0"><%= l(:label_teacher) %></option>
|
<strong><%= l(:label_identity) %><span class="required"> *</span></strong></td>
|
||||||
<option value="1"><%= l(:label_student) %></option>
|
<td class="info" style="width: 10px">
|
||||||
<option value="2"><%= l(:label_enterprise) %></option>
|
<select onchange="showtechnical_title(this.value, document.getElementById('userTechnical_title'));" name="identity" id="userIdentity" class="location">
|
||||||
<option value="3"><%= l(:label_account_developer) %></option>
|
<option value="">--请选择身份--</option>
|
||||||
|
<option value="0"><%= l(:label_teacher) %></option>
|
||||||
</select></td>
|
<option value="1"><%= l(:label_student) %></option>
|
||||||
<td>
|
<option value="2"><%= l(:label_enterprise) %></option>
|
||||||
<span id = 'technical_title' style = 'display:none'>
|
<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>
|
<select name="technical_title" id="userTechnical_title"></select></span>
|
||||||
<span id = 'no' style = 'display:none'>
|
<span id='no' style='display:none'>
|
||||||
|
|
||||||
<!-- modified by fq -->
|
<% unless User.current.user_extensions.nil? %>
|
||||||
<% unless User.current.user_extensions.nil? %>
|
|
||||||
<%= text_field_tag :no, User.current.user_extensions.student_id, :placeholder => "请输入学号" %></span>
|
<%= text_field_tag :no, User.current.user_extensions.student_id, :placeholder => "请输入学号" %></span>
|
||||||
<!-- <input name="no" id="no" value=<%= "#{User.current.user_extensions.student_id}" %> placeholder="请输入学号"></span> -->
|
|
||||||
<% else %>
|
<% else %>
|
||||||
<%= text_field_tag :no, nil, :placeholder => "请输入学号" %></span>
|
<%= text_field_tag :no, nil, :placeholder => "请输入学号" %></span>
|
||||||
<!-- <input name="no" id="no" placeholder="请输入学号"></span> -->
|
|
||||||
<% end %>
|
<% end %>
|
||||||
<!-- end -->
|
</td>
|
||||||
</td></tr></table></p>
|
</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></p>
|
||||||
|
|
||||||
<% if @user.auth_source_id.nil? %>
|
<p><%= f.password_field :password, :size => 25, :required => true %>
|
||||||
<p><%= f.text_field :login, :size => 25, :required => true %><span id="valid_user_login"></span>
|
<em class="info"><%= l(:text_caracters_minimum, :count => Setting.password_min_length) %></em></p>
|
||||||
<em class="info"><%= 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></p>
|
|
||||||
|
|
||||||
<p><%= f.password_field :password_confirmation, :size => 25, :required => true %></p>
|
<p><%= f.password_field :password_confirmation, :size => 25, :required => true %></p>
|
||||||
<% end %>
|
<% end %>
|
||||||
<span id = 'name' style = 'display:none'>
|
<span id='name' style='display:none'>
|
||||||
<p><%= f.text_field :firstname, :required => true %></p>
|
<p><%= f.text_field :firstname, :required => true %></p>
|
||||||
<p><%= f.text_field :lastname, :required => true %></p>
|
<p><%= f.text_field :lastname, :required => true %></p>
|
||||||
</span>
|
</span>
|
||||||
<span id = 'enterprise' style = 'display:none'>
|
<span id='enterprise' style='display:none'>
|
||||||
<p><table><tr><td class="info" align="right" style="width: 90px"><strong>企业名<span class="required"> *</span></strong></td>
|
<p><table>
|
||||||
<td class="info" style="width: 10px">
|
<tr>
|
||||||
<%= text_field_tag :enterprise_name %></td></tr></table></p>
|
<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>
|
</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 增加了身份、性别和地区-->
|
<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'>
|
<span id='gender' style='display:none'>
|
||||||
<p>
|
<p>
|
||||||
<table><tr>
|
<table>
|
||||||
<td class="info" align="right" style="width: 90px"><strong><%= l(:label_gender) %><span class="required"> </span></strong></td>
|
<tr>
|
||||||
<td class="info" style="width: 10px">
|
<td class="info" align="right" style="width: 90px">
|
||||||
<%= select_tag 'gender', "<option value = '0'>#{l(:label_gender_male)}</option>
|
<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 %>
|
<option value = '1'>#{l(:label_gender_female)}</option>".html_safe %>
|
||||||
</td>
|
</td>
|
||||||
</tr></table>
|
</tr>
|
||||||
</p>
|
</table>
|
||||||
|
</p>
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
|
|
||||||
<p><table><tr><td class="info" align="right" style="width: 90px"><strong><%= l(:label_location) %><span class="required"> *</span></strong></td>
|
<p>
|
||||||
<td class="info" style="width: 80px">
|
<table>
|
||||||
<select onchange="showcity(this.value, document.getElementById('userCity'));" name="province" id="userProvince">
|
<tr>
|
||||||
<option value="">--请选择省份--</option>
|
<td class="info" align="right" style="width: 90px">
|
||||||
<option value="北京">北京</option>
|
<strong><%= l(:label_location) %><span class="required"> *</span></strong>
|
||||||
<option value="上海">上海</option>
|
</td>
|
||||||
<option value="广东">广东</option>
|
<td class="info" style="width: 80px">
|
||||||
<option value="江苏">江苏</option>
|
<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>
|
||||||
<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>
|
<option value="云南">云南</option>
|
||||||
<td class="info" style="width: 100px">
|
<option value="香港">香港特别行政区</option>
|
||||||
<select name="city" id="userCity"></select></td></tr></table></p>
|
<option value="澳门">澳门特别行政区</option>
|
||||||
<!-- end -->
|
<option value="台湾">台湾</option>
|
||||||
</div>
|
<option value="海外">海外</option>
|
||||||
|
</select>
|
||||||
|
</td>
|
||||||
|
<td class="info" style="width: 100px">
|
||||||
|
<select name="city" id="userCity"></select>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</p>
|
||||||
|
<!-- end -->
|
||||||
|
</div>
|
||||||
|
|
||||||
<p><table><tr><td><%= submit_tag l(:button_submit) %></td></tr></table></p>
|
<p>
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<td><%= submit_tag l(:button_submit) %></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</p>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<% if Setting.openid? %>
|
<% if Setting.openid? %>
|
||||||
<p><%= f.text_field :identity_url %></p>
|
<p><%= f.text_field :identity_url %></p>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
|
||||||
<% @user.custom_field_values.select {|v| v.editable? || v.required?}.each do |value| %>
|
<% @user.custom_field_values.select { |v| v.editable? || v.required? }.each do |value| %>
|
||||||
<p><%= custom_field_tag_with_label :user, value %></p>
|
<p><%= custom_field_tag_with_label :user, value %></p>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var $login = $('#user_login')
|
jQuery(document).ready(function () {
|
||||||
var $mail = $('#user_mail')
|
var $login = $('#user_login')
|
||||||
|
var $mail = $('#user_mail')
|
||||||
jQuery(document).ready(function() {
|
|
||||||
$login.blur(function(event) {
|
$login.blur(function (event) {
|
||||||
var $parent = $(this).parent();
|
if ($(this).is('#user_login')) {
|
||||||
if ( $(this).is('#user_login')) {
|
$.get(
|
||||||
$.get('<%=account_valid_ajax_path%>?valid=login&value='+this.value, function(data) {
|
'<%=account_valid_ajax_path%>',
|
||||||
if (data.valid) {
|
{ valid: "login",
|
||||||
$('#valid_user_login').html('<span class="green">'+data.message+"</span>");
|
value: this.value },
|
||||||
}else{
|
function (data) {
|
||||||
$('#valid_user_login').html('<span class="red">'+data.message+"</span>");
|
if (data.valid) {
|
||||||
}
|
$('#valid_user_login').html('<span class="green">' + data.message + "</span>");
|
||||||
});
|
} else {
|
||||||
};
|
$('#valid_user_login').html('<span class="red">' + data.message + "</span>");
|
||||||
});
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
;
|
||||||
|
});
|
||||||
|
|
||||||
$mail.blur(function(event) {
|
$mail.blur(function (event) {
|
||||||
var $parent = $(this).parent();
|
if ($(this).is('#user_mail')) {
|
||||||
if ( $(this).is('#user_mail')) {
|
$.get('<%=account_valid_ajax_path%>',
|
||||||
$.get('<%=account_valid_ajax_path%>?valid=mail&value='+this.value, function(data) {
|
{ valid: "mail",
|
||||||
if (data.valid) {
|
value: this.value },
|
||||||
$('#valid_user_mail').html('<span class="green">'+data.message+"</span>");
|
function (data) {
|
||||||
}else{
|
if (data.valid) {
|
||||||
$('#valid_user_mail').html('<span class="red">'+data.message+"</span>");
|
$('#valid_user_mail').html('<span class="green">' + data.message + "</span>");
|
||||||
}
|
} else {
|
||||||
});
|
$('#valid_user_mail').html('<span class="red">' + data.message + "</span>");
|
||||||
};
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
;
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
|
||||||
|
|
||||||
</script>
|
</script>
|
@ -0,0 +1,11 @@
|
|||||||
|
<%= error_messages_for @contestnotifications %>
|
||||||
|
<div class="add_frame_header" >
|
||||||
|
<%= l(:bale_news_notice) %>
|
||||||
|
</div>
|
||||||
|
<div class="box tabular">
|
||||||
|
<p><%= f.text_field :title, :required => true, :size => 60, :style => "width:488px;" %></p>
|
||||||
|
<p><%= f.text_area :description, :required => true, :cols => 60, :rows => 11, :class => 'wiki-edit', :style => "width:490px;" %></p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<%= wikitoolbar_for 'news_description' %>
|
@ -0,0 +1,28 @@
|
|||||||
|
<!--<p><%= link_to_project(news.project) + ': ' unless @project %>
|
||||||
|
<table><tr><td><img src="/images/new/news.png" width="40" height="40"/></td><td><%= link_to h(news.title), news_path(news) %>
|
||||||
|
<%= "(#{l(:label_x_comments, :count => news.comments_count)})" if news.comments_count > 0 %>
|
||||||
|
|
||||||
|
<% unless news.summary.blank? %></td><td><span class="fontligher"><%=h news.summary %></span><% end %></td>
|
||||||
|
<td><span class="author"><%= authoring news.created_on, news.author %></span></td></tr></table></p>-->
|
||||||
|
|
||||||
|
<table width="660px" border="0" align="center">
|
||||||
|
<tr>
|
||||||
|
<td colspan="2" valign="top" width="50" ><img src="/images/new/news.png" width="40" height="40"/></td>
|
||||||
|
<td><table width="580px" border="0">
|
||||||
|
<tr>
|
||||||
|
<td colspan="2" valign="top"><strong> <%=link_to contestnotifications.author,contest_contestnotification_path(contestnotifications)%></strong>
|
||||||
|
<a class="font_lighter"><%= l(:label_project_newshare) %></a> <%= link_to h(contestnotifications.title), contest_contestnotification_path(contestnotifications) %>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="2" width="580px" ><p class="font_description"><%=h contestnotifications.description%></p></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td align="left"><a class="font_lighter"> <%= contestnotifications.created_at %></a></td>
|
||||||
|
<td width="200" align="right" class="a"><%= link_to l(:label_project_newother),contest_contestnotification_path(contestnotifications)%>
|
||||||
|
<%= "(#{l(:label_x_comments, :count => contestnotifications.notificationcomments_count)})" if contestnotifications.notificationcomments_count > 0 %>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
@ -0,0 +1,12 @@
|
|||||||
|
<h3><%=l(:label_news)%></h3>
|
||||||
|
|
||||||
|
<%= labelled_form_for @contestnotification, url: contest_contestnotification_path, :html => { :id => 'contestnotifications-form', :multipart => true, :method => :put } do |f| %>
|
||||||
|
<%= render :partial => 'form', :locals => { :f => f } %>
|
||||||
|
<%= submit_tag l(:button_save) %>
|
||||||
|
<%= preview_link preview_contestnotifications_path(id: @contestnotification), 'contestnotifications-form' %>
|
||||||
|
<% end %>
|
||||||
|
<div id="preview" class="wiki"></div>
|
||||||
|
|
||||||
|
<% content_for :header_tags do %>
|
||||||
|
<%= stylesheet_link_tag 'scm' %>
|
||||||
|
<% end %>
|
@ -0,0 +1,14 @@
|
|||||||
|
api.array :contestnotifications, api_meta(:total_count => @contestnotifications_count, :offset => @offset, :limit => @limit) do
|
||||||
|
@contestnotificationss.each do |contestnotifications|
|
||||||
|
api.contestnotifications do
|
||||||
|
api.id contestnotifications.id
|
||||||
|
api.contest(:id => contestnotifications.contest_id, :name => contestnotifications.contest.name) unless contestnotifications.contest.nil?
|
||||||
|
api.author(:id => contestnotifications.author_id, :name => contestnotifications.author.name) unless contestnotifications.author.nil?
|
||||||
|
|
||||||
|
api.title contestnotifications.title
|
||||||
|
api.summary contestnotifications.summary
|
||||||
|
api.description contestnotifications.description
|
||||||
|
api.created_at contestnotifications.created_at
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,97 @@
|
|||||||
|
<span style="font-size: 16px; border-bottom:1px solid #f0f0f0; margin-right: 15px;">
|
||||||
|
<%= l(:label_notification) %>
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<% if User.current.logged? && User.current == @contest.author %>
|
||||||
|
<%= link_to(l(:bale_news_notice),
|
||||||
|
new_contest_contestnotification_path(@contest),
|
||||||
|
:class => 'icon icon-add',
|
||||||
|
:onclick => 'showAndScrollTo("add-contestnotifications", "contestnotifications_title"); return false;') %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<% if @contest %>
|
||||||
|
<div id="add-contestnotifications" class="add_frame" style="display:none;">
|
||||||
|
<%= labelled_form_for @contestnotification, :url => contest_contestnotifications_path(@contest),
|
||||||
|
:html => {:id => 'contestnotifications-form', :multipart => true} do |f| %>
|
||||||
|
<%= render :partial => 'contestnotifications/form', :locals => {:f => f} %>
|
||||||
|
<%= submit_tag l(:button_create), :class => 'whiteButton m3p10 h30', :name => nil %>
|
||||||
|
<%#= preview_link preview_contestnotifications_path(:contest_id => @contest), 'contestnotifications-form', target='preview', {:class => 'whiteButton m3p10'} %>
|
||||||
|
|
|
||||||
|
<%= link_to l(:button_cancel), "#", :onclick => '$("#add-contestnotifications").hide(); return false;', :class => 'whiteButton m3p10' %>
|
||||||
|
<% end if @contest %>
|
||||||
|
<div id="preview" class="wiki"></div>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
<div>
|
||||||
|
<% if @contestnotificationss.empty? %>
|
||||||
|
<p class="nodata">
|
||||||
|
<%= l(:label_no_data) %>
|
||||||
|
</p>
|
||||||
|
<% else %>
|
||||||
|
<% @contestnotificationss.each do |contestnotifications| %>
|
||||||
|
|
||||||
|
<table class="content-text-list">
|
||||||
|
<tr>
|
||||||
|
<td colspan="2" valign="top" width="50"><%= link_to image_tag(url_to_avatar(contestnotifications.author), :class => "avatar"), user_path(contestnotifications.author) %></td>
|
||||||
|
<td>
|
||||||
|
<table width="580px" border="0">
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td colspan="2" valign="top">
|
||||||
|
<strong><%= link_to_user(contestnotifications.author) if contestnotifications.respond_to?(:author) %></strong><span style="margin-left: 4px;" class="font_lighter">
|
||||||
|
<%= l(:label_project_notice) %></span><span><%= link_to h(contestnotifications.title), contest_contestnotification_path(@contest, contestnotifications) %></span>
|
||||||
|
<span style="float: right">
|
||||||
|
<%= link_to l(:button_edit), edit_contest_contestnotification_path(@contest, contestnotifications) if (User.current.admin? && User.current.logged? )||(User.current == @contest.author && User.current.logged?) %>
|
||||||
|
<%= delete_link contest_contestnotification_path(@contest, contestnotifications) if (User.current.admin? && User.current.logged? )||(User.current == @contest.author && User.current.logged?) %>
|
||||||
|
</span>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="2" width="580px">
|
||||||
|
<span class="font_description"><%= textilizable(contestnotifications, :description) %></span></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td align="left"><span class="font_lighter"> <%= l :label_update_time %>
|
||||||
|
<%= format_time(contestnotifications.created_at) %></span></td>
|
||||||
|
<td width="350" align="right" class="a"><%= link_to l(:label_check_comment), contest_contestnotification_path(@contest, contestnotifications) %><%#= "(#{l(:label_x_comments, :count => contestnotifications.notificationcomments_count)})" if contestnotifications.notificationcomments_count >= 0 %></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
<!--end-->
|
||||||
|
<div style="padding-right: 10px">
|
||||||
|
<div class="pagination">
|
||||||
|
<ul>
|
||||||
|
<%= pagination_links_full @contestnotifications_pages %>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<% content_for :header_tags do %>
|
||||||
|
<%= auto_discovery_link_tag(:atom, params.merge({:format => 'atom', :page => nil, :key => User.current.rss_key})) %>
|
||||||
|
<%= stylesheet_link_tag 'scm' %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<% html_title(l(:label_news_plural)) -%>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script type='text/javascript'>
|
||||||
|
$(document).ready(function ($) {
|
||||||
|
$('.content-text-list').each(function () {
|
||||||
|
$(this).find('.delete_icon').hide();
|
||||||
|
$(this).mouseenter(function (event) {
|
||||||
|
$(this).find('.delete_icon').show();
|
||||||
|
});
|
||||||
|
$(this).mouseleave(function (event) {
|
||||||
|
$(this).find('.delete_icon').hide();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<!--end-->
|
@ -0,0 +1,9 @@
|
|||||||
|
|
||||||
|
<%= labelled_form_for @contestnotification, :url => contest_contestnotifications_path(@contest), :html => { :id => 'contestnotifications-form', :multipart => true } do |f| %>
|
||||||
|
<%= render :partial => 'contestnotifications/form', :locals => { :f => f } %>
|
||||||
|
<%= submit_tag l(:button_create), :class => "whiteButton m3p10 h30" %>
|
||||||
|
<%= submit_tag l(:button_cancel), :class => "whiteButton m3p10 h30",:onclick => "cancel();" %>
|
||||||
|
|
||||||
|
|
||||||
|
<% end %>
|
||||||
|
<div id="preview" class="wiki"></div>
|
@ -0,0 +1,91 @@
|
|||||||
|
|
||||||
|
<div class="contextual">
|
||||||
|
<%= link_to(l(:button_edit),
|
||||||
|
edit_contest_contestnotification_path(@contest, @contestnotification),
|
||||||
|
:class => 'icon icon-edit',
|
||||||
|
:accesskey => accesskey(:edit),
|
||||||
|
:onclick => '$("#edit-contestnotifications").show(); return true;') if (User.current.admin? && User.current.logged? )||(User.current == @contest.author && User.current.logged?)%>
|
||||||
|
<%= delete_link contest_contestnotification_path(@contest, @contestnotification) if (User.current.admin? && User.current.logged? )||(User.current == @contest.author && User.current.logged?) %>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<h3><strong><%=h @contestnotification.title %></strong></h3>
|
||||||
|
|
||||||
|
<div id="edit-contestnotifications" style="display:none;">
|
||||||
|
<%= labelled_form_for @contestnotification, :url => contest_contestnotification_path(@contest),
|
||||||
|
:html => { :id => 'contestnotifications-form', :multipart => true, :method => :put } do |f| %>
|
||||||
|
<%= render :partial => 'form', :locals => { :f => f } %>
|
||||||
|
<%= submit_tag l(:button_save) %>
|
||||||
|
<%= link_to l(:button_cancel), "#", :onclick => '$("#edit-contestnotifications").hide(); return false;' %>
|
||||||
|
<% end %>
|
||||||
|
<div id="preview" class="wiki"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="notificationcomments" style="margin-bottom:16px;">
|
||||||
|
|
||||||
|
<div style="margin:15px">
|
||||||
|
<span class="font_description"> <%= textilizable(@contestnotification, :description) %> </span>
|
||||||
|
<br/>
|
||||||
|
<%#= link_to_attachments @contestnotification %>
|
||||||
|
<br/>
|
||||||
|
<!--add comment-->
|
||||||
|
|
||||||
|
<% if User.current.logged? %>
|
||||||
|
<p>
|
||||||
|
<%= toggle_link l(:label_comment_add), "add_notificationcomment_form", :focus => "notificationcomment_notificationcomments" %>
|
||||||
|
</p>
|
||||||
|
<% else %>
|
||||||
|
<%= l(:label_user_login_notificationcomment) %>
|
||||||
|
<%= link_to l(:label_user_login_new), signin_path %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<%= form_tag( contest_contestnotification_notificationcomments_path(@contest, @contestnotification) , :id => "add_notificationcomment_form", :style => "display:none;") do %>
|
||||||
|
<div class="box">
|
||||||
|
<%= text_area 'notificationcomment', 'notificationcomments', :cols => 80, :rows => 15, :class => 'wiki-edit' %>
|
||||||
|
<%= wikitoolbar_for 'notificationcomment_notificationcomments' %>
|
||||||
|
</div>
|
||||||
|
<p>
|
||||||
|
<%= submit_tag l(:button_add) %>
|
||||||
|
<%= submit_tag l(:button_cancel), :onclick => "cancel();" %>
|
||||||
|
</p>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
|
||||||
|
<% html_title @contestnotification.title -%>
|
||||||
|
|
||||||
|
<% content_for :header_tags do %>
|
||||||
|
<%= stylesheet_link_tag 'scm' %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<!--dispaly comments-->
|
||||||
|
<div class="line_heng"></div>
|
||||||
|
</div>
|
||||||
|
<h3 class="notificationcomments"><%= l(:label_comment_plural) %></h3>
|
||||||
|
<% notificationcomments = @notificationcomments.reverse %>
|
||||||
|
<% notificationcomments.each do |notificationcomment| %>
|
||||||
|
<% next if notificationcomment.new_record? %>
|
||||||
|
<table width="660px" border="0" align="center">
|
||||||
|
<tr>
|
||||||
|
<td colspan="2" valign="top" width="50" ><%= image_tag(url_to_avatar(notificationcomment.author), :class => "avatar")%></td>
|
||||||
|
<td>
|
||||||
|
<table width="580px" border="0">
|
||||||
|
<tr>
|
||||||
|
<td colspan="2" valign="top"><strong><%= link_to_user(notificationcomment.author) if notificationcomment.respond_to?(:author) %> </strong><span class="font_lighter"><%= l(:label_project_newadd) %></span><%= l(:label_comment_plural) %></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="2" width="580px" >
|
||||||
|
<p class="font_description">
|
||||||
|
<%= textilizable(notificationcomment.notificationcomments) %>
|
||||||
|
</p></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td align="left"><span class="font_lighter"> <%= format_time(notificationcomment.created_at) %></span></td>
|
||||||
|
<td width="200" align="right" class="a"><%#= link_to_if_authorized_contest image_tag('delete.png'), {:controller => 'notificationcomments', :action => 'destroy', :id => @contestnotifications, :notificationcomment_id => notificationcomment},
|
||||||
|
:data => {:confirm => l(:text_are_you_sure)}, :method => :delete, :title => l(:button_delete) %></td>
|
||||||
|
</tr>
|
||||||
|
</table></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<% end if @notificationcomments.any? %>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!--end-->
|
@ -0,0 +1,4 @@
|
|||||||
|
<div style="text-align: center;">评分:
|
||||||
|
<%= rating_for homework, dimension: :quality, class: 'rateable div_inline' %>
|
||||||
|
<span style="font-size: 11px">(每个用户对每份作业只能进行一次评价!)</span>
|
||||||
|
</div>
|
@ -0,0 +1,44 @@
|
|||||||
|
<%= error_messages_for 'member' %>
|
||||||
|
<div style="float:left; width:60%;padding-left: 10px;padding-right: 10px"
|
||||||
|
xmlns="http://www.w3.org/1999/html" id = "homework_of_users">
|
||||||
|
<table class="list members" style="width: 100%">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th><%= l(:label_user) %></th>
|
||||||
|
<th><%= l(:label_role_plural) %></th>
|
||||||
|
<th style="width:10%"></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<!-- 发布人员不能被删除,将发布人员放在第一位 -->
|
||||||
|
<tr id="member-<%= homework.user.id %>" class="<%= cycle 'odd', 'even' %> member" style="text-align: center">
|
||||||
|
<td style="width: 40%"><%= link_to_user homework.user %></td>
|
||||||
|
<td style="text-align: center;width: 50%"> 发布人员 </td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
<% hoemwork_users.each do |user| %>
|
||||||
|
<tr id="member-<%= user.id %>" class="<%= cycle 'odd', 'even' %> member" style="text-align: center">
|
||||||
|
<% if homework.user != user %>
|
||||||
|
<td style="width: 40%"><%= link_to_user user %></td>
|
||||||
|
<td style="text-align: center;width: 50%"> 参与人员 </td>
|
||||||
|
<td><%= link_to l(:button_delete),destory_homework_users_homework_attach_path(:user_id=>user),:remote => true, :method => :post %></td>
|
||||||
|
<% end %>
|
||||||
|
</tr>
|
||||||
|
<% end %>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="splitcontentright" style="width: 37%">
|
||||||
|
<%= form_for(hoemwork_users, {:url => add_homework_users_homework_attach_path(homework), :remote => true, :method => :post}) do |f| %>
|
||||||
|
<fieldset>
|
||||||
|
<legend><%= l(:label_member_new) %></legend>
|
||||||
|
<p><%= label_tag "principal_search", l(:label_principal_search) %><%= text_field_tag 'principal_search', nil %></p>
|
||||||
|
<%= javascript_tag "observeSearchfield('principal_search', null, '#{ escape_javascript get_homework_member_list_homework_attach_index_path(:q => params[:q], :bid_id => params[:id]||homework, :format => 'js') }')" %>
|
||||||
|
<div id="principals_for_new_member">
|
||||||
|
<%= render_new_members_for_homework(members) %>
|
||||||
|
</div>
|
||||||
|
<p><%= submit_tag l(:button_add), :id => 'member-add-submit' %></p>
|
||||||
|
</fieldset>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
@ -0,0 +1,3 @@
|
|||||||
|
<div id="principals_for_new_member">
|
||||||
|
<%= render_new_members_for_homework(members) %>
|
||||||
|
</div>
|
@ -0,0 +1,22 @@
|
|||||||
|
<div class="box">
|
||||||
|
<p style=" padding: 3px 0 3px 0;padding-left: 50px; clear:left;">
|
||||||
|
<strong>标 题:</strong>
|
||||||
|
<%= f.text_field "name", :required => true, :size => 60, :style => "width:490px;" %>
|
||||||
|
</p>
|
||||||
|
<p style=" padding: 3px 0 3px 0;padding-left: 50px; clear:left;">
|
||||||
|
<strong style="vertical-align: top">描 述:</strong>
|
||||||
|
<span style="margin-left:-10px;padding-right: 20px;">
|
||||||
|
<%= f.text_area "description", :rows => 8, :class => 'wiki-edit', :style => "font-size:small;width:490px;margin-left:10px;" %>
|
||||||
|
</span>
|
||||||
|
</p>
|
||||||
|
<p style="padding-left: 60px">
|
||||||
|
<fieldset style="text-align: left;">
|
||||||
|
<legend>
|
||||||
|
<%= l(:label_attachment_plural) %>
|
||||||
|
</legend>
|
||||||
|
<p style=" padding: 3px 0 3px 0;padding-left: 50px; clear:left;">
|
||||||
|
<%= render :partial => 'attachments/form' %>
|
||||||
|
</p>
|
||||||
|
</fieldset>
|
||||||
|
</p>
|
||||||
|
</div>
|
@ -0,0 +1 @@
|
|||||||
|
$('#content2').html('<%= escape_javascript(render(:partial => 'homework_member', :locals => {:members => @members,:hoemwork_users =>@hoemwork_users,:homework => @homework} )) %>');
|
@ -0,0 +1 @@
|
|||||||
|
$('#content2').html('<%= escape_javascript(render(:partial => 'homework_member', :locals => {:members => @members,:hoemwork_users =>@hoemwork_users,:homework => @homework} )) %>');
|
@ -1,35 +1,79 @@
|
|||||||
<p style="font-weight: bold; color: rgb(237,137,36)" xmlns="http://www.w3.org/1999/html"> <%=raw l(:label_new_homework)%> </p>
|
<script type="text/javascript">
|
||||||
<div class="box">
|
function switchTab(ProTag) {
|
||||||
|
var display_index = 3 - ProTag;
|
||||||
|
document.getElementById("tab" + ProTag).className = "selected";
|
||||||
|
document.getElementById("tab" + display_index).className = "";
|
||||||
|
document.getElementById("content" + ProTag).style.display = "";
|
||||||
|
document.getElementById("content" + display_index).style.display = "none";
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div class="top-content">
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<td class="info_font" style="width: 240px; color: #15bccf">高校课程实践社区</td>
|
||||||
|
<td style="width: auto; color: #15bccf"><strong><%= l(:label_user_location) %> : </strong></td>
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="padding-left: 8px"><a><%= link_to request.host()+"/courses", :controller => 'projects', :action => 'course'%></a></td>
|
||||||
|
<td><p class="top-content-list-homework"><%=link_to "主页", home_path %> > <%=link_to l(:label_course_practice), :controller => 'projects', :action => 'course' %> >
|
||||||
|
<span><%= link_to(@homework.bid.courses.first.name.to_s, homework_project_path(@homework.bid.courses.first)) if @homework.bid.courses.first%></span> >
|
||||||
|
<%=link_to(@homework.bid.name, respond_path(@homework.bid)) %> > <span><%= link_to "修改作业",edit_homework_attach_path(@homework)%></span></p></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<p style="font-weight: bold; color: rgb(237,137,36)" xmlns="http://www.w3.org/1999/html"> <%=raw l(:label_edit_homework)%> </p>
|
||||||
|
<div class="tabs">
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
<a id = "tab1" href="#" class = "selected" onclick="switchTab(1);this.blur();return false;">
|
||||||
|
<%= l(:label_information_plural) %>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a id="tab2" href="#" onclick="switchTab(2); this.blur(); return false;">
|
||||||
|
<%= l(:label_member_plural) %>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="box" id="content1">
|
||||||
<%= form_for(@homework) do |f|%>
|
<%= form_for(@homework) do |f|%>
|
||||||
<p style=" padding: 3px 0 3px 0;padding-left: 50px; clear:left;">
|
<p style=" padding: 3px 0 3px 0;padding-left: 50px; clear:left;">
|
||||||
<strong>标 题:</strong>
|
<strong>标 题:</strong>
|
||||||
<%= f.text_field :name, :required => true, :name => "homework_name", :size => 60, :style => "width:490px;"%>
|
<%= f.text_field :name, :required => true, :name => "homework_name", :size => 60, :style => "width:490px;"%>
|
||||||
</p>
|
</p>
|
||||||
<p style=" padding: 3px 0 3px 0;padding-left: 50px; clear:left;">
|
<p style=" padding: 3px 0 3px 0;padding-left: 50px; clear:left;">
|
||||||
<strong style="vertical-align: top">描 述:</strong>
|
<strong style="vertical-align: top">描 述:</strong>
|
||||||
<span style="margin-left:-10px;padding-right: 20px;">
|
<span style="margin-left:-10px;padding-right: 20px;">
|
||||||
<%= f.text_area :description, :rows => 8, :name => "homework_description", :class => 'wiki-edit', :style => "font-size:small;width:490px;margin-left:10px;" %>
|
<%= f.text_area :description, :rows => 8, :name => "homework_description", :class => 'wiki-edit', :style => "font-size:small;width:490px;margin-left:10px;" %>
|
||||||
</span>
|
</span>
|
||||||
</p>
|
</p>
|
||||||
<p style="padding-left: 60px">
|
<p style="padding-left: 60px">
|
||||||
<fieldset style="text-align: left;">
|
<fieldset style="text-align: left;">
|
||||||
<p style="padding-left: 60px">
|
<p style="padding-left: 60px">
|
||||||
<% options = {:author => true, :deletable => attach_delete(@homework)} %>
|
<% options = {:author => true, :deletable => attach_delete(@homework)} %>
|
||||||
<%= render :partial => 'attachments/links',
|
<%= render :partial => 'attachments/links',
|
||||||
:locals => {:attachments => @homework.attachments, :options => options} %>
|
:locals => {:attachments => @homework.attachments, :options => options} %>
|
||||||
</p>
|
</p>
|
||||||
<legend>
|
<legend>
|
||||||
<%= l(:label_attachment_plural) %>
|
<%= l(:label_attachment_plural) %>
|
||||||
</legend>
|
</legend>
|
||||||
<p style=" padding: 3px 0 3px 0;padding-left: 50px; clear:left;">
|
<p style=" padding: 3px 0 3px 0;padding-left: 50px; clear:left;">
|
||||||
<%= render :partial => 'attachments/form' %>
|
<%= render :partial => 'attachments/form' %>
|
||||||
</p>
|
</p>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</p>
|
</p>
|
||||||
<p style="padding-left: 60px;padding-top: 10px;">
|
<p style="padding-left: 60px;padding-top: 10px;">
|
||||||
<span >
|
<span >
|
||||||
<%= submit_tag t(:label_button_ok), :sta => 0, :class => "enterprise"%>
|
<%= submit_tag t(:label_button_ok), :sta => 0, :class => "enterprise"%>
|
||||||
</span>
|
</span>
|
||||||
</p>
|
</p>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div id="content2" style="display: none" >
|
||||||
|
<%= render :partial => "homework_member",:locals => {:members => @members,:hoemwork_users =>@hoemwork_users,:homework => @homework} %>
|
||||||
|
</div>
|
||||||
|
@ -0,0 +1,2 @@
|
|||||||
|
$('#principals_for_new_member').replaceWith('<%= j(render :partial => "member_list_partial", locals:{members: @members})%>');
|
||||||
|
|
@ -0,0 +1,15 @@
|
|||||||
|
<div class="top-content">
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<td class="info_font" style="width: 240px; color: #15bccf">高校课程实践社区</td>
|
||||||
|
<td style="width: auto; color: #15bccf"><strong><%= l(:label_user_location) %> : </strong></td>
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="padding-left: 8px"><a><%= link_to request.host()+"/courses", :controller => 'projects', :action => 'course'%></a></td>
|
||||||
|
<td><p class="top-content-list-homework"><%=link_to "主页", home_path %> > <%=link_to l(:label_course_practice), :controller => 'projects', :action => 'course' %> >
|
||||||
|
<span><%= link_to(homework_attach.bid.courses.first.name.to_s, homework_project_path(homework_attach.bid.courses.first)) if homework_attach.bid.courses.first%></span> >
|
||||||
|
<%=link_to(homework_attach.bid.name, respond_path(homework_attach.bid)) %> > <span><%= link_to homework_attach.name.nil? ? homework_attach.attachments.first.filename : homework_attach.name,homework_attach_path(homework_attach)%></span></p></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue