diff --git a/app/models/course.rb b/app/models/course.rb index d98ac0f1e..4b4313ee1 100644 --- a/app/models/course.rb +++ b/app/models/course.rb @@ -72,7 +72,7 @@ class Course < ActiveRecord::Base validates_presence_of :term,:name validates_format_of :class_period, :with =>/^[1-9]\d*$/ validates_format_of :time, :with => /^\d{4}$/ - validates_format_of :name,:with =>/^[^ ]+[a-zA-Z0-9_\u4e00-\u9fa5\s\S]+$/ + validates_format_of :name,:with =>/^[^ ]+[a-zA-Z0-9_\u4e00-\u9fa5\s\S]*$/ validates_length_of :description, :maximum => 10000 before_save :self_validate diff --git a/app/services/syllabuses_service.rb b/app/services/syllabuses_service.rb index 530c550ed..dc6bfac91 100644 --- a/app/services/syllabuses_service.rb +++ b/app/services/syllabuses_service.rb @@ -61,4 +61,4 @@ class SyllabusesService end -end \ No newline at end of file +end diff --git a/app/views/wechats/user_activities.html.erb b/app/views/wechats/user_activities.html.erb index bb7d96d50..dfb6e125e 100644 --- a/app/views/wechats/user_activities.html.erb +++ b/app/views/wechats/user_activities.html.erb @@ -28,31 +28,31 @@ - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/javascripts/wechat/controllers/send_class_list.js b/public/javascripts/wechat/controllers/send_class_list.js index caca3cd6a..f9d6ef193 100644 --- a/public/javascripts/wechat/controllers/send_class_list.js +++ b/public/javascripts/wechat/controllers/send_class_list.js @@ -1,18 +1,11 @@ -app.controller('SendClassListController', ['$scope', '$http','$routeParams', 'config','auth','alertService', function($scope, $http, $routeParams, config, auth, alertService,rms){ +app.controller('SendClassListController', ['$scope', '$http','$routeParams', 'config','auth','alertService', 'rms', function($scope, $http, $routeParams, config, auth, alertService,rms){ var vm = $scope; var send_id = $routeParams.id; vm.alertService = alertService.create(); -// vm.courses = []; vm.syllabuses = []; var loadClassList = function () { -// $http.get(config.apiUrl + "courses?token=" + auth.token() + "&per_page_count=10&page=1").then( -// function (response) { -// console.log(response.data); -// vm.courses = response.data.data; -// } -// ); $http.get(config.apiUrl + "syllabuses?token=" + auth.token()).then( function (response) { console.log(response.data); @@ -59,4 +52,4 @@ app.controller('SendClassListController', ['$scope', '$http','$routeParams', 'co }) } -}]); \ No newline at end of file +}]);