From 2262997c31ff34dc0d1543ba20ce0f86f1e7a9d8 Mon Sep 17 00:00:00 2001 From: alan <547533434@qq.com> Date: Thu, 8 Jan 2015 16:16:59 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E3=80=8A=E6=96=B0?= =?UTF-8?q?=E5=BB=BA=E8=AF=BE=E7=A8=8B=E6=97=B6=EF=BC=9A=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E5=90=8D=E4=B8=AD=E6=9C=89=E7=A9=BA=E6=A0=BC=E6=88=96=E8=80=85?= =?UTF-8?q?=E7=89=B9=E6=AE=8A=E7=AC=A6=E5=8F=B7=E4=BC=9A=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=E5=90=8D=E7=A7=B0=E6=97=A0=E6=95=88,=E3=80=8B=20=20=20=20=20?= =?UTF-8?q?=20=E3=80=8A=20=E7=BC=BA=E9=99=B7=20Trustie-Forge#1782=20(?= =?UTF-8?q?=E5=B7=B2=E8=A7=A3=E5=86=B3):=20lable=E6=A0=87=E7=AD=BE?= =?UTF-8?q?=E5=92=8C=E5=AF=B9=E5=BA=94=E7=9A=84=E6=98=BE=E7=A4=BA=E5=80=BC?= =?UTF-8?q?=E4=B9=8B=E9=97=B4=E9=97=B4=E8=B7=9D=E8=BF=87=E5=A4=A7=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98=EF=BC=8C=E4=BE=8B=E5=A6=82=E4=B8=AA=E4=BA=BA?= =?UTF-8?q?=E4=B8=BB=E9=A1=B5=E5=B7=A6=E4=BE=A7=E7=9A=84=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=EF=BC=8C=E5=85=B7=E4=BD=93=E5=A6=82=E5=9B=BE=E6=89=80=E7=A4=BA?= =?UTF-8?q?=E3=80=8B=20=20=20=20=20=E3=80=8A=E6=9C=AC=E5=9C=B0=E7=89=88?= =?UTF-8?q?=E4=B8=AD=E5=85=B3=E4=BA=8E=E5=AD=A6=E7=94=9F=E5=88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8=8D=E7=BB=9F=E4=B8=80=E3=80=82=E3=80=8B?= =?UTF-8?q?=20=20=20=20=E3=80=8A=E8=BF=9B=E5=85=A5=E6=9F=90=E7=AB=9E?= =?UTF-8?q?=E8=B5=9B=E4=B8=BB=E9=A1=B5=EF=BC=8C=E7=82=B9=E5=87=BB=E5=88=9B?= =?UTF-8?q?=E6=96=B0=E7=AB=9E=E8=B5=9B=E9=93=BE=E6=8E=A5=E6=B2=A1=E5=8F=8D?= =?UTF-8?q?=E5=BA=94=E3=80=8Bbug=20Signed-off-by:=20alan=20<547533434@qq.c?= =?UTF-8?q?om>?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/courses_controller.rb | 3 +- app/helpers/courses_helper.rb | 2 +- app/models/course.rb | 2 +- app/views/courses/member.html.erb | 31 +++++++++---------- app/views/layouts/base_contest.html.erb | 7 +++-- app/views/layouts/base_courses.html.erb | 10 ++++-- app/views/layouts/base_newcontest.html.erb | 10 +++--- app/views/layouts/base_projects.html.erb | 4 +-- app/views/layouts/base_users.html.erb | 36 +++++++++++----------- public/stylesheets/application.css | 2 +- 10 files changed, 57 insertions(+), 50 deletions(-) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 87ab7e683..e76fa31dc 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -500,7 +500,8 @@ class CoursesController < ApplicationController end end - def course + def + course @school_id = params[:school_id] per_page_option = 10 if @school_id == "0" or @school_id.nil? diff --git a/app/helpers/courses_helper.rb b/app/helpers/courses_helper.rb index 096ce7ad8..8547ef18f 100644 --- a/app/helpers/courses_helper.rb +++ b/app/helpers/courses_helper.rb @@ -114,7 +114,7 @@ module CoursesHelper # 学生人数计算 # add by nwb def studentCount course - searchStudent(course).count.to_s#course.student.count + course.student.count.to_s#course.student.count end #课程成员数计算 diff --git a/app/models/course.rb b/app/models/course.rb index 196e7168d..c11f66d49 100644 --- a/app/models/course.rb +++ b/app/models/course.rb @@ -38,7 +38,7 @@ class Course < ActiveRecord::Base validates_presence_of :password, :term,:name validates_format_of :class_period, :with =>/^[1-9]\d*$/ - validates_format_of :name,:with =>/^[a-zA-Z0-9_\u4e00-\u9fa5]+$/ + validates_format_of :name,:with =>/^[^ ]+[a-zA-Z0-9_\u4e00-\u9fa5\s\S]+$/ validates_length_of :description, :maximum => 10000 before_save :self_validate after_create :create_board_sync diff --git a/app/views/courses/member.html.erb b/app/views/courses/member.html.erb index d199097be..81c469fd8 100644 --- a/app/views/courses/member.html.erb +++ b/app/views/courses/member.html.erb @@ -1,21 +1,19 @@ -