From 815d2ceb3d18022b05b169522db1d223e469e605 Mon Sep 17 00:00:00 2001 From: alan <547533434@qq.com> Date: Fri, 19 Dec 2014 23:12:32 +0800 Subject: [PATCH 01/28] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E3=80=8A=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E7=9B=B8=E5=90=8C=E7=BB=84=E6=97=B6=E5=BA=94=E8=AF=A5?= =?UTF-8?q?=E7=BB=99=E5=87=BA=E7=9B=B8=E5=85=B3=E6=8F=90=E7=A4=BA=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E3=80=8B=E5=8A=9F=E8=83=BD=20Signed-off-by:=20alan=20?= =?UTF-8?q?<547533434@qq.com>?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/courses_controller.rb | 19 +++++++++++++++++++ app/views/courses/member.html.erb | 19 +++++++++++++++++++ app/views/layouts/course_base.html.erb | 7 +++++-- app/views/projects/member.html.erb | 3 ++- config/locales/zh.yml | 5 +++-- config/routes.rb | 1 + 6 files changed, 49 insertions(+), 5 deletions(-) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 12852c63d..e79ca2caa 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -261,6 +261,25 @@ class CoursesController < ApplicationController @membercount = @members.count @course_groups = @course.course_groups end + + def valid_ajax + req = Hash.new(false) + req[:message] = '' + + valid_attr = params[:valid] + valid_value = params[:value] + + faker = CourseGroup.new + + if valid_attr.eql?('name') + faker.name = valid_value + faker.valid? + req[:valid] = faker.errors[:name].blank? + req[:message] = faker.errors[:name] + end + req[:message] = l(:modal_valid_passing) if req[:message].blank? + render :json => req + end def join_group @subPage_title = l :label_student_list group = CourseGroup.find(params[:object_id]) diff --git a/app/views/courses/member.html.erb b/app/views/courses/member.html.erb index b426e4a3e..ab95f5fdc 100644 --- a/app/views/courses/member.html.erb +++ b/app/views/courses/member.html.erb @@ -1,3 +1,22 @@ +
-