From b2b6536a0f85a66c7ca8e3aabf1780155e50a244 Mon Sep 17 00:00:00 2001 From: txz Date: Tue, 28 Jun 2016 14:48:33 +0800 Subject: [PATCH 01/87] =?UTF-8?q?=E5=BE=AE=E4=BF=A1css=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Gemfile~ | 114 +++++++++++++++++++++++++++++ db/schema.rb | 31 ++++---- public/stylesheets/weui/weixin.css | 13 ++-- 3 files changed, 134 insertions(+), 24 deletions(-) create mode 100644 Gemfile~ diff --git a/Gemfile~ b/Gemfile~ new file mode 100644 index 000000000..334f15853 --- /dev/null +++ b/Gemfile~ @@ -0,0 +1,114 @@ +source 'https://ruby.taobao.org/' + +unless RUBY_PLATFORM =~ /w32/ + # unix-like only + gem 'iconv' + gem "rmagick", ">= 2.0.0" + gem 'certified' +end + +gem 'net-ssh', '2.9.1' +gem 'jenkins_api_client' +gem 'nokogiri' + +gem 'wechat',path: 'lib/wechat' +gem 'grack', path:'lib/grack' +gem 'gitlab', path: 'lib/gitlab-cli' +gem 'rest-client' +gem "mysql2", "= 0.3.18" +gem 'redis-rails' +gem 'rubyzip' +gem 'delayed_job_active_record'#, :group => :production +gem 'daemons' +gem 'grape', '~> 0.9.0' +gem 'grape-entity' +gem 'rack-cors', :require => 'rack/cors' +gem 'seems_rateable', '~> 1.0.13' +gem 'rails', '~> 3.2' +gem "jquery-rails", "~> 2.0.2" +gem "i18n", "~> 0.6.0" +gem 'coderay', '~> 1.1.0' +gem "fastercsv", "~> 1.5.0", :platforms => [:mri_18, :mingw_18, :jruby] +gem "builder", "3.0.0" +gem 'acts-as-taggable-on', '2.4.1' +gem 'spreadsheet' +gem 'ruby-ole' +gem 'rails_kindeditor',path:'lib/rails_kindeditor' +gem 'binding_of_caller' +gem 'chinese_pinyin' +# gem 'sunspot_rails', '~> 1.3.3' +# gem 'sunspot_solr' +# gem 'sunspot' +# gem 'progress_bar' +gem 'ansi' + +gem 'kaminari' +gem 'elasticsearch-model' +gem 'elasticsearch-rails' + + +### profile +#gem 'oneapm_rpm' + +group :development do + gem 'grape-swagger' + gem 'better_errors', '~> 1.1.0' + # gem "query_reviewer" + # gem 'rack-mini-profiler', '~> 0.9.3' + if RUBY_PLATFORM =~ /w32/ + gem 'win32console' + end +end + +group :development, :test do + unless RUBY_PLATFORM =~ /w32/ + gem 'pry-rails' + if RUBY_VERSION >= '2.0.0' + gem 'pry-byebug' + end + gem 'pry-stack_explorer' + if RUBY_PLATFORM =~ /darwin/ + gem 'puma' + end + end + + gem 'rspec-rails', '~> 3.0' + gem 'factory_girl_rails' +end + +# Gems used only for assets and not required +# in production environments by default. +group :assets do + gem 'sass-rails', '~> 3.2.3' + gem 'coffee-rails', '~> 3.2.1' + + # See https://github.com/sstephenson/execjs#readme for more supported runtimes + # gem 'therubyracer', :platforms => :ruby + + gem 'uglifier', '>= 1.0.3' +end + +# Optional gem for LDAP authentication +group :ldap do + gem "net-ldap", "~> 0.3.1" +end + + +# Optional gem for OpenID authentication +group :openid do + gem "ruby-openid", "~> 2.1.4", :require => "openid" + gem "rack-openid" +end + + +database_file = File.join(File.dirname(__FILE__), "config/database.yml") +if File.exist?(database_file) +else + warn("Please configure your config/database.yml first") +end + +# Load plugins' Gemfiles +Dir.glob File.expand_path("../plugins/*/Gemfile", __FILE__) do |file| + puts "Loading #{file} ..." if $DEBUG # `ruby -d` or `bundle -v` + instance_eval File.read(file) +end diff --git a/db/schema.rb b/db/schema.rb index 148a6e21b..24c769ac8 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20160624032138) do +ActiveRecord::Schema.define(:version => 20160624103411) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -1125,23 +1125,6 @@ ActiveRecord::Schema.define(:version => 20160624032138) do t.integer "viewed_count", :default => 0 end - create_table "mess", :id => false, :force => true do |t| - t.string "课程名" - t.integer "课程ID", :default => 0, :null => false - t.string "教师姓", :default => "", :null => false - t.string "教师名", :limit => 30, :default => "", :null => false - t.string "主贴名", :default => "", :null => false - t.integer "主贴或回帖ID", :default => 0, :null => false - t.integer "回帖对应主贴ID" - t.integer "帖子点赞数" - t.integer "主贴回复数", :default => 0, :null => false - t.text "主贴或回帖内容" - t.datetime "发帖时间", :null => false - t.integer "发帖或回帖用户ID", :default => 0, :null => false - t.string "发帖或回帖用户姓", :default => "", :null => false - t.string "发帖或回帖用户名", :limit => 30, :default => "", :null => false - end - create_table "message_alls", :force => true do |t| t.integer "user_id" t.integer "message_id" @@ -1539,6 +1522,18 @@ ActiveRecord::Schema.define(:version => 20160624032138) do add_index "projects_trackers", ["project_id", "tracker_id"], :name => "projects_trackers_unique", :unique => true add_index "projects_trackers", ["project_id"], :name => "projects_trackers_project_id" + create_table "quality_analyses", :force => true do |t| + t.integer "project_id" + t.string "author_login" + t.string "rep_identifier" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "sonar_version", :default => 0 + t.string "path" + t.string "branch" + t.string "language" + end + create_table "queries", :force => true do |t| t.integer "project_id" t.string "name", :default => "", :null => false diff --git a/public/stylesheets/weui/weixin.css b/public/stylesheets/weui/weixin.css index 3360d81ee..3bbab9b6c 100644 --- a/public/stylesheets/weui/weixin.css +++ b/public/stylesheets/weui/weixin.css @@ -4,7 +4,7 @@ /*基本样式*/ body,table,input,textarea,select,button { font-family: "微软雅黑","宋体","Helvetica Neue", Helvetica, Arial, sans-serif;} body, ul, h1,h2,h3,h4,h5,p,pre,input {padding:0px; margin:0px;} -body{background-color: #EFEFF4;} +body{background-color: #efeff4;} ul li {list-style:none;} img {max-width:100%;} blockquote {border:1px solid #d4d4d4; padding: 0.6em; margin-left: 1.4em; margin-right: 0.4em; border-radius: 4px; font-family: "Microsoft YaHei"; background-size: 100% 100%; margin-top:5px;} @@ -19,6 +19,7 @@ blockquote {border:1px solid #d4d4d4; padding: 0.6em; margin-left: 1.4em; margin .mt5 {margin-top:5px;} .mt10 {margin-top:10px;} .mt11 {margin-top:11px;} +.mt12 {margin-top:12px;} .mt15 {margin-top:15px;} .mt30 {margin-top:30px;} .mt70 {margin-top:70px;} @@ -44,6 +45,7 @@ blockquote {border:1px solid #d4d4d4; padding: 0.6em; margin-left: 1.4em; margin .c-grey5 {color:#aaaaaa;} .c-grey6 {color:#777777;} .c-blue {color:#3b94d6;} +.c-white {color:#ffffff;} a {color:#707070;} a.c-grey {color:#707070;} a.c-grey2 {color:#9a9a9a;} @@ -73,7 +75,7 @@ a.underline {text-decoration:underline;} .btn1 {width:100%; height:40px; line-height:40px; vertical-align:middle; text-align:center; color:#fff; display:block; border-radius:5px;} .bg-blue:not(.btn-disabled):active {background-color:#2780c2;} .btn-disabled {background-color:#ccc;} - +.btn2 {width:145px; height:35px; color:#fff; font-size:15px; line-height:35px; text-align:center; vertical-align:middle; margin:18px auto 20px auto; border-radius:50px; display:block;} /*tab*/ .tab-wrap {position:relative; line-height:38px; display:flex; font-size:13px; background-color:#fff;} @@ -87,7 +89,6 @@ a.underline {text-decoration:underline;} .bottom-tab-wrap a {display:block; flex:1; position:relative;} .bottom-tab-wrap a:after {content:" "; position:absolute; left:0; top:0; width:1px; height:100%; border-left:1px solid #ccc; color:#707070;} - /*动态样式*/ .post-container {width:100%;} .post-wrapper {width:98%; border-radius:3px; box-shadow:0px 0px 8px rgba(146, 153, 169, 0.5); background-color:#ffffff; margin:10px auto;} @@ -134,7 +135,7 @@ a.underline {text-decoration:underline;} .locked_btn_cir {background: url("/images/wechat/locked.png") 0 0 no-repeat; cursor: default;} /*20150612加入班级样式*/ -.add-class-box {width:80%; max-width:300px; min-width:240px; height:150px; font-size:15px; color:#444; background-color:#fff; margin:0 auto; box-shadow: 0px 2px 8px rgba(146, 153, 169, 0.5); border-radius:5px; margin-top:100px;} +.add-class-box {position:fixed; width:80%; max-width:300px; min-width:240px; font-size:15px; color:#444; background-color:#fff; margin:0 auto; box-shadow: 0px 2px 8px rgba(146, 153, 169, 0.5); border-radius:5px; top:50%; left:50%; transform: translate(-50%,-50%);} .add-class-tip {padding-top:20px; padding-bottom:20px;} .class-number-input {width:80%; max-width:240px; height:28px; border:1px solid #ccc; padding-left:5px; margin:0 auto; display:block;} .cancel-btn {width:49%; height:37px; line-height:37px; text-align:center; vertical-align:middle; border-top:1px solid #ccc;} @@ -191,7 +192,7 @@ a.underline {text-decoration:underline;} .input-box { -webkit-appearance: none; font-size: 16px;width:100%; height:16px; padding: 10px 0px 10px 5px; line-height:16px; border:1px solid #ccc; border-radius:5px;} .login-op-wrap {height:30px; line-height:30px; vertical-align:middle;} .login-box{display:inline-block; width:14px; height:14px; line-height:14px; text-align:center; vertical-align:middle; border:1px solid #ccc; background:#fff; border-radius:3px; color:#fff; cursor:pointer;} -.login-box.checked{background:#63c360;} +.login-box.checked{background:#63c360; border:1px solid #63c360;} .login-box.checked:after{content:url(/images/wechat/checked.png);} .forget-psw-wrap {width:60px; margin:0 auto;} -.forget-psw {position:fixed; bottom:10px;} +.forget-psw {position:fixed; bottom:10px;} \ No newline at end of file From 2596231ce7d262c895a393d7865cd69fd0aba6ff Mon Sep 17 00:00:00 2001 From: txz Date: Wed, 29 Jun 2016 15:44:32 +0800 Subject: [PATCH 02/87] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E6=96=B0=E5=8A=A8?= =?UTF-8?q?=E6=80=81=E6=A0=B7=E5=BC=8F=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/stylesheets/weui/weixin.css | 35 ++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/public/stylesheets/weui/weixin.css b/public/stylesheets/weui/weixin.css index 3bbab9b6c..5b1c1df95 100644 --- a/public/stylesheets/weui/weixin.css +++ b/public/stylesheets/weui/weixin.css @@ -11,7 +11,9 @@ blockquote {border:1px solid #d4d4d4; padding: 0.6em; margin-left: 1.4em; margin .text-control {word-break:normal; word-wrap:break-word;} .f12 {font-size:12px;} .f13 {font-size:13px;} +.f14 {font-size:14px;} .f15 {font-size:15px;} +.f16 {font-size:16px;} .fb {font-weight:bold;} .mt2 {margin-top:2px;} .mt3 {margin-top:3px;} @@ -26,6 +28,7 @@ blockquote {border:1px solid #d4d4d4; padding: 0.6em; margin-left: 1.4em; margin .mb5 {margin-bottom:5px;} .mb10 {margin-bottom:10px;} .mb20 {margin-bottom:20px;} +.ml5 {margin-left:5px;} .ml10 {margin-left:10px;} .mr5 {margin-right:5px;} .mr10 {margin-right:10px;} @@ -91,15 +94,15 @@ a.underline {text-decoration:underline;} /*动态样式*/ .post-container {width:100%;} -.post-wrapper {width:98%; border-radius:3px; box-shadow:0px 0px 8px rgba(146, 153, 169, 0.5); background-color:#ffffff; margin:10px auto;} -.post-main {padding:10px; color:#9a9a9a;} -.post-avatar {width:40px; height:40px; margin-right:5px;} +.post-wrapper {width:100%; background-color:#ffffff; margin:10px auto;} +.post-main {padding:10px 15px; color:#9a9a9a;} +.post-avatar {width:30px; height:30px;} .post-title {font-size:13px; text-align:left;} .post-detail-info {font-size:13px; text-align:left; color:#9a9a9a;} .fl {float:left;} .fr {float:right;} .cl {clear:both; overflow:hidden;} -.post-content {width:100%; font-size:13px; line-height:18px; height:90px; overflow:hidden; word-break:break-all; word-wrap:break-word;} +.post-content {width:100%; font-size:14px; line-height:20px; height:100px; overflow:hidden; word-break:break-all; word-wrap:break-word;} .post-all-content a {color:#136ec2;} .post-interactive {width:100%; height:35px; line-height:35px; vertical-align:middle; border-top:1px solid #e6e6e6; background-color:#f8f9fb;} .post-interactive-column, @@ -108,23 +111,32 @@ a.underline {text-decoration:underline;} .more-wrap {width:100%;} .more-events {width:98%; font-size:13px; text-align:center; margin:0 auto; padding: 5px 0; border:1px solid #e6e6e6; border-radius:3px; background-color:#f8f9fb; } .border-bottom {border-bottom:1px solid #e6e6e6;} -.post-reply-wrap, .post-input-wrap {width:100%; background-color:#f8f9fb;} -.post-reply-row {padding:10px; color:#9a9a9a;} +.post-reply-wrap {width:100%;} +.post-input-wrap {width:100%; position:fixed; bottom:0;} +.post-input-wrap2 {width:100%;} +.post-reply-row {padding:10px 15px; color:#9a9a9a; background-color:#fff;} .post-reply-avatar {width:45px; height:30px; text-align:center; margin-right:10px;} .post-reply-user {font-size:13px; text-align:left; margin-bottom:10px;} -.post-reply-content {font-size:13px; text-align:left; word-break:break-all; word-wrap:break-word; overflow:hidden;} +.post-reply-content {font-size:13px; text-align:left; word-break:break-all; word-wrap:break-word; overflow:hidden; padding-bottom:15px; border-bottom:1px solid #ccc;} .post-reply-content img {max-width:100%;} .post-reply-date, .post-reply-trigger {font-size:13px;} -.post-input-container {padding-right:12px;} +.post-input-container {position:relative; padding-right:70px;} .copy-input {width:100%; height:28px; line-height:28px; padding:0 5px; vertical-align: middle; font-size:12px; border-radius:3px; position:absolute; left:-9999em;} -.post-reply-input {width:100%; height:28px; max-height:84px; line-height:28px; vertical-align: middle; font-size:12px; border:1px solid #e6e6e6; outline:none; padding:0 5px; margin:0; border-radius:3px; overflow-y:auto; resize:none;} -.post-reply-submit {font-size:13px; padding:3px 8px; color:#fff; background-color:#269ac9; outline:none; border:none; display:inline-block;} +.post-reply-input {width:100%; height:28px; max-height:84px; line-height:28px; vertical-align: middle; font-size:13px; border:1px solid #e6e6e6; outline:none; padding:0 5px; margin:0; border-radius:3px; overflow-y:auto; resize:none; background-color:#f0eff4;} +.post-reply-submit {position:absolute; font-size:13px; height:30px; line-height:30px; vertical-align:middle; padding:0 8px; color:#fff; background-color:#269ac9; outline:none; border:none; top:0; right:0;} .reply-icon {background:url(/images/wechat/icon_list.gif) -150px -155px no-repeat; width:20px; height:20px; display:inline-block; vertical-align:middle;} .praise-icon {background:url(/images/wechat/icon_list.gif) -36px -88px no-repeat; width:20px; height:20px; display:inline-block; vertical-align:middle;} .praised-icon {background:url(/images/wechat/icon_list.gif) -152px -86px no-repeat; width:20px; height:20px; display:inline-block; vertical-align:middle;} .num-block {display:inline-block; vertical-align:top;} .post-op-banner {height:20px; line-height:20px; vertical-align:middle;} +/*20160628动态新样式*/ +.post-dynamic-author {width:50%; height:30px; line-height:30px; font-size:14px; color:#5b5b5b; vertical-align:middle;} +.post-dynamic-time {height:30px; line-height:30px; vertical-align:middle;} +.post-dynamic-title {font-size:15px;} +.post-dynamic-from {width:50%; font-size:13px;} +.post-box-shadow {box-shadow: 0px 2px 8px rgba(146, 153, 169, 0.5);} + /* loading 弹框*/ .loading-bg {position:fixed; width:100%; height:100%; left:0; top:0; z-index:99; background:rgba(206, 206, 206, 0.3); overflow:hidden;} .loading-box {position:absolute; top:50%; background:rgba(240,240,240, 0.5); width:160px; height:72px; left:50%; margin-top:-36px; margin-left:-80px; text-align:center;} @@ -163,7 +175,8 @@ a.underline {text-decoration:underline;} .class-detail-tab {width:23%; height:38px; line-height:38px; font-size:13px; color:#444; background-color:#fff; float:left; text-align:center; vertical-align:middle; border-bottom:1px solid #ccc;} .class-detail-tab2 {width:32%; height:38px; line-height:38px; font-size:13px; color:#444; background-color:#fff; float:left; text-align:center; vertical-align:middle; border-bottom:1px solid #ccc;} .class-detail-tab3 {width:48%; height:38px; line-height:38px; font-size:13px; color:#444; background-color:#fff; float:left; text-align:center; vertical-align:middle; border-bottom:1px solid #ccc;} -.class-tab-active {border-bottom:1px solid #3b94d6;} +.class-tab-active {border-bottom:3px solid #3b94d6;} +.tab-active-arrow {border-width:4px; position:absolute; top:41px; left:50%; transform:translate(-50%,0); border-color:#3b94d6 transparent transparent transparent; border-style:solid dashed dashed dashed;} .class-search-wrap {padding:8px 12px; position:relative;} .class-search-inner {padding:0 30px; background-color:#fff;} .class-search-icon {position:absolute; top:16px; left:16px;} From 0bb5c8b5fb14c9e852d3b7cf742791569add4a69 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Wed, 29 Jun 2016 21:09:49 +0800 Subject: [PATCH 03/87] =?UTF-8?q?=E6=B3=A8=E5=86=8C=E7=BB=91=E5=AE=9A?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/mobile/apis/users.rb | 12 ++++- app/views/wechats/user_activities.html.erb | 46 ++++++++++---------- public/assets/wechat/reg.html | 3 +- public/javascripts/wechat/controllers/reg.js | 11 +++-- 4 files changed, 43 insertions(+), 29 deletions(-) diff --git a/app/api/mobile/apis/users.rb b/app/api/mobile/apis/users.rb index b5ee14d19..a6536e73e 100644 --- a/app/api/mobile/apis/users.rb +++ b/app/api/mobile/apis/users.rb @@ -53,10 +53,20 @@ module Mobile requires :password, type: String, desc: 'password' end post do + + openid = session[:wechat_openid] + logger.debug "openid ============== #{openid}" + raise "无法获取到openid,请在微信中打开本页面" unless openid + + us = UsersService.new user = us.register params.merge(:password_confirmation => params[:password], :should_confirmation_password => true) - raise "该邮箱已经被注册过了" if user.new_record? + raise user.errors.full_messages.first if user.new_record? + UserWechat.create!( + openid: openid, + user: user + ) present :data, user, with: Mobile::Entities::User present :status, 0 diff --git a/app/views/wechats/user_activities.html.erb b/app/views/wechats/user_activities.html.erb index 1e3957ea9..7b7cb95e5 100644 --- a/app/views/wechats/user_activities.html.erb +++ b/app/views/wechats/user_activities.html.erb @@ -28,29 +28,29 @@ - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/assets/wechat/reg.html b/public/assets/wechat/reg.html index 9184fd0ed..c39eb1619 100644 --- a/public/assets/wechat/reg.html +++ b/public/assets/wechat/reg.html @@ -40,4 +40,5 @@ - \ No newline at end of file + + \ No newline at end of file diff --git a/public/javascripts/wechat/controllers/reg.js b/public/javascripts/wechat/controllers/reg.js index dfa010ad7..44c2e098b 100644 --- a/public/javascripts/wechat/controllers/reg.js +++ b/public/javascripts/wechat/controllers/reg.js @@ -1,8 +1,9 @@ -app.controller('RegController', ['$scope', '$http', '$location', 'alertService', - function ($scope, $http, $location, alertService) { +app.controller('RegController', ['$scope', '$http', '$location', 'alertService','$location', + function ($scope, $http, $location, alertService, $location) { var vm = $scope; vm.errDialog = alertService.create(); + vm.successDialog = alertService.create(); vm.goLogin = function () { $location.path("/login"); @@ -32,10 +33,12 @@ app.controller('RegController', ['$scope', '$http', '$location', 'alertService', if (response.data.status != 0) { vm.errDialog.showMessage('出错了',response.data.message); } else { - vm.errDialog.showMessage("提示","注册且绑定微信成功"); + vm.successDialog.showMessage("提示","注册且绑定微信成功", function(){ + $location.path("/activities"); + }); } }, function (response) { - vm.errDialo.showMessage('出错了',response.data); + vm.errDialog.showMessage('出错了',response.data); }); } From c2482499839f7d8c9aef7983287d090d6e48a9f9 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Wed, 29 Jun 2016 21:11:21 +0800 Subject: [PATCH 04/87] =?UTF-8?q?=E6=B3=A8=E5=86=8C=E6=B2=A1=E6=9C=89loadi?= =?UTF-8?q?ng=E5=9B=BE=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/assets/wechat/reg.html | 3 +++ 1 file changed, 3 insertions(+) diff --git a/public/assets/wechat/reg.html b/public/assets/wechat/reg.html index c39eb1619..9e2978e3b 100644 --- a/public/assets/wechat/reg.html +++ b/public/assets/wechat/reg.html @@ -1,4 +1,7 @@
+ +
+
注册登录
From b010ce2e6113dd94fe9ba185eb21d86e3f859ca4 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Sat, 2 Jul 2016 23:46:45 +0800 Subject: [PATCH 05/87] =?UTF-8?q?=E5=8F=91=E9=80=81=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .access_token | 2 +- app/api/mobile/apis/courses.rb | 2 +- app/api/mobile/apis/resources.rb | 20 ++++- app/controllers/users_controller.rb | 40 +--------- app/services/courses_service.rb | 2 +- app/services/resources_service.rb | 53 ++++++++++++++ app/services/users_service.rb | 4 + app/views/wechats/user_activities.html.erb | 1 + public/assets/wechat/activities.html | 6 +- public/assets/wechat/class.html | 6 +- public/assets/wechat/class_list.html | 5 +- public/assets/wechat/myresource.html | 6 +- public/assets/wechat/new_class.html | 5 +- public/assets/wechat/send_class_list.html | 13 ++++ public/assets/wechat/templates/loading.html | 21 ++++++ .../javascripts/wechat/controllers/class.js | 4 + .../wechat/controllers/class_list.js | 73 ++++++++++++++----- .../wechat/controllers/myresource.js | 6 +- .../wechat/controllers/new_class.js | 10 +-- .../wechat/controllers/send_class_list.js | 47 ++++++++++++ .../wechat/directives/loading_spinner.js | 6 +- public/javascripts/wechat/others/routes.js | 1 + 22 files changed, 251 insertions(+), 82 deletions(-) create mode 100644 app/services/resources_service.rb create mode 100644 public/assets/wechat/send_class_list.html create mode 100644 public/assets/wechat/templates/loading.html create mode 100644 public/javascripts/wechat/controllers/send_class_list.js diff --git a/.access_token b/.access_token index 610b08d2e..2fb2e740f 100644 --- a/.access_token +++ b/.access_token @@ -1 +1 @@ -{"access_token":"oEEf8ZKAB8Y2G0o_xnTPkPJHKKk8iHkLC-f5ptvQ2nCMj9IpC86ivLD2-p38GfOkuG-HuQp3pWZqhs3NJXUMdPLWsr5k67hPZYuqg4ozLccx0xdLswapj0mn8ovZhK1tKIKiAFAOMO","expires_in":7200,"got_token_at":1467012449} \ No newline at end of file +{"access_token":"m8kGwb7G0laM6-0uHmPtxETR6WJk5PgR37te_h8aBwgqGXkml2ZZAvPUBldmzF5hDZsQBHEn8PUACSL60eDKlCWigwwUJReK2wB4UbXIc1UA-rrkpHuWl84H3rcswtlvHENjAHAZWF","expires_in":7200,"got_token_at":1467472907} \ No newline at end of file diff --git a/app/api/mobile/apis/courses.rb b/app/api/mobile/apis/courses.rb index 42303b63d..cb1db09d8 100644 --- a/app/api/mobile/apis/courses.rb +++ b/app/api/mobile/apis/courses.rb @@ -107,7 +107,7 @@ module Mobile status = cs.join_course({role: "10", openid: params[:openid], invite_code: params[:invite_code]}, current_user) { status: status[:state], - messsge:CoursesService::JoinCourseError.message(status[:state]) + message:CoursesService::JoinCourseError.message(status[:state]) } end diff --git a/app/api/mobile/apis/resources.rb b/app/api/mobile/apis/resources.rb index fca94a642..c2fcfa754 100644 --- a/app/api/mobile/apis/resources.rb +++ b/app/api/mobile/apis/resources.rb @@ -46,10 +46,26 @@ module Mobile end + desc '发送资源' + params do + requires :token, type: String + requires :course_ids, type: Array[Integer] + requires :send_id, type: Integer + end + post 'send' do + authenticate! + + rs = ResourcesService.new + ori, flag, save_message = rs.send_resource_to_course(params) + if flag + present :status, 0 + else + {status: -1, message: save_message.first} + end + end + end - - end end end \ No newline at end of file diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index b7972ff6f..3bf582e23 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -1977,44 +1977,8 @@ class UsersController < ApplicationController def add_exist_file_to_course @flag = true if params[:send_id].present? - send_id = params[:send_id] - @ori = Attachment.find_by_id(send_id) - course_ids = params[:course_ids] - if course_ids.nil? - @flag = false - end - unless course_ids.nil? - course_ids.each do |id| - next if @ori.blank? - @exist = false - Course.find(id).attachments.each do |att| #如果课程中包含该资源 - if att.id == @ori.id || (!att.copy_from.nil? && !@ori.copy_from.nil? && att.copy_from == @ori.copy_from) || att.copy_from == @ori.id || att.id == @ori.copy_from - att.created_on = Time.now - att.save - @exist = true - break - end - end - next if @exist - attach_copied_obj = @ori.copy - attach_copied_obj.tag_list.add(@ori.tag_list) # tag关联 - attach_copied_obj.container = Course.find(id) - attach_copied_obj.created_on = Time.now - attach_copied_obj.author_id = User.current.id - attach_copied_obj.is_public = 0 - attach_copied_obj.copy_from = @ori.copy_from.nil? ? @ori.id : @ori.copy_from #发送要添加copy_from - if attach_copied_obj.attachtype == nil - attach_copied_obj.attachtype = 4 - end - if attach_copied_obj.save - # 更新引用次数 - quotes = @ori.quotes.to_i + 1 - @ori.update_attribute(:quotes, quotes) unless @ori.nil? - @ori.forwards << Forward.new(:to_type => attach_copied_obj.class.name, :to_id => attach_copied_obj.id,:created_at => Time.now) - end - @save_message = attach_copied_obj.errors.full_messages - end - end + rs = ResourcesService.new + @ori, @flag, @save_message = rs.send_resource_to_course(params) elsif params[:send_ids].present? send_ids = params[:send_ids].split(",") course_ids = params[:course_ids] diff --git a/app/services/courses_service.rb b/app/services/courses_service.rb index dce3e1f18..e6143caec 100644 --- a/app/services/courses_service.rb +++ b/app/services/courses_service.rb @@ -324,7 +324,7 @@ class CoursesService 1, '密码错误', 2, '课程已过期 请联系课程管理员重启课程。', 3, '您已经加入了课程', - 4, '您加入的课程不存在', + 4, '您的邀请码不正确', 5, '您还未登录', 6, '申请成功,请等待审核完毕', 7, '您已经发送过申请了,请耐心等待', diff --git a/app/services/resources_service.rb b/app/services/resources_service.rb new file mode 100644 index 000000000..827fc3efd --- /dev/null +++ b/app/services/resources_service.rb @@ -0,0 +1,53 @@ +#coding=utf-8 + +class ResourcesService + + #发送资源到课程 + def send_resource_to_course params + send_id = params[:send_id] + @ori = Attachment.find_by_id(send_id) + course_ids = params[:course_ids] + @flag = false + unless course_ids.nil? + course_ids.each do |id| + next if @ori.blank? + @exist = false + Course.find(id).attachments.each do |att| #如果课程中包含该资源 + if att.id == @ori.id || (!att.copy_from.nil? && !@ori.copy_from.nil? && att.copy_from == @ori.copy_from) || att.copy_from == @ori.id || att.id == @ori.copy_from + att.created_on = Time.now + att.save + @exist = true + @flag = true + break + end + end + next if @exist + attach_copied_obj = @ori.copy + attach_copied_obj.tag_list.add(@ori.tag_list) # tag关联 + attach_copied_obj.container = Course.find(id) + attach_copied_obj.created_on = Time.now + attach_copied_obj.author_id = User.current.id + attach_copied_obj.is_public = 0 + attach_copied_obj.copy_from = @ori.copy_from.nil? ? @ori.id : @ori.copy_from #发送要添加copy_from + if attach_copied_obj.attachtype == nil + attach_copied_obj.attachtype = 4 + end + if attach_copied_obj.save + # 更新引用次数 + quotes = @ori.quotes.to_i + 1 + @ori.update_attribute(:quotes, quotes) unless @ori.nil? + @ori.forwards << Forward.new(:to_type => attach_copied_obj.class.name, :to_id => attach_copied_obj.id,:created_at => Time.now) + @flag = true + else + @flag = false + @save_message = attach_copied_obj.errors.full_messages + break + end + + end + end + + [@ori, @flag, @save_message] + end + +end \ No newline at end of file diff --git a/app/services/users_service.rb b/app/services/users_service.rb index 8df42fb41..ab1bb2ec4 100644 --- a/app/services/users_service.rb +++ b/app/services/users_service.rb @@ -319,4 +319,8 @@ class UsersService my_jours_arr end + + + + end diff --git a/app/views/wechats/user_activities.html.erb b/app/views/wechats/user_activities.html.erb index 7b7cb95e5..ab1d18a8d 100644 --- a/app/views/wechats/user_activities.html.erb +++ b/app/views/wechats/user_activities.html.erb @@ -50,6 +50,7 @@ + diff --git a/public/assets/wechat/activities.html b/public/assets/wechat/activities.html index f042daba7..ef3346e20 100644 --- a/public/assets/wechat/activities.html +++ b/public/assets/wechat/activities.html @@ -2,7 +2,11 @@
-
+ + +
我的动态
+ +
diff --git a/public/assets/wechat/class.html b/public/assets/wechat/class.html index dc575dc64..70dd64fad 100644 --- a/public/assets/wechat/class.html +++ b/public/assets/wechat/class.html @@ -20,7 +20,7 @@
-
{{r.filename}}发送
+
{{r.filename}}发送

暂无课件,
请登录Trustie网站,在PC浏览器中上传课件。

@@ -37,14 +37,14 @@
-
{{r.homework_name}}发送
+
{{r.homework_name}}

暂无作业,
请登录Trustie网站,在PC浏览器中上传作业。

-
{{r.exercise_name}}发送
+
{{r.exercise_name}}

暂无小测验,
请登录Trustie网站,在PC浏览器中上传小测验。

diff --git a/public/assets/wechat/class_list.html b/public/assets/wechat/class_list.html index 8ec8bcaa5..5c64b9a87 100644 --- a/public/assets/wechat/class_list.html +++ b/public/assets/wechat/class_list.html @@ -1,7 +1,7 @@
课程列表
-
未命名课程
+
未命名课程
\ No newline at end of file diff --git a/public/assets/wechat/myresource.html b/public/assets/wechat/myresource.html index 9d3bf0fda..dc4d6ea78 100644 --- a/public/assets/wechat/myresource.html +++ b/public/assets/wechat/myresource.html @@ -9,17 +9,17 @@
-
{{r.filename}}发送
+
{{r.filename}}发送

暂无课件,
请登录Trustie网站,在PC浏览器中上传课件。

-
{{r.homework_name}}发送
+
{{r.homework_name}}

暂无作业,
请登录Trustie网站,在PC浏览器中创建作业。

-
{{r.exercise_name}}发送
+
{{r.exercise_name}}

暂无测验,
请登录Trustie网站,在PC浏览器中创建测验。

diff --git a/public/assets/wechat/new_class.html b/public/assets/wechat/new_class.html index 2bb5d2aac..ab0fc96f6 100644 --- a/public/assets/wechat/new_class.html +++ b/public/assets/wechat/new_class.html @@ -3,5 +3,8 @@
课程
班级
- 完成 + 完成 + + +
diff --git a/public/assets/wechat/send_class_list.html b/public/assets/wechat/send_class_list.html new file mode 100644 index 000000000..4b8b8a27f --- /dev/null +++ b/public/assets/wechat/send_class_list.html @@ -0,0 +1,13 @@ + +
+
+ +
发送课程列表
+
未命名课程
+
    +
  • +
+ +
发送
+ +
diff --git a/public/assets/wechat/templates/loading.html b/public/assets/wechat/templates/loading.html new file mode 100644 index 000000000..8113a78c2 --- /dev/null +++ b/public/assets/wechat/templates/loading.html @@ -0,0 +1,21 @@ + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

数据加载中

+
+
\ No newline at end of file diff --git a/public/javascripts/wechat/controllers/class.js b/public/javascripts/wechat/controllers/class.js index c2281be88..1cd69bb43 100644 --- a/public/javascripts/wechat/controllers/class.js +++ b/public/javascripts/wechat/controllers/class.js @@ -105,6 +105,10 @@ app.controller('ClassController', ['$scope', 'config','$http', 'auth','$location $location.path("/invite_code").search({id: courseid}); }; + vm.sendFile = function(r){ + $location.path("/send_class_list").search({id: r.id}); + } + $http.get(config.apiUrl+ 'courses/'+courseid+"?token="+auth.token()).then( function(response) { console.log(response.data); diff --git a/public/javascripts/wechat/controllers/class_list.js b/public/javascripts/wechat/controllers/class_list.js index 4484ff834..21da4aea9 100644 --- a/public/javascripts/wechat/controllers/class_list.js +++ b/public/javascripts/wechat/controllers/class_list.js @@ -3,28 +3,63 @@ */ -app.controller('ClassListController', ['$scope','config','auth','$http','$location', function($scope, config, auth, $http, $location){ - var vm = $scope; - vm.courses = []; +app.controller('ClassListController', ['$scope', 'config', 'auth', '$http', '$location', 'alertService', + function ($scope, config, auth, $http, $location, alertService) { + var vm = $scope; + vm.courses = []; - $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; + vm.alertService = alertService.create(); + + + 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; + } + ); + }; + + loadClassList(); + + vm.goClass = function (course_id) { + console.log(course_id); + $location.path("/class").search({id: course_id}); } - ); - vm.goClass = function(course_id){ - console.log(course_id); - $location.path("/class").search({id: course_id}); - } + vm.newClass = function () { + $location.path("/new_class"); + } - vm.newClass = function(){ - $location.path("/new_class"); - } + vm.goResource = function () { + $location.path("/myresource"); + } - vm.goResource =function(){ - $location.path("/myresource"); - } + vm.joinClass = function () { + var code = window.prompt("请输入5位班级邀请码(不区分大小写)"); + if (code && code.length == 5) { + $http.post(config.apiUrl + "courses/join", { + token: auth.token(), + invite_code: code + }).then(function (response) { + console.log(response.data); + if (response.data.status != 0) { + vm.alertService.showMessage('错误', response.data.message); + } else { + vm.alertService.showMessage('提示', '加入课程成功'); + loadClassList(); + } + }); + } else { + if(code){ + vm.alertService.showMessage('错误', '邀请码格式不正确'); + } -}]); \ No newline at end of file + } + }; + + vm.onSetting = function () { + vm.alertService.showMessage('提示', '此功能正在开发中'); + } + + }]); \ No newline at end of file diff --git a/public/javascripts/wechat/controllers/myresource.js b/public/javascripts/wechat/controllers/myresource.js index 87b2a4d82..084205fbe 100644 --- a/public/javascripts/wechat/controllers/myresource.js +++ b/public/javascripts/wechat/controllers/myresource.js @@ -1,4 +1,4 @@ -app.controller('MyResourceController', ['$scope', '$http', 'auth', 'config', function($scope, $http, auth, config){ +app.controller('MyResourceController', ['$scope', '$http', 'auth', 'config', '$location', function($scope, $http, auth, config, $location){ var vm = $scope; vm.menus = ['课件', '作业', '测验']; @@ -27,4 +27,8 @@ app.controller('MyResourceController', ['$scope', '$http', 'auth', 'config', fun } vm.tab(1); + + vm.sendFile = function(r){ + $location.path("/send_class_list").search({id: r.id}); + } }] ); \ No newline at end of file diff --git a/public/javascripts/wechat/controllers/new_class.js b/public/javascripts/wechat/controllers/new_class.js index 488db31c6..c3c81eecd 100644 --- a/public/javascripts/wechat/controllers/new_class.js +++ b/public/javascripts/wechat/controllers/new_class.js @@ -1,12 +1,12 @@ -app.controller('NewClassController', ['$scope', '$http', 'auth', 'config', function($scope, $http, auth, config){ +app.controller('NewClassController', ['$scope', '$http', 'auth', 'config', 'alertService', function($scope, $http, auth, config, alertService){ var vm = $scope; - vm.resources = []; - vm.homeworks = []; - vm.exercises = []; + vm.alertService = alertService.create(); - + vm.newClass = function () { + vm.alertService.showMessage('提示', '此功能正在开发中'); + } }] ); \ No newline at end of file diff --git a/public/javascripts/wechat/controllers/send_class_list.js b/public/javascripts/wechat/controllers/send_class_list.js new file mode 100644 index 000000000..07d321ba2 --- /dev/null +++ b/public/javascripts/wechat/controllers/send_class_list.js @@ -0,0 +1,47 @@ +app.controller('SendClassListController', ['$scope', '$http','$routeParams', 'config','auth','alertService', function($scope, $http, $routeParams, config, auth, alertService){ + var vm = $scope; + var send_id = $routeParams.id; + + vm.alertService = alertService.create(); + vm.courses = []; + + 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; + } + ); + }; + + loadClassList(); + + vm.selectCourse = function(course){ + if( typeof course.checked !== 'boolean' ) course.checked = false; + course.checked = !course.checked; + } + + vm.sendToCourses = function(){ + var course_ids = []; + + for(var i in vm.courses){ + if(vm.courses[i].checked){ + course_ids.push(vm.courses[i].id); + } + } + + $http.post(config.apiUrl + "resources/send", { + token: auth.token(), course_ids: course_ids, send_id: send_id + }).then(function(response){ + console.log(response.data); + if(response.data.status == 0){ + vm.alertService.showMessage('提示', '发送成功', function () { + window.history.back(); + }); + } else { + vm.alertService.showMessage('发送出错', response.data.message); + } + }) + } + +}]); \ No newline at end of file diff --git a/public/javascripts/wechat/directives/loading_spinner.js b/public/javascripts/wechat/directives/loading_spinner.js index 780056828..cea916997 100644 --- a/public/javascripts/wechat/directives/loading_spinner.js +++ b/public/javascripts/wechat/directives/loading_spinner.js @@ -1,7 +1,5 @@ -app.directive('loadingSpinner', ['$http', function ($http) { +app.directive('loadingSpinner', ['$http', 'config', function ($http, config) { return { - restrict: 'A', - replace: true, - template: '
加载中...
', + templateUrl: config.rootPath+ 'templates/loading.html', }; }]); diff --git a/public/javascripts/wechat/others/routes.js b/public/javascripts/wechat/others/routes.js index 80efa71e9..ea6dca05d 100644 --- a/public/javascripts/wechat/others/routes.js +++ b/public/javascripts/wechat/others/routes.js @@ -35,6 +35,7 @@ app.config(['$routeProvider',"$httpProvider", "$locationProvider",'config', func .when('/class_list', makeRoute('class_list.html', 'ClassListController')) .when('/myresource', makeRoute('myresource.html', 'MyResourceController')) .when('/invite_code', makeRoute('invite_code.html', 'InviteCodeController')) + .when('/send_class_list', makeRoute('send_class_list.html', 'SendClassListController')) .otherwise({ redirectTo: '/activites' }); From 06733b17a06cab16cef43e4176743bea10c0520e Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Sun, 3 Jul 2016 00:07:55 +0800 Subject: [PATCH 06/87] ignore accesstoken --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index dbc349c80..fddb6dc72 100644 --- a/.gitignore +++ b/.gitignore @@ -35,3 +35,4 @@ vendor/cache 1234567 public/javascripts/wechat/node_modules/ .ruby-version +.access_token From 201abd63583b0e2a9a914598ea0d104ddb9a46ca Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Sun, 3 Jul 2016 00:08:51 +0800 Subject: [PATCH 07/87] assets --- app/views/wechats/user_activities.html.erb | 48 +++++++++++----------- public/javascripts/wechat/build/app.min.js | 15 +++---- 2 files changed, 32 insertions(+), 31 deletions(-) diff --git a/app/views/wechats/user_activities.html.erb b/app/views/wechats/user_activities.html.erb index ab1d18a8d..2d265484c 100644 --- a/app/views/wechats/user_activities.html.erb +++ b/app/views/wechats/user_activities.html.erb @@ -28,30 +28,30 @@ - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/javascripts/wechat/build/app.min.js b/public/javascripts/wechat/build/app.min.js index 1fea6f08a..267ab5dd4 100644 --- a/public/javascripts/wechat/build/app.min.js +++ b/public/javascripts/wechat/build/app.min.js @@ -3,8 +3,8 @@ app.factory("alertService",function(){function t(){this.title=null,this.message= app.filter("safeHtml",["$sce",function(t){return function(n){return t.trustAsHtml(n)}}]),app.filter("identify",function(){return function(t){return"TeachingAsistant"==t?"教辅":""}}); app.controller("ActivityController",["$anchorScroll","$location","$scope","$http","$timeout","auth","rms","common","alertService",function(a,t,e,o,i,c,n,r,s){e.replaceUrl=function(a){return a},e.alertService=s.create(),console.log("ActivityController load"),e.page=n.get("page")||0,e.activities=n.get("activities")||[],e.has_more=n.get("has_more"),e.loadActData=function(a){e.page=a,o({method:"POST",url:apiUrl+"activities",data:{token:c.token(),page:a}}).then(function(a){a.data.page>0?e.activities=e.activities.concat(a.data.data):e.activities=a.data.data,n.save("activities",e.activities),e.has_more=a.data.count+10*a.data.page
加载中...
'}}]); -app.config(["$routeProvider","$httpProvider","$locationProvider","config",function(e,o,r,t){var l=t.rootPath,n={delay:["auth",function(e){return e.get_bind()}]},s=function(e,o){return{templateUrl:l+e,controller:o,resolve:n}};e.when("/login",{templateUrl:l+"login.html",controller:"LoginController"}).when("/reg",{templateUrl:l+"reg.html",controller:"RegController"}).when("/activites",s("activities.html","ActivityController")).when("/issues/:id",s("issue_detail.html","IssueController")).when("/project_discussion/:id",s("project_discussion.html","DiscussionController")).when("/homework/:id",s("homework_detail.html","HomeworkController")).when("/course_notice/:id",s("course_notice.html","CourseNoticeController")).when("/course_discussion/:id",s("course_discussion.html","DiscussionController")).when("/journal_for_message/:id",s("jour_message_detail.html","JournalsController")).when("/blog_comment/:id",s("blog_detail.html","BlogController")).when("/class",s("class.html","ClassController")).when("/new_class",s("new_class.html","NewClassController")).when("/class_list",s("class_list.html","ClassListController")).when("/myresource",s("myresource.html","MyResourceController")).when("/invite_code",s("invite_code.html","InviteCodeController")).otherwise({redirectTo:"/activites"}),o.interceptors.push(["$q","$rootScope",function(e,o){return void 0==o.activeCalls&&(o.activeCalls=0),{request:function(e){return o.activeCalls+=1,e},requestError:function(e){return o.activeCalls-=1,e},response:function(e){return o.activeCalls-=1,e},responseError:function(e){return o.activeCalls-=1,e}}}])}]); \ No newline at end of file +app.directive("loadingSpinner",["$http","config",function(t,e){return{templateUrl:e.rootPath+"templates/loading.html"}}]); +app.config(["$routeProvider","$httpProvider","$locationProvider","config",function(e,o,t,l){var r=l.rootPath,s={delay:["auth",function(e){return e.get_bind()}]},n=function(e,o){return{templateUrl:r+e,controller:o,resolve:s}};e.when("/login",{templateUrl:r+"login.html",controller:"LoginController"}).when("/reg",{templateUrl:r+"reg.html",controller:"RegController"}).when("/activites",n("activities.html","ActivityController")).when("/issues/:id",n("issue_detail.html","IssueController")).when("/project_discussion/:id",n("project_discussion.html","DiscussionController")).when("/homework/:id",n("homework_detail.html","HomeworkController")).when("/course_notice/:id",n("course_notice.html","CourseNoticeController")).when("/course_discussion/:id",n("course_discussion.html","DiscussionController")).when("/journal_for_message/:id",n("jour_message_detail.html","JournalsController")).when("/blog_comment/:id",n("blog_detail.html","BlogController")).when("/class",n("class.html","ClassController")).when("/new_class",n("new_class.html","NewClassController")).when("/class_list",n("class_list.html","ClassListController")).when("/myresource",n("myresource.html","MyResourceController")).when("/invite_code",n("invite_code.html","InviteCodeController")).when("/send_class_list",n("send_class_list.html","SendClassListController")).otherwise({redirectTo:"/activites"}),o.interceptors.push(["$q","$rootScope",function(e,o){return void 0==o.activeCalls&&(o.activeCalls=0),{request:function(e){return o.activeCalls+=1,e},requestError:function(e){return o.activeCalls-=1,e},response:function(e){return o.activeCalls-=1,e},responseError:function(e){return o.activeCalls-=1,e}}}])}]); \ No newline at end of file From 2c13184d9da40facec629170b08dcabcde7175a7 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Mon, 4 Jul 2016 10:52:32 +0800 Subject: [PATCH 08/87] =?UTF-8?q?=E4=BF=AE=E6=94=B9js=E5=BC=95=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .access_token | 2 +- app/views/wechats/user_activities.html.erb | 52 +++++++++++----------- config/wechat.yml.test | 33 ++++++++++++++ 3 files changed, 60 insertions(+), 27 deletions(-) create mode 100644 config/wechat.yml.test diff --git a/.access_token b/.access_token index 2fb2e740f..f55f73861 100644 --- a/.access_token +++ b/.access_token @@ -1 +1 @@ -{"access_token":"m8kGwb7G0laM6-0uHmPtxETR6WJk5PgR37te_h8aBwgqGXkml2ZZAvPUBldmzF5hDZsQBHEn8PUACSL60eDKlCWigwwUJReK2wB4UbXIc1UA-rrkpHuWl84H3rcswtlvHENjAHAZWF","expires_in":7200,"got_token_at":1467472907} \ No newline at end of file +{"access_token":"0wlw4Hi6bX0ifpmwJ9iO4tOED-8ekIYplhlPcG9vFSQLYC0iW8tPE0MBfuWWnr5SRDVoSQwAmMbeU40QeHXdK7NkBruRSVT9hhFwWef01do3OkFwMr2M3atVCGjRDY_hFUSbAFAMBZ","expires_in":7200,"got_token_at":1467531769} \ No newline at end of file diff --git a/app/views/wechats/user_activities.html.erb b/app/views/wechats/user_activities.html.erb index 2d265484c..3ca452a34 100644 --- a/app/views/wechats/user_activities.html.erb +++ b/app/views/wechats/user_activities.html.erb @@ -26,32 +26,32 @@
- - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/config/wechat.yml.test b/config/wechat.yml.test new file mode 100644 index 000000000..9bc33029e --- /dev/null +++ b/config/wechat.yml.test @@ -0,0 +1,33 @@ +default: &default +# corpid: "corpid" +# corpsecret: "corpsecret" +# agentid: 1 +# Or if using public account, only need above two line + + # guange test + #appid: "wxf694495398c7d470" + #secret: "743e038392f1d89540e95f8f7645849a" + + appid: "wx8e1ab05163a28e37" + secret: "beb4d3bc4b32b3557811680835357841" + + token: "123456" + access_token: ".access_token" + encrypt_mode: false # if true must fill encoding_aes_key + encoding_aes_key: "QGfP13YP4BbQGkkrlYuxpn4ZIDXpBJww4fxl8CObvNw" + jsapi_ticket: "tmp/wechat_jsapi_ticket" + + #template + binding_succ_notice: "jjpDrgFErnmkrE9tf2M3o0t31ZrJ7mr0YtuE_wyLaMc" + journal_notice: "uC1zAw4F2q6HTA3Pcj8VUO6wKKKiYFwnPJB4iXxpdoM" + homework_message_notice: "tCf7teCVqc2vl2LZ_hppIdWmpg8yLcrI8XifxYePjps" + class_notice: "MQ_mFupbXP-9jWbeHT3C5xqNBvPo8EIlNv4ULakSpJA" + +production: + <<: *default + +development: + <<: *default + +test: + <<: *default From bd1aae07fd7ca1c0a418a38a1030909f7d0f134a Mon Sep 17 00:00:00 2001 From: txz Date: Mon, 4 Jul 2016 14:43:51 +0800 Subject: [PATCH 09/87] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E6=A0=B7=E5=BC=8F=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Gemfile | 2 +- public/assets/wechat/activities.html | 263 +++++++++++++++------------ public/stylesheets/weui/weixin.css | 2 +- 3 files changed, 149 insertions(+), 118 deletions(-) diff --git a/Gemfile b/Gemfile index eef93c371..fe7d46d01 100644 --- a/Gemfile +++ b/Gemfile @@ -6,7 +6,7 @@ unless RUBY_PLATFORM =~ /w32/ if RUBY_PLATFORM =~ /darwin/ gem "rmagick", "= 2.15.4" ## osx must be this version else - gem "rmagick", "= 2.13.1" ## centos yum install ImageMagick-devel + #gem "rmagick", "= 2.13.1" ## centos yum install ImageMagick-devel end gem 'certified' end diff --git a/public/assets/wechat/activities.html b/public/assets/wechat/activities.html index ef3346e20..b34098a8e 100644 --- a/public/assets/wechat/activities.html +++ b/public/assets/wechat/activities.html @@ -6,43 +6,46 @@
我的动态
+ +
-
-
- - +
+
+ +
{{act.latest_update}}
- -
+ +
迟交扣分:{{act.homework_common_detail.late_penalty}}分 匿评开启时间:{{act.homework_common_detail.evaluation_start}}
缺评扣分:{{act.homework_common_detail.absence_penalty}}分/作品 匿评关闭时间:{{act.homework_common_detail.evaluation_end}}
-
-
- 普通作业 - 编程作业 - 分组作业 - {{act.latest_update}} - 回复 - {{act.reply_count}} -
-
{{act.praise_count}}
-
{{act.praise_count}}
-
+ +
+
+
{{act.praise_count}}
+
{{act.praise_count}}
+ +
@@ -52,28 +55,32 @@
-
-
- - +
+
+ +
{{act.latest_update}}
- -
+ +
-
-
- {{act.activity_type_name}} - {{act.latest_update}} - 回复 - {{act.reply_count}} -
-
{{act.praise_count}}
-
{{act.praise_count}}
-
+ +
+
+
{{act.praise_count}}
+
{{act.praise_count}}
+ +
@@ -83,28 +90,33 @@
-
-
- - +
+
+ +
{{act.latest_update}}
- -
+ +
-
- {{act.activity_type_name}} - {{act.latest_update}} - 回复 - {{act.reply_count}} -
-
{{act.praise_count}}
-
{{act.praise_count}}
-
+ +
+
+
{{act.praise_count}}
+
{{act.praise_count}}
+ +
@@ -115,7 +127,7 @@
-
+
@@ -130,30 +142,34 @@
-
-
- - +
+
+ +
{{act.latest_update}}
- -
+ +
状态:{{act.issue_detail.issue_status}} 优先级:{{act.issue_detail.issue_priority}}
指派给:{{act.issue_detail.issue_assigned_to}} 完成度:{{act.issue_detail.done_ratio}}%
-
-
- {{act.activity_type_name}} - {{act.latest_update}} - 回复 - {{act.reply_count}} -
-
{{act.praise_count}}
-
{{act.praise_count}}
-
+ +
+
+
{{act.praise_count}}
+
{{act.praise_count}}
+ +
@@ -164,28 +180,32 @@
-
-
- - +
+
+ +
{{act.latest_update}}
- -
+ +
-
-
- {{act.activity_type_name}} - {{act.latest_update}} - 回复 - {{act.reply_count}} -
-
{{act.praise_count}}
-
{{act.praise_count}}
-
+ +
+
+
{{act.praise_count}}
+
{{act.praise_count}}
+ +
@@ -195,7 +215,7 @@
-
+
@@ -210,27 +230,32 @@
-
-
- - +
+
+ +
{{act.latest_update}}
-
-
+
-
- {{act.latest_update}} - 回复 - {{act.reply_count}} -
-
{{act.praise_count}}
-
{{act.praise_count}}
-
+ +
+
+
{{act.praise_count}}
+
{{act.praise_count}}
+ +
@@ -241,27 +266,33 @@
-
-
- - +
+
+ +
{{act.latest_update}}
- -
+ +
-
- {{act.latest_update}} - 回复 - {{act.reply_count}} -
-
{{act.praise_count}}
-
{{act.praise_count}}
-
+ +
+
+
{{act.praise_count}}
+
{{act.praise_count}}
+ +
diff --git a/public/stylesheets/weui/weixin.css b/public/stylesheets/weui/weixin.css index 5b1c1df95..7c219c571 100644 --- a/public/stylesheets/weui/weixin.css +++ b/public/stylesheets/weui/weixin.css @@ -109,7 +109,7 @@ a.underline {text-decoration:underline;} .post-interactive-reply, .post-interactive-praise {width:50%; text-align:center; float:left; font-size:13px;} .more-wrap {width:100%;} -.more-events {width:98%; font-size:13px; text-align:center; margin:0 auto; padding: 5px 0; border:1px solid #e6e6e6; border-radius:3px; background-color:#f8f9fb; } +.more-events {width:100%; font-size:13px; text-align:center; margin:0 auto; padding: 5px 0; border-top:1px solid #e6e6e6; border-bottom:1px solid #e6e6e6; border-radius:3px; background-color:#f8f9fb; } .border-bottom {border-bottom:1px solid #e6e6e6;} .post-reply-wrap {width:100%;} .post-input-wrap {width:100%; position:fixed; bottom:0;} From 60367415fae1fbc3c66c248a5e4fadcd5e7f1472 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Mon, 4 Jul 2016 16:19:05 +0800 Subject: [PATCH 10/87] =?UTF-8?q?=E6=96=B0=E5=BB=BA=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .access_token | 2 +- app/api/mobile/api.rb | 2 + app/api/mobile/apis/syllabuses.rb | 50 ++++++++++++++++ app/api/mobile/entities/course.rb | 3 + app/api/mobile/entities/syllabus.rb | 12 ++++ app/helpers/users_helper.rb | 15 +++++ app/models/course.rb | 13 +++- app/models/syllabus.rb | 6 +- app/services/courses_service.rb | 2 + app/services/syllabuses_service.rb | 59 +++++++++++++++++++ db/schema.rb | 35 +++++++++-- public/assets/wechat/class_list.html | 23 +++++--- public/assets/wechat/new_class.html | 14 +++-- .../wechat/controllers/class_list.js | 19 +++--- .../wechat/controllers/new_class.js | 45 +++++++++++++- public/stylesheets/weui/weixin.css | 2 +- 16 files changed, 266 insertions(+), 36 deletions(-) create mode 100644 app/api/mobile/apis/syllabuses.rb create mode 100644 app/api/mobile/entities/syllabus.rb create mode 100644 app/services/syllabuses_service.rb diff --git a/.access_token b/.access_token index f55f73861..19fe1d90e 100644 --- a/.access_token +++ b/.access_token @@ -1 +1 @@ -{"access_token":"0wlw4Hi6bX0ifpmwJ9iO4tOED-8ekIYplhlPcG9vFSQLYC0iW8tPE0MBfuWWnr5SRDVoSQwAmMbeU40QeHXdK7NkBruRSVT9hhFwWef01do3OkFwMr2M3atVCGjRDY_hFUSbAFAMBZ","expires_in":7200,"got_token_at":1467531769} \ No newline at end of file +{"access_token":"vEA6yE7AclWpSWvnRngP7PHl7t8xOexEJS73mWtpEYCCtT6otLnxGV71YQIACEChH5jTZteXhgeuqfbVNB_f0HOYyF0yZpVmiMHANI2BqFVyKqqDOppujvyzF7JHk6TMEGLfAFAHJO","expires_in":7200,"got_token_at":1467618773} \ No newline at end of file diff --git a/app/api/mobile/api.rb b/app/api/mobile/api.rb index c555eb633..9b4bdb5d6 100644 --- a/app/api/mobile/api.rb +++ b/app/api/mobile/api.rb @@ -19,6 +19,7 @@ module Mobile require_relative 'apis/new_comment' require_relative 'apis/praise' require_relative 'apis/resources' + require_relative 'apis/syllabuses' class API < Grape::API version 'v1', using: :path @@ -73,6 +74,7 @@ module Mobile mount Apis::NewComment mount Apis::Praise mount Apis::Resources + mount Apis::Syllabuses add_swagger_documentation ({api_version: 'v1', base_path: '/api'}) if Rails.env.development? diff --git a/app/api/mobile/apis/syllabuses.rb b/app/api/mobile/apis/syllabuses.rb new file mode 100644 index 000000000..f8286f56d --- /dev/null +++ b/app/api/mobile/apis/syllabuses.rb @@ -0,0 +1,50 @@ +#coding=utf-8 + +module Mobile + module Apis + class Syllabuses < Grape::API + + resources :syllabuses do + desc "获取大纲列表" + params do + requires :token, type: String + end + get do + authenticate! + + cs = SyllabusesService.new + courses = cs.user_syllabus(current_user) + present :data, courses, with: Mobile::Entities::Syllabus + present :status, 0 + end + + desc "新建大纲" + params do + requires :token, type: String + requires :title, type: String, desc: '大纲标题' + requires :courses, type: Array[String], desc: '课程名' + end + post do + authenticate! + + ss = SyllabusesService.new + + sy = ss.create(current_user, params[:title], + params[:courses].map{|c| {name: c} }) + + if sy.new_record? + {status:-1, message: '创建大纲失败' } + else + present :data, sy, with: Mobile::Entities::Syllabus + present :status, 0 + end + + end + + end + + + + end + end +end \ No newline at end of file diff --git a/app/api/mobile/entities/course.rb b/app/api/mobile/entities/course.rb index 487a75c4d..ea74058f4 100644 --- a/app/api/mobile/entities/course.rb +++ b/app/api/mobile/entities/course.rb @@ -15,6 +15,8 @@ module Mobile #f.img_url if f.respond_to?(:img_url) elsif field == :created_at || field == :updated_at (format_time(c[field]) if (c.is_a?(Hash) && c.key?(field))) || (format_time(c.send(field)) if c.respond_to?(field)) + elsif field == :member_count + ::Course===c ? c.members.count : 0 else (c[field] if (c.is_a?(Hash) && c.key?(field))) || (c.send(field) if c.respond_to?(field)) end @@ -49,6 +51,7 @@ module Mobile course_expose :qrcode course_expose :updated_at course_expose :course_student_num + course_expose :member_count expose :teacher, using: Mobile::Entities::User do |c, opt| if c.is_a? ::Course c.teacher diff --git a/app/api/mobile/entities/syllabus.rb b/app/api/mobile/entities/syllabus.rb new file mode 100644 index 000000000..bb39fa4f6 --- /dev/null +++ b/app/api/mobile/entities/syllabus.rb @@ -0,0 +1,12 @@ +module Mobile + module Entities + class Syllabus < Grape::Entity + include ApplicationHelper + + expose :title + expose :id + + expose :courses, using: Mobile::Entities::Course + end + end +end diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb index f312d2275..98b993183 100644 --- a/app/helpers/users_helper.rb +++ b/app/helpers/users_helper.rb @@ -388,6 +388,21 @@ module UsersHelper return result end + + #获取指定用户的课程大纲 + def user_syllabus(user) + results = [] + courses = user_courses_list(user) + + other = Syllabus.new(title: '未命名课程') + + courses.each do |c| + other << c unless c.syllabus + end + + user.syllabuses.to_a << other + end + #获取用户参与的公开的课程列表 def user_public_course_list user membership = user.coursememberships.all#@user.coursememberships.all(:conditions => Course.visible_condition(User.current)) diff --git a/app/models/course.rb b/app/models/course.rb index e4b08697b..408a86ad7 100644 --- a/app/models/course.rb +++ b/app/models/course.rb @@ -4,6 +4,8 @@ require 'elasticsearch/model' class Course < ActiveRecord::Base include Redmine::SafeAttributes + include CoursesHelper + STATUS_ACTIVE = 1 STATUS_CLOSED = 5 STATUS_ARCHIVED = 9 @@ -22,7 +24,7 @@ class Course < ActiveRecord::Base end end - attr_accessible :code, :extra, :name, :state, :tea_id, :time , :location, :state, :term, :password,:is_public,:description,:class_period, :open_student, :enterprise_name, :is_delete + attr_accessible :code, :extra, :name, :state, :tea_id, :time , :location, :state, :term, :password,:is_public,:description,:class_period, :open_student, :enterprise_name, :is_delete, :syllabus_id #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表 @@ -69,8 +71,10 @@ 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_length_of :description, :maximum => 10000 + before_save :self_validate # 公开课程变成私有课程,所有资源都变成私有 after_update :update_files_public,:update_course_ealasticsearch_index @@ -296,6 +300,13 @@ class Course < ActiveRecord::Base end end + + def update_default_value + self.time = Time.now.year unless time + self.term = cur_course_term unless term + self.class_period = 10 unless class_period + end + # 创建课程讨论区 def create_board_sync @board = self.boards.build diff --git a/app/models/syllabus.rb b/app/models/syllabus.rb index 5e368f341..5ea8a6b84 100644 --- a/app/models/syllabus.rb +++ b/app/models/syllabus.rb @@ -9,8 +9,10 @@ class Syllabus < ActiveRecord::Base belongs_to :user has_many :courses has_many :journals_for_messages, :as => :jour, :dependent => :destroy - attr_accessible :description, :title, :eng_name, :syllabus_type, :credit, :hours, :theory_hours, :practice_hours, :applicable_major, :pre_course - safe_attributes 'title', 'description', 'eng_name', 'syllabus_type', 'credit', 'hours', 'theory_hours', 'practice_hours', 'credit', 'applicable_major', 'pre_course' + attr_accessible :description, :user_id, :title, :eng_name, :syllabus_type, :credit, :hours, :theory_hours, :practice_hours, :applicable_major, :pre_course + safe_attributes 'title','user', 'description', 'eng_name', 'syllabus_type', 'credit', 'hours', 'theory_hours', 'practice_hours', 'credit', 'applicable_major', 'pre_course' + + validates :title, :user_id, presence: true def delete_kindeditor_assets delete_kindeditor_assets_from_disk self.id,OwnerTypeHelper::SYLLABUS diff --git a/app/services/courses_service.rb b/app/services/courses_service.rb index 7a8d0fd32..a55a81e89 100644 --- a/app/services/courses_service.rb +++ b/app/services/courses_service.rb @@ -44,6 +44,8 @@ class CoursesService } end + + #搜索课程 def search_course params,current_user courses_all = Course.all_course diff --git a/app/services/syllabuses_service.rb b/app/services/syllabuses_service.rb new file mode 100644 index 000000000..9b060697c --- /dev/null +++ b/app/services/syllabuses_service.rb @@ -0,0 +1,59 @@ +#coding=utf-8 + +class SyllabusesService + + include ApplicationHelper + include CoursesHelper + + #获取指定用户的课程大纲 + def user_syllabus(user) + courses = CoursesService.new.user_courses_list(user) + + other = Syllabus.new(title: '未命名课程') + + courses.each do |c| + other.courses << c[:course] unless c[:course].syllabus + end + + user.syllabuses.to_a << other + end + + def after_create_course(course, user) + #unless User.current.admin? + r = Role.givable.find_by_id(Setting.new_project_user_role_id.to_i) || Role.givable.first + m = Member.new(:user => user, :roles => [r]) + m.project_id = -1 + course_info = CourseInfos.new(:user_id => user.id, :course_id => course.id) + #user_grades = UserGrade.create(:user_id => User.current.id, :course_id => @course.id) + course.members << m + course.course_infos << course_info + end + + #创建大纲 + # params {title: '大纲名称', [{course}, {course}]} + def create(user, title, courses = []) + sy = Syllabus.new(title: title, user_id: user.id) + ActiveRecord::Base.transaction() do + sy.save! + + courses.each do |course| + if ::Course === course + course.syllabus_id = sy.id + course.save! + elsif Hash === course + c = ::Course.new(course) + c.tea_id = user.id + c.syllabus_id = sy.id + c.update_default_value + c.save! + after_create_course(c, user) + end + end + + end + + sy + end + + +end \ No newline at end of file diff --git a/db/schema.rb b/db/schema.rb index 3258f89c1..d2947c19d 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20160627090316) do +ActiveRecord::Schema.define(:version => 20160630112733) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -57,6 +57,18 @@ ActiveRecord::Schema.define(:version => 20160627090316) do t.integer "user_id", :null => false end + create_table "apply_add_schools", :force => true do |t| + t.string "name" + t.string "province" + t.string "city" + t.string "address" + t.string "remarks" + t.integer "school_id" + t.integer "status", :default => 0 + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + create_table "apply_homeworks", :force => true do |t| t.integer "status" t.integer "user_id" @@ -550,9 +562,9 @@ ActiveRecord::Schema.define(:version => 20160627090316) do t.integer "excellent_option", :default => 0 t.integer "is_copy", :default => 0 t.integer "visits", :default => 0 - t.integer "syllabus_id" t.string "invite_code" t.string "qrcode" + t.integer "syllabus_id" end add_index "courses", ["invite_code"], :name => "index_courses_on_invite_code", :unique => true @@ -1633,10 +1645,11 @@ ActiveRecord::Schema.define(:version => 20160627090316) do create_table "schools", :force => true do |t| t.string "name" t.string "province" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false t.string "logo_link" t.string "pinyin" + t.integer "school_type", :default => 0 end create_table "secdomains", :force => true do |t| @@ -1849,8 +1862,18 @@ ActiveRecord::Schema.define(:version => 20160627090316) do t.string "title" t.text "description" t.integer "user_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "eng_name" + t.integer "syllabus_type" + t.integer "credit" + t.integer "hours" + t.integer "theory_hours" + t.integer "practice_hours" + t.string "applicable_major" + t.string "pre_course" + t.integer "visits", :default => 0 + t.integer "des_status", :default => 0 end add_index "syllabuses", ["user_id"], :name => "index_syllabuses_on_user_id" diff --git a/public/assets/wechat/class_list.html b/public/assets/wechat/class_list.html index 5c64b9a87..aded4e443 100644 --- a/public/assets/wechat/class_list.html +++ b/public/assets/wechat/class_list.html @@ -1,15 +1,20 @@
课程列表
-
未命名课程
-
    -
  • - - - > - {{course.course_student_num}}人 -
  • -
+ +
+
{{syllabus.title}}
+
    +
  • + + + > + {{course.member_count}}人 +
  • +
+
+ +
diff --git a/public/assets/wechat/new_class.html b/public/assets/wechat/new_class.html index ab0fc96f6..039d19d75 100644 --- a/public/assets/wechat/new_class.html +++ b/public/assets/wechat/new_class.html @@ -1,10 +1,14 @@
-
新建课程
-
课程
-
班级
- - 完成 +
+
新建课程
+ +
课程
+ +
班级删除
+ + 完成 +
diff --git a/public/javascripts/wechat/controllers/class_list.js b/public/javascripts/wechat/controllers/class_list.js index 21da4aea9..c30be8bcb 100644 --- a/public/javascripts/wechat/controllers/class_list.js +++ b/public/javascripts/wechat/controllers/class_list.js @@ -3,25 +3,28 @@ */ -app.controller('ClassListController', ['$scope', 'config', 'auth', '$http', '$location', 'alertService', - function ($scope, config, auth, $http, $location, alertService) { +app.controller('ClassListController', ['$scope', 'config', 'auth', '$http', '$location', 'alertService','rms', + function ($scope, config, auth, $http, $location, alertService,rms) { var vm = $scope; - vm.courses = []; + vm.syllabuses = rms.get('syllabuses') || []; vm.alertService = alertService.create(); - var loadClassList = function () { - $http.get(config.apiUrl + "courses?token=" + auth.token() + "&per_page_count=10&page=1").then( + $http.get(config.apiUrl + "syllabuses?token=" + auth.token()).then( function (response) { console.log(response.data); - vm.courses = response.data.data; + vm.syllabuses = response.data.data; + rms.save('syllabuses', vm.syllabuses); } ); }; - loadClassList(); - + if(vm.syllabuses.length<=0){ + loadClassList(); + } + + vm.goClass = function (course_id) { console.log(course_id); $location.path("/class").search({id: course_id}); diff --git a/public/javascripts/wechat/controllers/new_class.js b/public/javascripts/wechat/controllers/new_class.js index c3c81eecd..ef46fc4ba 100644 --- a/public/javascripts/wechat/controllers/new_class.js +++ b/public/javascripts/wechat/controllers/new_class.js @@ -1,12 +1,51 @@ -app.controller('NewClassController', ['$scope', '$http', 'auth', 'config', 'alertService', function($scope, $http, auth, config, alertService){ +app.controller('NewClassController', ['$scope', '$http', 'auth', 'config', 'alertService','$location', function($scope, $http, auth, config, alertService, $location){ var vm = $scope; vm.alertService = alertService.create(); - vm.newClass = function () { - vm.alertService.showMessage('提示', '此功能正在开发中'); + vm.syllabus = { + courses: [{name: ''}], + }; + + vm.addClass = function(){ + vm.syllabus.courses.push({}); + }; + + vm.deleteClass = function(index){ + vm.syllabus.courses.splice(index, 1); + } + + vm.newClass = function (frm, syllabus) { + frm.$setSubmitted(); + console.log(syllabus); + + if(!frm.$valid){ + console.log(frm.$error); + return; + } + + var courses = []; + for(var i in vm.syllabus.courses){ + courses .push(vm.syllabus.courses[i].name); + } + + $http.post(config.apiUrl+"syllabuses", { + token: auth.token(), + title: syllabus.title, + courses: courses + }).then(function(response){ + if(response.data.status!=0){ + vm.alertService.showMessage('出错了', response.data.message); + } else { + vm.alertService.showMessage('提示', '新建课程成功', function(){ + window.history.back(); + }); + } + console.log(response.data.data); + }); + } }] ); \ No newline at end of file diff --git a/public/stylesheets/weui/weixin.css b/public/stylesheets/weui/weixin.css index 5b1c1df95..3b5507170 100644 --- a/public/stylesheets/weui/weixin.css +++ b/public/stylesheets/weui/weixin.css @@ -77,7 +77,7 @@ a.underline {text-decoration:underline;} /*按钮样式*/ .btn1 {width:100%; height:40px; line-height:40px; vertical-align:middle; text-align:center; color:#fff; display:block; border-radius:5px;} .bg-blue:not(.btn-disabled):active {background-color:#2780c2;} -.btn-disabled {background-color:#ccc;} +.btn-disabled {background-color:#ccc !important;} .btn2 {width:145px; height:35px; color:#fff; font-size:15px; line-height:35px; text-align:center; vertical-align:middle; margin:18px auto 20px auto; border-radius:50px; display:block;} /*tab*/ From 45b824938e203c6dbf7e565f279ebf2240a34aa2 Mon Sep 17 00:00:00 2001 From: txz Date: Mon, 4 Jul 2016 16:41:41 +0800 Subject: [PATCH 11/87] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E8=AE=A8=E8=AE=BA?= =?UTF-8?q?=E5=8C=BA=E4=B8=8E=E8=AF=BE=E7=A8=8B=E9=80=9A=E7=9F=A5=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E9=A1=B5=E9=9D=A2=E6=A0=B7=E5=BC=8F=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/assets/wechat/activities.html | 21 ++++-- public/assets/wechat/course_discussion.html | 72 +++++++++++---------- public/assets/wechat/course_notice.html | 70 +++++++++++--------- public/stylesheets/weui/weixin.css | 1 + 4 files changed, 92 insertions(+), 72 deletions(-) diff --git a/public/assets/wechat/activities.html b/public/assets/wechat/activities.html index b34098a8e..a51a0f5f0 100644 --- a/public/assets/wechat/activities.html +++ b/public/assets/wechat/activities.html @@ -23,7 +23,8 @@
{{act.latest_update}}
@@ -60,7 +61,8 @@
{{act.latest_update}}
@@ -95,7 +97,8 @@
{{act.latest_update}}
@@ -147,7 +150,8 @@
{{act.latest_update}}
@@ -185,7 +189,8 @@
{{act.latest_update}}
@@ -235,7 +240,8 @@
{{act.latest_update}}
@@ -271,7 +277,8 @@
{{act.latest_update}}
diff --git a/public/assets/wechat/course_discussion.html b/public/assets/wechat/course_discussion.html index cc188f978..142a474fd 100644 --- a/public/assets/wechat/course_discussion.html +++ b/public/assets/wechat/course_discussion.html @@ -4,51 +4,57 @@
-
+
-
{{discussion.subject}}
- - - - - - - -
发布者:{{discussion.user.realname}}
来   源:{{discussion.course_project_name}}  |  课程问答区
-
+
+
- {{discussion.created_on}} +
{{discussion.subject}}
+
{{discussion.course_project_name}}-课程问答区{{discussion.created_on}}
+
+
+
+
+
{{discussion.praise_count}}
+
{{discussion.praise_count}}
+
+
-
-
-
回复 ({{discussion.replies_count}})
-
已赞 ({{discussion.praise_count}})
-
赞 ({{discussion.praise_count}})
-
-
-
-
- -
-
{{journal.lasted_comment}}
-
回复
+
+
+
+
+ +
{{journal.lasted_comment}}
+
+
+
-
-
-
+ +
-
- + + + +
- - -
diff --git a/public/assets/wechat/course_notice.html b/public/assets/wechat/course_notice.html index e3346ea93..780aa43a8 100644 --- a/public/assets/wechat/course_notice.html +++ b/public/assets/wechat/course_notice.html @@ -3,51 +3,57 @@
-
+
-
{{news.title}}
- - - - - - - -
发布者:{{news.author.realname}}
来   源:{{news.course_name}}  |  课程通知
+
+ +
+
{{news.title}}
+
{{news.course_name}}-课程通知{{news.created_on}}
- {{news.created_on}} +
+
+
{{news.praise_count}}
+
{{news.praise_count}}
+
+
-
-
回复 ({{news.comments_count}})
-
已赞 ({{news.praise_count}})
-
赞 ({{news.praise_count}})
-
-
-
-
-
- -
-
{{comments.created_on}}
-
回复
+
+
+
+
+ +
{{comments.created_on}}
+
+
+
-
-
-
+ +
-
- + + + +
- - -
diff --git a/public/stylesheets/weui/weixin.css b/public/stylesheets/weui/weixin.css index 7c219c571..1b2e295f5 100644 --- a/public/stylesheets/weui/weixin.css +++ b/public/stylesheets/weui/weixin.css @@ -112,6 +112,7 @@ a.underline {text-decoration:underline;} .more-events {width:100%; font-size:13px; text-align:center; margin:0 auto; padding: 5px 0; border-top:1px solid #e6e6e6; border-bottom:1px solid #e6e6e6; border-radius:3px; background-color:#f8f9fb; } .border-bottom {border-bottom:1px solid #e6e6e6;} .post-reply-wrap {width:100%;} +.post-reply-wrap:first-child {border-top:1px solid #ccc;} .post-input-wrap {width:100%; position:fixed; bottom:0;} .post-input-wrap2 {width:100%;} .post-reply-row {padding:10px 15px; color:#9a9a9a; background-color:#fff;} From 9d0b5789d9493bfccc02049955358b066f7b5c8d Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Mon, 4 Jul 2016 16:50:49 +0800 Subject: [PATCH 12/87] =?UTF-8?q?1.=E4=BF=AE=E6=94=B9=E6=88=91=E7=9A=84?= =?UTF-8?q?=E5=8A=A8=E6=80=81=E5=8D=9A=E5=AE=A2=E8=AF=A6=E6=83=85=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E6=98=BE=E7=A4=BA=E4=B8=8D=E4=BA=86=E7=9A=84BUG=20=20?= =?UTF-8?q?2.=E8=B5=84=E6=BA=90=E7=95=8C=E9=9D=A2=E5=88=87=E6=8D=A2?= =?UTF-8?q?=E6=98=AF=E6=9A=82=E6=97=A0XX=E5=85=88=E9=9A=90=E8=97=8F=20=203?= =?UTF-8?q?.=20=E5=8F=91=E9=80=81=E8=B5=84=E6=BA=90=E4=B8=8D=E9=80=89?= =?UTF-8?q?=E6=8B=A9=E7=8F=AD=E7=BA=A7=E7=9A=84=E6=8F=90=E7=A4=BA=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/mobile/apis/blog_comments.rb | 2 +- public/assets/wechat/class.html | 6 +++--- public/assets/wechat/myresource.html | 9 ++++++--- public/javascripts/wechat/controllers/class.js | 6 ++++++ public/javascripts/wechat/controllers/myresource.js | 12 ++++++------ 5 files changed, 22 insertions(+), 13 deletions(-) diff --git a/app/api/mobile/apis/blog_comments.rb b/app/api/mobile/apis/blog_comments.rb index 5a064245a..bb5758e71 100644 --- a/app/api/mobile/apis/blog_comments.rb +++ b/app/api/mobile/apis/blog_comments.rb @@ -7,7 +7,7 @@ module Mobile desc "get special topic" get ':id' do - user = UserWechat.find_by_openid(params[:openid]).user + user = current_user blog = BlogComment.find params[:id] present :data, blog, with: Mobile::Entities::BlogComment,user: user present :status, 0 diff --git a/public/assets/wechat/class.html b/public/assets/wechat/class.html index 70dd64fad..fa52c9ea4 100644 --- a/public/assets/wechat/class.html +++ b/public/assets/wechat/class.html @@ -21,7 +21,7 @@
{{r.filename}}发送
-

暂无课件,
+

暂无课件,
请登录Trustie网站,在PC浏览器中上传课件。

@@ -38,14 +38,14 @@
{{r.homework_name}}
-

暂无作业,
+

暂无作业,
请登录Trustie网站,在PC浏览器中上传作业。

{{r.exercise_name}}
-

暂无小测验,
+

暂无小测验,
请登录Trustie网站,在PC浏览器中上传小测验。

diff --git a/public/assets/wechat/myresource.html b/public/assets/wechat/myresource.html index dc4d6ea78..1317ac11a 100644 --- a/public/assets/wechat/myresource.html +++ b/public/assets/wechat/myresource.html @@ -1,4 +1,5 @@
+
我的资源
{{menu}} @@ -8,19 +9,21 @@
+
{{r.filename}}发送
-

暂无课件,
+

暂无课件,
请登录Trustie网站,在PC浏览器中上传课件。

{{r.homework_name}}
-

暂无作业,
+

暂无作业,
请登录Trustie网站,在PC浏览器中创建作业。

{{r.exercise_name}}
-

暂无测验,
+

暂无测验,
请登录Trustie网站,在PC浏览器中创建测验。

+
diff --git a/public/javascripts/wechat/controllers/class.js b/public/javascripts/wechat/controllers/class.js index 1cd69bb43..d5de23859 100644 --- a/public/javascripts/wechat/controllers/class.js +++ b/public/javascripts/wechat/controllers/class.js @@ -31,6 +31,7 @@ app.controller('ClassController', ['$scope', 'config','$http', 'auth','$location {token: auth.token(), name: ''} ).then(function(response){ vm.resources = response.data.data; + vm.resources_tag = true; }); } } @@ -40,6 +41,7 @@ app.controller('ClassController', ['$scope', 'config','$http', 'auth','$location $http.get(config.apiUrl + "courses/homeworks/"+courseid+"?token="+auth.token()).then(function(response){ vm.homeworks = response.data.data; console.log(response.data); + vm.homeworks_tag = true; }); } } @@ -49,6 +51,7 @@ app.controller('ClassController', ['$scope', 'config','$http', 'auth','$location $http.get(config.apiUrl + "courses/"+courseid+"/exercises?token="+auth.token()).then(function(response){ vm.exercises = response.data.data; console.log(response.data); + vm.exercises_tag = true; }); } } @@ -64,6 +67,9 @@ app.controller('ClassController', ['$scope', 'config','$http', 'auth','$location vm.showResources = false; vm.showHomework = false; vm.showTestcase = false; + vm.resources_tag = false; + vm.homeworks_tag = false; + vm.exercises_tag = false; if(vm.isTeacher){ if(index == 1){ //课件 diff --git a/public/javascripts/wechat/controllers/myresource.js b/public/javascripts/wechat/controllers/myresource.js index 084205fbe..462a35842 100644 --- a/public/javascripts/wechat/controllers/myresource.js +++ b/public/javascripts/wechat/controllers/myresource.js @@ -2,23 +2,23 @@ app.controller('MyResourceController', ['$scope', '$http', 'auth', 'config', '$l var vm = $scope; vm.menus = ['课件', '作业', '测验']; - vm.resources = []; - vm.homeworks = []; - vm.exercise = []; + vm.resources = null; + vm.homeworks = null; + vm.exercise = null; vm.tab = function(index){ vm.currentTab = index; - if(index==1){ + if(index==1 && (!vm.resources || vm.resources.length <= 0 )){ $http.get(config.apiUrl + "resources?token="+auth.token()).then(function(response){ console.log(response.data); vm.resources = response.data.data; }); - } else if(index==2){ + } else if(index==2 && (!vm.homeworks || vm.homeworks.length <= 0) ){ $http.get(config.apiUrl + "resources/homeworks?token="+auth.token()).then(function(response){ console.log(response.data); vm.homeworks = response.data.data; }); - } else if(index==3){ + } else if(index==3 && (!vm.exercise || vm.exercise.length <= 0) ){ $http.get(config.apiUrl + "resources/exercies?token="+auth.token()).then(function(response){ console.log(response.data); vm.exercise = response.data.data; From 48fb02a2d6c1d905f5e5d39fcf2c6aee5c04d42b Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Mon, 4 Jul 2016 17:04:06 +0800 Subject: [PATCH 13/87] =?UTF-8?q?=E7=AE=A1=E7=90=86=E8=AF=BE=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/mobile/apis/courses.rb | 17 ++++ app/api/mobile/apis/syllabuses.rb | 14 ++++ app/controllers/courses_controller.rb | 2 +- app/models/course.rb | 4 + app/views/wechats/user_activities.html.erb | 1 + public/assets/wechat/class_list.html | 4 +- public/assets/wechat/edit_class.html | 14 ++++ .../wechat/controllers/class_list.js | 6 +- .../wechat/controllers/edit_class.js | 77 +++++++++++++++++++ public/javascripts/wechat/others/routes.js | 1 + 10 files changed, 134 insertions(+), 6 deletions(-) create mode 100644 public/assets/wechat/edit_class.html create mode 100644 public/javascripts/wechat/controllers/edit_class.js diff --git a/app/api/mobile/apis/courses.rb b/app/api/mobile/apis/courses.rb index cb1db09d8..917a396e2 100644 --- a/app/api/mobile/apis/courses.rb +++ b/app/api/mobile/apis/courses.rb @@ -396,6 +396,23 @@ module Mobile present :status,0 end + desc '删除课程' + params do + requires :token, type: String + end + post ':course_id/del' do + authenticate! + c = Course.find(params[:course_id]) + if c.members.count > 1 + {status: -1, message: '已经有成员加入,不能删除'} + else + c.delete! + present :status,0 + end + + + end + end end end diff --git a/app/api/mobile/apis/syllabuses.rb b/app/api/mobile/apis/syllabuses.rb index f8286f56d..47989155e 100644 --- a/app/api/mobile/apis/syllabuses.rb +++ b/app/api/mobile/apis/syllabuses.rb @@ -18,6 +18,18 @@ module Mobile present :status, 0 end + desc "获取某个大纲" + params do + requires :token, type: String + end + get ':id' do + authenticate! + + sy = ::Syllabus.find(params[:id]) + present :data, sy, with: Mobile::Entities::Syllabus + present :status, 0 + end + desc "新建大纲" params do requires :token, type: String @@ -41,6 +53,8 @@ module Mobile end + + end diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index e81251f63..a9d84c2d9 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -1090,7 +1090,7 @@ class CoursesController < ApplicationController #删除课程 #删除课程只是将课程的is_deleted状态改为false,is_deleted为false状态的课程只有管理员可以看到 def destroy - @course.update_attributes(:is_delete => true) + @course.delete! @course = nil redirect_to user_url(User.current) end diff --git a/app/models/course.rb b/app/models/course.rb index 408a86ad7..d98ac0f1e 100644 --- a/app/models/course.rb +++ b/app/models/course.rb @@ -173,6 +173,10 @@ class Course < ActiveRecord::Base ) end + def delete! + update_attribute(:is_delete, true) + end + def visible?(user=User.current) user.allowed_to?(:view_course, self) end diff --git a/app/views/wechats/user_activities.html.erb b/app/views/wechats/user_activities.html.erb index 3ca452a34..a9254829b 100644 --- a/app/views/wechats/user_activities.html.erb +++ b/app/views/wechats/user_activities.html.erb @@ -41,6 +41,7 @@ + diff --git a/public/assets/wechat/class_list.html b/public/assets/wechat/class_list.html index aded4e443..919eb1364 100644 --- a/public/assets/wechat/class_list.html +++ b/public/assets/wechat/class_list.html @@ -3,7 +3,7 @@
课程列表
-
{{syllabus.title}}
+
{{syllabus.title}}
  • @@ -15,8 +15,6 @@
- -
新建课程 加入班级 diff --git a/public/assets/wechat/edit_class.html b/public/assets/wechat/edit_class.html new file mode 100644 index 000000000..a1a243b12 --- /dev/null +++ b/public/assets/wechat/edit_class.html @@ -0,0 +1,14 @@ +
+
+ +
管理课程
+
+
课程
+ +
班级删除
+ + 完成 +
+ + +
diff --git a/public/javascripts/wechat/controllers/class_list.js b/public/javascripts/wechat/controllers/class_list.js index c30be8bcb..2896d508d 100644 --- a/public/javascripts/wechat/controllers/class_list.js +++ b/public/javascripts/wechat/controllers/class_list.js @@ -61,8 +61,10 @@ app.controller('ClassListController', ['$scope', 'config', 'auth', '$http', '$lo } }; - vm.onSetting = function () { - vm.alertService.showMessage('提示', '此功能正在开发中'); + vm.onSetting = function (syllabus) { + console.log(syllabus); + rms.save('current_edit_syllobus', syllabus); + $location.path("/edit_class").search({id: syllabus.id}); } }]); \ No newline at end of file diff --git a/public/javascripts/wechat/controllers/edit_class.js b/public/javascripts/wechat/controllers/edit_class.js new file mode 100644 index 000000000..8520a6eca --- /dev/null +++ b/public/javascripts/wechat/controllers/edit_class.js @@ -0,0 +1,77 @@ + + +app.controller('EditClassController', ['$scope', '$http', 'auth', 'config', 'alertService','$location','$routeParams','rms', function($scope, $http, auth, config, alertService, $location,$routeParams, rms){ + var vm = $scope; + + vm.syllabus = rms.get('current_edit_syllobus'); + console.log(vm.syllabus); + + var syllabus_id = $routeParams.id; + if(!vm.syllabus){ + $http.get(config.apiUrl+"syllabuses/"+syllabus_id+"?token="+auth.token()).then(function(response){ + console.log(response.data); + vm.syllabus = response.data.data; + }); + } + + vm.alertService = alertService.create(); + vm.addClass = function(){ + vm.syllabus.courses.push({}); + }; + + vm.deleteClass = function(index){ + var course = vm.syllabus.courses[index]; + if(course.id >0){ + $http.post(config.apiUrl+'courses/'+course.id+'/del', { + token: auth.token() + }).then(function(response){ + if(response.data.status!=0){ + vm.alertService.showMessage('出错了', response.data.message); + } else { + vm.alertService.showMessage('提示', '删除班级成功', function(){ + vm.syllabus.courses.splice(index, 1); + }); + } + console.log(response.data.data); + }); + } else { + vm.syllabus.courses.splice(index, 1); + } + + } + + vm.newClass = function (frm, syllabus) { + frm.$setSubmitted(); + console.log(syllabus); + + if(!frm.$valid){ + console.log(frm.$error); + return; + } + + var courses = []; + for(var i in vm.syllabus.courses){ + var course = vm.syllabus.courses[i]; + if(course.id>0){ + courses.push(course.name); + } + } + + $http.post(config.apiUrl+"syllabuses", { + token: auth.token(), + id: syllabus_id, + courses: courses + }).then(function(response){ + if(response.data.status!=0){ + vm.alertService.showMessage('出错了', response.data.message); + } else { + vm.alertService.showMessage('提示', '保存课程成功', function(){ + window.history.back(); + }); + } + console.log(response.data.data); + }); + + } + +}] ); \ No newline at end of file diff --git a/public/javascripts/wechat/others/routes.js b/public/javascripts/wechat/others/routes.js index ea6dca05d..2c63609b0 100644 --- a/public/javascripts/wechat/others/routes.js +++ b/public/javascripts/wechat/others/routes.js @@ -32,6 +32,7 @@ app.config(['$routeProvider',"$httpProvider", "$locationProvider",'config', func .when('/blog_comment/:id', makeRoute('blog_detail.html', 'BlogController')) .when('/class', makeRoute('class.html', 'ClassController')) .when('/new_class', makeRoute('new_class.html', 'NewClassController')) + .when('/edit_class', makeRoute('edit_class.html', 'EditClassController')) .when('/class_list', makeRoute('class_list.html', 'ClassListController')) .when('/myresource', makeRoute('myresource.html', 'MyResourceController')) .when('/invite_code', makeRoute('invite_code.html', 'InviteCodeController')) From 3066a564bd5afe0e989cdf7bc823906bbf19066f Mon Sep 17 00:00:00 2001 From: txz Date: Mon, 4 Jul 2016 17:06:43 +0800 Subject: [PATCH 14/87] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E8=AF=A6=E6=83=85=E9=A1=B5=E9=9D=A2=E6=A0=B7=E5=BC=8F=E6=9B=B4?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/assets/wechat/homework_detail.html | 88 +++++++++++------------ 1 file changed, 44 insertions(+), 44 deletions(-) diff --git a/public/assets/wechat/homework_detail.html b/public/assets/wechat/homework_detail.html index 387b69867..30d68606f 100644 --- a/public/assets/wechat/homework_detail.html +++ b/public/assets/wechat/homework_detail.html @@ -5,65 +5,65 @@
-
{{homework.name}}
- - - - - - - - - - - - -
发布者: - {{homework.author.realname}} - {{homework.author.nickname}}
来   源:{{homework.course_name}}  |  课程作业
类   别:普通作业 - 编程作业 - 分组作业 -
+ +
+ +
+
{{homework.name}}
+
{{homework.course_name}}-普通作业编程作业分组作业{{homework.publish_time}}
- 迟交扣分:{{homework.late_penalty}}分
- 缺评扣分:{{homework.absence_penalty}}分/作品
- 匿评开启时间:{{homework.evaluation_start}}
+ 迟交扣分:{{homework.late_penalty}}分 + 缺评扣分:{{homework.absence_penalty}}分/作品 + 匿评开启时间:{{homework.evaluation_start}} 匿评关闭时间:{{homework.evaluation_end}}
- {{homework.publish_time}} +
+
+
{{homework.praise_count}}
+
{{homework.praise_count}}
+
+
-
-
回复 ({{homework.whomework_journal_count}})
-
已赞 ({{homework.praise_count}})
-
赞 ({{homework.praise_count}})
-
-
-
-
-
- -
-
{{journal.lasted_comment}}
-
回复
+ +
+
+
+
+ +
{{journal.lasted_comment}}
+
+
+
-
+
-
-
+ +
-
- + + + +
- - -
+
\ No newline at end of file From da19bbd3a0d043d4f8e0f30e01edcdb914efe108 Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Tue, 5 Jul 2016 09:02:34 +0800 Subject: [PATCH 15/87] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BA=86=E4=B8=8B?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=B5=84=E6=96=99=E7=95=8C=E9=9D=A2=E7=9A=84?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/school_controller.rb | 26 ++-- app/models/apply_add_schools.rb | 1 + app/views/my/_apply_add_school.html.erb | 187 ------------------------ app/views/my/account.html.erb | 185 ----------------------- public/javascripts/application.js | 186 +++++++++++++++++++++++ 5 files changed, 202 insertions(+), 383 deletions(-) diff --git a/app/controllers/school_controller.rb b/app/controllers/school_controller.rb index 44f4378fe..dab752afb 100644 --- a/app/controllers/school_controller.rb +++ b/app/controllers/school_controller.rb @@ -155,47 +155,51 @@ class SchoolController < ApplicationController def apply_add_school data = {result:0,name:params[:name],school_id:0} - #0 成功 1参数错误 2名称已存在 + #0 成功 1参数错误 2名称已存在 3.失败 data[:result] = 0 #检验参数 if params[:name] == "" || params[:province] == "" || params[:city] == "" || params[:address] == "" data[:result] = 1 else - school_id = School.find_by_sql("select id from schools where name='#{params[:name]}'").first - if school_id + school = School.where("name = '#{params[:name]}'").first + if school data[:result] = 2 else school = School.new school.name = params[:name].strip school.pinyin = Pinyin.t(params[:name].strip, splitter: '') - school.save #status 0未处理 1通过 2拒绝 applyschool = ApplyAddSchools.new - applyschool.school_id = school.id + + #用belongs_to 可以一起存数据库 + applyschool.school = school applyschool.name = school.name applyschool.province = params[:province] applyschool.city = params[:city] applyschool.address = params[:address] applyschool.remarks = params[:remarks] - applyschool.save - data[:school_id] = school.id + if applyschool.save + data[:school_id] = school.id + else + data[:result] = 3 + end end end render :json =>data end def search_repeat_schoolname - status = 0 + status = 0 #没有重复的 name = params[:name] if name - school_id = School.find_by_sql("select id from schools where name='#{name}'").first + school = School.where("name = '#{name}'").first - if school_id - status = 1 + if school + status = 1 #有重复的 end end diff --git a/app/models/apply_add_schools.rb b/app/models/apply_add_schools.rb index 2082c0012..efa56e808 100644 --- a/app/models/apply_add_schools.rb +++ b/app/models/apply_add_schools.rb @@ -1,3 +1,4 @@ class ApplyAddSchools < ActiveRecord::Base attr_accessible :address, :city, :name, :province, :remarks, :school_id, :status + belongs_to :school end diff --git a/app/views/my/_apply_add_school.html.erb b/app/views/my/_apply_add_school.html.erb index 1449fa1f1..c7b08e305 100644 --- a/app/views/my/_apply_add_school.html.erb +++ b/app/views/my/_apply_add_school.html.erb @@ -120,193 +120,6 @@ }); } - function showcity(province, cityField) { - $("#provincenotice").hide(); - 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; - }*/ - } - } - function ifNameRepeat(){ //名称不能为空也不能重复 diff --git a/app/views/my/account.html.erb b/app/views/my/account.html.erb index 589541c39..d356756c1 100644 --- a/app/views/my/account.html.erb +++ b/app/views/my/account.html.erb @@ -249,191 +249,6 @@ <% end %> <% html_title(l(:label_course_all)) -%> diff --git a/app/views/admin/create_syllabus.js.erb b/app/views/admin/create_syllabus.js.erb new file mode 100644 index 000000000..ac37abd78 --- /dev/null +++ b/app/views/admin/create_syllabus.js.erb @@ -0,0 +1,10 @@ +hideModal(); +<%courses = Course.where("tea_id = #{@user.id}") %> +<% unless courses.empty? %> + <% courses.each do |course|%> + $("#course_<%=course.id %>").html("<%=escape_javascript(render :partial => 'courselist_detail_tr', :locals => {:course => course}) %>"); + <% end %> +<% end %> +<% if @flag == 1 %> + $("#course_<%=@course.id %>").html(""); +<% end %> \ No newline at end of file diff --git a/app/views/admin/excellent_courses.html.erb b/app/views/admin/excellent_courses.html.erb index c107713a0..0418ebf30 100644 --- a/app/views/admin/excellent_courses.html.erb +++ b/app/views/admin/excellent_courses.html.erb @@ -16,7 +16,7 @@ 序号 - 课程名 + 班级名 主讲老师 diff --git a/app/views/admin/non_syllabus_courses.html.erb b/app/views/admin/non_syllabus_courses.html.erb new file mode 100644 index 000000000..6c3cbec10 --- /dev/null +++ b/app/views/admin/non_syllabus_courses.html.erb @@ -0,0 +1,164 @@ +
+ <%= link_to l(:label_course_new), {:controller => 'courses', :action => 'new'}, :class => 'icon icon-add' %> +
+ +

+ 未配置班级列表 +

+<%= render 'tab_syllabuses_courses' %> + +

+ 未配置班级列表 +

+ +<%= form_tag({}, :method => :get) do %> +
+ + <%= text_field_tag 'name', params[:name], :size => 30, :placeholder => '班级、老师名称' %> + <%= submit_tag l(:button_apply), :class => "small", :name => nil %> + <%= link_to l(:button_clear), {:controller => 'admin', :action => 'non_syllabus_courses'}, :class => 'icon icon-reload' %> +
+<% end %> +  + +
+ + + + + + + + + + + + + + + + <% @courses.each do |course| %> + " id="course_<%=course.id %>"> + + + + + + + + + + + <% end %> + +
+ 序号 + + 班级 + + 主讲老师 + + 学时 + + <%=l(:field_is_public)%> + + <%=l(:field_created_on)%> + + 动态时间 + + 课程 + + +
+ <%= course.id %> + + + <%= course.name%> + + + <%= link_to(course.try(:teacher).try(:realname).truncate(6, omission: '...'), user_path(course.teacher)) %> + + <%= course.class_period %> + + <%= checked_image course.is_public? %> + + <%= format_date(course.created_at) %> + + <%= course.updated_at.strftime('%Y-%m-%d %H:%M:%S') %> + + <%= select_tag :syllabus_id,options_for_select(course_syllabus_option(course.teacher),course.syllabus_id), {:id=>"new_syllabus_id_#{course.id}", :class=>"course_syllabus_input", :onchange=>"select_syllabus(#{course.id});"}%> + + 新建课程 +
+
+ + + + +<% html_title(l(:label_course_all)) -%> diff --git a/app/views/admin/syllabuses.html.erb b/app/views/admin/syllabuses.html.erb new file mode 100644 index 000000000..1066ac3ef --- /dev/null +++ b/app/views/admin/syllabuses.html.erb @@ -0,0 +1,142 @@ +

+ 课程列表 +

+<%= render 'tab_syllabuses_courses' %> + +

+ 课程列表 +

+ +<%= form_tag({}, :method => :get) do %> +
+ + <%= text_field_tag 'name', params[:name], :size => 30, :placeholder => '课程名称' %> + <%= submit_tag l(:button_apply), :class => "small", :name => nil %> + <%= link_to l(:button_clear), {:controller => 'admin', :action => 'syllabuses'}, :class => 'icon icon-reload' %> +
+<% end %> +  + +
+ + + + + + + + + + + + <% @syllabuses.each do |syllabus| %> + + + + + + + + <% courses = syllabus.courses %> + <% courses.each do |course| %> + + + + + + + + <% end %> + <% end %> + +
+ 序号 + + 课程名称 + + 班级名称 + + 创建老师 + + <%=l(:field_created_on)%> +
+ <%= syllabus.id %> + + + <%= link_to(syllabus.title, syllabus_path(syllabus.id)) %> + + + + <%= link_to(syllabus.try(:user).try(:realname).truncate(6, omission: '...'), user_path(syllabus.user)) %> + + <%= format_date(syllabus.created_at) %> +
+ <%= course.id %> + + + + <%= course.name%> + + + <%= link_to(course.try(:teacher).try(:realname).truncate(6, omission: '...'), user_path(course.teacher)) %> + + <%= format_date(course.created_at) %> +
+
+ + + + \ No newline at end of file diff --git a/app/views/admin/update_course_name.js.erb b/app/views/admin/update_course_name.js.erb new file mode 100644 index 000000000..2da524b5b --- /dev/null +++ b/app/views/admin/update_course_name.js.erb @@ -0,0 +1 @@ +$("#rename_course_name_<%=@course.id %>").html("<%=@course.name %>"); \ No newline at end of file diff --git a/app/views/layouts/base_admin.html.erb b/app/views/layouts/base_admin.html.erb index cff80a15d..81cc2df9d 100644 --- a/app/views/layouts/base_admin.html.erb +++ b/app/views/layouts/base_admin.html.erb @@ -19,6 +19,10 @@ <%= call_hook :view_layouts_base_html_head %> <%= yield :header_tags -%> + +
diff --git a/config/locales/courses/zh.yml b/config/locales/courses/zh.yml index 1aa1ea666..29d6b236c 100644 --- a/config/locales/courses/zh.yml +++ b/config/locales/courses/zh.yml @@ -12,7 +12,7 @@ zh: # label_course_join_student: 加入班级 label_course_exit_student: 退出班级 - label_course_new: 新建课程 + label_course_new: 新建班级 label_course_name: 课程名称 label_homework: 作业 diff --git a/config/locales/zh.yml b/config/locales/zh.yml index fc3e39980..0220cd11c 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -482,9 +482,10 @@ zh: label_show_contest: 显示竞赛 #by young label_requirement: 需求 - label_new_course: 课程列表 - label_course_all: 课程列表 - label_excellent_courses_list: 精品课程列表 + label_new_course: 班级列表 + label_course_all: 班级列表 + label_syllabus_all: 课程列表 + label_excellent_courses_list: 精品班级列表 label_course_resource_list: 班级资源列表 label_project_resource_list: 項目资源列表 label_teacher_all: 所有教师 @@ -1367,7 +1368,7 @@ zh: label_bid_reason_homework: 请输入作业提交说明! label_create_new_projects: 创建项目 label_call_for_bids: 发布需求 - label_create_course: 创建课程 + label_create_course: 创建班级 label_milestone: 里程碑 label_features: 特性 @@ -1488,7 +1489,7 @@ zh: label_user_project: 项目 - label_user_course: 课程 + label_user_course: 班级 label_user_homework: 作业 label_bid_if_agreement: 如果喜欢我,请点击我 @@ -1542,7 +1543,7 @@ zh: label_teacher_work_unit: 教师单位 label_course_time: 课程年度 label_i_new_activity: 有了新活动在 - label_choose_course: 选择课程 + label_choose_course: 选择班级 button_submit_homework: 提交作业 button_submit_bid: 参与竞标 label_requirement_from: 需求来源 @@ -1596,9 +1597,9 @@ zh: #end - label_joined_course: 参加的课程 - label_created_course: 创建的课程 - label_course: 课程 + label_joined_course: 参加的班级 + label_created_course: 创建的班级 + label_course: 班级 label_public_info: (打钩为公开,不打钩则不公开,若不公开,仅项目成员可见该项目。) diff --git a/config/routes.rb b/config/routes.rb index 4465c9e1b..5717325e1 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1027,7 +1027,10 @@ RedmineApp::Application.routes.draw do match 'admin', :to => 'admin#index', :via => :get match 'admin/projects', :via => :get - get 'admin/courses' + get 'admin/courses', as: :all_courses + get 'admin/syllabuses', as: :all_syllabuses + get 'admin/non_syllabus_courses', as: :non_syllabus_courses + post 'admin/update_course_name' get 'admin/excellent_courses', as: :excellent_courses get 'admin/excellent_all_courses', as: :excellent_all_courses match 'admin/set_excellent_course/:id', :to => 'admin#set_excellent_course' @@ -1060,6 +1063,8 @@ RedmineApp::Application.routes.draw do get 'admin/homework' get 'admin/apply_for_homework' get 'admin/code_work_tests' + post 'admin/select_course_syllabus' + post 'admin/create_syllabus' resources :auth_sources do member do diff --git a/lib/redmine.rb b/lib/redmine.rb index c0aa658ae..cfd8b6824 100644 --- a/lib/redmine.rb +++ b/lib/redmine.rb @@ -367,7 +367,7 @@ end Redmine::MenuManager.map :admin_menu do |menu| menu.push :organization, {:controller => 'admin', :action => 'organization'}, :caption => :label_organization_list menu.push :projects, {:controller => 'admin', :action => 'projects'}, :caption => :label_project_plural - menu.push :courses, {:controller => 'admin', :action => 'courses'}, :caption => :label_course_all + menu.push :syllabuses, {:controller => 'admin', :action => 'syllabuses'}, :caption => :label_course_all menu.push :users, {:controller => 'admin', :action => 'users'}, :caption => :label_user_plural menu.push :messages, {:controller => 'admin', :action => 'messages'}, :caption => :label_system_message menu.push :schools, {:controller => 'admin', :action => 'schools'}, :caption => :label_school_plural diff --git a/public/javascripts/application.js b/public/javascripts/application.js index 525a1fb1a..da833fe47 100644 --- a/public/javascripts/application.js +++ b/public/javascripts/application.js @@ -1589,3 +1589,71 @@ function expand_course_list(id, target, btnid, count) { } } +function regex_syllabus_name() { + var name = $.trim($("#new_syllabus_name").val()); + if(name.length < 2) + { + $("#new_syllabus_name_notice").show(); + return false; + } + else + { + $("#new_syllabus_name_notice").hide(); + return true; + } +} + +function alert_new_syllabus(course_id, flag){ + htmlvalue = "

新建课程

    " + + "
  • " + + "" + + "
    " + + "" + + "
  • " + + "
    " + + "
  • " + + "" + + "" + + "
  • " + + "
    " + + "
  • " + + "提交" + + "取消" + + "
    " + + "
  • " + + "
"; + pop_up_box(htmlvalue,600,30,50); +} + +function admin_new_syllabus(course_id, flag){ + if(regex_syllabus_name()) { + $.ajax({ + type: "post", + url: "/admin/create_syllabus", + data: {course_id: course_id, + title: $("#new_syllabus_name").val(), + eng_name: $("#new_syllabus_eng_name").val(), + flag: flag}, + success: function (data) { + } + }); + hideModal(); + } +} + +//执行修改courseName方法 +function updateCourseName(){ + if(isdb){ + isdb = false; + if($("#renameCourseName").val() == tagName){ //如果值一样,则恢复原来的状态 + ele.parent().css("border",""); + ele.parent().html(tagNameHtml); + } + else{ + $.post( + '<%= admin_update_course_name_path %>', + {"course_id": tagId, "name": $("#renameCourseName").val().trim()} + ); + } + } +} \ No newline at end of file diff --git a/public/javascripts/course.js b/public/javascripts/course.js index 8215f3aa1..0e60f01c9 100644 --- a/public/javascripts/course.js +++ b/public/javascripts/course.js @@ -224,20 +224,6 @@ function submit_new_syllabus() } } -function regex_syllabus_name() { - var name = $.trim($("#new_syllabus_name").val()); - if(name.length < 2) - { - $("#new_syllabus_name_notice").show(); - return false; - } - else - { - $("#new_syllabus_name_notice").hide(); - return true; - } -} - //课程讨论区 function regexTopicSubject() { var name = $("#message_subject").val(); diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 3764ceb04..112f8224b 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -1409,6 +1409,7 @@ table td {padding:2px;} table p {margin:0;} .odd {background-color:#f6f7f8;} .even {background-color: #fff;} +.odd_grey {background-color: #b4b4b4} a.sort { padding-right: 16px; background-position: 100% 50%; background-repeat: no-repeat; } a.sort.asc { background-image: url(../images/sort_asc.png); } @@ -2847,4 +2848,10 @@ img.school_avatar { } .admin_message_warn{font-size: 12px;color: red;} -a.btn_message_free{ background:#15BCCF; display:block; text-align:center; color:#fff; padding:3px 0; width:60px; margin-bottom:10px;margin-left: 58px;} \ No newline at end of file +a.btn_message_free{ background:#15BCCF; display:block; text-align:center; color:#fff; padding:3px 0; width:60px; margin-bottom:10px;margin-left: 58px;} + +.course_syllabus_input{width:120px;} +.name_input{ border:1px solid #64bdd9; height:16px; width:310px; background:#fff; margin-bottom:10px; padding:5px;} +a.Blue-btn{ display:block; margin-right:15px;width:65px; height:22px; background-color:#ffffff; line-height:24px; vertical-align:middle; text-align:center; border:1px solid #3598db; color:#3598db; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px;} +a:hover.Blue-btn{ background:#3598db; color:#fff;} +.c_white {color:#fff;} \ No newline at end of file From a732efa6c6809596ee518120f4e738df3961b3a1 Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Thu, 7 Jul 2016 10:42:51 +0800 Subject: [PATCH 37/87] =?UTF-8?q?1.=E7=BB=84=E7=BB=87=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E4=B8=AD=E5=8E=BB=E6=8E=89=E8=AE=BE=E4=B8=BA=E9=A6=96=E9=A1=B5?= =?UTF-8?q?=E7=9A=84=E6=96=87=E7=AB=A0=E5=8A=A8=E6=80=81=202.=E4=B8=AA?= =?UTF-8?q?=E4=BA=BA=E4=B8=BB=E9=A1=B5=E5=8A=A8=E6=80=81=E4=B8=AD=E5=8E=BB?= =?UTF-8?q?=E6=8E=89=E8=AE=BE=E4=B8=BA=E9=A6=96=E9=A1=B5=E7=9A=84=E5=8D=9A?= =?UTF-8?q?=E5=AE=A2=E5=8A=A8=E6=80=81=E5=B9=B6=E5=B0=86=20=E6=9C=80?= =?UTF-8?q?=E4=B8=8A=E9=9D=A2=E7=9A=84=E5=8D=9A=E5=AE=A2=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E5=9B=9E=E5=A4=8D=E5=86=85=E5=AE=B9=E5=8F=8A=E5=8F=AF=E5=9B=9E?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/blog_comments_controller.rb | 3 ++ app/views/blog_comments/reply.js.erb | 5 +- app/views/blogs/_homepage.html.erb | 49 +++++++++++++++++++ .../organizations/_org_activities.html.erb | 2 +- app/views/users/_user_activities.html.erb | 4 +- 5 files changed, 60 insertions(+), 3 deletions(-) diff --git a/app/controllers/blog_comments_controller.rb b/app/controllers/blog_comments_controller.rb index 0224a587d..4a8de5814 100644 --- a/app/controllers/blog_comments_controller.rb +++ b/app/controllers/blog_comments_controller.rb @@ -116,6 +116,9 @@ class BlogCommentsController < ApplicationController #回复 def reply + if params[:homepage] + @in_user_homepage = true + end if params[:in_user_center] @in_user_center = true end diff --git a/app/views/blog_comments/reply.js.erb b/app/views/blog_comments/reply.js.erb index 915ab892d..baf4418e9 100644 --- a/app/views/blog_comments/reply.js.erb +++ b/app/views/blog_comments/reply.js.erb @@ -1,4 +1,7 @@ -<% if @in_user_center%> +<% if @in_user_homepage %> + <% homepage = BlogComment.find(@user.blog.homepage_id) %> + $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'blogs/homepage', :locals => {:activity => homepage, :user_activity_id => homepage.id}) %>"); +<% elsif @in_user_center%> $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/user_blog', :locals => {:activity => @article,:user_activity_id =>@user_activity_id}) %>"); // init_activity_KindEditor_data(<%#= @user_activity_id%>,"","87%", 'UserActivity'); <% else%> diff --git a/app/views/blogs/_homepage.html.erb b/app/views/blogs/_homepage.html.erb index 5dbee59d6..140f547cb 100644 --- a/app/views/blogs/_homepage.html.erb +++ b/app/views/blogs/_homepage.html.erb @@ -48,4 +48,53 @@
+ <% count=activity.children.count %> +
+ <%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id} %> + + <% comments = activity.children.reorder("created_on desc").limit(3) %> + <% if count > 0 %> +
+ <%= render :partial => 'users/all_replies', :locals => {:comments => comments}%> +
+ <% end %> + + <% if activity.locked == false && User.current.logged?%> +
+
<%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(activity.author_id), :alt => "用户头像" %>
+
+ <% if User.current.logged? %> +
+ <%= form_for('new_form',:url => {:controller => 'blog_comments', :action => 'reply', :user_id=>activity.author_id,:blog_id=>activity.blog_id,:id=>activity.id,:homepage=>1},:method => "post", :remote => true) do |f|%> + + + + + + +
+ + +
+

+ <% end%> +
+ <% else %> + <%= render :partial => "users/show_unlogged" %> + <% end %> +
+
+
+
+ <% end %> +
+ \ No newline at end of file diff --git a/app/views/organizations/_org_activities.html.erb b/app/views/organizations/_org_activities.html.erb index cc1404eb5..bddba3eee 100644 --- a/app/views/organizations/_org_activities.html.erb +++ b/app/views/organizations/_org_activities.html.erb @@ -46,7 +46,7 @@
<% end %> - <% if act.org_act_type == 'OrgDocumentComment' %> + <% if act.org_act_type == 'OrgDocumentComment' && act.org_act.organization.home_id != act.org_act.id %> <%= render :partial => 'show_org_document', :locals => {:document => act.org_act, :act => act, :flag => 2, :org_subfield_id => params[:org_subfield_id]} %> <% end %> <% end %> diff --git a/app/views/users/_user_activities.html.erb b/app/views/users/_user_activities.html.erb index 5d06a7001..5c6f07bb1 100644 --- a/app/views/users/_user_activities.html.erb +++ b/app/views/users/_user_activities.html.erb @@ -93,7 +93,9 @@ <%# cache (act) do %> <% case user_activity.act_type.to_s %> <% when 'BlogComment' %> - <%= render :partial => 'user_blog', :locals => {:activity => act,:user_activity_id =>user_activity.id} %> + <% if !(act.blog.homepage_id and act.id == act.blog.homepage_id) %> + <%= render :partial => 'user_blog', :locals => {:activity => act,:user_activity_id =>user_activity.id} %> + <% end %> <% end %> <%# end %> <% end %> From 92b6171c36d7fd931bd1210d23621018c6be7757 Mon Sep 17 00:00:00 2001 From: huang Date: Thu, 7 Jul 2016 11:08:29 +0800 Subject: [PATCH 38/87] sonar error puts --- .../quality_analysis_controller.rb | 25 ++++++++----------- app/views/quality_analysis/create.html.erb | 20 ++++++++------- .../repositories/_quality_analysis.html.erb | 2 +- public/stylesheets/public.css | 4 +-- 4 files changed, 25 insertions(+), 26 deletions(-) diff --git a/app/controllers/quality_analysis_controller.rb b/app/controllers/quality_analysis_controller.rb index bec66aeff..4c67ef621 100644 --- a/app/controllers/quality_analysis_controller.rb +++ b/app/controllers/quality_analysis_controller.rb @@ -61,7 +61,7 @@ class QualityAnalysisController < ApplicationController # 判断调用sonar分析是否成功 # 等待启动时间处理, 最长时间为30分钟 for i in 0..60 do - sleep(60) + sleep(30) @current_build_status = @client.job.get_current_build_status("#{job_name}") if (@current_build_status != "not_run" || @current_build_status != "running") break @@ -74,23 +74,27 @@ class QualityAnalysisController < ApplicationController @console_build = @client.job.get_console_output("#{job_name}", build_num = 0, start = 0, mode = 'text') logger.info("@current_build_status is ==> #{@current_build_status}") - logger.info("@console_build is ==> #{@console_build}") - d = @client.job.delete("#{job_name}") if jenkins_job == '200' && code != '201' logger.error("delete result ==> #{code}") + if @current_build_status == "success" + SonarError.create() + end if qa.blank? && @current_build_status == "success" QualityAnalysis.create(:project_id => @project.id, :author_login => user_name, :rep_identifier => identifier, :sonar_version => version, :path => path, :branch => branch, :language => language, :sonar_name => "#{user_name}:#{rep_id}") else - qa.update_attribute(:sonar_version, version) + qa.update_attribute(:sonar_version, version) unless qa.blank? end end rescue => e puts e end respond_to do |format| - format.html{redirect_to project_quality_analysis_path(:project_id => @project.id, :resource_id => sonar_name, :branch => branch, :current_build_status => @current_build_status, :job_name => job_name)} - # format.js{redirect_to project_quality_analysis_path(:project_id => @project.id, :resource_id => sonar_name, :branch => branch)} + if @current_build_status == "success" + format.html{redirect_to project_quality_analysis_path(:project_id => @project.id, :resource_id => sonar_name, :branch => branch, :current_build_status => @current_build_status, :job_name => job_name)} + elsif @current_build_status == "failure" + format.html + end end end @@ -145,7 +149,7 @@ class QualityAnalysisController < ApplicationController get_current_build_status = @client.job.get_current_build_status("Hjqreturn-1280") logger.error("Failed to update job: ==> #{jenkins_job}") unless jenkins_job == '200' - # 数据更新到Trustie数据库 + # 数据更新到Trustie数据 if jenkins_job == '200' logger.info("quality_ananlysis will be updated: ==> #{jenkins_job}") @quality_analysis.path = path @@ -168,18 +172,12 @@ class QualityAnalysisController < ApplicationController @branch = params[:branch] @resource_id = params[:resource_id] @sonar_address = Redmine::Configuration['sonar_address'] - @jenkins_address = Redmine::Configuration['jenkins_address'] if params[:resource_id].nil? @name_flag = true projects_date = open(@sonar_address + "/api/projects/index").read arr = JSON.parse(projects_date).map {|m| m["nm"]} # eg: ["Hjqreturn:cc_rep", "Hjqreturn:putong", "Hjqreturn:sonar_rep2", "shitou:sonar_rep"] @quality_analyses = QualityAnalysis.where(:project_id => @project.id).select{|qa| arr.include?(qa.sonar_name)} - else - if params[:current_build_status] == "failure" - job_name = params[:job_name] - @console_build = @client.job.get_console_output("#{job_name}", build_num = 0, start = 0, mode = 'text')["output"] - end complexity_date = open(@sonar_address + "/api/resources/index?resource=#{@resource_id}&depth=0&metrics=sqale_rating,function_complexity,duplicated_lines_density,comment_lines_density,sqale_index,lines,file_line,files,functions,classes,directories").read @complexity =JSON.parse(complexity_date).first issue_date = open(@sonar_address + "/api/resources/index?resource=#{@resource_id}&depth=0&metrics=blocker_violations,critical_violations,major_violations,minor_violations,info_violations,violations").read @@ -188,7 +186,6 @@ class QualityAnalysisController < ApplicationController rescue => e puts e end - end # Find project of id params[:project_id] diff --git a/app/views/quality_analysis/create.html.erb b/app/views/quality_analysis/create.html.erb index e7c81f662..a0a9d7254 100644 --- a/app/views/quality_analysis/create.html.erb +++ b/app/views/quality_analysis/create.html.erb @@ -1,9 +1,11 @@ -<% if @current_build_status == "success" %> - <%= render :partial => "show", :locals => {:branch => params[:branch]} %> -<% else %> - <% if @build_console_result %> - 运行结果超时 - <% else %> - <%= render :partial => "console_output" %> - <% end %> -<% end %> \ No newline at end of file +
+

质量分析

+
+
+
本次分析失败,原因如下:
+ <% if @current_build_status == "failure" %> + <%= h @console_build.to_json %> + <% elsif @build_console_result == false %> + 分析超时 + <% end %> +
\ No newline at end of file diff --git a/app/views/repositories/_quality_analysis.html.erb b/app/views/repositories/_quality_analysis.html.erb index 0053849a3..936e513f5 100644 --- a/app/views/repositories/_quality_analysis.html.erb +++ b/app/views/repositories/_quality_analysis.html.erb @@ -15,7 +15,7 @@ <%= select_tag :language, options_for_select(["java","python","ruby","c++","c#","c"]), :id => 'branch', :class => "analysis-option-box" %>
- +
diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css index 7cfb7f9e0..9662181df 100644 --- a/public/stylesheets/public.css +++ b/public/stylesheets/public.css @@ -246,7 +246,7 @@ a.c_green{ color:#28be6c;} .b_blue{background:#64bdd9;} .b_green{background:#28be6c;} .b_slow_yellow{background:#adde18;} -.b_yellow{background:#DDDF0D;} +.b_yellow{background:#e4de4b;} .b_slow_red{background:#df8538;} .b_green2 {background:#63c360;} .b_red {background:#d60308;} @@ -1184,4 +1184,4 @@ a.shadowbox_news_all{ display:block; width:305px; height:40px; line-height:40px; .reply_iconup{ position:absolute; top:21px; left:13px; color:#d4d4d4; font-size:16px; background:#f1f1f1; line-height:13px;} /*20160622代码分析弹窗*/ -.analysis-option-box {width:100%; border:1px solid #ccc; padding:3px 5px;} +.analysis-option-box {width:100%; border:1px solid #ccc; padding:3px 5px;} From b90c90bc60c923d8225d6cf469adcc5d5aada794 Mon Sep 17 00:00:00 2001 From: huang Date: Thu, 7 Jul 2016 14:22:48 +0800 Subject: [PATCH 39/87] add model error_list --- .../quality_analysis_controller.rb | 39 +++++++++++++----- app/models/sonar_error.rb | 3 ++ app/views/quality_analysis/create.html.erb | 6 +-- .../quality_analysis/error_list.html.erb | 11 +++++ config/routes.rb | 1 + .../20160707031248_create_sonar_errors.rb | 11 +++++ db/schema.rb | 41 ++++++++++++++++--- spec/factories/sonar_errors.rb | 7 ++++ spec/models/sonar_error_spec.rb | 5 +++ 9 files changed, 105 insertions(+), 19 deletions(-) create mode 100644 app/models/sonar_error.rb create mode 100644 app/views/quality_analysis/error_list.html.erb create mode 100644 db/migrate/20160707031248_create_sonar_errors.rb create mode 100644 spec/factories/sonar_errors.rb create mode 100644 spec/models/sonar_error_spec.rb diff --git a/app/controllers/quality_analysis_controller.rb b/app/controllers/quality_analysis_controller.rb index 4c67ef621..f18cc7d46 100644 --- a/app/controllers/quality_analysis_controller.rb +++ b/app/controllers/quality_analysis_controller.rb @@ -72,18 +72,28 @@ class QualityAnalysisController < ApplicationController end end - @console_build = @client.job.get_console_output("#{job_name}", build_num = 0, start = 0, mode = 'text') + # 获取sonar output结果 + console_build = @client.job.get_console_output("#{job_name}", build_num = 0, start = 0, mode = 'text') logger.info("@current_build_status is ==> #{@current_build_status}") - d = @client.job.delete("#{job_name}") if jenkins_job == '200' && code != '201' - logger.error("delete result ==> #{code}") - if @current_build_status == "success" - SonarError.create() - end - if qa.blank? && @current_build_status == "success" - QualityAnalysis.create(:project_id => @project.id, :author_login => user_name, :rep_identifier => identifier, - :sonar_version => version, :path => path, :branch => branch, :language => language, :sonar_name => "#{user_name}:#{rep_id}") + + # 两种情况需要删除job: + # 1/创建成功但是build失败则删除job + # 2/creat和build成功,调用sonar启动失败则删除job + # 错误信息存储需存到Trustie数据库,否则一旦job删除则无法获取这些信息 + if jenkins_job == '200' && code != '201' + @client.job.delete("#{job_name}") else - qa.update_attribute(:sonar_version, version) unless qa.blank? + if @current_build_status == "failure" + @sonar_error = SonarError.create(:project_id => @project.id, :jenkins_job_name => job_name, :output => console_build) + @client.job.delete("#{job_name}") + elsif @current_build_status == "success" + if qa.blank? + QualityAnalysis.create(:project_id => @project.id, :author_login => user_name, :rep_identifier => identifier, + :sonar_version => version, :path => path, :branch => branch, :language => language, :sonar_name => "#{user_name}:#{rep_id}") + else + qa.update_attribute(:sonar_version, version) + end + end end end rescue => e @@ -93,11 +103,18 @@ class QualityAnalysisController < ApplicationController if @current_build_status == "success" format.html{redirect_to project_quality_analysis_path(:project_id => @project.id, :resource_id => sonar_name, :branch => branch, :current_build_status => @current_build_status, :job_name => job_name)} elsif @current_build_status == "failure" - format.html + format.html{redirect_to error_list_project_quality_analysi_path(:project_id => @project.id, :job_name => job_name)} end end end + def error_list + @error_list = SonarError.where(:jenkins_job_name => params[:job_name]).first + respond_to do |format| + format.html + end + end + # get language type def swith_language_type language if language == "c#" diff --git a/app/models/sonar_error.rb b/app/models/sonar_error.rb new file mode 100644 index 000000000..05fcfc5b9 --- /dev/null +++ b/app/models/sonar_error.rb @@ -0,0 +1,3 @@ +class SonarError < ActiveRecord::Base + attr_accessible :jenkins_job_name, :output, :project_id +end diff --git a/app/views/quality_analysis/create.html.erb b/app/views/quality_analysis/create.html.erb index a0a9d7254..4f01fa2c8 100644 --- a/app/views/quality_analysis/create.html.erb +++ b/app/views/quality_analysis/create.html.erb @@ -3,9 +3,9 @@
本次分析失败,原因如下:
- <% if @current_build_status == "failure" %> - <%= h @console_build.to_json %> - <% elsif @build_console_result == false %> + <% if @build_console_result == false %> 分析超时 + <% else %> + <%= h @sonar_error.to_json %> <% end %>
\ No newline at end of file diff --git a/app/views/quality_analysis/error_list.html.erb b/app/views/quality_analysis/error_list.html.erb new file mode 100644 index 000000000..217990b13 --- /dev/null +++ b/app/views/quality_analysis/error_list.html.erb @@ -0,0 +1,11 @@ +
+

质量分析

+
+
+
本次分析失败,原因如下:
+ <% if @build_console_result == false %> + 分析超时 + <% else %> + <%= h @error_list.to_json %> + <% end %> +
\ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index bc9abeb35..0ef4c9fcb 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -797,6 +797,7 @@ RedmineApp::Application.routes.draw do match 'update_jenkins_job' match 'edit' match 'create' + get 'error_list' end end # resources :files, :only => [:index, :new, :create] do diff --git a/db/migrate/20160707031248_create_sonar_errors.rb b/db/migrate/20160707031248_create_sonar_errors.rb new file mode 100644 index 000000000..c55caccce --- /dev/null +++ b/db/migrate/20160707031248_create_sonar_errors.rb @@ -0,0 +1,11 @@ +class CreateSonarErrors < ActiveRecord::Migration + def change + create_table :sonar_errors do |t| + t.integer :project_id + t.string :jenkins_job_name + t.text :output + + t.timestamps + end + end +end diff --git a/db/schema.rb b/db/schema.rb index 3258f89c1..93dbba8a4 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20160627090316) do +ActiveRecord::Schema.define(:version => 20160707031248) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -57,6 +57,18 @@ ActiveRecord::Schema.define(:version => 20160627090316) do t.integer "user_id", :null => false end + create_table "apply_add_schools", :force => true do |t| + t.string "name" + t.string "province" + t.string "city" + t.string "address" + t.string "remarks" + t.integer "school_id" + t.integer "status", :default => 0 + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + create_table "apply_homeworks", :force => true do |t| t.integer "status" t.integer "user_id" @@ -1633,10 +1645,11 @@ ActiveRecord::Schema.define(:version => 20160627090316) do create_table "schools", :force => true do |t| t.string "name" t.string "province" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false t.string "logo_link" t.string "pinyin" + t.integer "school_type", :default => 0 end create_table "secdomains", :force => true do |t| @@ -1725,6 +1738,14 @@ ActiveRecord::Schema.define(:version => 20160627090316) do t.integer "project_id" end + create_table "sonar_errors", :force => true do |t| + t.integer "project_id" + t.string "jenkins_job_name" + t.text "output" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + create_table "ssos", :force => true do |t| t.integer "user_id" t.string "openid" @@ -1849,8 +1870,18 @@ ActiveRecord::Schema.define(:version => 20160627090316) do t.string "title" t.text "description" t.integer "user_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "eng_name" + t.integer "syllabus_type" + t.integer "credit" + t.integer "hours" + t.integer "theory_hours" + t.integer "practice_hours" + t.string "applicable_major" + t.string "pre_course" + t.integer "visits", :default => 0 + t.integer "des_status", :default => 0 end add_index "syllabuses", ["user_id"], :name => "index_syllabuses_on_user_id" diff --git a/spec/factories/sonar_errors.rb b/spec/factories/sonar_errors.rb new file mode 100644 index 000000000..a5ed5485f --- /dev/null +++ b/spec/factories/sonar_errors.rb @@ -0,0 +1,7 @@ +FactoryGirl.define do + factory :sonar_error do + project_id 1 + jenkins_job_name "MyString" + output "MyText" + end +end diff --git a/spec/models/sonar_error_spec.rb b/spec/models/sonar_error_spec.rb new file mode 100644 index 000000000..9aae8db29 --- /dev/null +++ b/spec/models/sonar_error_spec.rb @@ -0,0 +1,5 @@ +require 'rails_helper' + +RSpec.describe SonarError, :type => :model do + pending "add some examples to (or delete) #{__FILE__}" +end From 10789d2505daca1734ae64ff7f62b2374b1ddb3a Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Thu, 7 Jul 2016 14:35:15 +0800 Subject: [PATCH 40/87] added alert2 --- public/assets/wechat/login.html | 2 +- public/assets/wechat/templates/alert2.html | 11 ++++++++ public/javascripts/wechat/directives/alert.js | 28 ++++++++++++++++++- 3 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 public/assets/wechat/templates/alert2.html diff --git a/public/assets/wechat/login.html b/public/assets/wechat/login.html index 309db29de..1283ad281 100644 --- a/public/assets/wechat/login.html +++ b/public/assets/wechat/login.html @@ -22,4 +22,4 @@
- \ No newline at end of file + diff --git a/public/assets/wechat/templates/alert2.html b/public/assets/wechat/templates/alert2.html new file mode 100644 index 000000000..d798ab20f --- /dev/null +++ b/public/assets/wechat/templates/alert2.html @@ -0,0 +1,11 @@ +
+
+
+
{{title}}
+
{{message}}
+
+ 取消 + 确定 +
+
+
diff --git a/public/javascripts/wechat/directives/alert.js b/public/javascripts/wechat/directives/alert.js index f53ecdb5a..e10bd4a0b 100644 --- a/public/javascripts/wechat/directives/alert.js +++ b/public/javascripts/wechat/directives/alert.js @@ -16,4 +16,30 @@ app.directive('myAlert', ['config', function(config){ }; } } -}]); \ No newline at end of file +}]); + +app.directive('myAlert2', ['config', function(config){ + return { + templateUrl: config.rootPath+ 'templates/alert2.html', + scope: { + title: "=", + message: "=", + visible: "=", + cb: "=" + }, + link: function(scope){ + scope.dismiss = function(){ + scope.visible = false; + if(typeof scope.cb === 'function'){ + scope.cb(); + } + }; + scope.confirm = function(){ + scope.visible = false; + if(typeof scope.cb === 'function'){ + scope.cb(); + } + } + } + } +}]); From 7859bf9c324cf01eaa8c21c05f9b99141c02f064 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Thu, 7 Jul 2016 14:51:54 +0800 Subject: [PATCH 41/87] . --- public/javascripts/wechat/directives/alert.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/public/javascripts/wechat/directives/alert.js b/public/javascripts/wechat/directives/alert.js index e10bd4a0b..4b703811c 100644 --- a/public/javascripts/wechat/directives/alert.js +++ b/public/javascripts/wechat/directives/alert.js @@ -30,9 +30,6 @@ app.directive('myAlert2', ['config', function(config){ link: function(scope){ scope.dismiss = function(){ scope.visible = false; - if(typeof scope.cb === 'function'){ - scope.cb(); - } }; scope.confirm = function(){ scope.visible = false; From 3a6470b1f3e827bc6103bb03bc3e18e7e1e65bb0 Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Thu, 7 Jul 2016 14:55:41 +0800 Subject: [PATCH 42/87] =?UTF-8?q?=E5=88=A0=E9=99=A4=E7=8F=AD=E7=BA=A7?= =?UTF-8?q?=E6=97=B6=E5=A2=9E=E5=8A=A0=E6=8F=90=E7=A4=BA=E7=A1=AE=E5=AE=9A?= =?UTF-8?q?=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/assets/wechat/edit_class.html | 3 +- .../wechat/controllers/edit_class.js | 36 +++++++++++-------- 2 files changed, 24 insertions(+), 15 deletions(-) diff --git a/public/assets/wechat/edit_class.html b/public/assets/wechat/edit_class.html index a1a243b12..e6b649adc 100644 --- a/public/assets/wechat/edit_class.html +++ b/public/assets/wechat/edit_class.html @@ -10,5 +10,6 @@ 完成 - + +
diff --git a/public/javascripts/wechat/controllers/edit_class.js b/public/javascripts/wechat/controllers/edit_class.js index 8520a6eca..b7e7bf40c 100644 --- a/public/javascripts/wechat/controllers/edit_class.js +++ b/public/javascripts/wechat/controllers/edit_class.js @@ -14,7 +14,12 @@ app.controller('EditClassController', ['$scope', '$http', 'auth', 'config', 'ale }); } - vm.alertService = alertService.create(); + //单弹框 + vm.alertService_1 = alertService.create(); + + //双弹框 + vm.alertService_2 = alertService.create(); + vm.addClass = function(){ vm.syllabus.courses.push({}); }; @@ -22,18 +27,21 @@ app.controller('EditClassController', ['$scope', '$http', 'auth', 'config', 'ale vm.deleteClass = function(index){ var course = vm.syllabus.courses[index]; if(course.id >0){ - $http.post(config.apiUrl+'courses/'+course.id+'/del', { - token: auth.token() - }).then(function(response){ - if(response.data.status!=0){ - vm.alertService.showMessage('出错了', response.data.message); - } else { - vm.alertService.showMessage('提示', '删除班级成功', function(){ - vm.syllabus.courses.splice(index, 1); - }); - } - console.log(response.data.data); + vm.alertService_2.showMessage('提示', '您确定要删除该班级吗?', function() { + $http.post(config.apiUrl+'courses/'+course.id+'/del', { + token: auth.token() + }).then(function(response){ + if(response.data.status!=0){ + vm.alertService_1.showMessage('出错了', response.data.message); + } else { + vm.alertService_1.showMessage('提示', '删除班级成功', function(){ + vm.syllabus.courses.splice(index, 1); + }); + } + console.log(response.data.data); + }); }); + } else { vm.syllabus.courses.splice(index, 1); } @@ -63,9 +71,9 @@ app.controller('EditClassController', ['$scope', '$http', 'auth', 'config', 'ale courses: courses }).then(function(response){ if(response.data.status!=0){ - vm.alertService.showMessage('出错了', response.data.message); + vm.alertService_1.showMessage('出错了', response.data.message); } else { - vm.alertService.showMessage('提示', '保存课程成功', function(){ + vm.alertService_1.showMessage('提示', '保存课程成功', function(){ window.history.back(); }); } From a2ba65956ce3945f9bf753f8a71b6ce04a83e231 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Thu, 7 Jul 2016 15:03:45 +0800 Subject: [PATCH 43/87] . --- app/views/wechats/user_activities.html.erb | 56 +++++++++++----------- public/javascripts/wechat/build/app.min.js | 17 +++---- 2 files changed, 37 insertions(+), 36 deletions(-) diff --git a/app/views/wechats/user_activities.html.erb b/app/views/wechats/user_activities.html.erb index a9254829b..bb7d96d50 100644 --- a/app/views/wechats/user_activities.html.erb +++ b/app/views/wechats/user_activities.html.erb @@ -26,33 +26,33 @@
- - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + - \ No newline at end of file + diff --git a/public/javascripts/wechat/build/app.min.js b/public/javascripts/wechat/build/app.min.js index 267ab5dd4..ea8984ad0 100644 --- a/public/javascripts/wechat/build/app.min.js +++ b/public/javascripts/wechat/build/app.min.js @@ -1,23 +1,24 @@ var app=angular.module("wechat",["ngRoute"]);app.constant("config",{rootPath:"/assets/wechat/",rootUrl:"/",apiUrl:"/api/v1/"}),app.run(["$rootScope","auth","$location","$routeParams",function(t,a,e,r){g_redirect_path&&g_redirect_path.length>1&&(e.path(g_redirect_path),g_redirect_path=null),t.$on("$routeChangeError",function(t,a,r){a&&a.templateUrl&&(a.templateUrl.endsWith("login.html")||a.templateUrl.endsWith("reg.html")||e.path("/login"))}),t.$on("$routeChangeStart",function(t,a,e){})}]); app.factory("alertService",function(){function t(){this.title=null,this.message=null,this.visible=null,this.cb=null}return t.prototype.showMessage=function(t,e,n){this.message=e,this.title=t,this.visible=!0,this.cb=n},t.prototype.dismiss=function(){this.message=null,this.title=null,this.visible=!1,this.cb&&this.cb()},{create:function(){return new t}}}),app.factory("auth",["$http","$routeParams","$q","session","config",function(t,e,n,o,a){var i=function(){var a=n.defer(),i=c();if(i&&i.length>10)a.resolve(i);else{window.g_code||e.code||o.get("code");t.post("/wechat/get_bind",{}).then(function(t){0!=t.data.status?a.reject(t.data.message):(o.save("token",t.data.token),a.resolve(t.data.token))})["catch"](function(t){a.reject(t)})}return a.promise},c=function(){return o.get("token")};return{get_bind:i,token:c}}]),app.factory("session",function(){return{save:function(t,e){sessionStorage.setItem(t,e)},get:function(t){return sessionStorage.getItem(t)}}}),app.factory("rms",function(){var t={},e=function(e,n){t[e]=n},n=function(e){return t[e]};return{save:e,get:n}}),app.factory("common",["$http","auth","$routeParams",function(t,e,n){var o=function(n,o,a,i){if(a.comment&&!(a.comment.length<=0)){var c=a.comment.replace(/\n/g,"
"),s={type:o,content:c,token:e.token()};a.disabled=!0,t({method:"POST",url:apiUrl+"new_comment/"+n,data:s}).then(function(t){a.disabled=!1,"function"==typeof i&&i()},function(t){})}},a=function(n,o){return t({method:"GET",url:apiUrl+o+"/"+n+"?token="+e.token()})},i=function(n){n.praise_count+=1,n.has_praise=!0,t({method:"POST",url:apiUrl+"praise/"+n.act_id,data:{token:e.token(),type:n.act_type}}).then(function(t){console.log(t.data)},function(t){})},c=function(n){n.praise_count-=1,n.has_praise=!1,t({method:"POST",url:apiUrl+"praise/"+n.act_id,data:{token:e.token(),type:n.act_type}}).then(function(t){console.log(t.data)},function(t){})},s=function(t){t.scope.formData={comment:""};var e=function(e){a(e,t.type).then(function(e){t.loadCallback(e.data)},function(t){})};e(t.id),t.scope.addReply=function(n){console.log(n.comment),o(t.id,t.replyType,n,function(){t.scope.formData={comment:""},e(t.id),"function"==typeof t.replyCallback&&t.replyCallback()})},t.scope.addPraise=i,t.scope.decreasePraise=c};return{init:s,addCommonReply:o,loadCommonData:a,addCommonPraise:i,decreaseCommonPraise:c}}]); app.filter("safeHtml",["$sce",function(t){return function(n){return t.trustAsHtml(n)}}]),app.filter("identify",function(){return function(t){return"TeachingAsistant"==t?"教辅":""}}); -app.controller("ActivityController",["$anchorScroll","$location","$scope","$http","$timeout","auth","rms","common","alertService",function(a,t,e,o,i,c,n,r,s){e.replaceUrl=function(a){return a},e.alertService=s.create(),console.log("ActivityController load"),e.page=n.get("page")||0,e.activities=n.get("activities")||[],e.has_more=n.get("has_more"),e.loadActData=function(a){e.page=a,o({method:"POST",url:apiUrl+"activities",data:{token:c.token(),page:a}}).then(function(a){a.data.page>0?e.activities=e.activities.concat(a.data.data):e.activities=a.data.data,n.save("activities",e.activities),e.has_more=a.data.count+10*a.data.page0)switch(e.data.container_type){case"All":t.activities=t.activities.concat(e.data.data);break;case"Course":t.course_activities=t.course_activities.concat(e.data.data);break;case"Project":t.project_activities=t.project_activities.concat(e.data.data);break;case 3:}else switch(e.data.container_type){case"All":t.activities=e.data.data;break;case"Course":t.course_activities=e.data.data;break;case"Project":t.project_activities=e.data.data;break;case 3:}switch(e.data.container_type){case"All":r.save("activities",t.activities),t.has_more=e.data.count+10*e.data.page0?c.alertService_2.showMessage("提示","您确定要删除该班级吗?",function(){e.post(o.apiUrl+"courses/"+t.id+"/del",{token:a.token()}).then(function(e){0!=e.data.status?c.alertService_1.showMessage("出错了",e.data.message):c.alertService_1.showMessage("提示","删除班级成功",function(){c.syllabus.courses.splice(s,1)}),console.log(e.data.data)})}):c.syllabus.courses.splice(s,1)},c.newClass=function(s,t){if(s.$setSubmitted(),console.log(t),!s.$valid)return void console.log(s.$error);var l=[];for(var r in c.syllabus.courses){var n=c.syllabus.courses[r];n.id>0&&l.push(n.name)}e.post(o.apiUrl+"syllabuses",{token:a.token(),id:u,courses:l}).then(function(s){0!=s.data.status?c.alertService_1.showMessage("出错了",s.data.message):c.alertService_1.showMessage("提示","保存课程成功",function(){window.history.back()}),console.log(s.data.data)})}}]); app.controller("HomeworkController",["$scope","$http","$routeParams","auth","common",function(o,e,l,n,r){r.init({id:l.id,scope:o,type:"whomeworks",replyType:"HomeworkCommon",loadCallback:function(e){console.log(e),o.homework=e.data},replyCallback:function(){}})}]); app.controller("InviteCodeController",["$scope","$http","$routeParams","config","auth",function(t,e,i,n,o){var a=t;a.course={};var c=i.id;e.get(n.apiUrl+"courses/"+c+"?token="+o.token()).then(function(t){console.log(t.data),a.course=t.data.data}),a.share=function(){window.WeixinJSBridge.invoke("sendAppMessage",{appid:"wxf694495398c7d470",type:"link",data_url:"",img_url:"http://pnewsapp.tc.qq.com/newsapp_bt/0/9963967/640",img_height:370,img_width:550,link:"http://view.inews.qq.com/a/WXN2013101101385701",desc:"desc",title:"title"},function(t){})}}]); app.controller("IssueController",["$scope","$http","$routeParams","auth","common",function(o,e,l,s,t){t.init({id:l.id,scope:o,type:"issues",replyType:"Issue",loadCallback:function(e){console.log(e),o.issue=e.data},replyCallback:function(){}})}]); app.controller("JournalsController",["$scope","$http","$routeParams","auth","common",function(o,a,e,l,n){n.init({id:e.id,scope:o,type:"journal_for_messages",replyType:"JournalsForMessage",loadCallback:function(a){o.message=a.data},replyCallback:function(){}})}]); app.controller("LoginController",["$scope","$http","$location","$routeParams","alertService","config","auth","session",function(e,o,t,a,i,n,s,l){s.get_bind().then(function(){t.path("/activities")}),a.code&&l.save("code",a.code);var r=e;r.loginFailed=!1,r.alertService=i.create(),r.findPwdDialog=i.create(),r.login=function(a,i){return a.$setSubmitted(),console.log(i),a.$valid?(console.log(apiUrl+"auth"),void o.post(n.apiUrl+"users/wxbind",{login:i.login,password:i.password}).then(function(o){console.log(o.data),r.loginFailed=0!=o.data.status,e.loginFailed?r.alertService.showMessage("出错了",o.data.message):r.alertService.showMessage("提示",o.data.message,function(){t.path("/activities")})})["catch"](function(e){r.alertService.showMessage("出错了",e)})):void console.log(a.$error)},r.showBox=function(){r.findPwdDialog.showMessage("提示","请访问www.trustie.net获取密码,谢谢!")},r.goReg=function(){t.path("/reg")}}]); -app.controller("MyResourceController",["$scope","$http","auth","config","$location",function(e,o,t,n,a){var r=e;r.menus=["课件","作业","测验"],r.resources=[],r.homeworks=[],r.exercise=[],r.tab=function(e){r.currentTab=e,1==e?o.get(n.apiUrl+"resources?token="+t.token()).then(function(e){console.log(e.data),r.resources=e.data.data}):2==e?o.get(n.apiUrl+"resources/homeworks?token="+t.token()).then(function(e){console.log(e.data),r.homeworks=e.data.data}):3==e&&o.get(n.apiUrl+"resources/exercies?token="+t.token()).then(function(e){console.log(e.data),r.exercise=e.data.data})},r.tab(1),r.sendFile=function(e){a.path("/send_class_list").search({id:e.id})}}]); -app.controller("NewClassController",["$scope","$http","auth","config","alertService",function(e,r,t,a,c){var l=e;l.alertService=c.create(),l.newClass=function(){l.alertService.showMessage("提示","此功能正在开发中")}}]); +app.controller("MyResourceController",["$scope","$http","auth","config","$location",function(e,o,t,n,r){var s=e;s.menus=["课件","作业","测验"],s.resources=null,s.homeworks=null,s.exercise=null,s.tab=function(e){s.currentTab=e,1==e&&(!s.resources||s.resources.length<=0)?o.get(n.apiUrl+"resources?token="+t.token()).then(function(e){console.log(e.data),s.resources=e.data.data}):2==e&&(!s.homeworks||s.homeworks.length<=0)?o.get(n.apiUrl+"resources/homeworks?token="+t.token()).then(function(e){console.log(e.data),s.homeworks=e.data.data}):3==e&&(!s.exercise||s.exercise.length<=0)&&o.get(n.apiUrl+"resources/exercies?token="+t.token()).then(function(e){console.log(e.data),s.exercise=e.data.data})},s.tab(1),s.sendFile=function(e){r.path("/send_class_list").search({id:e.id})}}]); +app.controller("NewClassController",["$scope","$http","auth","config","alertService","$location",function(s,e,a,o,l,t){var r=s;r.alertService=l.create(),r.syllabus={courses:[{name:""}]},r.addClass=function(){r.syllabus.courses.push({})},r.deleteClass=function(s){r.syllabus.courses.splice(s,1)},r.newClass=function(s,l){if(s.$setSubmitted(),console.log(l),!s.$valid)return void console.log(s.$error);var t=[];for(var n in r.syllabus.courses)t.push(r.syllabus.courses[n].name);e.post(o.apiUrl+"syllabuses",{token:a.token(),title:l.title,courses:t}).then(function(s){0!=s.data.status?r.alertService.showMessage("出错了",s.data.message):r.alertService.showMessage("提示","新建课程成功",function(){window.history.back()}),console.log(s.data.data)})}}]); app.controller("RegController",["$scope","$http","$location","alertService","$location",function(e,o,a,s,a){var t=e;t.errDialog=s.create(),t.successDialog=s.create(),t.goLogin=function(){a.path("/login")},t.isagreed=!0,t.agreed=function(e){t.isagreed=!e},t.reg=function(e,s){return e.$setSubmitted(),console.log(e),e.$valid?(console.log(s),void o.post(apiUrl+"users",{login:s.username,password:s.password,mail:s.email}).then(function(e){0!=e.data.status?t.errDialog.showMessage("出错了",e.data.message):t.successDialog.showMessage("提示","注册且绑定微信成功",function(){a.path("/activities")})},function(e){t.errDialog.showMessage("出错了",e.data)})):void console.log(e.$error)}}]); -app.controller("SendClassListController",["$scope","$http","$routeParams","config","auth","alertService",function(e,o,s,t,c,a){var r=e,n=s.id;r.alertService=a.create(),r.courses=[];var i=function(){o.get(t.apiUrl+"courses?token="+c.token()+"&per_page_count=10&page=1").then(function(e){console.log(e.data),r.courses=e.data.data})};i(),r.selectCourse=function(e){"boolean"!=typeof e.checked&&(e.checked=!1),e.checked=!e.checked},r.sendToCourses=function(){var e=[];for(var s in r.courses)r.courses[s].checked&&e.push(r.courses[s].id);o.post(t.apiUrl+"resources/send",{token:c.token(),course_ids:e,send_id:n}).then(function(e){console.log(e.data),0==e.data.status?r.alertService.showMessage("提示","发送成功",function(){window.history.back()}):r.alertService.showMessage("发送出错",e.data.message)})}}]); -app.directive("myAlert",["config",function(t){return{templateUrl:t.rootPath+"templates/alert.html",scope:{title:"=",message:"=",visible:"=",cb:"="},link:function(t){t.dismiss=function(){t.visible=!1,"function"==typeof t.cb&&t.cb()}}}}]); +app.controller("SendClassListController",["$scope","$http","$routeParams","config","auth","alertService",function(e,s,a,o,t,l,r){var c=e,n=a.id;c.alertService=l.create(),c.syllabuses=[];var u=function(){s.get(o.apiUrl+"syllabuses?token="+t.token()).then(function(e){console.log(e.data),c.syllabuses=e.data.data,r.save("syllabuses",c.syllabuses)})};u(),c.selectCourse=function(e){"boolean"!=typeof e.checked&&(e.checked=!1),e.checked=!e.checked},c.sendToCourses=function(){var e=[];for(var a in c.syllabuses)for(var l in c.syllabuses[a].courses)c.syllabuses[a].courses[l].checked&&e.push(c.syllabuses[a].courses[l].id);return e.length<=0?void c.alertService.showMessage("提醒","请先选择班级"):void s.post(o.apiUrl+"resources/send",{token:t.token(),course_ids:e,send_id:n}).then(function(e){console.log(e.data),0==e.data.status?c.alertService.showMessage("提示","发送成功",function(){window.history.back()}):c.alertService.showMessage("发送出错",e.data.message)})}}]); +app.directive("myAlert",["config",function(t){return{templateUrl:t.rootPath+"templates/alert.html",scope:{title:"=",message:"=",visible:"=",cb:"="},link:function(t){t.dismiss=function(){t.visible=!1,"function"==typeof t.cb&&t.cb()}}}}]),app.directive("myAlert2",["config",function(t){return{templateUrl:t.rootPath+"templates/alert2.html",scope:{title:"=",message:"=",visible:"=",cb:"="},link:function(t){t.dismiss=function(){t.visible=!1},t.confirm=function(){t.visible=!1,"function"==typeof t.cb&&t.cb()}}}}]); app.directive("pwdconfirm",function(){return{require:"ngModel",link:function(r,n,i,e){e.$validators.pwdconfirm=function(n,i){return r.user&&r.user.password==i}}}}); app.directive("inputAuto",function(){return{restrict:"A",scope:{},link:function(n,t){var e=t.parent().children().eq(0),i=t.parent().next();t.on("input",function(){console.log(i),e.html(t[0].value);var n=e[0].scrollHeight;t.css("height",n+"px")}),i.on("click",function(){t.css("height","28px")})}}}); app.directive("loadingSpinner",["$http","config",function(t,e){return{templateUrl:e.rootPath+"templates/loading.html"}}]); -app.config(["$routeProvider","$httpProvider","$locationProvider","config",function(e,o,t,l){var r=l.rootPath,s={delay:["auth",function(e){return e.get_bind()}]},n=function(e,o){return{templateUrl:r+e,controller:o,resolve:s}};e.when("/login",{templateUrl:r+"login.html",controller:"LoginController"}).when("/reg",{templateUrl:r+"reg.html",controller:"RegController"}).when("/activites",n("activities.html","ActivityController")).when("/issues/:id",n("issue_detail.html","IssueController")).when("/project_discussion/:id",n("project_discussion.html","DiscussionController")).when("/homework/:id",n("homework_detail.html","HomeworkController")).when("/course_notice/:id",n("course_notice.html","CourseNoticeController")).when("/course_discussion/:id",n("course_discussion.html","DiscussionController")).when("/journal_for_message/:id",n("jour_message_detail.html","JournalsController")).when("/blog_comment/:id",n("blog_detail.html","BlogController")).when("/class",n("class.html","ClassController")).when("/new_class",n("new_class.html","NewClassController")).when("/class_list",n("class_list.html","ClassListController")).when("/myresource",n("myresource.html","MyResourceController")).when("/invite_code",n("invite_code.html","InviteCodeController")).when("/send_class_list",n("send_class_list.html","SendClassListController")).otherwise({redirectTo:"/activites"}),o.interceptors.push(["$q","$rootScope",function(e,o){return void 0==o.activeCalls&&(o.activeCalls=0),{request:function(e){return o.activeCalls+=1,e},requestError:function(e){return o.activeCalls-=1,e},response:function(e){return o.activeCalls-=1,e},responseError:function(e){return o.activeCalls-=1,e}}}])}]); \ No newline at end of file +app.config(["$routeProvider","$httpProvider","$locationProvider","config",function(e,o,t,l){var r=l.rootPath,s={delay:["auth",function(e){return e.get_bind()}]},n=function(e,o){return{templateUrl:r+e,controller:o,resolve:s}};e.when("/login",{templateUrl:r+"login.html",controller:"LoginController"}).when("/reg",{templateUrl:r+"reg.html",controller:"RegController"}).when("/activites",n("activities.html","ActivityController")).when("/issues/:id",n("issue_detail.html","IssueController")).when("/project_discussion/:id",n("project_discussion.html","DiscussionController")).when("/homework/:id",n("homework_detail.html","HomeworkController")).when("/course_notice/:id",n("course_notice.html","CourseNoticeController")).when("/course_discussion/:id",n("course_discussion.html","DiscussionController")).when("/journal_for_message/:id",n("jour_message_detail.html","JournalsController")).when("/blog_comment/:id",n("blog_detail.html","BlogController")).when("/class",n("class.html","ClassController")).when("/new_class",n("new_class.html","NewClassController")).when("/edit_class",n("edit_class.html","EditClassController")).when("/class_list",n("class_list.html","ClassListController")).when("/myresource",n("myresource.html","MyResourceController")).when("/invite_code",n("invite_code.html","InviteCodeController")).when("/send_class_list",n("send_class_list.html","SendClassListController")).otherwise({redirectTo:"/activites"}),o.interceptors.push(["$q","$rootScope",function(e,o){return void 0==o.activeCalls&&(o.activeCalls=0),{request:function(e){return o.activeCalls+=1,e},requestError:function(e){return o.activeCalls-=1,e},response:function(e){return o.activeCalls-=1,e},responseError:function(e){return o.activeCalls-=1,e}}}])}]); \ No newline at end of file From da7509f64cf9f1c924e17747e9449a7b94f191c5 Mon Sep 17 00:00:00 2001 From: cxt Date: Thu, 7 Jul 2016 15:04:57 +0800 Subject: [PATCH 44/87] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E5=A4=A7=E7=BA=B2?= =?UTF-8?q?=E7=9A=84=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/syllabuses_controller.rb | 12 +++++++- app/helpers/application_helper.rb | 2 +- app/helpers/courses_helper.rb | 6 ++-- app/views/courses/new.html.erb | 2 +- app/views/courses/settings.html.erb | 2 +- app/views/layouts/_project_info.html.erb | 30 ++++++++++--------- app/views/layouts/_syllabus_info.html.erb | 25 +++++++++------- app/views/layouts/_syllabus_title.html.erb | 5 ++++ app/views/layouts/base_syllabus.html.erb | 4 +-- .../syllabuses/edit_syllabus_title.js.erb | 3 ++ config/routes.rb | 1 + public/javascripts/syllabus.js | 18 +++++++++++ public/stylesheets/leftside.css | 2 +- public/stylesheets/syllabus.css | 6 ++-- 14 files changed, 81 insertions(+), 37 deletions(-) create mode 100644 app/views/layouts/_syllabus_title.html.erb create mode 100644 app/views/syllabuses/edit_syllabus_title.js.erb diff --git a/app/controllers/syllabuses_controller.rb b/app/controllers/syllabuses_controller.rb index 8ff88823d..8d7195f38 100644 --- a/app/controllers/syllabuses_controller.rb +++ b/app/controllers/syllabuses_controller.rb @@ -6,7 +6,7 @@ class SyllabusesController < ApplicationController include CoursesHelper before_filter :is_logged, :only => [:index, :show, :edit, :new, :update, :destroy, :delete_syllabus] - before_filter :find_syllabus, :only => [:show, :edit, :update, :destroy, :syllabus_courselist, :edit_syllabus_eng_name, :update_base_info, :delete_syllabus, :delete_des] + before_filter :find_syllabus, :only => [:show, :edit, :update, :destroy, :syllabus_courselist, :edit_syllabus_eng_name, :edit_syllabus_title, :update_base_info, :delete_syllabus, :delete_des] def index user = User.current @syllabuses = user.syllabuses @@ -140,6 +140,16 @@ class SyllabusesController < ApplicationController end end + #修改课程名称 + def edit_syllabus_title + if @syllabus && params[:title] != "" + @syllabus.update_column("title",params[:title]) + end + respond_to do |format| + format.js + end + end + #修改英文名称 def edit_syllabus_eng_name if @syllabus diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index e4fa452f5..5b18908d4 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -3323,7 +3323,7 @@ def get_group_member_names work result end -def course_syllabus_option user +def course_syllabus_option user = User.current syllabuses = user.syllabuses type = [] option1 = [] diff --git a/app/helpers/courses_helper.rb b/app/helpers/courses_helper.rb index 55a4da73a..d1f4bfe97 100644 --- a/app/helpers/courses_helper.rb +++ b/app/helpers/courses_helper.rb @@ -772,12 +772,12 @@ module CoursesHelper url = joined ? join_path(:object_id => course.id) : try_join_path(:object_id => course.id) method = joined ? 'delete' : 'post' if joined - link = link_to(text, url, :remote => true, :method => method, :class => "pr_join_a", :id => "#{course.id}", :confirm => l(:text_are_you_sure_out)) + link = link_to(text, url, :remote => true, :method => method, :class => "Blue-btn", :style => "margin_left: 0px;", :id => "#{course.id}", :confirm => l(:text_are_you_sure_out)) else - link = link_to(text, url, :remote => true, :method => method, :id => "#{course.id}", :class => "pr_join_a") + link = link_to(text, url, :remote => true, :method => method, :id => "#{course.id}", :class => "Blue-btn", :style => "margin_left: 0px;") end else - link = "#{l(:label_course_join_student)}" + link = "#{l(:label_course_join_student)}" end link.html_safe end diff --git a/app/views/courses/new.html.erb b/app/views/courses/new.html.erb index f8db461a6..78b3d8293 100644 --- a/app/views/courses/new.html.erb +++ b/app/views/courses/new.html.erb @@ -7,7 +7,7 @@
  • <% if @syllabus.nil? %> - <%= select_tag :syllabus_id,options_for_select(syllabus_option,@course.syllabus_id), {:id=>"new_syllabus_id", :class=>"syllabus_input"} %> + <%= select_tag :syllabus_id,options_for_select(course_syllabus_option,@course.syllabus_id), {:id=>"new_syllabus_id", :class=>"syllabus_input"} %> <% else %> <%=@syllabus.title %> diff --git a/app/views/courses/settings.html.erb b/app/views/courses/settings.html.erb index 10bb0ed55..ee0f6c98a 100644 --- a/app/views/courses/settings.html.erb +++ b/app/views/courses/settings.html.erb @@ -31,7 +31,7 @@
  • - <%= select_tag :syllabus_id,options_for_select(syllabus_option,@course.syllabus_id), {:id=>"edit_syllabus_id", :class=>"syllabus_input", :style=>'width:280px'} %> + <%= select_tag :syllabus_id,options_for_select(course_syllabus_option,@course.syllabus_id), {:id=>"edit_syllabus_id", :class=>"syllabus_input", :style=>'width:280px'} %>
  • diff --git a/app/views/layouts/_project_info.html.erb b/app/views/layouts/_project_info.html.erb index c0366ec39..b0407e2c5 100644 --- a/app/views/layouts/_project_info.html.erb +++ b/app/views/layouts/_project_info.html.erb @@ -8,30 +8,29 @@ <% end %> <%= image_tag(url_to_avatar(@course), :width => "60", :height => "60") %>
  • -
    +
    + <% if @course.syllabus%> - + <%= @course.syllabus.title + " •" %> <% end %> -
    - - <%=@course.is_public == 0 ? '(私有)' : '(公开)' %> +  <%= @course.name %><%=@course.is_public == 0 ? '(私有)' : '(公开)' %> <% if is_excellent_course(@course) %> 精品课程 <% end %> -
    -
    -
    - <% unless is_teacher %> -
    <%= join_in_course_header(@course, User.current) %>
    - <% end %> +
    +
    - 邀请码: - <%=@course.generate_invite_code %> + 邀请码: + <%=@course.generate_invite_code %> + <% unless is_teacher %> +
    <%= join_in_course_header(@course, User.current) %>
    + <% end %>
    +
    <%= l(:label_account_identity_teacher)%>(<%= course_teacher_link teacher_num %>) @@ -45,6 +44,9 @@
      • + <% if @course.syllabus %> +
      • <%= link_to "查看课程", syllabus_path(@course.syllabus), :class => "postOptionLink", :target => "_blank" %>
      • + <% end %>
      • <%= link_to "班级配置", {:controller => 'courses', :action => 'settings', :id => @course}, :class => "postOptionLink" %>
      • <%= link_to @course.is_public == 0 ? "设为公开" : "设为私有", {:controller => 'courses', :action => 'private_or_public', :id => @course},:remote=>true,:confirm=>"您确定要设置为"+(@course.is_public == 0 ? "公开" : "私有")+"吗", :class => "postOptionLink" %>
      • <%= link_to "复制学期", copy_course_course_path(@course.id),:remote=>true, :class => "postOptionLink" %>
      • diff --git a/app/views/layouts/_syllabus_info.html.erb b/app/views/layouts/_syllabus_info.html.erb index b67cb4c4d..10979a00f 100644 --- a/app/views/layouts/_syllabus_info.html.erb +++ b/app/views/layouts/_syllabus_info.html.erb @@ -1,12 +1,14 @@ -<% teachers_num = teacher_count @syllabus%> -<% students_num = student_count @syllabus%> -<% files_num = file_count @syllabus%> -
    +
    + <% unless User.current.logged? %> +
    +

    您尚未登录,登录 + 后可浏览更多信息 +

    +
    + <% end %>
    <%= form_tag( search_project_project_files_path(@project), method: 'get',:class => "re_search",:remote=>true) do %> diff --git a/app/views/files/_subfield_files.html.erb b/app/views/files/_subfield_files.html.erb index 516e42c68..6a60442b8 100644 --- a/app/views/files/_subfield_files.html.erb +++ b/app/views/files/_subfield_files.html.erb @@ -35,6 +35,14 @@
    +
    + <% unless User.current.logged? %> +
    +

    您尚未登录,登录 + 后可浏览更多信息 +

    +
    + <% end %>
    <%= form_tag( search_files_in_subfield_org_subfield_files_path(@org_subfield), method: 'get',:class => "re_search",:remote=>true) do %> diff --git a/app/views/syllabuses/show.html.erb b/app/views/syllabuses/show.html.erb index e3e6436b4..a47f3f81e 100644 --- a/app/views/syllabuses/show.html.erb +++ b/app/views/syllabuses/show.html.erb @@ -9,16 +9,12 @@

    课程信息

    -<% if @syllabus.des_status == 1 && @syllabus.courses.empty? %> +<% if @syllabus.des_status == 1 && @syllabus.courses.where("is_delete = 0").empty? %>
    <% if User.current == @syllabus.user %>

    您建立的课程还未创建班级,请 <%= link_to "新建班级", new_course_path(:host=> Setting.host_course, :syllabus_id => @syllabus.id), :class => "syllabusbox_a_blue", :target => '_blank'%>

    - <% elsif User.current.user_extensions && User.current.user_extensions.identity == 0 && User.current.allowed_to?(:add_course, nil, :global => true)%> -

    本课程下还未创建班级,请 - <%= link_to "新建班级", new_course_path(:host=> Setting.host_course, :syllabus_id => @syllabus.id), :class => "syllabusbox_a_blue", :target => '_blank'%> -

    <% else %>

    本课程下还未创建班级,敬请期待。

    diff --git a/public/stylesheets/org.css b/public/stylesheets/org.css index 459d050e1..71c2736bb 100644 --- a/public/stylesheets/org.css +++ b/public/stylesheets/org.css @@ -181,3 +181,17 @@ a.follow-button:hover {background-color:#c1c1c1;} /*组织未登录提示*/ .visitor-box {width:620px; height:33px; line-height:33px; text-align:center; vertical-align: middle; border:1px solid #ccc; background-color: #fff;} + +/* 未登录的提示信息 */ +.syllabusbox_tishi{ + font-size:14px; + width:733px; + color:#cb7c01; + padding:10px 0 0 15px; + background:#fff7d1; + border:1px solid #fcd9b4; + height:34px; +} +a.syllabusbox_a_blue{ + color:#3b94d6 !important; +} diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css index 0afdf4332..a1b379f85 100644 --- a/public/stylesheets/public.css +++ b/public/stylesheets/public.css @@ -1226,3 +1226,17 @@ a:hover.comment_ding_link{ color:#269ac9;} .orig_sub:hover{ background:#297fb8;} .orig_cont_hide{ text-align:center; width:624px; display:block; font-size:14px; color:#333; border-bottom:1px solid #F3DDB3; padding:8px 0;} .orig_icon{ color:#888; margin-right:10px; font-size:14px; font-weight:bold;} + +/* 未登录的提示信息 */ +.syllabusbox_tishi{ + font-size:14px; + width:733px; + color:#cb7c01; + padding:10px 0 0 15px; + background:#fff7d1; + border:1px solid #fcd9b4; + height:34px; +} +a.syllabusbox_a_blue{ + color:#3b94d6 !important; +} From 406d636aacb5e9db9d8a167b4822d2374d8e4d07 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 8 Jul 2016 11:27:03 +0800 Subject: [PATCH 49/87] add error system --- .../quality_analysis_controller.rb | 24 +++++++++++++++---- .../quality_analysis/error_list.html.erb | 2 +- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/app/controllers/quality_analysis_controller.rb b/app/controllers/quality_analysis_controller.rb index f18cc7d46..c53e1939a 100644 --- a/app/controllers/quality_analysis_controller.rb +++ b/app/controllers/quality_analysis_controller.rb @@ -26,14 +26,25 @@ class QualityAnalysisController < ApplicationController job_name = "#{user_name}-#{rep_id}" sonar_name = "#{user_name}:#{rep_id}" + # 考虑到历史数据:有些用户创建类job但是build失败,即sonar没有结果,这个时候需要把job删除,并且删掉quality_analyses表数据 + # 如果不要这句则需要迁移数据 + @sonar_address = Redmine::Configuration['sonar_address'] + projects_date = open(@sonar_address + "/api/projects/index").read + arr = JSON.parse(projects_date).map {|m| m["nm"]} # eg: ["Hjqreturn:cc_rep", "Hjqreturn:putong", "Hjqreturn:sonar_rep2", "shitou:sonar_rep"] + quality_an = QualityAnalysis.where(:sonar_name => sonar_name).first + if @client.job.exists?(job_name) && QualityAnalysis.where(:sonar_name => sonar_name).select{|qa| arr.include?(qa.sonar_name)}.blank? + logger.info("88888888888888888888") + aa = @client.job.delete("#{job_name}") + quality_an.delete unless quality_an.blank? + end # Checks if the given job exists in Jenkins. unless @client.job.exists?(job_name) @g = Gitlab.client branch = params[:branch] language = swith_language_type(params[:language]) path = params[:path].blank? ? "./" : params[:path] - qa = QualityAnalysis.where(:project_id => @project.id, :author_login => user_name).first - version = qa.nil? ? 1 : qa.sonar_version + 1 + # qa = QualityAnalysis.where(:project_id => @project.id, :author_login => user_name).first + version = quality_an.nil? ? 1 : quality_an.sonar_version + 1 properties = "sonar.projectKey=#{sonar_name} sonar.projectName=#{sonar_name} sonar.projectVersion=#{version} @@ -73,7 +84,7 @@ class QualityAnalysisController < ApplicationController end # 获取sonar output结果 - console_build = @client.job.get_console_output("#{job_name}", build_num = 0, start = 0, mode = 'text') + console_build = @client.job.get_console_output("#{job_name}", build_num = 0, start = 0, mode = 'text')["output"] logger.info("@current_build_status is ==> #{@current_build_status}") # 两种情况需要删除job: @@ -84,10 +95,13 @@ class QualityAnalysisController < ApplicationController @client.job.delete("#{job_name}") else if @current_build_status == "failure" - @sonar_error = SonarError.create(:project_id => @project.id, :jenkins_job_name => job_name, :output => console_build) + reg_console = /Exception:.*?\r/.match(console_build) + output = reg_console[0].gsub("\r", "") unless reg_console.nil? + se = SonarError.where(:jenkins_job_name => job_name).first + se.nil? ? SonarError.create(:project_id => @project.id, :jenkins_job_name => job_name, :output => output) : se.update_column(:output, output) @client.job.delete("#{job_name}") elsif @current_build_status == "success" - if qa.blank? + if quality_an.blank? QualityAnalysis.create(:project_id => @project.id, :author_login => user_name, :rep_identifier => identifier, :sonar_version => version, :path => path, :branch => branch, :language => language, :sonar_name => "#{user_name}:#{rep_id}") else diff --git a/app/views/quality_analysis/error_list.html.erb b/app/views/quality_analysis/error_list.html.erb index 217990b13..84f2777fa 100644 --- a/app/views/quality_analysis/error_list.html.erb +++ b/app/views/quality_analysis/error_list.html.erb @@ -6,6 +6,6 @@ <% if @build_console_result == false %> 分析超时 <% else %> - <%= h @error_list.to_json %> + <%= h @error_list.output %> <% end %>
    \ No newline at end of file From ed39b4b4f1901159b92e164661dc579c5be38d81 Mon Sep 17 00:00:00 2001 From: txz Date: Fri, 8 Jul 2016 11:29:33 +0800 Subject: [PATCH 50/87] =?UTF-8?q?=E5=8A=A8=E6=80=81=EF=BC=9A=E5=88=9B?= =?UTF-8?q?=E5=BB=BA=E7=8F=AD=E7=BA=A7=EF=BC=9B=E5=AD=A6=E7=94=9F=E8=BF=9B?= =?UTF-8?q?=E5=85=A5=E8=B5=84=E6=BA=90=E4=B9=9F=E6=98=BE=E7=A4=BA=E8=AF=BE?= =?UTF-8?q?=E4=BB=B6=EF=BC=9B=E5=B7=B2=E6=9C=89=E7=8F=AD=E7=BA=A7=E5=92=8C?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=8F=AD=E7=BA=A7=E9=A2=9C=E8=89=B2=E5=8C=BA?= =?UTF-8?q?=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/schema.rb | 2 +- public/assets/wechat/activities.html | 2 +- public/javascripts/wechat/controllers/class.js | 2 +- public/stylesheets/weui/weixin.css | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/db/schema.rb b/db/schema.rb index d2947c19d..619ccb7bb 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -562,9 +562,9 @@ ActiveRecord::Schema.define(:version => 20160630112733) do t.integer "excellent_option", :default => 0 t.integer "is_copy", :default => 0 t.integer "visits", :default => 0 + t.integer "syllabus_id" t.string "invite_code" t.string "qrcode" - t.integer "syllabus_id" end add_index "courses", ["invite_code"], :name => "index_courses_on_invite_code", :unique => true diff --git a/public/assets/wechat/activities.html b/public/assets/wechat/activities.html index 037ef8277..60075ad2e 100644 --- a/public/assets/wechat/activities.html +++ b/public/assets/wechat/activities.html @@ -136,7 +136,7 @@
    - +
    diff --git a/public/javascripts/wechat/controllers/class.js b/public/javascripts/wechat/controllers/class.js index d5de23859..87703b681 100644 --- a/public/javascripts/wechat/controllers/class.js +++ b/public/javascripts/wechat/controllers/class.js @@ -130,7 +130,7 @@ app.controller('ClassController', ['$scope', 'config','$http', 'auth','$location if(is_teacher){ vm.menus = ["课件", "作业", "小测验", "学生管理"]; } else { - vm.menus = ['课堂资源', "我的同学"]; + vm.menus = ['课件', "我的同学"]; } } diff --git a/public/stylesheets/weui/weixin.css b/public/stylesheets/weui/weixin.css index 795decd06..32bacf4f7 100644 --- a/public/stylesheets/weui/weixin.css +++ b/public/stylesheets/weui/weixin.css @@ -198,7 +198,7 @@ a.underline {text-decoration:underline;} .students-amount {height:14px; line-height:14px; vertical-align:middle; padding:2px 5px; background-color:#e6e6e6; border-radius:10px;} .new-class-btn {font-size:15px; color:#fff; background-color:#3b94d6; padding:10px 40px; border-radius:20px; display:inline-block; margin:0 auto;} .join-class-btn {font-size:15px; color:#444; background-color:#ccc; padding:10px 40px; border-radius:20px; display:inline-block; margin:0 auto;} -.new-class-input {width:60%; color:#aaa; height:35px; line-height:35px; vertical-align:middle; border:none; outline:none;} +.new-class-input {width:60%; color:#555; height:35px; line-height:35px; vertical-align:middle; border:none; outline:none;} /*20160616登录注册*/ .login-wrap {padding:0 10px;} From 13bae8f8a5f2d05820b96d0abd96d3f88cb12fab Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 8 Jul 2016 13:17:14 +0800 Subject: [PATCH 51/87] =?UTF-8?q?=E7=BA=BF=E4=B8=8B=E4=BD=9C=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/homework_common_controller.rb | 12 +- app/controllers/student_work_controller.rb | 46 +++--- app/controllers/users_controller.rb | 12 ++ app/helpers/application_helper.rb | 25 +-- app/helpers/student_work_helper.rb | 13 ++ app/models/student_work.rb | 4 +- .../student_work/_evaluation_title.html.erb | 17 +-- .../_evaluation_un_common_title.html.erb | 48 ++++++ .../_evaluation_un_common_work.html.erb | 79 ++++++++++ .../_evaluation_un_group_title.html.erb | 44 ++++++ .../_evaluation_un_group_work.html.erb | 89 +++++++++++ .../_evaluation_un_pro_title.html.erb | 55 +++++++ .../_evaluation_un_pro_work.html.erb | 83 ++++++++++ .../_evaluation_un_title.html.erb | 143 ++++++++++-------- .../student_work/_evaluation_un_work.html.erb | 85 +++++------ .../student_work/_evaluation_work.html.erb | 53 +++---- app/views/users/_course_homework.html.erb | 8 +- .../users/_user_homework_detail.html.erb | 8 +- ...160708005533_add_status_to_student_work.rb | 24 +++ db/schema.rb | 20 ++- lib/tasks/homework_evaluation.rake | 6 +- public/stylesheets/courses.css | 26 +++- public/stylesheets/public.css | 5 +- 23 files changed, 699 insertions(+), 206 deletions(-) create mode 100644 app/views/student_work/_evaluation_un_common_title.html.erb create mode 100644 app/views/student_work/_evaluation_un_common_work.html.erb create mode 100644 app/views/student_work/_evaluation_un_group_title.html.erb create mode 100644 app/views/student_work/_evaluation_un_group_work.html.erb create mode 100644 app/views/student_work/_evaluation_un_pro_title.html.erb create mode 100644 app/views/student_work/_evaluation_un_pro_work.html.erb create mode 100644 db/migrate/20160708005533_add_status_to_student_work.rb diff --git a/app/controllers/homework_common_controller.rb b/app/controllers/homework_common_controller.rb index 376f8d5c2..5e67f6f26 100644 --- a/app/controllers/homework_common_controller.rb +++ b/app/controllers/homework_common_controller.rb @@ -178,7 +178,7 @@ class HomeworkCommonController < ApplicationController @statue = 4 and return unless User.current.admin? || User.current.allowed_to?(:as_teacher,@course) @statue = 5 and return if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d") if @homework_detail_manual.comment_status == 1 - student_works = @homework.student_works + student_works = @homework.student_works.has_committed if student_works && student_works.size >= 2 if @homework.homework_type == 3 student_work_projects = @homework.student_work_projects.where("student_work_id is not null") @@ -232,8 +232,8 @@ class HomeworkCommonController < ApplicationController @homework_detail_manual.update_column('comment_status', 3) @homework_detail_manual.update_column('evaluation_end', Date.today) #计算缺评扣分 - work_ids = "(" + @homework.student_works.map(&:id).join(",") + ")" - @homework.student_works.each do |student_work| + work_ids = "(" + @homework.student_works.has_committed.map(&:id).join(",") + ")" + @homework.student_works.has_committed.each do |student_work| absence_penalty_count = student_work.user.student_works_evaluation_distributions.where("student_work_id IN #{work_ids}").count - student_work.user.student_works_scores.where("student_work_id IN #{work_ids}").count student_work.absence_penalty = absence_penalty_count > 0 ? absence_penalty_count * @homework_detail_manual.absence_penalty : 0 student_work.save @@ -263,11 +263,11 @@ class HomeworkCommonController < ApplicationController @totle_size = 0 if @homework_detail_manual.comment_status == 1 @totle_size = @course.student.count - @cur_size = @homework.student_works.size + @cur_size = @homework.student_works.has_committed.size elsif @homework_detail_manual.comment_status == 2 - @homework.student_works.map { |work| @totle_size += work.student_works_evaluation_distributions.count} + @homework.student_works.has_committed.map { |work| @totle_size += work.student_works_evaluation_distributions.count} @cur_size = 0 - @homework.student_works.map { |work| @cur_size += work.student_works_scores.where(:reviewer_role => 3).count} + @homework.student_works.has_committed.map { |work| @cur_size += work.student_works_scores.select("distinct user_id").where(:reviewer_role => 3).count} end @percent = format("%.2f",(@cur_size.to_f / ( @totle_size == 0 ? 1 : @totle_size)) * 100) @user_activity_id = params[:user_activity_id].to_i diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index 661770206..1696259bf 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -390,7 +390,7 @@ class StudentWorkController < ApplicationController student_in_group = '(' + group_students.map{|user| user.id}.join(',') + ')' end #开放作品 || 老师 || 超级管理员 || 禁用匿评&&作业截止&&已提交作品 显示所有列表 - if (@homework.is_open == 1 && @course.is_public == 1) || (@homework.is_open == 1 && @course.is_public == 0 && User.current.member_of_course?(@course)) || @is_teacher || User.current.admin? || (User.current.member_of_course?(@course) && @homework.anonymous_comment == 1 && Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.now.strftime("%Y-%m-%d") && !@homework.student_works.where(:user_id => User.current.id).empty?) + if (@homework.is_open == 1 && @course.is_public == 1) || (@homework.is_open == 1 && @course.is_public == 0 && User.current.member_of_course?(@course)) || @is_teacher || User.current.admin? || (User.current.member_of_course?(@course) && @homework.anonymous_comment == 1 && Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.now.strftime("%Y-%m-%d") && !@homework.student_works.has_committed.where(:user_id => User.current.id).empty?) if @order == 'lastname' @stundet_works = search_homework_member @homework.student_works.select("student_works.*,student_works.work_score as score").joins(:user).where("users.id in #{student_in_group}").order("CONVERT(lastname USING gbk) COLLATE gbk_chinese_ci #{@b_sort}, login #{@b_sort}"),@name elsif @order == 'student_id' @@ -409,7 +409,7 @@ class StudentWorkController < ApplicationController @stundet_works = @homework.student_works.select("student_works.*,student_works.work_score as score").where(:id => pro.student_work_id) end else - @stundet_works = @homework.student_works.select("student_works.*,student_works.work_score as score").where(:user_id => User.current.id) + @stundet_works = @homework.student_works.has_committed.select("student_works.*,student_works.work_score as score").where(:user_id => User.current.id) end elsif @homework.homework_detail_manual.comment_status == 2 #学生 && 开启匿评 看到匿评列表 if @homework.homework_type == 3 @@ -420,7 +420,7 @@ class StudentWorkController < ApplicationController my_work = @homework.student_works.where(:id => pro.student_work_id) end else - my_work = @homework.student_works.where(:user_id => User.current.id) + my_work = @homework.student_works.has_committed.where(:user_id => User.current.id) end @stundet_works = my_work + User.current.student_works_evaluation_distributions.map(&:student_work).select { |work| work.homework_common_id == @homework.id} elsif @homework.homework_detail_manual.comment_status == 3 #学生 && 关闭匿评 未提交作品之前列表为空,提交了作品看到所有的 @@ -432,17 +432,17 @@ class StudentWorkController < ApplicationController my_work = @homework.student_works.select("student_works.*,student_works.work_score as score").where(:id => pro.student_work_id) end else - my_work = @homework.student_works.select("student_works.*,student_works.work_score as score").where(:user_id => User.current.id) + my_work = @homework.student_works.has_committed.select("student_works.*,student_works.work_score as score").where(:user_id => User.current.id) end if my_work.empty? @stundet_works = [] else if @order == 'lastname' - @stundet_works = search_homework_member @homework.student_works.select("student_works.*,student_works.work_score as score").joins(:user).where("users.id in #{student_in_group}").order("CONVERT(lastname USING gbk) COLLATE gbk_chinese_ci #{@b_sort}, login #{@b_sort}"),@name + @stundet_works = search_homework_member @homework.student_works.has_committed.select("student_works.*,student_works.work_score as score").joins(:user).where("users.id in #{student_in_group}").order("CONVERT(lastname USING gbk) COLLATE gbk_chinese_ci #{@b_sort}, login #{@b_sort}"),@name elsif @order == 'student_id' - @stundet_works = search_homework_member @homework.student_works.select("student_works.*,student_works.work_score as score").joins(:user).where("users.id in #{student_in_group}").joins("join user_extensions on student_works.user_id = user_extensions.user_id").order("#{@order} #{@b_sort}"),@name + @stundet_works = search_homework_member @homework.student_works.has_committed.select("student_works.*,student_works.work_score as score").joins(:user).where("users.id in #{student_in_group}").joins("join user_extensions on student_works.user_id = user_extensions.user_id").order("#{@order} #{@b_sort}"),@name else - @stundet_works = search_homework_member @homework.student_works.select("student_works.*,student_works.work_score as score").joins(:user).where("users.id in #{student_in_group}").order("#{@order} #{@b_sort}"),@name + @stundet_works = search_homework_member @homework.student_works.has_committed.select("student_works.*,student_works.work_score as score").joins(:user).where("users.id in #{student_in_group}").order("#{@order} #{@b_sort}"),@name end @show_all = true end @@ -454,9 +454,9 @@ class StudentWorkController < ApplicationController return end - @student_work_count = (search_homework_member @homework.student_works.select("student_works.*,student_works.work_score as score").joins(:user).where("users.id in #{student_in_group}").order("#{@order} #{@b_sort}"),@name).count + @student_work_count = (search_homework_member @homework.student_works.has_committed.select("student_works.*,student_works.work_score as score").joins(:user).where("users.id in #{student_in_group}").order("#{@order} #{@b_sort}"),@name).count else - if (@homework.is_open == 1 &&@course.is_public == 1) || (@homework.is_open == 1 && @course.is_public == 0 && User.current.member_of_course?(@course)) || @is_teacher || User.current.admin? || (User.current.member_of_course?(@course) && @homework.anonymous_comment == 1 && Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.now.strftime("%Y-%m-%d") && !@homework.student_works.where(:user_id => User.current.id).empty?) + if (@homework.is_open == 1 &&@course.is_public == 1) || (@homework.is_open == 1 && @course.is_public == 0 && User.current.member_of_course?(@course)) || @is_teacher || User.current.admin? || (User.current.member_of_course?(@course) && @homework.anonymous_comment == 1 && Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.now.strftime("%Y-%m-%d") && !@homework.student_works.has_committed.where(:user_id => User.current.id).empty?) if @order == 'lastname' @stundet_works = search_homework_member @homework.student_works.select("student_works.*,student_works.work_score as score").joins(:user).order("CONVERT(lastname USING gbk) COLLATE gbk_chinese_ci #{@b_sort}, login #{@b_sort}"),@name elsif @order == 'student_id' @@ -475,7 +475,7 @@ class StudentWorkController < ApplicationController @stundet_works = @homework.student_works.select("student_works.*,student_works.work_score as score").where(:id => pro.student_work_id) end else - @stundet_works = @homework.student_works.select("student_works.*,student_works.work_score as score").where(:user_id => User.current.id) + @stundet_works = @homework.student_works.has_committed.select("student_works.*,student_works.work_score as score").where(:user_id => User.current.id) end elsif @homework.homework_detail_manual.comment_status == 2 #学生 && 开启匿评 看到匿评列表 if @homework.homework_type == 3 @@ -486,7 +486,7 @@ class StudentWorkController < ApplicationController my_work = @homework.student_works.where(:id => pro.student_work_id) end else - my_work = @homework.student_works.where(:user_id => User.current.id) + my_work = @homework.student_works.has_committed.where(:user_id => User.current.id) end @stundet_works = my_work + User.current.student_works_evaluation_distributions.map(&:student_work).select { |work| work.homework_common_id == @homework.id} elsif @homework.homework_detail_manual.comment_status == 3 #学生 && 关闭匿评 未提交作品之前列表为空,提交了作品看到所有的 @@ -498,17 +498,17 @@ class StudentWorkController < ApplicationController my_work = @homework.student_works.select("student_works.*,student_works.work_score as score").where(:id => pro.student_work_id) end else - my_work = @homework.student_works.select("student_works.*,student_works.work_score as score").where(:user_id => User.current.id) + my_work = @homework.student_works.has_committed.select("student_works.*,student_works.work_score as score").where(:user_id => User.current.id) end if my_work.empty? @stundet_works = [] else if @order == 'lastname' - @stundet_works = search_homework_member @homework.student_works.select("student_works.*,student_works.work_score as score").joins(:user).order("CONVERT(lastname USING gbk) COLLATE gbk_chinese_ci #{@b_sort}, login #{@b_sort}"),@name + @stundet_works = search_homework_member @homework.student_works.has_committed.select("student_works.*,student_works.work_score as score").joins(:user).order("CONVERT(lastname USING gbk) COLLATE gbk_chinese_ci #{@b_sort}, login #{@b_sort}"),@name elsif @order == 'student_id' - @stundet_works = search_homework_member @homework.student_works.select("student_works.*,student_works.work_score as score").joins("join user_extensions on student_works.user_id = user_extensions.user_id").order("#{@order} #{@b_sort}"),@name + @stundet_works = search_homework_member @homework.student_works.has_committed.select("student_works.*,student_works.work_score as score").joins("join user_extensions on student_works.user_id = user_extensions.user_id").order("#{@order} #{@b_sort}"),@name else - @stundet_works = search_homework_member @homework.student_works.select("student_works.*,student_works.work_score as score").order("#{@order} #{@b_sort}"),@name + @stundet_works = search_homework_member @homework.student_works.has_committed.select("student_works.*,student_works.work_score as score").order("#{@order} #{@b_sort}"),@name end @show_all = true end @@ -519,7 +519,7 @@ class StudentWorkController < ApplicationController render_403 return end - @student_work_count = (search_homework_member @homework.student_works.select("student_works.*,student_works.work_score as score").order("#{@order} #{@b_sort}"),@name).count + @student_work_count = (search_homework_member @homework.student_works.has_committed.select("student_works.*,student_works.work_score as score").order("#{@order} #{@b_sort}"),@name).count end @score = @b_sort == "desc" ? "asc" : "desc" @@ -547,10 +547,10 @@ class StudentWorkController < ApplicationController return end @user = User.current - @student_work = @homework.student_works.where("user_id = ?",User.current.id).first - if @student_work.nil? + #@student_work = @homework.student_works.where("user_id = ?",User.current.id).first + #if @student_work.nil? @student_work = StudentWork.new - end + #end respond_to do |format| format.html{ render :layout => "new_base_user"} end @@ -560,7 +560,7 @@ class StudentWorkController < ApplicationController # 提交作品前先判断是否已经提交 @has_commit = false; if hsd_committed_work?(User.current.id, @homework.id) - @work = StudentWork.where("user_id =? and homework_common_id =?", User.current.id, @homework.id).first + @work = StudentWork.where("user_id =? and homework_common_id =? and work_status != 0", User.current.id, @homework.id).first @has_commit = true; #flash[:notice] = l(:notice_successful_create) #redirect_to edit_student_work_url(params[:student_work]) @@ -572,6 +572,7 @@ class StudentWorkController < ApplicationController if params[:student_work] @submit_result = true student_work = StudentWork.find(params[:student_work_id]) if params[:student_work_id] + student_work = StudentWork.where("user_id =? and homework_common_id =? and work_status = 0", User.current.id, @homework.id).first student_work ||= StudentWork.new student_work.name = params[:student_work][:name] == "#{@homework.name}的作品提交(可修改)" ? "#{@homework.name}的作品提交" : params[:student_work][:name] student_work.description = params[:student_work][:description] @@ -586,8 +587,10 @@ class StudentWorkController < ApplicationController #提交作品时,计算是否迟交 if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(Time.now.to_s).strftime("%Y-%m-%d") student_work.late_penalty = @homework.late_penalty + student_work.work_status = 2 else student_work.late_penalty = 0 + student_work.work_status = 1 end if student_work.save if @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1 @@ -810,6 +813,7 @@ class StudentWorkController < ApplicationController if @is_teacher @is_new = true @is_last_a = false + @work.update_column('work_status', 1) else @is_new = false end @@ -1148,7 +1152,7 @@ class StudentWorkController < ApplicationController end def hsd_committed_work?(user, homework) - sw = StudentWork.where("user_id =? and homework_common_id =?", user, homework).first + sw = StudentWork.where("user_id =? and homework_common_id =? and work_status != 0", user, homework).first sw.nil? ? result = false : result = true result end diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 2925950e6..44344f1b5 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -950,8 +950,10 @@ class UsersController < ApplicationController #提交作品时,计算是否迟交 if Time.parse(homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(Time.now.to_s).strftime("%Y-%m-%d") student_work.late_penalty = homework.late_penalty + student_work.work_status = 2 else student_work.late_penalty = 0 + student_work.work_status = 1 end student_work.save @@ -1042,6 +1044,16 @@ class UsersController < ApplicationController homework_detail_manual.save if homework_detail_manual homework_detail_programing.save if homework_detail_programing homework_detail_group.save if homework_detail_group + + if homework.homework_type != 3 + unless homework.course.nil? + name = homework.name + homework.course.student.each do |student| + StudentWork.create(:name => "#{name}的作品提交", :homework_common_id => homework.id, :user_id => student.student_id) + end + end + end + if params[:quotes] && !params[:quotes].blank? quotes_homework = HomeworkCommon.find params[:quotes].to_i quotes_homework.update_column(:quotes, quotes_homework.quotes+1) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 33bfb39d3..162344f6e 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -2682,39 +2682,40 @@ module ApplicationHelper #根据传入作业确定显示为编辑作品还是新建作品,或者显示作品数量 def user_for_homework_common homework,is_teacher if User.current.member_of_course?(homework.course) + count = homework.student_works.has_committed.count if is_teacher #老师显示作品数量 - link_to "作品(#{homework.student_works.count})", student_work_index_url_in_org(homework.id), :class => "c_blue" + link_to "作品(#{count})", student_work_index_url_in_org(homework.id), :class => "c_blue" else #学生显示提交作品、修改作品等按钮 work = cur_user_works_for_homework homework project = cur_user_projects_for_homework homework if work.nil? && Time.parse(homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d") if homework.homework_type ==3 && project.nil? && homework.homework_detail_group.base_on_project == 1 - link_to "提交作品(#{homework.student_works.count})","javascript:void(0)", :class => 'c_grey',:style=>"cursor:not-allowed",:title => '请先关联项目再提交作品' + link_to "提交作品(#{count})","javascript:void(0)", :class => 'c_grey',:style=>"cursor:not-allowed",:title => '请先关联项目再提交作品' else - link_to "提交作品(#{homework.student_works.count})", new_student_work_url_without_domain(homework.id),:class => 'c_blue' + link_to "提交作品(#{count})", new_student_work_url_without_domain(homework.id),:class => 'c_blue' end elsif work.nil? && Time.parse(homework.end_time.to_s).strftime("%Y-%m-%d") < Time.now.strftime("%Y-%m-%d") if homework.homework_type ==3 && project.nil? && homework.homework_detail_group.base_on_project == 1 - link_to "补交作品(#{homework.student_works.count})","javascript:void(0)", :class => 'c_grey',:style=>"cursor:not-allowed",:title => '请先关联项目再补交作品' + link_to "补交作品(#{count})","javascript:void(0)", :class => 'c_grey',:style=>"cursor:not-allowed",:title => '请先关联项目再补交作品' else - link_to "补交作品(#{homework.student_works.count})", new_student_work_url_without_domain(homework.id),:class => 'c_red' + link_to "补交作品(#{count})", new_student_work_url_without_domain(homework.id),:class => 'c_red' end else if homework.homework_detail_manual && homework.homework_detail_manual.comment_status == 2 #匿评作业,且作业状态不是在开启匿评之前 link_to "作品匿评", student_work_index_url_in_org(homework.id), :class => 'c_blue', :title => "开启匿评后不可修改作品" elsif homework.homework_detail_manual && homework.homework_detail_manual.comment_status == 3 - link_to "查看作品(#{homework.student_works.count})",student_work_index_url_in_org(homework.id), :class => 'c_blue', :title => "匿评已结束" + link_to "查看作品(#{count})",student_work_index_url_in_org(homework.id), :class => 'c_blue', :title => "匿评已结束" elsif homework.homework_type == 2 && Time.parse(homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d")#编程作业不能修改作品 - link_to "修改作品(#{homework.student_works.count})", new_student_work_url_without_domain(homework.id),:class => 'c_blue' + link_to "修改作品(#{count})", new_student_work_url_without_domain(homework.id),:class => 'c_blue' elsif Time.parse(homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d") && work.user_id == User.current.id - link_to "修改作品(#{homework.student_works.count})", edit_student_work_url_without_domain(work.id),:class => 'c_blue' + link_to "修改作品(#{count})", edit_student_work_url_without_domain(work.id),:class => 'c_blue' else - link_to "查看作品(#{homework.student_works.count})", student_work_index_url_in_org(homework.id), :class => 'c_blue', :title => "作业截止后不可修改作品" + link_to "查看作品(#{count})", student_work_index_url_in_org(homework.id), :class => 'c_blue', :title => "作业截止后不可修改作品" end end end else - link_to "作品(#{homework.student_works.count})",student_work_index_url_in_org(homework.id),:class => "c_blue" + link_to "作品(#{count})",student_work_index_url_in_org(homework.id),:class => "c_blue" end end @@ -2752,7 +2753,7 @@ module ApplicationHelper #获取当前用户在指定作业下提交的作业的集合 def cur_user_works_for_homework homework - work = homework.student_works.where("user_id = ?",User.current).first + work = homework.student_works.where("user_id = ? && work_status != 0",User.current).first if homework.homework_type == 3 pro = homework.student_work_projects.where("user_id = #{User.current.id}").first if pro.nil? || pro.student_work_id == "" || pro.student_work_id.nil? @@ -3339,4 +3340,4 @@ def course_syllabus_option user = User.current end end type -end +end diff --git a/app/helpers/student_work_helper.rb b/app/helpers/student_work_helper.rb index 74788751b..42a3a6538 100644 --- a/app/helpers/student_work_helper.rb +++ b/app/helpers/student_work_helper.rb @@ -52,6 +52,19 @@ module StudentWorkHelper result end + def get_status status + str = "" + case status + when 0 + str = "未提交" + when 1 + str = "已提交" + when 2 + str = "迟交" + end + str + end + #获取赞的总数 def praise_homework_count obj_id PraiseTread.where("praise_tread_object_id = #{obj_id} AND praise_tread_object_type = 'StudentWork'").count diff --git a/app/models/student_work.rb b/app/models/student_work.rb index ddd91df38..3fcc9fb8a 100644 --- a/app/models/student_work.rb +++ b/app/models/student_work.rb @@ -13,6 +13,8 @@ class StudentWork < ActiveRecord::Base has_many :course_messages, :class_name =>'CourseMessage', :as => :course_message, :dependent => :destroy has_many :attachments, :dependent => :destroy + scope :has_committed, lambda{where("work_status != 0")} + before_destroy :delete_praise before_save :set_program_score, :set_src @@ -172,7 +174,7 @@ class StudentWork < ActiveRecord::Base # status == 0 : delay def act_as_message - if self.created_at > self.homework_common.end_time + 1 + if self.work_status != 0 && self.created_at > self.homework_common.end_time + 1 self.course_messages << CourseMessage.new(:user_id => self.user_id, :course_id => self.homework_common.course_id, :viewed => false, :status => false) end end diff --git a/app/views/student_work/_evaluation_title.html.erb b/app/views/student_work/_evaluation_title.html.erb index 9875a4cc6..55e1b57c1 100644 --- a/app/views/student_work/_evaluation_title.html.erb +++ b/app/views/student_work/_evaluation_title.html.erb @@ -1,32 +1,31 @@ - + <% if @homework.homework_type != 3 %> - - - <% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1 %> - + <% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 0 %> - + <% end %> <% if @homework.homework_type == 2%> - <% end%> - diff --git a/app/views/student_work/_evaluation_un_common_title.html.erb b/app/views/student_work/_evaluation_un_common_title.html.erb new file mode 100644 index 000000000..6f8d4800a --- /dev/null +++ b/app/views/student_work/_evaluation_un_common_title.html.erb @@ -0,0 +1,48 @@ + + + + + + + + + <% if @homework.anonymous_comment == 0 %> + + <% end %> + + \ No newline at end of file diff --git a/app/views/student_work/_evaluation_un_common_work.html.erb b/app/views/student_work/_evaluation_un_common_work.html.erb new file mode 100644 index 000000000..73accd2cb --- /dev/null +++ b/app/views/student_work/_evaluation_un_common_work.html.erb @@ -0,0 +1,79 @@ + + + + + + + + + + <% if @homework.anonymous_comment == 0 %> + + <% end %> + + <% if student_work.homework_common && student_work.homework_common.teacher_priority == 1 && student_work.teacher_score %> + <% score = student_work.respond_to?("score") ? student_work.score : student_work.teacher_score %> + <% else %> + <% score = student_work.respond_to?("score") ? student_work.score : (student_work.final_score || 0) - student_work.absence_penalty - student_work.late_penalty %> + <% end %> + + + \ No newline at end of file diff --git a/app/views/student_work/_evaluation_un_group_title.html.erb b/app/views/student_work/_evaluation_un_group_title.html.erb new file mode 100644 index 000000000..cb69c0fc2 --- /dev/null +++ b/app/views/student_work/_evaluation_un_group_title.html.erb @@ -0,0 +1,44 @@ + + + + <% if @homework.homework_detail_group.base_on_project == 1 %> + + + <% elsif @homework.homework_detail_group.base_on_project == 0 %> + + <% end %> + + + + <% if @homework.anonymous_comment == 0 %> + + <% end %> + + \ No newline at end of file diff --git a/app/views/student_work/_evaluation_un_group_work.html.erb b/app/views/student_work/_evaluation_un_group_work.html.erb new file mode 100644 index 000000000..b4337eeb2 --- /dev/null +++ b/app/views/student_work/_evaluation_un_group_work.html.erb @@ -0,0 +1,89 @@ + + + + + <% if @homework.homework_detail_group.base_on_project == 1 %> + + <% if student_work.project.is_public || User.current.member_of?(student_work.project) || User.current.admin? %> + + <% else %> + + <% end %> + <% elsif @homework.homework_detail_group.base_on_project == 0 %> + + <% end %> + + + + <% if @homework.anonymous_comment == 0%> + + <% end %> + + <% if student_work.homework_common && student_work.homework_common.teacher_priority == 1 && student_work.teacher_score %> + <% score = student_work.respond_to?("score") ? student_work.score : student_work.teacher_score %> + <% else %> + <% score = student_work.respond_to?("score") ? student_work.score : (student_work.final_score || 0) - student_work.absence_penalty - student_work.late_penalty%> + <% end %> + + + \ No newline at end of file diff --git a/app/views/student_work/_evaluation_un_pro_title.html.erb b/app/views/student_work/_evaluation_un_pro_title.html.erb new file mode 100644 index 000000000..86c102a4d --- /dev/null +++ b/app/views/student_work/_evaluation_un_pro_title.html.erb @@ -0,0 +1,55 @@ + + + + + + + + + + + <% if @homework.anonymous_comment == 0 %> + + <% end %> + + \ No newline at end of file diff --git a/app/views/student_work/_evaluation_un_pro_work.html.erb b/app/views/student_work/_evaluation_un_pro_work.html.erb new file mode 100644 index 000000000..0aed8f708 --- /dev/null +++ b/app/views/student_work/_evaluation_un_pro_work.html.erb @@ -0,0 +1,83 @@ + + + + + + + + + + + + <% if @homework.anonymous_comment == 0 %> + + <% end %> + + <% if student_work.homework_common && student_work.homework_common.teacher_priority == 1 && student_work.teacher_score %> + <% score = student_work.respond_to?("score") ? student_work.score : student_work.teacher_score %> + <% else %> + <% score = student_work.respond_to?("score") ? student_work.score : (student_work.final_score || 0) - student_work.absence_penalty - student_work.late_penalty %> + <% end %> + + + \ No newline at end of file diff --git a/app/views/student_work/_evaluation_un_title.html.erb b/app/views/student_work/_evaluation_un_title.html.erb index 1b3683506..4fdd6384f 100644 --- a/app/views/student_work/_evaluation_un_title.html.erb +++ b/app/views/student_work/_evaluation_un_title.html.erb @@ -1,77 +1,86 @@
    序号序号  作品名称 + 姓名 + 学号 作品名称组长 关联项目 作品名称组长 - 时间 + 状态 + 系统 + 我的评分
    序号  + <%= link_to "姓名", @show_all ? student_work_index_path(:homework => @homework.id, :order => "lastname", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)", :class => "c_dark f14 fb", :remote => true %> + <% if @show_all && @order == "lastname" %> + <%= link_to "", student_work_index_path(:homework => @homework.id, :order => "lastname", :sort => @score, :name => @name, :group => @group), :class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none", :style => "line-height:30px; vertical-align:middle;", :remote => true %> + <% end %> + + <%= link_to "学号", @show_all ? student_work_index_path(:homework => @homework.id, :order => "student_id", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)", :class => "c_dark f14 fb", :remote => true %> + <% if @show_all && @order == "student_id" %> + <%= link_to "", student_work_index_path(:homework => @homework.id, :order => "student_id", :sort => @score, :name => @name, :group => @group), :class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none", :style => "line-height:30px; vertical-align:middle;", :remote => true %> + <% end %> + + <%= link_to "时间", @show_all ? student_work_index_path(:homework => @homework.id, :order => "created_at", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)", :class => "c_dark f14 fb", :remote => true %> + <% if @show_all && @order == "created_at" %> + <%= link_to "", student_work_index_path(:homework => @homework.id, :order => "created_at", :sort => @score, :name => @name, :group => @group), :class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none", :style => "line-height:30px; vertical-align:middle;", :remote => true %> + <% end %> + + <%= link_to "教师", @show_all ? student_work_index_path(:homework => @homework.id, :order => "teacher_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)", :class => "c_dark f14 fb", :remote => true %> + <% if @show_all && @order == "teacher_score" %> + <%= link_to "", student_work_index_path(:homework => @homework.id, :order => "teacher_score", :sort => @score, :name => @name, :group => @group), :class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none", :style => "line-height:30px; vertical-align:middle;", :remote => true %> + <% end %> + + <%= link_to "教辅", @show_all ? student_work_index_path(:homework => @homework.id, :order => "teaching_asistant_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)", :class => "c_dark f14 fb", :remote => true %> + <% if @show_all && @order == "teaching_asistant_score" %> + <%= link_to "", student_work_index_path(:homework => @homework.id, :order => "teaching_asistant_score", :sort => @score, :name => @name, :group => @group), :class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none", :style => "line-height:30px; vertical-align:middle;", :remote => true %> + <% end %> + + <%= link_to "匿评", @show_all ? student_work_index_path(:homework => @homework.id, :order => "student_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)", :class => "c_dark f14 fb", :remote => true %> + <% if @show_all && @order == "student_score" %> + <%= link_to "", student_work_index_path(:homework => @homework.id, :order => "student_score", :sort => @score, :name => @name, :group => @group), :class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none", :style => "line-height:30px; vertical-align:middle;", :remote => true %> + <% end %> + + <%= link_to "成绩", @show_all ? student_work_index_path(:homework => @homework.id, :order => "score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)", :class => "c_dark f14 fb", :remote => true %> + <% if @show_all && @order == "score" %> + <%= link_to "", student_work_index_path(:homework => @homework.id, :order => "score", :sort => @score, :name => @name, :group => @group), :class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none", :style => "line-height:30px; vertical-align:middle;", :remote => true %> + <% end %> +
    <%= index + 1 %> + <%= link_to(image_tag(url_to_avatar(student_work.user), :width => "40", :height => "40", :style => "display:block;"), user_activities_path(student_work.user)) %> + + <%= student_work.user.show_name %> + " onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor:pointer;"> + <%= student_work.user.user_extensions.nil? ? "--" : student_work.user.user_extensions.student_id %> + + <% if student_work.created_at && @homework.end_time %> + <%= Time.parse(format_time(student_work.created_at)).strftime("%m-%d %H:%M") %>  + <% if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(format_time(student_work.created_at)).strftime("%Y-%m-%d") %> + [迟交] + <% end %> + <% end %> + + <%= student_work.teacher_score.nil? ? "--" : format("%.1f", student_work.teacher_score) %> + + <%= student_work.teaching_asistant_score.nil? ? "--" : format("%.1f", student_work.teaching_asistant_score) %> + + <% if student_work.student_score.nil? %> + 未参与 + <% else %> + <%= format("%.1f", student_work.student_score) %> + <% end %> + <% unless student_work.student_score.nil? %> + + (<%= student_work.student_works_scores.where(:reviewer_role => 3).group_by(&:user_id).count %>) + + +
    + 现共有 +  <%= student_work.student_works_scores.where(:reviewer_role => 3).group_by(&:user_id).count %>  + 名学生进行了匿评,平均分为 +  <%= format("%.1f", student_work.student_score) %> 分。 +
    + <% end %> +
    + <%= score.nil? ? "--" : format("%.1f", score<0 ? 0 : score) %> + <% unless score.nil? %> +
    + 作品最终评分为 +  <%= student_work.final_score %> 分。 + 迟交扣分 +   + <%= student_work.homework_common && student_work.homework_common.teacher_priority == 1 && student_work.teacher_score ? 0 : student_work.late_penalty %> +  分, + 缺评扣分 +   + <%= student_work.homework_common && student_work.homework_common.teacher_priority == 1 && student_work.teacher_score ? 0 : student_work.absence_penalty %> +  分, + 最终成绩为 +  <%= format("%.1f", score<0 ? 0 : score) %> 分。 +
    + <% end %> +
    +
    + +
    +
    序号 组长 + 关联项目 + 组长 + <%= link_to "时间", @show_all ? student_work_index_path(:homework => @homework.id, :order => "created_at", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)", :class => "c_dark f14 fb", :remote => true %> + <% if @show_all && @order == "created_at" %> + <%= link_to "", student_work_index_path(:homework => @homework.id, :order => "created_at", :sort => @score, :name => @name, :group => @group), :class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none", :style => "line-height:30px; vertical-align:middle;", :remote => true %> + <% end %> + + <%= link_to "教师", @show_all ? student_work_index_path(:homework => @homework.id, :order => "teacher_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)", :class => "c_dark f14 fb", :remote => true %> + <% if @show_all && @order == "teacher_score" %> + <%= link_to "", student_work_index_path(:homework => @homework.id, :order => "teacher_score", :sort => @score, :name => @name, :group => @group), :class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none", :style => "line-height:30px; vertical-align:middle;", :remote => true %> + <% end %> + + <%= link_to "教辅", @show_all ? student_work_index_path(:homework => @homework.id, :order => "teaching_asistant_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)", :class => "c_dark f14 fb", :remote => true %> + <% if @show_all && @order == "teaching_asistant_score" %> + <%= link_to "", student_work_index_path(:homework => @homework.id, :order => "teaching_asistant_score", :sort => @score, :name => @name, :group => @group), :class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none", :style => "line-height:30px; vertical-align:middle;", :remote => true %> + <% end %> + + <%= link_to "匿评", @show_all ? student_work_index_path(:homework => @homework.id, :order => "student_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)", :class => "c_dark f14 fb", :remote => true %> + <% if @show_all && @order == "student_score" %> + <%= link_to "", student_work_index_path(:homework => @homework.id, :order => "student_score", :sort => @score, :name => @name, :group => @group), :class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none", :style => "line-height:30px; vertical-align:middle;", :remote => true %> + <% end %> + + <%= link_to "成绩", @show_all ? student_work_index_path(:homework => @homework.id, :order => "score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)", :class => "c_dark f14 fb", :remote => true %> + <% if @show_all && @order == "score" %> + <%= link_to "", student_work_index_path(:homework => @homework.id, :order => "score", :sort => @score, :name => @name, :group => @group), :class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none", :style => "line-height:30px; vertical-align:middle;", :remote => true %> + <% end %> +
    <%=index + 1 %> + <%= link_to(image_tag(url_to_avatar(student_work.user),:width =>"40",:height => "40",:style => "display:block;"),user_activities_path(student_work.user)) %> + +
    + <%= link_to student_work.user.show_name,"javascript:void(0)" ,:title => student_work.user.show_name, :class => "linkGrey f14 StudentName break_word #{@homework.homework_type == 2 ? '' : 'width165'}"%> +
    +
    + <%= link_to( student_work.project.name, project_path(student_work.project.id))%> + + <%= student_work.project.name %> + +
    + <%= link_to student_work.user.show_name,"javascript:void(0)" ,:title => student_work.user.show_name, :class => "linkGrey f14 StudentName break_word #{@homework.homework_type == 2 ? '' : 'width165'}"%> +
    +
    + <% if student_work.created_at && @homework.end_time%> + <%= Time.parse(format_time(student_work.created_at)).strftime("%m-%d %H:%M")%>  + <% if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(format_time(student_work.created_at)).strftime("%Y-%m-%d") %> + [迟交] + <% end %> + <% end %> + + <%= student_work.teacher_score.nil? ? "--" : format("%.1f",student_work.teacher_score)%> + + <%= student_work.teaching_asistant_score.nil? ? "--" : format("%.1f",student_work.teaching_asistant_score)%> + + <% if student_work.student_score.nil? %> + 未参与 + <% else %> + <%=format("%.1f",student_work.student_score) %> + <% end %> + <% unless student_work.student_score.nil?%> + + (<%= student_work.student_works_scores.where(:reviewer_role => 3).group_by(&:user_id).count%>) + +
    + 现共有 +  <%= student_work.student_works_scores.where(:reviewer_role => 3).group_by(&:user_id).count%>  + 名学生进行了匿评,平均分为 +  <%= format("%.1f",student_work.student_score)%> 分。 +
    + <% end%> +
    + <%= score.nil? ? "--" : format("%.1f",score<0 ? 0 : score)%> + <% unless score.nil?%> +
    + 作品最终评分为 +  <%= student_work.final_score%> 分。 + 迟交扣分 +   + <%= student_work.homework_common && student_work.homework_common.teacher_priority == 1 && student_work.teacher_score ? 0 : student_work.late_penalty %> +  分, + 缺评扣分 +   + <%= student_work.homework_common && student_work.homework_common.teacher_priority == 1 && student_work.teacher_score ? 0 : student_work.absence_penalty%> +  分, + 最终成绩为 +  <%= format("%.1f",score<0 ? 0 : score)%> 分。 +
    + <% end%> +
    序号  + <%= link_to "姓名", @show_all ? student_work_index_path(:homework => @homework.id, :order => "lastname", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)", :class => "c_dark f14 fb", :remote => true %> + <% if @show_all && @order == "lastname" %> + <%= link_to "", student_work_index_path(:homework => @homework.id, :order => "lastname", :sort => @score, :name => @name, :group => @group), :class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none", :style => "line-height:30px; vertical-align:middle;", :remote => true %> + <% end %> + + <%= link_to "学号", @show_all ? student_work_index_path(:homework => @homework.id, :order => "student_id", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)", :class => "c_dark f14 fb", :remote => true %> + <% if @show_all && @order == "student_id" %> + <%= link_to "", student_work_index_path(:homework => @homework.id, :order => "student_id", :sort => @score, :name => @name, :group => @group), :class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none", :style => "line-height:30px; vertical-align:middle;", :remote => true %> + <% end %> + + <%= link_to "时间", @show_all ? student_work_index_path(:homework => @homework.id, :order => "created_at", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)", :class => "c_dark f14 fb", :remote => true %> + <% if @show_all && @order == "created_at" %> + <%= link_to "", student_work_index_path(:homework => @homework.id, :order => "created_at", :sort => @score, :name => @name, :group => @group), :class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none", :style => "line-height:30px; vertical-align:middle;", :remote => true %> + <% end %> + + <%= link_to "教师", @show_all ? student_work_index_path(:homework => @homework.id, :order => "teacher_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)", :class => "c_dark f14 fb", :remote => true %> + <% if @show_all && @order == "teacher_score" %> + <%= link_to "", student_work_index_path(:homework => @homework.id, :order => "teacher_score", :sort => @score, :name => @name, :group => @group), :class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none", :style => "line-height:30px; vertical-align:middle;", :remote => true %> + <% end %> + + <%= link_to "教辅", @show_all ? student_work_index_path(:homework => @homework.id, :order => "teaching_asistant_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)", :class => "c_dark f14 fb", :remote => true %> + <% if @show_all && @order == "teaching_asistant_score" %> + <%= link_to "", student_work_index_path(:homework => @homework.id, :order => "teaching_asistant_score", :sort => @score, :name => @name, :group => @group), :class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none", :style => "line-height:30px; vertical-align:middle;", :remote => true %> + <% end %> + + <%= link_to "系统", @show_all ? student_work_index_path(:homework => @homework.id, :order => "system_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)", :class => "c_dark f14 fb", :remote => true %> + <% if @show_all && @order == "system_score" %> + <%= link_to "", student_work_index_path(:homework => @homework.id, :order => "system_score", :sort => @score, :name => @name, :group => @group), :class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none", :style => "line-height:30px; vertical-align:middle;", :remote => true %> + <% end %> + + <%= link_to "匿评", @show_all ? student_work_index_path(:homework => @homework.id, :order => "student_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)", :class => "c_dark f14 fb", :remote => true %> + <% if @show_all && @order == "student_score" %> + <%= link_to "", student_work_index_path(:homework => @homework.id, :order => "student_score", :sort => @score, :name => @name, :group => @group), :class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none", :style => "line-height:30px; vertical-align:middle;", :remote => true %> + <% end %> + + <%= link_to "成绩", @show_all ? student_work_index_path(:homework => @homework.id, :order => "score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)", :class => "c_dark f14 fb", :remote => true %> + <% if @show_all && @order == "score" %> + <%= link_to "", student_work_index_path(:homework => @homework.id, :order => "score", :sort => @score, :name => @name, :group => @group), :class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none", :style => "line-height:30px; vertical-align:middle;", :remote => true %> + <% end %> +
    <%= index + 1 %> + <%= link_to(image_tag(url_to_avatar(student_work.user), :width => "40", :height => "40", :style => "display:block;"), user_activities_path(student_work.user)) %> + + <%= student_work.user.show_name %> + " onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor:pointer;"> + <%= student_work.user.user_extensions.nil? ? "--" : student_work.user.user_extensions.student_id %> + + <% if student_work.created_at && @homework.end_time %> + <%= Time.parse(format_time(student_work.created_at)).strftime("%m-%d %H:%M") %>  + <% if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(format_time(student_work.created_at)).strftime("%Y-%m-%d") %> + [迟交] + <% end %> + <% end %> + + <%= student_work.teacher_score.nil? ? "--" : format("%.1f", student_work.teacher_score) %> + + <%= student_work.teaching_asistant_score.nil? ? "--" : format("%.1f", student_work.teaching_asistant_score) %> + + <%= student_work.system_score.nil? ? "--" : format("%.1f", student_work.system_score) %> + + <% if student_work.student_score.nil? %> + 未参与 + <% else %> + <%= format("%.1f", student_work.student_score) %> + <% end %> + <% unless student_work.student_score.nil? %> + + (<%= student_work.student_works_scores.where(:reviewer_role => 3).group_by(&:user_id).count %>) + + +
    + 现共有 +  <%= student_work.student_works_scores.where(:reviewer_role => 3).group_by(&:user_id).count %>  + 名学生进行了匿评,平均分为 +  <%= format("%.1f", student_work.student_score) %> 分。 +
    + <% end %> +
    + <%= score.nil? ? "--" : format("%.1f", score<0 ? 0 : score) %> + <% unless score.nil? %> +
    + 作品最终评分为 +  <%= student_work.final_score %> 分。 + 迟交扣分 +   + <%= student_work.homework_common && student_work.homework_common.teacher_priority == 1 && student_work.teacher_score ? 0 : student_work.late_penalty %> +  分, + 缺评扣分 +   + <%= student_work.homework_common && student_work.homework_common.teacher_priority == 1 && student_work.teacher_score ? 0 : student_work.absence_penalty %> +  分, + 最终成绩为 +  <%= format("%.1f", score<0 ? 0 : score) %> 分。 +
    + <% end %> +
    +
    + +
    +
    - - - - <% if @homework.homework_type != 3 %> - - - - <% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1 %> - - + + + <% if @homework.homework_type != 3 %> + + + <% else %> + <% if @homework.homework_detail_group.base_on_project == 1 %> + + + <% elsif @homework.homework_detail_group.base_on_project == 0 %> + + <% end %> + <% end %> + - <% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 0 %> - - <% end %> - - - - <% if @homework.homework_type == 2%> - - <% end%> - <% if @homework.anonymous_comment == 0%> - - <% end %> - - - <% @stundet_works.each_with_index do |student_work, i|%> - <%= render :partial => "evaluation_un_work", :locals => {:student_work => student_work, :index => i}%> + <% if @homework.homework_type == 2 %> + + <% end %> + <% if @homework.anonymous_comment == 0 %> + + <% end %> + + + <%# end %> + <% @stundet_works.each_with_index do |student_work, i| %> + <%= render :partial => "evaluation_un_work", :locals => {:student_work => student_work, :index => i} %> - <% end%> + <% end %>
    序号 作品名称 - <%= link_to "姓名",@show_all ? student_work_index_path(:homework => @homework.id,:order => "lastname", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb" ,:remote => true%> - <% if @show_all && @order == "lastname"%> - <%= link_to "", student_work_index_path(:homework => @homework.id,:order => "lastname", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none" ,:style => "line-height:30px; vertical-align:middle;",:remote => true%> - <% end%> - - <%= link_to "学号",@show_all ? student_work_index_path(:homework => @homework.id,:order => "student_id", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb" ,:remote => true%> - <% if @show_all && @order == "student_id"%> - <%= link_to "", student_work_index_path(:homework => @homework.id,:order => "student_id", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none" ,:style => "line-height:30px; vertical-align:middle;",:remote => true%> - <% end%> - 作品名称 - 关联项目 + <%# if @homework.homework_type == 1 %> + <%#= render :partial => 'evaluation_un_common_title' %> + <%# elsif @homework.homework_type == 2 %> + <%#= render :partial => 'evaluation_un_pro_title' %> + <%# elsif @homework.homework_type == 3 %> + <%#= render :partial => 'evaluation_un_group_title' %> + <%# else %> +
    序号  + <%= link_to "姓名", @show_all ? student_work_index_path(:homework => @homework.id, :order => "lastname", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)", :class => "c_dark f14 fb", :remote => true %> + <% if @show_all && @order == "lastname" %> + <%= link_to "", student_work_index_path(:homework => @homework.id, :order => "lastname", :sort => @score, :name => @name, :group => @group), :class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none", :style => "line-height:30px; vertical-align:middle;", :remote => true %> + <% end %> + + <%= link_to "学号", @show_all ? student_work_index_path(:homework => @homework.id, :order => "student_id", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)", :class => "c_dark f14 fb", :remote => true %> + <% if @show_all && @order == "student_id" %> + <%= link_to "", student_work_index_path(:homework => @homework.id, :order => "student_id", :sort => @score, :name => @name, :group => @group), :class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none", :style => "line-height:30px; vertical-align:middle;", :remote => true %> + <% end %> + 组长 + 关联项目 + 组长 + <%= link_to "状态", @show_all ? student_work_index_path(:homework => @homework.id, :order => "work_status", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)", :class => "c_dark f14 fb", :remote => true %> + <% if @show_all && @order == "work_status" %> + <%= link_to "", student_work_index_path(:homework => @homework.id, :order => "work_status", :sort => @score, :name => @name, :group => @group), :class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none", :style => "line-height:30px; vertical-align:middle;", :remote => true %> + <% end %> 作品名称 - <%= link_to "时间",@show_all ? student_work_index_path(:homework => @homework.id,:order => "created_at", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb" ,:remote => true%> - <% if @show_all && @order == "created_at"%> - <%= link_to "", student_work_index_path(:homework => @homework.id,:order => "created_at", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none",:style => "line-height:30px; vertical-align:middle;",:remote => true%> - <% end%> - - <%= link_to "教师",@show_all ? student_work_index_path(:homework => @homework.id,:order => "teacher_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb" ,:remote => true%> - <% if @show_all && @order == "teacher_score"%> - <%= link_to "", student_work_index_path(:homework => @homework.id,:order => "teacher_score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none" ,:style => "line-height:30px; vertical-align:middle;",:remote => true%> - <% end%> - - <%= link_to "教辅",@show_all ? student_work_index_path(:homework => @homework.id,:order => "teaching_asistant_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb",:remote => true%> - <% if @show_all && @order == "teaching_asistant_score"%> - <%= link_to "", student_work_index_path(:homework => @homework.id,:order => "teaching_asistant_score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none",:style => "line-height:30px; vertical-align:middle;",:remote => true%> - <% end%> - - <%= link_to "系统",@show_all ? student_work_index_path(:homework => @homework.id,:order => "system_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb",:remote => true%> - <% if @show_all && @order == "system_score"%> - <%= link_to "", student_work_index_path(:homework => @homework.id,:order => "system_score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none",:style => "line-height:30px; vertical-align:middle;",:remote => true%> - <% end%> + + <%= link_to "教师", @show_all ? student_work_index_path(:homework => @homework.id, :order => "teacher_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)", :class => "c_dark f14 fb", :remote => true %> + <% if @show_all && @order == "teacher_score" %> + <%= link_to "", student_work_index_path(:homework => @homework.id, :order => "teacher_score", :sort => @score, :name => @name, :group => @group), :class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none", :style => "line-height:30px; vertical-align:middle;", :remote => true %> + <% end %> - <%= link_to "匿评",@show_all ? student_work_index_path(:homework => @homework.id,:order => "student_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb",:remote => true%> - <% if @show_all && @order == "student_score"%> - <%= link_to "", student_work_index_path(:homework => @homework.id,:order => "student_score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none",:style => "line-height:30px; vertical-align:middle;",:remote => true%> - <% end%> + + <%= link_to "教辅", @show_all ? student_work_index_path(:homework => @homework.id, :order => "teaching_asistant_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)", :class => "c_dark f14 fb", :remote => true %> + <% if @show_all && @order == "teaching_asistant_score" %> + <%= link_to "", student_work_index_path(:homework => @homework.id, :order => "teaching_asistant_score", :sort => @score, :name => @name, :group => @group), :class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none", :style => "line-height:30px; vertical-align:middle;", :remote => true %> + <% end %> - <%= link_to "成绩",@show_all ? student_work_index_path(:homework => @homework.id,:order => "score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb",:remote => true%> - <% if @show_all && @order == "score"%> - <%= link_to "", student_work_index_path(:homework => @homework.id,:order => "score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none",:style => "line-height:30px; vertical-align:middle;",:remote => true%> - <% end%> -
    + <%= link_to "系统", @show_all ? student_work_index_path(:homework => @homework.id, :order => "system_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)", :class => "c_dark f14 fb", :remote => true %> + <% if @show_all && @order == "system_score" %> + <%= link_to "", student_work_index_path(:homework => @homework.id, :order => "system_score", :sort => @score, :name => @name, :group => @group), :class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none", :style => "line-height:30px; vertical-align:middle;", :remote => true %> + <% end %> + + <%= link_to "匿评", @show_all ? student_work_index_path(:homework => @homework.id, :order => "student_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)", :class => "c_dark f14 fb", :remote => true %> + <% if @show_all && @order == "student_score" %> + <%= link_to "", student_work_index_path(:homework => @homework.id, :order => "student_score", :sort => @score, :name => @name, :group => @group), :class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none", :style => "line-height:30px; vertical-align:middle;", :remote => true %> + <% end %> + + <%= link_to "成绩", @show_all ? student_work_index_path(:homework => @homework.id, :order => "score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)", :class => "c_dark f14 fb", :remote => true %> + <% if @show_all && @order == "score" %> + <%= link_to "", student_work_index_path(:homework => @homework.id, :order => "score", :sort => @score, :name => @name, :group => @group), :class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none", :style => "line-height:30px; vertical-align:middle;", :remote => true %> + <% end %> +
    -
    +
    \ No newline at end of file diff --git a/app/views/student_work/_evaluation_un_work.html.erb b/app/views/student_work/_evaluation_un_work.html.erb index 93c800879..ed0ba5542 100644 --- a/app/views/student_work/_evaluation_un_work.html.erb +++ b/app/views/student_work/_evaluation_un_work.html.erb @@ -1,71 +1,69 @@ +<%# if @homework.homework_type == 1 %> + <%#= render :partial => 'evaluation_un_common_work', :locals => {:student_work => student_work, :index => index} %> +<%# elsif @homework.homework_type == 2 %> + <%#= render :partial => 'evaluation_un_pro_work', :locals => {:student_work => student_work, :index => index} %> +<%# elsif @homework.homework_type == 3 %> + <%#= render :partial => 'evaluation_un_group_work', :locals => {:student_work => student_work, :index => index} %> +<%# else %> - <%=index + 1 %> + <%=index + 1 %> <%= link_to(image_tag(url_to_avatar(student_work.user),:width =>"40",:height => "40",:style => "display:block;"),user_activities_path(student_work.user)) %> <% if @homework.homework_type != 3 %> - - <% student_work_name = student_work.name.nil? || student_work.name.empty? ? student_work.user.show_name + '的作品' : student_work.name%> -
    - <%= link_to student_work_name,"javascript:void(0)" ,:title => student_work_name, :class => "linkGrey f14 StudentName break_word #{@homework.homework_type == 2 ? '' : 'width165'}"%> -
    - - + <%= student_work.user.show_name%> - " onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor:pointer;"> + " onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor:pointer;"> <%= student_work.user.user_extensions.nil? ? "--" : student_work.user.user_extensions.student_id%> - <% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1 %> - - <% student_work_name = student_work.name.nil? || student_work.name.empty? ? student_work.user.show_name + '的作品' : student_work.name%> -
    - <%= link_to student_work_name,"javascript:void(0)" ,:title => student_work_name, :class => "linkGrey f14 StudentName break_word #{@homework.homework_type == 2 ? '' : 'width165'}"%> -
    - - <% if student_work.project.is_public || User.current.member_of?(student_work.project) || User.current.admin? %> - - <%= link_to( student_work.project.name, project_path(student_work.project.id))%> - - <% else %> - - <%= student_work.project.name %> - - <% end %> - <% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 0 %> - - <% student_work_name = student_work.name.nil? || student_work.name.empty? ? student_work.user.show_name + '的作品' : student_work.name%> -
    - <%= link_to student_work_name,"javascript:void(0)" ,:title => student_work_name, :class => "linkGrey f14 StudentName break_word #{@homework.homework_type == 2 ? '' : 'width165'}"%> -
    - + <% else %> + <% if @homework.homework_detail_group.base_on_project == 1 %> + +
    + <%= link_to student_work.user.show_name,"javascript:void(0)" ,:title => student_work.user.show_name, :class => "StudentName break_word"%> +
    + + <% if student_work.project.is_public || User.current.member_of?(student_work.project) || User.current.admin? %> + + <%= link_to( student_work.project.name, project_path(student_work.project.id))%> + + <% else %> + + <%= student_work.project.name %> + + <% end %> + <% elsif @homework.homework_detail_group.base_on_project == 0 %> + +
    + <%= link_to student_work.user.show_name,"javascript:void(0)" ,:title => student_work.user.show_name, :class => "StudentName break_word #{@homework.homework_type == 2 ? '' : 'width165'}"%> +
    + + <% end %> <% end %> - - <% if student_work.created_at && @homework.end_time%> - <%= Time.parse(format_time(student_work.created_at)).strftime("%m-%d %H:%M")%>  - <% if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(format_time(student_work.created_at)).strftime("%Y-%m-%d") %> - [迟交] - <% end %> + + <% if student_work.work_status%> + <%=get_status student_work.work_status %> <% end %> - + <%= student_work.teacher_score.nil? ? "--" : format("%.1f",student_work.teacher_score)%> - + <%= student_work.teaching_asistant_score.nil? ? "--" : format("%.1f",student_work.teaching_asistant_score)%> <% if @homework.homework_type == 2%> - + <%= student_work.system_score.nil? ? "--" : format("%.1f",student_work.system_score)%> <% end%> <% if @homework.anonymous_comment == 0%> - + <% if student_work.student_score.nil? %> 未参与 <% else %> @@ -90,7 +88,7 @@ <% else %> <% score = student_work.respond_to?("score") ? student_work.score : (student_work.final_score || 0) - student_work.absence_penalty - student_work.late_penalty%> <% end %> - + <%= score.nil? ? "--" : format("%.1f",score<0 ? 0 : score)%> <% unless score.nil?%>
    @@ -111,6 +109,7 @@
    +<%# end %> - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + 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 +}]); From 3c23560d770a88bb9cefeb8f4f3887c6fbb01a2a Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Fri, 8 Jul 2016 17:11:16 +0800 Subject: [PATCH 61/87] =?UTF-8?q?=E6=88=91=E7=9A=84=E8=B5=84=E6=BA=90?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E6=97=A0=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/assets/wechat/myresource.html | 8 ++++---- public/javascripts/wechat/controllers/myresource.js | 5 ++++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/public/assets/wechat/myresource.html b/public/assets/wechat/myresource.html index 1317ac11a..068c503ce 100644 --- a/public/assets/wechat/myresource.html +++ b/public/assets/wechat/myresource.html @@ -6,22 +6,22 @@
    - +
    -
    {{r.filename}}发送
    +
    {{r.filename}}发送

    暂无课件,
    请登录Trustie网站,在PC浏览器中上传课件。

    -
    {{r.homework_name}}
    +
    {{r.homework_name}}

    暂无作业,
    请登录Trustie网站,在PC浏览器中创建作业。

    -
    {{r.exercise_name}}
    +
    {{r.exercise_name}}

    暂无测验,
    请登录Trustie网站,在PC浏览器中创建测验。

    diff --git a/public/javascripts/wechat/controllers/myresource.js b/public/javascripts/wechat/controllers/myresource.js index 462a35842..b371ee8cc 100644 --- a/public/javascripts/wechat/controllers/myresource.js +++ b/public/javascripts/wechat/controllers/myresource.js @@ -6,8 +6,11 @@ app.controller('MyResourceController', ['$scope', '$http', 'auth', 'config', '$l vm.homeworks = null; vm.exercise = null; + vm.searchText = ""; + vm.tab = function(index){ vm.currentTab = index; + vm.searchText = ""; if(index==1 && (!vm.resources || vm.resources.length <= 0 )){ $http.get(config.apiUrl + "resources?token="+auth.token()).then(function(response){ console.log(response.data); @@ -31,4 +34,4 @@ app.controller('MyResourceController', ['$scope', '$http', 'auth', 'config', '$l vm.sendFile = function(r){ $location.path("/send_class_list").search({id: r.id}); } -}] ); \ No newline at end of file +}] ); From 5c0468f8fd870e9a2d2b14a9f940fe1e14a0e361 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Fri, 8 Jul 2016 17:18:09 +0800 Subject: [PATCH 62/87] =?UTF-8?q?=E4=BA=8C=E7=BB=B4=E7=A0=81=E8=BF=87?= =?UTF-8?q?=E6=9C=9F=E6=94=B9=E4=B8=BA=E4=B8=80=E4=B8=AA=E6=9C=88=E6=9C=89?= =?UTF-8?q?=E6=95=88=E6=9C=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/course.rb | 2 +- db/migrate/20160708091258_renew_qrcode.rb | 8 ++++++++ db/schema.rb | 4 ++-- 3 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 db/migrate/20160708091258_renew_qrcode.rb diff --git a/app/models/course.rb b/app/models/course.rb index 4b4313ee1..561a031ae 100644 --- a/app/models/course.rb +++ b/app/models/course.rb @@ -495,7 +495,7 @@ class Course < ActiveRecord::Base def generate_qrcode ticket = self.qrcode if !ticket || ticket.size < 10 - response = Wechat.api.qrcode_create_scene(invite_code) + response = Wechat.api.qrcode_create_scene(invite_code, 2592000) logger.debug "response = #{response}" self.qrcode = response['ticket'] save! && reload diff --git a/db/migrate/20160708091258_renew_qrcode.rb b/db/migrate/20160708091258_renew_qrcode.rb new file mode 100644 index 000000000..59f92b315 --- /dev/null +++ b/db/migrate/20160708091258_renew_qrcode.rb @@ -0,0 +1,8 @@ +class RenewQrcode < ActiveRecord::Migration + def up + Course.update_all(:qrcode => '') + end + + def down + end +end diff --git a/db/schema.rb b/db/schema.rb index 619ccb7bb..3a56c6af4 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20160630112733) do +ActiveRecord::Schema.define(:version => 20160708091258) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -562,9 +562,9 @@ ActiveRecord::Schema.define(:version => 20160630112733) do t.integer "excellent_option", :default => 0 t.integer "is_copy", :default => 0 t.integer "visits", :default => 0 - t.integer "syllabus_id" t.string "invite_code" t.string "qrcode" + t.integer "syllabus_id" end add_index "courses", ["invite_code"], :name => "index_courses_on_invite_code", :unique => true From 9ae746150166d06007a954d905622908822535ce Mon Sep 17 00:00:00 2001 From: txz Date: Fri, 8 Jul 2016 17:22:44 +0800 Subject: [PATCH 63/87] =?UTF-8?q?=E8=B5=84=E6=BA=90=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E5=AD=A6=E7=94=9F=E8=BF=9B=E5=85=A5=E6=97=B6=E4=B9=9F=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E4=B8=BA=E8=AF=BE=E4=BB=B6=EF=BC=9B=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?tab=E9=A1=B5=E6=A0=B7=E5=BC=8F=E6=9B=BF=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/assets/wechat/class.html | 23 ++++++++++++---------- public/javascripts/wechat/build/app.min.js | 2 +- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/public/assets/wechat/class.html b/public/assets/wechat/class.html index fa52c9ea4..6f8354259 100644 --- a/public/assets/wechat/class.html +++ b/public/assets/wechat/class.html @@ -1,18 +1,21 @@
    {{course.name}}邀请码
    -
    - - -
    - -
    -
    -
    + + -
    -
    + + + + + + + + + +
    diff --git a/public/javascripts/wechat/build/app.min.js b/public/javascripts/wechat/build/app.min.js index ea8984ad0..bec28a587 100644 --- a/public/javascripts/wechat/build/app.min.js +++ b/public/javascripts/wechat/build/app.min.js @@ -3,7 +3,7 @@ app.factory("alertService",function(){function t(){this.title=null,this.message= app.filter("safeHtml",["$sce",function(t){return function(n){return t.trustAsHtml(n)}}]),app.filter("identify",function(){return function(t){return"TeachingAsistant"==t?"教辅":""}}); app.controller("ActivityController",["$anchorScroll","$location","$scope","$http","$timeout","auth","rms","common","alertService",function(e,a,t,c,o,i,r,s,n){t.replaceUrl=function(e){return e},t.menus=["所有动态","课程动态","项目动态"],t.alertService=n.create(),console.log("ActivityController load"),t.page=r.get("page")||0,t.activities=r.get("activities")||[],t.has_more=r.get("has_more"),t.course_page=r.get("course_page")||0,t.course_activities=r.get("course_activities")||[],t.course_has_more=r.get("course_has_more"),t.project_page=r.get("project_page")||0,t.project_activities=r.get("project_activities")||[],t.project_has_more=r.get("project_has_more"),t.loadActData=function(e,a){switch(container_type="All",e){case 1:container_type="All",t.page=a;break;case 2:container_type="Course",t.course_page=a;break;case 3:container_type="Project",t.project_page=a}c({method:"POST",url:apiUrl+"activities",data:{token:i.token(),page:a,container_type:container_type}}).then(function(e){if(e.data.page>0)switch(e.data.container_type){case"All":t.activities=t.activities.concat(e.data.data);break;case"Course":t.course_activities=t.course_activities.concat(e.data.data);break;case"Project":t.project_activities=t.project_activities.concat(e.data.data);break;case 3:}else switch(e.data.container_type){case"All":t.activities=e.data.data;break;case"Course":t.course_activities=e.data.data;break;case"Project":t.project_activities=e.data.data;break;case 3:}switch(e.data.container_type){case"All":r.save("activities",t.activities),t.has_more=e.data.count+10*e.data.page Date: Fri, 8 Jul 2016 17:22:58 +0800 Subject: [PATCH 64/87] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=BE=AE=E4=BF=A1?= =?UTF-8?q?=E5=8F=91=E9=80=81=E8=B5=84=E6=BA=90=E5=B9=B3=E5=8F=B0=E4=B8=8D?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=8F=91=E9=80=81=E4=BA=BA=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98=EF=BC=8C=E5=88=A0=E9=99=A4=E7=8F=AD=E7=BA=A7=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=E6=96=87=E5=AD=97=E4=B8=8D=E5=B1=85=E4=B8=AD=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E7=AD=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/mobile/apis/resources.rb | 2 +- app/services/resources_service.rb | 4 +-- app/services/syllabuses_service.rb | 26 +++++-------------- public/assets/wechat/send_class_list.html | 4 +-- .../wechat/controllers/edit_class.js | 2 +- .../wechat/controllers/send_class_list.js | 4 +-- public/stylesheets/weui/weui.min.css | 2 +- 7 files changed, 16 insertions(+), 28 deletions(-) diff --git a/app/api/mobile/apis/resources.rb b/app/api/mobile/apis/resources.rb index c2fcfa754..6dfe8e599 100644 --- a/app/api/mobile/apis/resources.rb +++ b/app/api/mobile/apis/resources.rb @@ -56,7 +56,7 @@ module Mobile authenticate! rs = ResourcesService.new - ori, flag, save_message = rs.send_resource_to_course(params) + ori, flag, save_message = rs.send_resource_to_course(current_user,params) if flag present :status, 0 else diff --git a/app/services/resources_service.rb b/app/services/resources_service.rb index 827fc3efd..a0fec585a 100644 --- a/app/services/resources_service.rb +++ b/app/services/resources_service.rb @@ -3,7 +3,7 @@ class ResourcesService #发送资源到课程 - def send_resource_to_course params + def send_resource_to_course user,params send_id = params[:send_id] @ori = Attachment.find_by_id(send_id) course_ids = params[:course_ids] @@ -26,7 +26,7 @@ class ResourcesService attach_copied_obj.tag_list.add(@ori.tag_list) # tag关联 attach_copied_obj.container = Course.find(id) attach_copied_obj.created_on = Time.now - attach_copied_obj.author_id = User.current.id + attach_copied_obj.author_id = user.id attach_copied_obj.is_public = 0 attach_copied_obj.copy_from = @ori.copy_from.nil? ? @ori.id : @ori.copy_from #发送要添加copy_from if attach_copied_obj.attachtype == nil diff --git a/app/services/syllabuses_service.rb b/app/services/syllabuses_service.rb index d81d131a4..7bcc84e5b 100644 --- a/app/services/syllabuses_service.rb +++ b/app/services/syllabuses_service.rb @@ -46,28 +46,16 @@ class SyllabusesService courses = user.courses.not_deleted syllabus_ids = courses.empty? ? '(-1)' : "(" + courses.map{|course| !course.syllabus_id.nil? && course.syllabus_id}.join(",") + ")" syllabuses = Syllabus.where("id in #{syllabus_ids} or user_id = #{user.id}").order("updated_at desc") + + user.syllabuses.each do |syllabus| + syllabus.courses = syllabus.courses.not_deleted + end + syllabuses.to_a << other #管理权限 can_setting syllabuses.each do |s| - s = judge_can_setting(s,user) - - # s[:can_setting] = s.user_id == user.id ? true : false - # s.courses.each do |c| - # c[:can_setting] = false - # - # member = c.members.where("user_id=#{user.id} and course_id=#{c.id}")[0] - # roleName = member.roles[0].name if member - # - # if roleName && (roleName == "TeachingAsistant" || roleName == "Teacher" ) - # c[:can_setting] = true - # end - # - # if c.tea_id == user.id - # c[:can_setting] = true - # end - # end end syllabuses @@ -138,8 +126,8 @@ class SyllabusesService #新增班级 add_courses = option[:add_courses] add_courses.each do |c| - course = ::Course.new(c) - course.name = add_courses + course = Course.new() + course.name = c course.tea_id = user.id course.syllabus_id = sy.id course.update_default_value diff --git a/public/assets/wechat/send_class_list.html b/public/assets/wechat/send_class_list.html index 699d6c34f..6d1860e0c 100644 --- a/public/assets/wechat/send_class_list.html +++ b/public/assets/wechat/send_class_list.html @@ -5,10 +5,10 @@
    发送课程列表
    -
    +
    {{syllabus.title}}
      -
    • +
    diff --git a/public/javascripts/wechat/controllers/edit_class.js b/public/javascripts/wechat/controllers/edit_class.js index 8fea8f967..2e802ccd3 100644 --- a/public/javascripts/wechat/controllers/edit_class.js +++ b/public/javascripts/wechat/controllers/edit_class.js @@ -4,7 +4,6 @@ app.controller('EditClassController', ['$scope', '$http', 'auth', 'config', 'ale var vm = $scope; vm.syllabus = rms.get('current_edit_syllobus'); - console.log(vm.syllabus); var syllabus_id = $routeParams.id; if(!vm.syllabus){ @@ -13,6 +12,7 @@ app.controller('EditClassController', ['$scope', '$http', 'auth', 'config', 'ale vm.syllabus = response.data.data; }); } + console.log(vm.syllabus); //名字用两份 for(var i in vm.syllabus.courses){ diff --git a/public/javascripts/wechat/controllers/send_class_list.js b/public/javascripts/wechat/controllers/send_class_list.js index caca3cd6a..beb94dab2 100644 --- a/public/javascripts/wechat/controllers/send_class_list.js +++ b/public/javascripts/wechat/controllers/send_class_list.js @@ -1,4 +1,4 @@ -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', function($scope, $http, $routeParams, config, auth, alertService){ var vm = $scope; var send_id = $routeParams.id; @@ -17,7 +17,7 @@ app.controller('SendClassListController', ['$scope', '$http','$routeParams', 'co function (response) { console.log(response.data); vm.syllabuses = response.data.data; - rms.save('syllabuses', vm.syllabuses); +// rms.save('syllabuses', vm.syllabuses); } ); }; diff --git a/public/stylesheets/weui/weui.min.css b/public/stylesheets/weui/weui.min.css index 7b75fa7dd..f999fdfaf 100644 --- a/public/stylesheets/weui/weui.min.css +++ b/public/stylesheets/weui/weui.min.css @@ -2,4 +2,4 @@ * WeUI v0.2.2 (https://github.com/weui/weui) * Copyright 2016 Tencent, Inc. * Licensed under the MIT license - */.weui_input,.weui_select,.weui_switch{-webkit-appearance:none}.weui_btn,.weui_btn:after,.weui_grid,.weui_switch{box-sizing:border-box}html{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{line-height:1.6;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif}*{margin:0;padding:0}a img{border:0}a{text-decoration:none}@font-face{font-weight:400;font-style:normal;font-family:weui;src:url(data:application/octet-stream;base64,d09GRgABAAAAAA8oAA4AAAAAGewAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABPUy8yAAABRAAAAEQAAABWQClLhWNtYXAAAAGIAAAAOgAAAUrUIBe2Y3Z0IAAAAcQAAAAKAAAACgAAAABmcGdtAAAB0AAABZQAAAtwiJCQWWdhc3AAAAdkAAAACAAAAAgAAAAQZ2x5ZgAAB2wAAASuAAAHEkoVOHVoZWFkAAAMHAAAADUAAAA2CDTIZ2hoZWEAAAxUAAAAHQAAACQHlgNiaG10eAAADHQAAAAPAAAAPDqYAABsb2NhAA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MzIwLTMyMCAxNDMtMzIwIDMyMC0zMjB6IiBob3Jpei1hZHYteD0iMTAwMCIgLz4KPC9mb250Pgo8L2RlZnM+Cjwvc3ZnPg==) format('svg')}[class*=" weui_icon_"]:before,[class^=weui_icon_]:before{font-family:weui;font-style:normal;font-weight:400;speak:none;display:inline-block;vertical-align:middle;text-decoration:inherit;width:1em;text-align:center;font-variant:normal;text-transform:none;line-height:1em;margin:0}.weui_btn,.weui_dialog_ft a{text-decoration:none;-webkit-tap-highlight-color:transparent}.weui_icon_circle:before{content:"\EA01"}.weui_icon_download:before{content:"\EA02"}.weui_icon_info:before{content:"\EA03"}.weui_icon_safe_success:before{content:"\EA04"}.weui_icon_safe_warn:before{content:"\EA05"}.weui_icon_success:before{content:"\EA06";font-size:23px;color:#09BB07}.weui_icon_success_circle:before{content:"\EA07"}.weui_icon_success_no_circle:before{content:"\EA08"}.weui_icon_waiting:before{content:"\EA09";font-size:23px;color:#10AEFF}.weui_icon_waiting_circle:before{content:"\EA0A"}.weui_icon_warn:before{content:"\EA0B";font-size:23px;color:#F43530}.weui_icon_info_circle:before{content:"\EA0C"}.weui_icon_cancel:before{content:"\EA0D"}.weui_icon_info:before{font-size:23px;color:#10AEFF}.weui_icon_success_circle:before,.weui_icon_success_no_circle:before{font-size:23px;color:#09BB07}.weui_icon_waiting_circle:before{font-size:23px;color:#10AEFF}.weui_icon_circle:before{font-size:23px;color:#C9C9C9}.weui_icon_download:before,.weui_icon_info_circle:before{font-size:23px;color:#09BB07}.weui_icon_safe_success:before{color:#09BB07}.weui_icon_safe_warn:before{color:#FFBE00}.weui_icon_cancel:before{color:#F43530;font-size:22px}.weui_icon_search:before{content:"\EA0E";color:#B2B2B2;font-size:14px}.weui_icon_msg:before,.weui_icon_safe:before{font-size:104px}.weui_icon_warn.weui_icon_msg:before{color:#F76260}.weui_btn.weui_btn_mini{line-height:1.9;font-size:14px;padding:0 .75em;display:inline-block}button.weui_btn,input.weui_btn{width:100%;border-width:0;outline:0;-webkit-appearance:none}button.weui_btn:focus,input.weui_btn:focus{outline:0}button.weui_btn_inline,button.weui_btn_mini,input.weui_btn_inline,input.weui_btn_mini{width:auto}.weui_btn+.weui_btn{margin-top:15px}.weui_btn.weui_btn_inline+.weui_btn.weui_btn_inline{margin-top:auto;margin-left:15px}.weui_btn_area{margin:1.17647059em 15px .3em}.weui_btn_area.weui_btn_area_inline{-webkit-display:-webkit-box;-webkit-display:-webkit-flex;display:-webkit-box;display:-ms-flexbox;display:flex}.weui_btn_area.weui_btn_area_inline .weui_btn{margin-top:auto;margin-right:15px;width:100%;-webkit-flex:1;-webkit-box-flex:1;-ms-flex:1;flex:1}.weui_btn_area.weui_btn_area_inline .weui_btn:last-child{margin-right:0}.weui_btn{position:relative;display:block;margin-left:auto;margin-right:auto;padding-left:14px;padding-right:14px;font-size:18px;text-align:center;color:#FFF;line-height:2.33333333;border-radius:5px;overflow:hidden}.weui_btn:after,.weui_cell:before{content:" ";position:absolute}.weui_btn:after{width:200%;height:200%;top:0;left:0;border:1px solid rgba(0,0,0,.2);-webkit-transform:scale(.5);-ms-transform:scale(.5);transform:scale(.5);-webkit-transform-origin:0 0;-ms-transform-origin:0 0;transform-origin:0 0;border-radius:10px}.weui_btn.weui_btn_inline{display:inline-block}.weui_btn_default{background-color:#F7F7F7;color:#454545}.weui_btn_default:not(.weui_btn_disabled):visited{color:#454545}.weui_btn_default:not(.weui_btn_disabled):active{color:#A1A1A1;background-color:#DEDEDE}.weui_btn_primary{background-color:#04BE02}.weui_btn_primary:not(.weui_btn_disabled):visited{color:#FFF}.weui_btn_primary:not(.weui_btn_disabled):active{color:rgba(255,255,255,.4);background-color:#039702}.weui_btn_warn{background-color:#EF4F4F}.weui_btn_warn:not(.weui_btn_disabled):visited{color:#FFF}.weui_btn_warn:not(.weui_btn_disabled):active{color:rgba(255,255,255,.4);background-color:#C13E3E}.weui_btn_disabled{color:rgba(255,255,255,.6)}.weui_btn_disabled.weui_btn_default{color:#C9C9C9}.weui_btn_plain_primary{color:#04BE02;border:1px solid #04BE02}button.weui_btn_plain_primary,input.weui_btn_plain_primary{border-width:1px;background-color:transparent}.weui_btn_plain_primary:active{border-color:#039702}.weui_btn_plain_primary:after{border-width:0}.weui_btn_plain_default{color:#5A5A5A;border:1px solid #5A5A5A}button.weui_btn_plain_default,input.weui_btn_plain_default{border-width:1px;background-color:transparent}.weui_btn_plain_default:after{border-width:0}.weui_cell:before,.weui_cells:before{top:0;border-top:1px solid #D9D9D9;-webkit-transform:scaleY(.5);-ms-transform:scaleY(.5)}.weui_cell:before{width:100%;height:1px;color:#D9D9D9;-webkit-transform-origin:0 0;-ms-transform-origin:0 0;transform-origin:0 0;transform:scaleY(.5);left:15px}.weui_cells:before,.weui_grids:before{-webkit-transform-origin:0 0;-ms-transform-origin:0 0}.weui_cell:first-child:before{display:none}.weui_cells{margin-top:1.17647059em;background-color:#FFF;line-height:1.41176471;font-size:17px;overflow:hidden;position:relative}.weui_cells_access .weui_cell:not(.no_access):active,.weui_cells_checkbox .weui_cell:active,.weui_cells_radio .weui_cell:active{background-color:#ECECEC}.weui_cells_tips,.weui_cells_title{padding-left:15px;padding-right:15px;font-size:14px}.weui_cells:after,.weui_cells:before{position:absolute;left:0;width:100%;height:1px;color:#D9D9D9;content:" "}.weui_cells:before{transform-origin:0 0;transform:scaleY(.5)}.weui_cells:after{bottom:0;border-bottom:1px solid #D9D9D9;-webkit-transform-origin:0 100%;-ms-transform-origin:0 100%;transform-origin:0 100%;-webkit-transform:scaleY(.5);-ms-transform:scaleY(.5);transform:scaleY(.5)}.weui_cells_title{margin-top:.77em;margin-bottom:.3em;color:#888}.weui_cells_title+.weui_cells{margin-top:0}.weui_cells_tips{margin-top:.3em;color:#888}.weui_cell{padding:10px 15px;position:relative;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center}.weui_cell_ft{text-align:right;color:#888}.weui_cell_primary{-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1}.weui_cells_access .weui_cell:not(.no_access){-webkit-tap-highlight-color:transparent}.weui_cells_access a.weui_cell{color:inherit}.weui_cells_access .weui_cell_ft:after{content:" ";display:inline-block;-webkit-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg);height:6px;width:6px;border-width:2px 2px 0 0;border-color:#C8C8CD;border-style:solid;position:relative;top:-2px;top:-1px;margin-left:.3em}.weui_check_label{-webkit-tap-highlight-color:transparent}.weui_check{position:absolute;left:-9999em}.weui_cells_radio .weui_cell_ft{padding-left:.35em}.weui_cells_radio .weui_check:checked+.weui_icon_checked:before{content:'\EA08';color:#09BB07;font-size:16px}.weui_cells_checkbox .weui_cell_hd{padding-right:.35em}.weui_cells_checkbox .weui_icon_checked:before{content:'\EA01';color:#C9C9C9;font-size:23px;display:block}.weui_cells_checkbox .weui_check:checked+.weui_icon_checked:before{content:'\EA06';color:#09BB07}.weui_input,.weui_textarea{border:0;color:inherit;outline:0}.weui_label{display:block;width:3em}.weui_input{width:100%;background-color:transparent;font-size:inherit;height:1.41176471em;line-height:1.41176471}.weui_input::-webkit-inner-spin-button,.weui_input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.weui_textarea{display:block;resize:none;width:100%;font-size:1em;line-height:inherit}.weui_textarea_counter{color:#B2B2B2;text-align:right}.weui_dialog,.weui_grid_label,.weui_msg,.weui_toptips{text-align:center}.weui_cell_warn .weui_textarea_counter{color:#E64340}.weui_toptips{display:none;position:fixed;-webkit-transform:translateZ(0);width:100%;top:0;line-height:2.3;font-size:14px;color:#FFF;z-index:2}.weui_toptips.weui_warn{background-color:#E64340}.weui_cells_form .weui_cell_warn{color:#E64340}.weui_cells_form .weui_cell_warn .weui_icon_warn{display:inline-block}.weui_cells_form .weui_cell_hd{padding-right:.3em}.weui_cells_form .weui_cell_ft{font-size:0}.weui_cells_form .weui_icon_warn{display:none}.weui_cell_select .weui_cell_bd:after,.weui_select_before .weui_cell_hd:before{content:" ";display:inline-block;margin-top:-3px}.weui_cell_select{padding:0}.weui_select,.weui_select_after,.weui_select_before .weui_cell_bd{padding-left:15px}.weui_cell_select .weui_select{padding-right:30px}.weui_cell_select .weui_cell_bd:after{-webkit-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg);height:6px;width:6px;border-width:2px 2px 0 0;border-color:#C8C8CD;border-style:solid;position:absolute;top:50%;right:15px}.weui_grid:before,.weui_select_before .weui_cell_hd:after{-webkit-transform-origin:0 100%;-ms-transform-origin:0 100%}.weui_select,.weui_select_before .weui_cell_hd{position:relative}.weui_select{border:0;outline:0;background-color:transparent;width:100%;font-size:inherit;height:44px;z-index:1}.weui_select_before{padding-right:15px}.weui_select_before .weui_select{width:auto}.weui_select_before .weui_cell_hd:after{content:" ";position:absolute;right:0;top:0;width:1px;height:100%;border-right:1px solid #D9D9D9;color:#D9D9D9;transform-origin:0 100%;-webkit-transform:scaleX(.5);-ms-transform:scaleX(.5);transform:scaleX(.5)}.weui_select_before .weui_cell_hd:before{-webkit-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg);height:6px;width:6px;border-width:2px 2px 0 0;border-color:#C8C8CD;border-style:solid;position:absolute;top:50%;right:15px}.weui_select_before .weui_cell_bd:after{display:none}.weui_vcode{padding-top:0;padding-right:0;padding-bottom:0}.weui_vcode .weui_cell_ft img{margin-left:5px;height:44px;vertical-align:middle}.weui_cell_switch{padding-top:6px;padding-bottom:6px}.weui_switch{-moz-appearance:none;appearance:none;position:relative;width:52px;height:32px;border:1px solid #DFDFDF;outline:0;border-radius:16px;background:#DFDFDF}.weui_switch:after,.weui_switch:before{position:absolute;height:30px;border-radius:15px;top:0;left:0;content:" "}.weui_switch:before{width:50px;background-color:#FDFDFD;-webkit-transition:-webkit-transform .3s;transition:transform .3s}.weui_switch:after{width:30px;background-color:#FFF;box-shadow:0 1px 3px rgba(0,0,0,.4);-webkit-transition:-webkit-transform .3s;transition:transform .3s}.weui_switch:checked{border-color:#04BE02;background-color:#04BE02}.weui_switch:checked:before{-webkit-transform:scale(0);-ms-transform:scale(0);transform:scale(0)}.weui_switch:checked:after{-webkit-transform:translateX(20px);-ms-transform:translateX(20px);transform:translateX(20px)}.weui_uploader_hd{padding-top:0;padding-right:0;padding-left:0}.weui_uploader_hd .weui_cell_ft{font-size:1em}.weui_uploader_bd{margin-bottom:-4px;margin-right:-9px;overflow:hidden}.weui_uploader_file,.weui_uploader_input_wrp{margin-right:9px;margin-bottom:9px;float:left}.weui_uploader_files{list-style:none}.weui_uploader_file{width:79px;height:79px;background:center center no-repeat;background-size:cover}.weui_uploader_status{position:relative}.weui_uploader_status:before{content:" ";position:absolute;top:0;right:0;bottom:0;left:0;background-color:rgba(0,0,0,.5)}.weui_uploader_status .weui_uploader_status_content{position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%);transform:translate(-50%,-50%);color:#FFF}.weui_uploader_status .weui_icon_warn{display:block}.weui_uploader_input_wrp{position:relative;width:77px;height:77px;border:1px solid #D9D9D9}.weui_uploader_input_wrp:after,.weui_uploader_input_wrp:before{content:" ";position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%);transform:translate(-50%,-50%);background-color:#D9D9D9}.weui_uploader_input_wrp:before{width:2px;height:39.5px}.weui_uploader_input_wrp:after{width:39.5px;height:2px}.weui_uploader_input_wrp:active{border-color:#999}.weui_uploader_input_wrp:active:after,.weui_uploader_input_wrp:active:before{background-color:#999}.weui_uploader_input{position:absolute;z-index:1;top:0;left:0;width:100%;height:100%;opacity:0;-webkit-tap-highlight-color:transparent}.weui_msg{padding-top:36px}.weui_msg .weui_icon_area{margin-bottom:30px}.weui_msg .weui_text_area{margin-bottom:25px;padding:0 20px}.weui_msg .weui_msg_title{margin-bottom:5px;font-weight:400;font-size:20px}.weui_msg .weui_msg_desc{font-size:14px;color:#888}.weui_msg .weui_opr_area{margin-bottom:25px}.weui_msg .weui_extra_area{margin-bottom:15px;font-size:14px;color:#888}.weui_msg .weui_extra_area a{color:#61749B}@media screen and (min-height:438px){.weui_extra_area{position:fixed;left:0;bottom:0;width:100%;text-align:center}}.weui_article{padding:20px 15px;font-size:15px}.weui_article section{margin-bottom:1.5em}.weui_article h1{font-size:17px;font-weight:400;margin-bottom:.75em}.weui_article h2{font-size:16px;font-weight:400;margin-bottom:.3em}.weui_article h3{font-weight:400;font-size:15px}.weui_progress{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center}.weui_progress_bar{background-color:#EBEBEB;height:3px;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1}.weui_progress_inner_bar{width:0;height:100%;background-color:#09BB07}.weui_progress_opr{display:block;margin-left:15px;font-size:0}.weui_grids{position:relative;overflow:hidden}.weui_grids:after,.weui_grids:before{content:" ";position:absolute;color:#D9D9D9;top:0;left:0}.weui_grids:before{width:100%;height:1px;border-top:1px solid #D9D9D9;transform-origin:0 0;-webkit-transform:scaleY(.5);-ms-transform:scaleY(.5);transform:scaleY(.5)}.weui_dialog_ft:after,.weui_grids:after{-webkit-transform-origin:0 0;-ms-transform-origin:0 0}.weui_grids:after{width:1px;height:100%;border-left:1px solid #D9D9D9;transform-origin:0 0;-webkit-transform:scaleX(.5);-ms-transform:scaleX(.5);transform:scaleX(.5)}.weui_grid{position:relative;float:left;padding:20px 10px;width:33.33333333%}.weui_grid:after,.weui_grid:before{content:" ";position:absolute;color:#D9D9D9}.weui_grid:before{top:0;width:1px;height:100%;border-right:1px solid #D9D9D9;transform-origin:0 100%;-webkit-transform:scaleX(.5);-ms-transform:scaleX(.5);transform:scaleX(.5);right:-1px}.weui_grid:after{left:0;bottom:0;width:100%;height:1px;border-bottom:1px solid #D9D9D9;-webkit-transform-origin:0 100%;-ms-transform-origin:0 100%;transform-origin:0 100%;-webkit-transform:scaleY(.5);-ms-transform:scaleY(.5);transform:scaleY(.5)}.weui_grid:active{background-color:#E4E4E4}.weui_grid_icon{width:28px;height:28px;margin:0 auto}.weui_grid_icon img{display:block;width:100%;height:100%}.weui_grid_icon+.weui_grid_label{margin-top:5px}.weui_grid_label{display:block;color:#000;font-size:14px}.weui_dialog{position:fixed;z-index:13;width:85%;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%);transform:translate(-50%,-50%);background-color:#FAFAFC;border-radius:3px}.weui_dialog_confirm .weui_dialog .weui_dialog_hd{padding:1.2em 20px .5em}.weui_dialog_confirm .weui_dialog .weui_dialog_bd{text-align:left}.weui_dialog_hd{padding:1.2em 0 .5em}.weui_dialog_title{font-weight:400;font-size:17px}.weui_dialog_bd{padding:0 20px;font-size:15px;color:#888}.weui_dialog_ft{position:relative;line-height:42px;margin-top:20px;font-size:17px;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.weui_dialog_ft a{display:block;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;color:#3CC51F}.weui_dialog_confirm .weui_dialog_ft a:after,.weui_dialog_ft:after{content:" ";left:0;top:0;color:#D5D5D6}.weui_dialog_ft a:active{background-color:#EEE}.weui_dialog_ft:after{position:absolute;width:100%;height:1px;border-top:1px solid #D5D5D6;transform-origin:0 0;-webkit-transform:scaleY(.5);-ms-transform:scaleY(.5);transform:scaleY(.5)}.weui_dialog_confirm .weui_dialog_ft a{position:relative}.weui_dialog_confirm .weui_dialog_ft a:after{position:absolute;width:1px;height:100%;border-left:1px solid #D5D5D6;-webkit-transform-origin:0 0;-ms-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleX(.5);-ms-transform:scaleX(.5);transform:scaleX(.5)}.weui_dialog_confirm .weui_dialog_ft a:first-child:after{display:none}.weui_btn_dialog.default{color:#353535}.weui_btn_dialog.primary{color:#0BB20C}@media screen and (min-width:1024px){.weui_dialog{width:35%}}.weui_toast{position:fixed;z-index:3;width:7.6em;min-height:7.6em;top:180px;left:50%;margin-left:-3.8em;background:rgba(40,40,40,.75);text-align:center;border-radius:5px;color:#FFF}.weui_icon_toast{margin:22px 0 0;display:block}.weui_icon_toast:before{content:'\EA08';color:#FFF;font-size:55px}.weui_toast_content{margin:0 0 15px}.weui_loading_toast .weui_toast_content{margin-top:64%;font-size:14px}.weui_loading{position:absolute;width:0;z-index:2000000000;left:50%;top:38%}.weui_loading_leaf{position:absolute;top:-1px;opacity:.25}.weui_loading_leaf:before{content:" ";position:absolute;width:8.14px;height:3.08px;background:#d1d1d5;box-shadow:rgba(0,0,0,.0980392) 0 0 1px;border-radius:1px;-webkit-transform-origin:left 50% 0;-ms-transform-origin:left 50% 0;transform-origin:left 50% 0}.weui_mask,.weui_mask_transition,.weui_mask_transparent{z-index:1;height:100%;position:fixed;left:0;top:0;width:100%}.weui_loading_leaf_0{-webkit-animation:opacity-60-25-0-12 1.25s linear infinite;animation:opacity-60-25-0-12 1.25s linear infinite}.weui_loading_leaf_0:before{-webkit-transform:rotate(0) translate(7.92px,0);-ms-transform:rotate(0) translate(7.92px,0);transform:rotate(0) translate(7.92px,0)}.weui_loading_leaf_1{-webkit-animation:opacity-60-25-1-12 1.25s linear infinite;animation:opacity-60-25-1-12 1.25s linear infinite}.weui_loading_leaf_1:before{-webkit-transform:rotate(30deg) translate(7.92px,0);-ms-transform:rotate(30deg) translate(7.92px,0);transform:rotate(30deg) translate(7.92px,0)}.weui_loading_leaf_2{-webkit-animation:opacity-60-25-2-12 1.25s linear infinite;animation:opacity-60-25-2-12 1.25s linear infinite}.weui_loading_leaf_2:before{-webkit-transform:rotate(60deg) translate(7.92px,0);-ms-transform:rotate(60deg) translate(7.92px,0);transform:rotate(60deg) translate(7.92px,0)}.weui_loading_leaf_3{-webkit-animation:opacity-60-25-3-12 1.25s linear infinite;animation:opacity-60-25-3-12 1.25s linear infinite}.weui_loading_leaf_3:before{-webkit-transform:rotate(90deg) translate(7.92px,0);-ms-transform:rotate(90deg) translate(7.92px,0);transform:rotate(90deg) translate(7.92px,0)}.weui_loading_leaf_4{-webkit-animation:opacity-60-25-4-12 1.25s linear infinite;animation:opacity-60-25-4-12 1.25s linear infinite}.weui_loading_leaf_4:before{-webkit-transform:rotate(120deg) translate(7.92px,0);-ms-transform:rotate(120deg) translate(7.92px,0);transform:rotate(120deg) translate(7.92px,0)}.weui_loading_leaf_5{-webkit-animation:opacity-60-25-5-12 1.25s linear infinite;animation:opacity-60-25-5-12 1.25s linear infinite}.weui_loading_leaf_5:before{-webkit-transform:rotate(150deg) translate(7.92px,0);-ms-transform:rotate(150deg) translate(7.92px,0);transform:rotate(150deg) translate(7.92px,0)}.weui_loading_leaf_6{-webkit-animation:opacity-60-25-6-12 1.25s linear infinite;animation:opacity-60-25-6-12 1.25s linear infinite}.weui_loading_leaf_6:before{-webkit-transform:rotate(180deg) translate(7.92px,0);-ms-transform:rotate(180deg) translate(7.92px,0);transform:rotate(180deg) translate(7.92px,0)}.weui_loading_leaf_7{-webkit-animation:opacity-60-25-7-12 1.25s linear infinite;animation:opacity-60-25-7-12 1.25s linear infinite}.weui_loading_leaf_7:before{-webkit-transform:rotate(210deg) translate(7.92px,0);-ms-transform:rotate(210deg) translate(7.92px,0);transform:rotate(210deg) translate(7.92px,0)}.weui_loading_leaf_8{-webkit-animation:opacity-60-25-8-12 1.25s linear infinite;animation:opacity-60-25-8-12 1.25s linear infinite}.weui_loading_leaf_8:before{-webkit-transform:rotate(240deg) translate(7.92px,0);-ms-transform:rotate(240deg) translate(7.92px,0);transform:rotate(240deg) translate(7.92px,0)}.weui_loading_leaf_9{-webkit-animation:opacity-60-25-9-12 1.25s linear infinite;animation:opacity-60-25-9-12 1.25s linear infinite}.weui_loading_leaf_9:before{-webkit-transform:rotate(270deg) translate(7.92px,0);-ms-transform:rotate(270deg) translate(7.92px,0);transform:rotate(270deg) translate(7.92px,0)}.weui_loading_leaf_10{-webkit-animation:opacity-60-25-10-12 1.25s linear infinite;animation:opacity-60-25-10-12 1.25s linear infinite}.weui_loading_leaf_10:before{-webkit-transform:rotate(300deg) translate(7.92px,0);-ms-transform:rotate(300deg) translate(7.92px,0);transform:rotate(300deg) translate(7.92px,0)}.weui_loading_leaf_11{-webkit-animation:opacity-60-25-11-12 1.25s linear infinite;animation:opacity-60-25-11-12 1.25s linear infinite}.weui_loading_leaf_11:before{-webkit-transform:rotate(330deg) translate(7.92px,0);-ms-transform:rotate(330deg) translate(7.92px,0);transform:rotate(330deg) translate(7.92px,0)}@-webkit-keyframes opacity-60-25-0-12{0%,0.01%{opacity:.25}0.02%{opacity:1}100%,60.01%{opacity:.25}}@-webkit-keyframes opacity-60-25-1-12{0%,8.34333%{opacity:.25}8.35333%{opacity:1}100%,68.3433%{opacity:.25}}@-webkit-keyframes opacity-60-25-2-12{0%,16.6767%{opacity:.25}16.6867%{opacity:1}100%,76.6767%{opacity:.25}}@-webkit-keyframes opacity-60-25-3-12{0%,25.01%{opacity:.25}25.02%{opacity:1}100%,85.01%{opacity:.25}}@-webkit-keyframes opacity-60-25-4-12{0%,33.3433%{opacity:.25}33.3533%{opacity:1}100%,93.3433%{opacity:.25}}@-webkit-keyframes opacity-60-25-5-12{0%{opacity:.270958333333333}41.6767%{opacity:.25}41.6867%{opacity:1}1.67667%{opacity:.25}100%{opacity:.270958333333333}}@-webkit-keyframes opacity-60-25-6-12{0%{opacity:.375125}50.01%{opacity:.25}50.02%{opacity:1}10.01%{opacity:.25}100%{opacity:.375125}}@-webkit-keyframes opacity-60-25-7-12{0%{opacity:.479291666666667}58.3433%{opacity:.25}58.3533%{opacity:1}18.3433%{opacity:.25}100%{opacity:.479291666666667}}@-webkit-keyframes opacity-60-25-8-12{0%{opacity:.583458333333333}66.6767%{opacity:.25}66.6867%{opacity:1}26.6767%{opacity:.25}100%{opacity:.583458333333333}}@-webkit-keyframes opacity-60-25-9-12{0%{opacity:.687625}75.01%{opacity:.25}75.02%{opacity:1}35.01%{opacity:.25}100%{opacity:.687625}}@-webkit-keyframes opacity-60-25-10-12{0%{opacity:.791791666666667}83.3433%{opacity:.25}83.3533%{opacity:1}43.3433%{opacity:.25}100%{opacity:.791791666666667}}@-webkit-keyframes opacity-60-25-11-12{0%{opacity:.895958333333333}91.6767%{opacity:.25}91.6867%{opacity:1}51.6767%{opacity:.25}100%{opacity:.895958333333333}}.weui_mask{background:rgba(0,0,0,.6)}.weui_mask_transition{display:none;background:0 0;-webkit-transition:background .3s;transition:background .3s}.weui_fade_toggle{background:rgba(0,0,0,.6)}.weui_actionsheet{position:fixed;left:0;bottom:0;-webkit-transform:translate(0,100%);-ms-transform:translate(0,100%);transform:translate(0,100%);-webkit-backface-visibility:hidden;backface-visibility:hidden;z-index:2;width:100%;background-color:#EFEFF4;-webkit-transition:-webkit-transform .3s;transition:transform .3s}.weui_actionsheet_menu{background-color:#FFF}.weui_actionsheet_action{margin-top:6px;background-color:#FFF}.weui_actionsheet_cell{position:relative;padding:10px 0;text-align:center;font-size:18px}.weui_actionsheet_cell:before{content:" ";position:absolute;left:0;top:0;width:100%;height:1px;border-top:1px solid #D9D9D9;color:#D9D9D9;-webkit-transform-origin:0 0;-ms-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleY(.5);-ms-transform:scaleY(.5);transform:scaleY(.5)}.weui_actionsheet_cell:active{background-color:#ECECEC}.weui_actionsheet_cell:first-child:before{display:none}.weui_actionsheet_toggle{-webkit-transform:translate(0,0);-ms-transform:translate(0,0);transform:translate(0,0)} \ No newline at end of file + */.weui_input,.weui_select,.weui_switch{-webkit-appearance:none}.weui_btn,.weui_btn:after,.weui_grid,.weui_switch{box-sizing:border-box}html{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{line-height:1.6;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif}*{margin:0;padding:0}a img{border:0}a{text-decoration:none}@font-face{font-weight:400;font-style:normal;font-family:weui;src:url(data:application/octet-stream;base64,d09GRgABAAAAAA8oAA4AAAAAGewAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABPUy8yAAABRAAAAEQAAABWQClL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JDYRuwA0NgWbADJbACYiCwAFBYsEBgWWawAWNhsAIlRmE4IyA8IzgbISAgRiNHsAErI2E4IVmxKwEUKy2wQiywNSsusSsBFCstsEMssDYrISMgIDywBCNCIzixKwEUK7AEQy6wKystsEQssAAVIEewACNCsgABARUUEy6wMSotsEUssAAVIEewACNCsgABARUUEy6wMSotsEYssQABFBOwMiotsEcssDQqLbBILLAAFkUjIC4gRoojYTixKwEUKy2wSSywCCNCsEgrLbBKLLIAAEErLbBLLLIAAUErLbBMLLIBAEErLbBNLLIBAUErLbBOLLIAAEIrLbBPLLIAAUIrLbBQLLIBAEIrLbBRLLIBAUIrLbBSLLIAAD4rLbBTLLIAAT4rLbBULLIBAD4rLbBVLLIBAT4rLbBWLLIAAEArLbBXLLIAAUArLbBYLLIBAEArLbBZLLIBAUArLbBaLLIAAEMrLbBbLLIAAUMrLbBcLLIBAEMrLbBdLLIBAUMrLbBeLLIAAD8rLbBfLLIAAT8rLbBgLLIBAD8rLbBhLLIBAT8rLbBiLLA3Ky6xKwEUKy2wYyywNyuwOystsGQssDcrsDwrLbBlLLAAFrA3K7A9Ky2wZiywOCsusSsBFCstsGcssDgrsDsrLbBoLLA4K7A8Ky2waSywOCuwPSstsGossDkrLrErARQrLbBrLLA5K7A7Ky2wbCywOSuwPCstsG0ssDkrsD0rLbBuLLA6Ky6xKwEUKy2wbyywOiuwOystsHAssDorsDwrLbBxLLA6K7A9Ky2wciyzCQQCA0VYIRsjIVlCK7AIZbADJFB4sAEVMC0AS7gAyFJYsQEBjlmwAbkIAAgAY3CxAAVCsQAAKrEABUKxAAgqsQAFQrEACCqxAAVCuQAAAAkqsQAFQrkAAAAJKrEDAESxJAGIUViwQIhYsQNkRLEmAYhRWLoIgAABBECIY1RYsQMARFlZWVmxAAwquAH/hbAEjbECAEQA) format('woff'),url(data:application/octet-stream;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/Pgo8IURPQ1RZUEUgc3ZnIFBVQkx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TctOTAtMjUzLTkwLTIyMSAwLTQwMCAxNzktNDAwIDQwMHMxNzkgNDAwIDQwMCA0MDAgNDAwLTE3OSA0MDAtNDAwYzAtOTYtMzQtMTg0LTkwLTI1M2wyOTAtMjkxLTU2LTU2LTI5MSAyOTB6IG0tMjUzLTEwYzE3NyAwIDMyMCAxNDMgMzIwIDMyMHMtMTQzIDMyMC0zMjAgMzIwLTMyMC0xNDMtMzIwLTMyMCAxNDMtMzIwIDMyMC0zMjB6IiBob3Jpei1hZHYteD0iMTAwMCIgLz4KPC9mb250Pgo8L2RlZnM+Cjwvc3ZnPg==) format('svg')}[class*=" weui_icon_"]:before,[class^=weui_icon_]:before{font-family:weui;font-style:normal;font-weight:400;speak:none;display:inline-block;vertical-align:middle;text-decoration:inherit;width:1em;text-align:center;font-variant:normal;text-transform:none;line-height:1em;margin:0}.weui_btn,.weui_dialog_ft a{text-decoration:none;-webkit-tap-highlight-color:transparent}.weui_icon_circle:before{content:"\EA01"}.weui_icon_download:before{content:"\EA02"}.weui_icon_info:before{content:"\EA03"}.weui_icon_safe_success:before{content:"\EA04"}.weui_icon_safe_warn:before{content:"\EA05"}.weui_icon_success:before{content:"\EA06";font-size:23px;color:#09BB07}.weui_icon_success_circle:before{content:"\EA07"}.weui_icon_success_no_circle:before{content:"\EA08"}.weui_icon_waiting:before{content:"\EA09";font-size:23px;color:#10AEFF}.weui_icon_waiting_circle:before{content:"\EA0A"}.weui_icon_warn:before{content:"\EA0B";font-size:23px;color:#F43530}.weui_icon_info_circle:before{content:"\EA0C"}.weui_icon_cancel:before{content:"\EA0D"}.weui_icon_info:before{font-size:23px;color:#10AEFF}.weui_icon_success_circle:before,.weui_icon_success_no_circle:before{font-size:23px;color:#09BB07}.weui_icon_waiting_circle:before{font-size:23px;color:#10AEFF}.weui_icon_circle:before{font-size:23px;color:#C9C9C9}.weui_icon_download:before,.weui_icon_info_circle:before{font-size:23px;color:#09BB07}.weui_icon_safe_success:before{color:#09BB07}.weui_icon_safe_warn:before{color:#FFBE00}.weui_icon_cancel:before{color:#F43530;font-size:22px}.weui_icon_search:before{content:"\EA0E";color:#B2B2B2;font-size:14px}.weui_icon_msg:before,.weui_icon_safe:before{font-size:104px}.weui_icon_warn.weui_icon_msg:before{color:#F76260}.weui_btn.weui_btn_mini{line-height:1.9;font-size:14px;padding:0 .75em;display:inline-block}button.weui_btn,input.weui_btn{width:100%;border-width:0;outline:0;-webkit-appearance:none}button.weui_btn:focus,input.weui_btn:focus{outline:0}button.weui_btn_inline,button.weui_btn_mini,input.weui_btn_inline,input.weui_btn_mini{width:auto}.weui_btn+.weui_btn{margin-top:15px}.weui_btn.weui_btn_inline+.weui_btn.weui_btn_inline{margin-top:auto;margin-left:15px}.weui_btn_area{margin:1.17647059em 15px .3em}.weui_btn_area.weui_btn_area_inline{-webkit-display:-webkit-box;-webkit-display:-webkit-flex;display:-webkit-box;display:-ms-flexbox;display:flex}.weui_btn_area.weui_btn_area_inline .weui_btn{margin-top:auto;margin-right:15px;width:100%;-webkit-flex:1;-webkit-box-flex:1;-ms-flex:1;flex:1}.weui_btn_area.weui_btn_area_inline .weui_btn:last-child{margin-right:0}.weui_btn{position:relative;display:block;margin-left:auto;margin-right:auto;padding-left:14px;padding-right:14px;font-size:18px;text-align:center;color:#FFF;line-height:2.33333333;border-radius:5px;overflow:hidden}.weui_btn:after,.weui_cell:before{content:" ";position:absolute}.weui_btn:after{width:200%;height:200%;top:0;left:0;border:1px solid rgba(0,0,0,.2);-webkit-transform:scale(.5);-ms-transform:scale(.5);transform:scale(.5);-webkit-transform-origin:0 0;-ms-transform-origin:0 0;transform-origin:0 0;border-radius:10px}.weui_btn.weui_btn_inline{display:inline-block}.weui_btn_default{background-color:#F7F7F7;color:#454545}.weui_btn_default:not(.weui_btn_disabled):visited{color:#454545}.weui_btn_default:not(.weui_btn_disabled):active{color:#A1A1A1;background-color:#DEDEDE}.weui_btn_primary{background-color:#04BE02}.weui_btn_primary:not(.weui_btn_disabled):visited{color:#FFF}.weui_btn_primary:not(.weui_btn_disabled):active{color:rgba(255,255,255,.4);background-color:#039702}.weui_btn_warn{background-color:#EF4F4F}.weui_btn_warn:not(.weui_btn_disabled):visited{color:#FFF}.weui_btn_warn:not(.weui_btn_disabled):active{color:rgba(255,255,255,.4);background-color:#C13E3E}.weui_btn_disabled{color:rgba(255,255,255,.6)}.weui_btn_disabled.weui_btn_default{color:#C9C9C9}.weui_btn_plain_primary{color:#04BE02;border:1px solid #04BE02}button.weui_btn_plain_primary,input.weui_btn_plain_primary{border-width:1px;background-color:transparent}.weui_btn_plain_primary:active{border-color:#039702}.weui_btn_plain_primary:after{border-width:0}.weui_btn_plain_default{color:#5A5A5A;border:1px solid #5A5A5A}button.weui_btn_plain_default,input.weui_btn_plain_default{border-width:1px;background-color:transparent}.weui_btn_plain_default:after{border-width:0}.weui_cell:before,.weui_cells:before{top:0;border-top:1px solid #D9D9D9;-webkit-transform:scaleY(.5);-ms-transform:scaleY(.5)}.weui_cell:before{width:100%;height:1px;color:#D9D9D9;-webkit-transform-origin:0 0;-ms-transform-origin:0 0;transform-origin:0 0;transform:scaleY(.5);left:15px}.weui_cells:before,.weui_grids:before{-webkit-transform-origin:0 0;-ms-transform-origin:0 0}.weui_cell:first-child:before{display:none}.weui_cells{margin-top:1.17647059em;background-color:#FFF;line-height:1.41176471;font-size:17px;overflow:hidden;position:relative}.weui_cells_access .weui_cell:not(.no_access):active,.weui_cells_checkbox .weui_cell:active,.weui_cells_radio .weui_cell:active{background-color:#ECECEC}.weui_cells_tips,.weui_cells_title{padding-left:15px;padding-right:15px;font-size:14px}.weui_cells:after,.weui_cells:before{position:absolute;left:0;width:100%;height:1px;color:#D9D9D9;content:" "}.weui_cells:before{transform-origin:0 0;transform:scaleY(.5)}.weui_cells:after{bottom:0;border-bottom:1px solid #D9D9D9;-webkit-transform-origin:0 100%;-ms-transform-origin:0 100%;transform-origin:0 100%;-webkit-transform:scaleY(.5);-ms-transform:scaleY(.5);transform:scaleY(.5)}.weui_cells_title{margin-top:.77em;margin-bottom:.3em;color:#888}.weui_cells_title+.weui_cells{margin-top:0}.weui_cells_tips{margin-top:.3em;color:#888}.weui_cell{padding:10px 15px;position:relative;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center}.weui_cell_ft{text-align:right;color:#888}.weui_cell_primary{-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1}.weui_cells_access .weui_cell:not(.no_access){-webkit-tap-highlight-color:transparent}.weui_cells_access a.weui_cell{color:inherit}.weui_cells_access .weui_cell_ft:after{content:" ";display:inline-block;-webkit-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg);height:6px;width:6px;border-width:2px 2px 0 0;border-color:#C8C8CD;border-style:solid;position:relative;top:-2px;top:-1px;margin-left:.3em}.weui_check_label{-webkit-tap-highlight-color:transparent}.weui_check{position:absolute;left:-9999em}.weui_cells_radio .weui_cell_ft{padding-left:.35em}.weui_cells_radio .weui_check:checked+.weui_icon_checked:before{content:'\EA08';color:#09BB07;font-size:16px}.weui_cells_checkbox .weui_cell_hd{padding-right:.35em}.weui_cells_checkbox .weui_icon_checked:before{content:'\EA01';color:#C9C9C9;font-size:23px;display:block}.weui_cells_checkbox .weui_check:checked+.weui_icon_checked:before{content:'\EA06';color:#09BB07}.weui_input,.weui_textarea{border:0;color:inherit;outline:0}.weui_label{display:block;width:3em}.weui_input{width:100%;background-color:transparent;font-size:inherit;height:1.41176471em;line-height:1.41176471}.weui_input::-webkit-inner-spin-button,.weui_input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.weui_textarea{display:block;resize:none;width:100%;font-size:1em;line-height:inherit}.weui_textarea_counter{color:#B2B2B2;text-align:right}.weui_dialog,.weui_grid_label,.weui_msg,.weui_toptips{text-align:center}.weui_cell_warn .weui_textarea_counter{color:#E64340}.weui_toptips{display:none;position:fixed;-webkit-transform:translateZ(0);width:100%;top:0;line-height:2.3;font-size:14px;color:#FFF;z-index:2}.weui_toptips.weui_warn{background-color:#E64340}.weui_cells_form .weui_cell_warn{color:#E64340}.weui_cells_form .weui_cell_warn .weui_icon_warn{display:inline-block}.weui_cells_form .weui_cell_hd{padding-right:.3em}.weui_cells_form .weui_cell_ft{font-size:0}.weui_cells_form .weui_icon_warn{display:none}.weui_cell_select .weui_cell_bd:after,.weui_select_before .weui_cell_hd:before{content:" ";display:inline-block;margin-top:-3px}.weui_cell_select{padding:0}.weui_select,.weui_select_after,.weui_select_before .weui_cell_bd{padding-left:15px}.weui_cell_select .weui_select{padding-right:30px}.weui_cell_select .weui_cell_bd:after{-webkit-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg);height:6px;width:6px;border-width:2px 2px 0 0;border-color:#C8C8CD;border-style:solid;position:absolute;top:50%;right:15px}.weui_grid:before,.weui_select_before .weui_cell_hd:after{-webkit-transform-origin:0 100%;-ms-transform-origin:0 100%}.weui_select,.weui_select_before .weui_cell_hd{position:relative}.weui_select{border:0;outline:0;background-color:transparent;width:100%;font-size:inherit;height:44px;z-index:1}.weui_select_before{padding-right:15px}.weui_select_before .weui_select{width:auto}.weui_select_before .weui_cell_hd:after{content:" ";position:absolute;right:0;top:0;width:1px;height:100%;border-right:1px solid #D9D9D9;color:#D9D9D9;transform-origin:0 100%;-webkit-transform:scaleX(.5);-ms-transform:scaleX(.5);transform:scaleX(.5)}.weui_select_before .weui_cell_hd:before{-webkit-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg);height:6px;width:6px;border-width:2px 2px 0 0;border-color:#C8C8CD;border-style:solid;position:absolute;top:50%;right:15px}.weui_select_before .weui_cell_bd:after{display:none}.weui_vcode{padding-top:0;padding-right:0;padding-bottom:0}.weui_vcode .weui_cell_ft img{margin-left:5px;height:44px;vertical-align:middle}.weui_cell_switch{padding-top:6px;padding-bottom:6px}.weui_switch{-moz-appearance:none;appearance:none;position:relative;width:52px;height:32px;border:1px solid #DFDFDF;outline:0;border-radius:16px;background:#DFDFDF}.weui_switch:after,.weui_switch:before{position:absolute;height:30px;border-radius:15px;top:0;left:0;content:" "}.weui_switch:before{width:50px;background-color:#FDFDFD;-webkit-transition:-webkit-transform .3s;transition:transform .3s}.weui_switch:after{width:30px;background-color:#FFF;box-shadow:0 1px 3px rgba(0,0,0,.4);-webkit-transition:-webkit-transform .3s;transition:transform .3s}.weui_switch:checked{border-color:#04BE02;background-color:#04BE02}.weui_switch:checked:before{-webkit-transform:scale(0);-ms-transform:scale(0);transform:scale(0)}.weui_switch:checked:after{-webkit-transform:translateX(20px);-ms-transform:translateX(20px);transform:translateX(20px)}.weui_uploader_hd{padding-top:0;padding-right:0;padding-left:0}.weui_uploader_hd .weui_cell_ft{font-size:1em}.weui_uploader_bd{margin-bottom:-4px;margin-right:-9px;overflow:hidden}.weui_uploader_file,.weui_uploader_input_wrp{margin-right:9px;margin-bottom:9px;float:left}.weui_uploader_files{list-style:none}.weui_uploader_file{width:79px;height:79px;background:center center no-repeat;background-size:cover}.weui_uploader_status{position:relative}.weui_uploader_status:before{content:" ";position:absolute;top:0;right:0;bottom:0;left:0;background-color:rgba(0,0,0,.5)}.weui_uploader_status .weui_uploader_status_content{position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%);transform:translate(-50%,-50%);color:#FFF}.weui_uploader_status .weui_icon_warn{display:block}.weui_uploader_input_wrp{position:relative;width:77px;height:77px;border:1px solid #D9D9D9}.weui_uploader_input_wrp:after,.weui_uploader_input_wrp:before{content:" ";position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%);transform:translate(-50%,-50%);background-color:#D9D9D9}.weui_uploader_input_wrp:before{width:2px;height:39.5px}.weui_uploader_input_wrp:after{width:39.5px;height:2px}.weui_uploader_input_wrp:active{border-color:#999}.weui_uploader_input_wrp:active:after,.weui_uploader_input_wrp:active:before{background-color:#999}.weui_uploader_input{position:absolute;z-index:1;top:0;left:0;width:100%;height:100%;opacity:0;-webkit-tap-highlight-color:transparent}.weui_msg{padding-top:36px}.weui_msg .weui_icon_area{margin-bottom:30px}.weui_msg .weui_text_area{margin-bottom:25px;padding:0 20px}.weui_msg .weui_msg_title{margin-bottom:5px;font-weight:400;font-size:20px}.weui_msg .weui_msg_desc{font-size:14px;color:#888}.weui_msg .weui_opr_area{margin-bottom:25px}.weui_msg .weui_extra_area{margin-bottom:15px;font-size:14px;color:#888}.weui_msg .weui_extra_area a{color:#61749B}@media screen and (min-height:438px){.weui_extra_area{position:fixed;left:0;bottom:0;width:100%;text-align:center}}.weui_article{padding:20px 15px;font-size:15px}.weui_article section{margin-bottom:1.5em}.weui_article h1{font-size:17px;font-weight:400;margin-bottom:.75em}.weui_article h2{font-size:16px;font-weight:400;margin-bottom:.3em}.weui_article h3{font-weight:400;font-size:15px}.weui_progress{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center}.weui_progress_bar{background-color:#EBEBEB;height:3px;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1}.weui_progress_inner_bar{width:0;height:100%;background-color:#09BB07}.weui_progress_opr{display:block;margin-left:15px;font-size:0}.weui_grids{position:relative;overflow:hidden}.weui_grids:after,.weui_grids:before{content:" ";position:absolute;color:#D9D9D9;top:0;left:0}.weui_grids:before{width:100%;height:1px;border-top:1px solid #D9D9D9;transform-origin:0 0;-webkit-transform:scaleY(.5);-ms-transform:scaleY(.5);transform:scaleY(.5)}.weui_dialog_ft:after,.weui_grids:after{-webkit-transform-origin:0 0;-ms-transform-origin:0 0}.weui_grids:after{width:1px;height:100%;border-left:1px solid #D9D9D9;transform-origin:0 0;-webkit-transform:scaleX(.5);-ms-transform:scaleX(.5);transform:scaleX(.5)}.weui_grid{position:relative;float:left;padding:20px 10px;width:33.33333333%}.weui_grid:after,.weui_grid:before{content:" ";position:absolute;color:#D9D9D9}.weui_grid:before{top:0;width:1px;height:100%;border-right:1px solid #D9D9D9;transform-origin:0 100%;-webkit-transform:scaleX(.5);-ms-transform:scaleX(.5);transform:scaleX(.5);right:-1px}.weui_grid:after{left:0;bottom:0;width:100%;height:1px;border-bottom:1px solid #D9D9D9;-webkit-transform-origin:0 100%;-ms-transform-origin:0 100%;transform-origin:0 100%;-webkit-transform:scaleY(.5);-ms-transform:scaleY(.5);transform:scaleY(.5)}.weui_grid:active{background-color:#E4E4E4}.weui_grid_icon{width:28px;height:28px;margin:0 auto}.weui_grid_icon img{display:block;width:100%;height:100%}.weui_grid_icon+.weui_grid_label{margin-top:5px}.weui_grid_label{display:block;color:#000;font-size:14px}.weui_dialog{position:fixed;z-index:13;width:85%;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%);transform:translate(-50%,-50%);background-color:#FAFAFC;border-radius:3px}.weui_dialog_confirm .weui_dialog .weui_dialog_hd{padding:1.2em 20px .5em}.weui_dialog_confirm .weui_dialog .weui_dialog_bd{text-align:center}.weui_dialog_hd{padding:1.2em 0 .5em}.weui_dialog_title{font-weight:400;font-size:17px}.weui_dialog_bd{padding:0 20px;font-size:15px;color:#888}.weui_dialog_ft{position:relative;line-height:42px;margin-top:20px;font-size:17px;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.weui_dialog_ft a{display:block;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;color:#3CC51F}.weui_dialog_confirm .weui_dialog_ft a:after,.weui_dialog_ft:after{content:" ";left:0;top:0;color:#D5D5D6}.weui_dialog_ft a:active{background-color:#EEE}.weui_dialog_ft:after{position:absolute;width:100%;height:1px;border-top:1px solid #D5D5D6;transform-origin:0 0;-webkit-transform:scaleY(.5);-ms-transform:scaleY(.5);transform:scaleY(.5)}.weui_dialog_confirm .weui_dialog_ft a{position:relative}.weui_dialog_confirm .weui_dialog_ft a:after{position:absolute;width:1px;height:100%;border-left:1px solid #D5D5D6;-webkit-transform-origin:0 0;-ms-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleX(.5);-ms-transform:scaleX(.5);transform:scaleX(.5)}.weui_dialog_confirm .weui_dialog_ft a:first-child:after{display:none}.weui_btn_dialog.default{color:#353535}.weui_btn_dialog.primary{color:#0BB20C}@media screen and (min-width:1024px){.weui_dialog{width:35%}}.weui_toast{position:fixed;z-index:3;width:7.6em;min-height:7.6em;top:180px;left:50%;margin-left:-3.8em;background:rgba(40,40,40,.75);text-align:center;border-radius:5px;color:#FFF}.weui_icon_toast{margin:22px 0 0;display:block}.weui_icon_toast:before{content:'\EA08';color:#FFF;font-size:55px}.weui_toast_content{margin:0 0 15px}.weui_loading_toast .weui_toast_content{margin-top:64%;font-size:14px}.weui_loading{position:absolute;width:0;z-index:2000000000;left:50%;top:38%}.weui_loading_leaf{position:absolute;top:-1px;opacity:.25}.weui_loading_leaf:before{content:" ";position:absolute;width:8.14px;height:3.08px;background:#d1d1d5;box-shadow:rgba(0,0,0,.0980392) 0 0 1px;border-radius:1px;-webkit-transform-origin:left 50% 0;-ms-transform-origin:left 50% 0;transform-origin:left 50% 0}.weui_mask,.weui_mask_transition,.weui_mask_transparent{z-index:1;height:100%;position:fixed;left:0;top:0;width:100%}.weui_loading_leaf_0{-webkit-animation:opacity-60-25-0-12 1.25s linear infinite;animation:opacity-60-25-0-12 1.25s linear infinite}.weui_loading_leaf_0:before{-webkit-transform:rotate(0) translate(7.92px,0);-ms-transform:rotate(0) translate(7.92px,0);transform:rotate(0) translate(7.92px,0)}.weui_loading_leaf_1{-webkit-animation:opacity-60-25-1-12 1.25s linear infinite;animation:opacity-60-25-1-12 1.25s linear infinite}.weui_loading_leaf_1:before{-webkit-transform:rotate(30deg) translate(7.92px,0);-ms-transform:rotate(30deg) translate(7.92px,0);transform:rotate(30deg) translate(7.92px,0)}.weui_loading_leaf_2{-webkit-animation:opacity-60-25-2-12 1.25s linear infinite;animation:opacity-60-25-2-12 1.25s linear infinite}.weui_loading_leaf_2:before{-webkit-transform:rotate(60deg) translate(7.92px,0);-ms-transform:rotate(60deg) translate(7.92px,0);transform:rotate(60deg) translate(7.92px,0)}.weui_loading_leaf_3{-webkit-animation:opacity-60-25-3-12 1.25s linear infinite;animation:opacity-60-25-3-12 1.25s linear infinite}.weui_loading_leaf_3:before{-webkit-transform:rotate(90deg) translate(7.92px,0);-ms-transform:rotate(90deg) translate(7.92px,0);transform:rotate(90deg) translate(7.92px,0)}.weui_loading_leaf_4{-webkit-animation:opacity-60-25-4-12 1.25s linear infinite;animation:opacity-60-25-4-12 1.25s linear infinite}.weui_loading_leaf_4:before{-webkit-transform:rotate(120deg) translate(7.92px,0);-ms-transform:rotate(120deg) translate(7.92px,0);transform:rotate(120deg) translate(7.92px,0)}.weui_loading_leaf_5{-webkit-animation:opacity-60-25-5-12 1.25s linear infinite;animation:opacity-60-25-5-12 1.25s linear infinite}.weui_loading_leaf_5:before{-webkit-transform:rotate(150deg) translate(7.92px,0);-ms-transform:rotate(150deg) translate(7.92px,0);transform:rotate(150deg) translate(7.92px,0)}.weui_loading_leaf_6{-webkit-animation:opacity-60-25-6-12 1.25s linear infinite;animation:opacity-60-25-6-12 1.25s linear infinite}.weui_loading_leaf_6:before{-webkit-transform:rotate(180deg) translate(7.92px,0);-ms-transform:rotate(180deg) translate(7.92px,0);transform:rotate(180deg) translate(7.92px,0)}.weui_loading_leaf_7{-webkit-animation:opacity-60-25-7-12 1.25s linear infinite;animation:opacity-60-25-7-12 1.25s linear infinite}.weui_loading_leaf_7:before{-webkit-transform:rotate(210deg) translate(7.92px,0);-ms-transform:rotate(210deg) translate(7.92px,0);transform:rotate(210deg) translate(7.92px,0)}.weui_loading_leaf_8{-webkit-animation:opacity-60-25-8-12 1.25s linear infinite;animation:opacity-60-25-8-12 1.25s linear infinite}.weui_loading_leaf_8:before{-webkit-transform:rotate(240deg) translate(7.92px,0);-ms-transform:rotate(240deg) translate(7.92px,0);transform:rotate(240deg) translate(7.92px,0)}.weui_loading_leaf_9{-webkit-animation:opacity-60-25-9-12 1.25s linear infinite;animation:opacity-60-25-9-12 1.25s linear infinite}.weui_loading_leaf_9:before{-webkit-transform:rotate(270deg) translate(7.92px,0);-ms-transform:rotate(270deg) translate(7.92px,0);transform:rotate(270deg) translate(7.92px,0)}.weui_loading_leaf_10{-webkit-animation:opacity-60-25-10-12 1.25s linear infinite;animation:opacity-60-25-10-12 1.25s linear infinite}.weui_loading_leaf_10:before{-webkit-transform:rotate(300deg) translate(7.92px,0);-ms-transform:rotate(300deg) translate(7.92px,0);transform:rotate(300deg) translate(7.92px,0)}.weui_loading_leaf_11{-webkit-animation:opacity-60-25-11-12 1.25s linear infinite;animation:opacity-60-25-11-12 1.25s linear infinite}.weui_loading_leaf_11:before{-webkit-transform:rotate(330deg) translate(7.92px,0);-ms-transform:rotate(330deg) translate(7.92px,0);transform:rotate(330deg) translate(7.92px,0)}@-webkit-keyframes opacity-60-25-0-12{0%,0.01%{opacity:.25}0.02%{opacity:1}100%,60.01%{opacity:.25}}@-webkit-keyframes opacity-60-25-1-12{0%,8.34333%{opacity:.25}8.35333%{opacity:1}100%,68.3433%{opacity:.25}}@-webkit-keyframes opacity-60-25-2-12{0%,16.6767%{opacity:.25}16.6867%{opacity:1}100%,76.6767%{opacity:.25}}@-webkit-keyframes opacity-60-25-3-12{0%,25.01%{opacity:.25}25.02%{opacity:1}100%,85.01%{opacity:.25}}@-webkit-keyframes opacity-60-25-4-12{0%,33.3433%{opacity:.25}33.3533%{opacity:1}100%,93.3433%{opacity:.25}}@-webkit-keyframes opacity-60-25-5-12{0%{opacity:.270958333333333}41.6767%{opacity:.25}41.6867%{opacity:1}1.67667%{opacity:.25}100%{opacity:.270958333333333}}@-webkit-keyframes opacity-60-25-6-12{0%{opacity:.375125}50.01%{opacity:.25}50.02%{opacity:1}10.01%{opacity:.25}100%{opacity:.375125}}@-webkit-keyframes opacity-60-25-7-12{0%{opacity:.479291666666667}58.3433%{opacity:.25}58.3533%{opacity:1}18.3433%{opacity:.25}100%{opacity:.479291666666667}}@-webkit-keyframes opacity-60-25-8-12{0%{opacity:.583458333333333}66.6767%{opacity:.25}66.6867%{opacity:1}26.6767%{opacity:.25}100%{opacity:.583458333333333}}@-webkit-keyframes opacity-60-25-9-12{0%{opacity:.687625}75.01%{opacity:.25}75.02%{opacity:1}35.01%{opacity:.25}100%{opacity:.687625}}@-webkit-keyframes opacity-60-25-10-12{0%{opacity:.791791666666667}83.3433%{opacity:.25}83.3533%{opacity:1}43.3433%{opacity:.25}100%{opacity:.791791666666667}}@-webkit-keyframes opacity-60-25-11-12{0%{opacity:.895958333333333}91.6767%{opacity:.25}91.6867%{opacity:1}51.6767%{opacity:.25}100%{opacity:.895958333333333}}.weui_mask{background:rgba(0,0,0,.6)}.weui_mask_transition{display:none;background:0 0;-webkit-transition:background .3s;transition:background .3s}.weui_fade_toggle{background:rgba(0,0,0,.6)}.weui_actionsheet{position:fixed;left:0;bottom:0;-webkit-transform:translate(0,100%);-ms-transform:translate(0,100%);transform:translate(0,100%);-webkit-backface-visibility:hidden;backface-visibility:hidden;z-index:2;width:100%;background-color:#EFEFF4;-webkit-transition:-webkit-transform .3s;transition:transform .3s}.weui_actionsheet_menu{background-color:#FFF}.weui_actionsheet_action{margin-top:6px;background-color:#FFF}.weui_actionsheet_cell{position:relative;padding:10px 0;text-align:center;font-size:18px}.weui_actionsheet_cell:before{content:" ";position:absolute;left:0;top:0;width:100%;height:1px;border-top:1px solid #D9D9D9;color:#D9D9D9;-webkit-transform-origin:0 0;-ms-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleY(.5);-ms-transform:scaleY(.5);transform:scaleY(.5)}.weui_actionsheet_cell:active{background-color:#ECECEC}.weui_actionsheet_cell:first-child:before{display:none}.weui_actionsheet_toggle{-webkit-transform:translate(0,0);-ms-transform:translate(0,0);transform:translate(0,0)} \ No newline at end of file From c2166811eb588fd038e36f6c19e48378d0198825 Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Fri, 8 Jul 2016 17:35:14 +0800 Subject: [PATCH 65/87] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E7=95=8C=E9=9D=A2=E5=88=B7=E6=96=B0=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/mobile/apis/syllabuses.rb | 2 +- .../wechat/controllers/edit_class.js | 19 +++++++++++++------ 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/app/api/mobile/apis/syllabuses.rb b/app/api/mobile/apis/syllabuses.rb index 682929a90..57db4cb9e 100644 --- a/app/api/mobile/apis/syllabuses.rb +++ b/app/api/mobile/apis/syllabuses.rb @@ -28,7 +28,7 @@ module Mobile ss = SyllabusesService.new sy = ::Syllabus.find(params[:id]) - + sy.courses = sy.courses.not_deleted sy = ss.judge_can_setting(sy,current_user) present :data, sy, with: Mobile::Entities::Syllabus diff --git a/public/javascripts/wechat/controllers/edit_class.js b/public/javascripts/wechat/controllers/edit_class.js index 2e802ccd3..5f377e594 100644 --- a/public/javascripts/wechat/controllers/edit_class.js +++ b/public/javascripts/wechat/controllers/edit_class.js @@ -10,18 +10,25 @@ app.controller('EditClassController', ['$scope', '$http', 'auth', 'config', 'ale $http.get(config.apiUrl+"syllabuses/"+syllabus_id+"?token="+auth.token()).then(function(response){ console.log(response.data); vm.syllabus = response.data.data; + if (vm.syllabus) { + for (var i in vm.syllabus.courses) { + var course = vm.syllabus.courses[i]; + course.tmpname = course.name; + } + vm.syllabus.tmptitle = vm.syllabus.title; + } }); } console.log(vm.syllabus); //名字用两份 - for(var i in vm.syllabus.courses){ - var course = vm.syllabus.courses[i]; - course.tmpname = course.name; + if (vm.syllabus) { + for (var i in vm.syllabus.courses) { + var course = vm.syllabus.courses[i]; + course.tmpname = course.name; + } + vm.syllabus.tmptitle = vm.syllabus.title; } - vm.syllabus.tmptitle = vm.syllabus.title; - - //单弹框 vm.alertService_1 = alertService.create(); From f1f61c304a0feb741f58bd6aca7169092efa3055 Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Fri, 8 Jul 2016 18:08:31 +0800 Subject: [PATCH 66/87] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=98=BE=E7=A4=BA=E6=9C=89=E8=AF=AF=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/syllabuses_service.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/services/syllabuses_service.rb b/app/services/syllabuses_service.rb index 7bcc84e5b..b28b01412 100644 --- a/app/services/syllabuses_service.rb +++ b/app/services/syllabuses_service.rb @@ -47,6 +47,7 @@ class SyllabusesService syllabus_ids = courses.empty? ? '(-1)' : "(" + courses.map{|course| !course.syllabus_id.nil? && course.syllabus_id}.join(",") + ")" syllabuses = Syllabus.where("id in #{syllabus_ids} or user_id = #{user.id}").order("updated_at desc") + user.syllabuses = syllabuses user.syllabuses.each do |syllabus| syllabus.courses = syllabus.courses.not_deleted end From 1df13682141fad908c3264c65b48a0e4859f8931 Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Fri, 8 Jul 2016 18:12:22 +0800 Subject: [PATCH 67/87] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E5=90=8D=E4=BF=AE=E6=94=B9=E6=97=A0=E6=95=88=E7=9A=84BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/syllabuses_service.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/services/syllabuses_service.rb b/app/services/syllabuses_service.rb index e4feb4ad1..b44e6e126 100644 --- a/app/services/syllabuses_service.rb +++ b/app/services/syllabuses_service.rb @@ -112,7 +112,7 @@ class SyllabusesService syllabus_title = option[:title] sy.title = syllabus_title - + sy.save! #修改班级名称 modify_courses = option[:modify_courses] modify_courses.each do |c| From 3362ebe321a3fe4efee2a638fef194448abe536d Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 8 Jul 2016 18:22:59 +0800 Subject: [PATCH 68/87] =?UTF-8?q?=E7=BA=BF=E4=B8=8B=E4=BD=9C=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/homework_common_controller.rb | 26 +++++++++++++------ app/controllers/users_controller.rb | 11 +++++++- app/helpers/application_helper.rb | 2 +- .../_programing_work_show.html.erb | 2 +- app/views/users/_course_homework.html.erb | 12 ++++++--- .../users/_user_homework_detail.html.erb | 11 +++++--- 6 files changed, 47 insertions(+), 17 deletions(-) diff --git a/app/controllers/homework_common_controller.rb b/app/controllers/homework_common_controller.rb index 5e67f6f26..6724f42bb 100644 --- a/app/controllers/homework_common_controller.rb +++ b/app/controllers/homework_common_controller.rb @@ -27,6 +27,7 @@ class HomeworkCommonController < ApplicationController #@homeworks = @course.homework_commons.where("publish_time <= '#{Date.today}'").order("created_at desc").limit(10).offset(@page * 10) @homework_commons = @course.homework_commons.where("name like '%#{search}%' and publish_time <= '#{Date.today}'").order("created_at desc") end + #update_homework_time @homework_commons @is_student = User.current.logged? && (User.current.admin? || (User.current.member_of_course?(@course) && !@is_teacher)) @is_new = params[:is_new] @@ -409,8 +410,8 @@ class HomeworkCommonController < ApplicationController def update_homework_time homeworks unless homeworks.nil? homeworks.each do |h| - if h.homework_type == 3 - student_works = h.student_work_projects.where("is_leader = 1") + if h.homework_type == 3 && h.homework_detail_group.base_on_project == 1 + student_works = h.student_work_projects.where("is_leader = 1 && project_id != -1") time = h.updated_at unless student_works.nil? student_works.each do |s| @@ -418,7 +419,7 @@ class HomeworkCommonController < ApplicationController unless project.nil? && project.gpid.nil? project_time=project.updated_on project_time=ForgeActivity.where("project_id=?",project.id).last.updated_at if ForgeActivity.where("project_id=?",project.id).last - if format_time(time) < format_time(project_time) + if time.strftime('%Y-%m-%d %H:%M:%S') < project_time.strftime('%Y-%m-%d %H:%M:%S') time = project_time end begin @@ -428,21 +429,30 @@ class HomeworkCommonController < ApplicationController changesets = g.commits(project.gpid, :ref_name => default_branch) changesets_latest_coimmit = changesets[0] unless changesets[0].blank? - if format_time(time) < format_time(changesets_latest_coimmit.created_at) + if time.strftime('%Y-%m-%d %H:%M:%S') update homework project time") end end end end - puts h.updated_at - puts time s_time = time - if format_time(time) > format_time(h.updated_at) + if time.strftime('%Y-%m-%d %H:%M:%S') > h.updated_at.strftime('%Y-%m-%d %H:%M:%S') h.update_column('updated_at', s_time) + course_activity = CourseActivity.where("course_act_type=? and course_act_id =?", 'HomeworkCommon', h.id).first + if course_activity && (time.strftime('%Y-%m-%d %H:%M:%S') > course_activity.updated_at.strftime('%Y-%m-%d %H:%M:%S')) + course_activity.update_column('updated_at', s_time) + end + user_activity = UserActivity.where("act_type=? and act_id =?", 'HomeworkCommon', h.id).first + if user_activity && (time.strftime('%Y-%m-%d %H:%M:%S') > user_activity.updated_at.strftime('%Y-%m-%d %H:%M:%S')) + user_activity.update_column('updated_at', s_time) + end + org_activity = OrgActivity.where("org_act_type=? and org_act_id =?", 'HomeworkCommon', h.id).first + if org_activity && (time.strftime('%Y-%m-%d %H:%M:%S') > org_activity.updated_at.strftime('%Y-%m-%d %H:%M:%S')) + org_activity.update_column('updated_at', s_time) + end end end end diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 44344f1b5..5fe7efc51 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -1048,9 +1048,18 @@ class UsersController < ApplicationController if homework.homework_type != 3 unless homework.course.nil? name = homework.name + name_str = name + "的作品提交" + str = "" homework.course.student.each do |student| - StudentWork.create(:name => "#{name}的作品提交", :homework_common_id => homework.id, :user_id => student.student_id) + if str != "" + str += "," + end + str += "('#{name_str}',#{homework.id},#{student.student_id}, '#{format_time(Time.now)}', '#{format_time(Time.now)}')" end + #('#{name}的作品提交',#{homework.id},#{student.student_id}, '#{format_time(Time.now)}', '#{format_time(Time.now)}') + sql = "insert into student_works (name, homework_common_id,user_id, created_at, updated_at) values" + str + #StudentWork.create(:name => "#{name}的作品提交", :homework_common_id => homework.id, :user_id => student.student_id) + ActiveRecord::Base.connection.execute sql end end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 3cbafac9c..4ebb8eb80 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -2681,8 +2681,8 @@ module ApplicationHelper #根据传入作业确定显示为编辑作品还是新建作品,或者显示作品数量 def user_for_homework_common homework,is_teacher + count = homework.student_works.has_committed.count if User.current.member_of_course?(homework.course) - count = homework.student_works.has_committed.count if is_teacher #老师显示作品数量 link_to "作品(#{count})", student_work_index_url_in_org(homework.id), :class => "c_blue" else #学生显示提交作品、修改作品等按钮 diff --git a/app/views/student_work/_programing_work_show.html.erb b/app/views/student_work/_programing_work_show.html.erb index c4df9e715..c111fbe48 100644 --- a/app/views/student_work/_programing_work_show.html.erb +++ b/app/views/student_work/_programing_work_show.html.erb @@ -26,7 +26,7 @@
  • 编程代码: -
    +
    diff --git a/app/views/users/_course_homework.html.erb b/app/views/users/_course_homework.html.erb index d6fa4eff7..783193e46 100644 --- a/app/views/users/_course_homework.html.erb +++ b/app/views/users/_course_homework.html.erb @@ -195,8 +195,13 @@ <% sort_projects = project_sort_update projects %>
    - <% first_pro = project_sort_first(projects).first %> - # <%=time_from_now first_pro.updated_at %><%= link_to User.find(first_pro.user_id).show_name, user_activities_path(first_pro.user_id), :class => "newsBlue ml5 mr5"%>更新了项目,最近更新: + <%# first_pro = sort_projects.first %> + <% first_pro = Project.find sort_projects.first.project_id %> + <% commit_time = first_pro.project_score.commit_time %> + <% one_time = first_pro.updated_on %> + <% one_forge_time=ForgeActivity.where("project_id=?",first_pro.id).last.updated_at if ForgeActivity.where("project_id=?",first_pro.id).last %> + <% one_time= one_time > one_forge_time ? one_time : one_forge_time %> + # <%=time_from_now !commit_time.nil? && format_time(commit_time) > format_time(one_time) ? commit_time : one_time %><%= link_to User.find(first_pro.user_id).show_name, user_activities_path(first_pro.user_id), :class => "newsBlue ml5 mr5"%>更新了项目,最近更新:
    <% sort_projects.each_with_index do |pro, i| %> @@ -219,7 +224,8 @@ <% end %> <% com_time = project.project_score.commit_time %> <% time=project.updated_on %> - <% time=ForgeActivity.where("project_id=?",project.id).last.updated_at if ForgeActivity.where("project_id=?",project.id).last %> + <% forge_time=ForgeActivity.where("project_id=?",project.id).last.updated_at if ForgeActivity.where("project_id=?",project.id).last %> + <% time= time > forge_time ? time : forge_time %>

    <%=(User.find project.user_id).show_name %>(组长)

    <%=time_from_now !com_time.nil? && format_time(com_time) > format_time(time) ? com_time : time %>  <%= project.project_score.changeset_num %>提交

    diff --git a/app/views/users/_user_homework_detail.html.erb b/app/views/users/_user_homework_detail.html.erb index 986371be3..4c8e17d5d 100644 --- a/app/views/users/_user_homework_detail.html.erb +++ b/app/views/users/_user_homework_detail.html.erb @@ -206,8 +206,12 @@ <% sort_projects = project_sort_update projects %>
    - <% first_pro = project_sort_first(projects).first %> - # <%=time_from_now first_pro.updated_at %><%= link_to User.find(first_pro.user_id).show_name, user_activities_path(first_pro.user_id), :class => "newsBlue ml5 mr5"%>更新了项目,最近更新: + <% first_pro = Project.find sort_projects.first.project_id %> + <% commit_time = first_pro.project_score.commit_time %> + <% one_time = first_pro.updated_on %> + <% one_forge_time=ForgeActivity.where("project_id=?",first_pro.id).last.updated_at if ForgeActivity.where("project_id=?",first_pro.id).last %> + <% one_time= one_time > one_forge_time ? one_time : one_forge_time %> + # <%=time_from_now !commit_time.nil? && format_time(commit_time) > format_time(one_time) ? commit_time : one_time %><%= link_to User.find(first_pro.user_id).show_name, user_activities_path(first_pro.user_id), :class => "newsBlue ml5 mr5"%>更新了项目,最近更新:
    <% sort_projects.each_with_index do |pro, i| %> @@ -230,7 +234,8 @@ <% end %> <% com_time = project.project_score.commit_time %> <% time=project.updated_on %> - <% time=ForgeActivity.where("project_id=?",project.id).last.updated_at if ForgeActivity.where("project_id=?",project.id).last %> + <% forge_time=ForgeActivity.where("project_id=?",project.id).last.updated_at if ForgeActivity.where("project_id=?",project.id).last %> + <% time= time > forge_time ? time : forge_time %>

    <%=(User.find project.user_id).show_name %>(组长)

    <%=time_from_now !com_time.nil? && format_time(com_time) > format_time(time) ? com_time : time %>  <%= project.project_score.changeset_num %>提交

    From 189e641d23a896d32f56c80642cbfb12c6808f8e Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Fri, 8 Jul 2016 18:32:30 +0800 Subject: [PATCH 69/87] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E6=94=B9=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/syllabuses_service.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/services/syllabuses_service.rb b/app/services/syllabuses_service.rb index b44e6e126..d0bf816ec 100644 --- a/app/services/syllabuses_service.rb +++ b/app/services/syllabuses_service.rb @@ -47,8 +47,7 @@ class SyllabusesService syllabus_ids = courses.empty? ? '(-1)' : "(" + courses.map{|course| !course.syllabus_id.nil? && course.syllabus_id}.join(",") + ")" syllabuses = Syllabus.where("id in #{syllabus_ids} or user_id = #{user.id}").order("updated_at desc") - user.syllabuses = syllabuses - user.syllabuses.each do |syllabus| + syllabuses.each do |syllabus| syllabus.courses = syllabus.courses.not_deleted end From 5ccde8e4338bc2882894b7f39a51f279d6725ffb Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Fri, 8 Jul 2016 18:52:21 +0800 Subject: [PATCH 70/87] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=98=BE=E7=A4=BA=E4=B8=8D=E5=AF=B9=E7=9A=84?= =?UTF-8?q?BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/syllabuses_service.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/services/syllabuses_service.rb b/app/services/syllabuses_service.rb index d0bf816ec..b3190182c 100644 --- a/app/services/syllabuses_service.rb +++ b/app/services/syllabuses_service.rb @@ -48,7 +48,7 @@ class SyllabusesService syllabuses = Syllabus.where("id in #{syllabus_ids} or user_id = #{user.id}").order("updated_at desc") syllabuses.each do |syllabus| - syllabus.courses = syllabus.courses.not_deleted + syllabus.courses = courses.where("syllabus_id = #{syllabus.id}").select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS updatetime").order("time desc") end syllabuses.to_a << other From f8eb150530afac82ffe54396920a93060f6fc354 Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Fri, 8 Jul 2016 19:12:26 +0800 Subject: [PATCH 71/87] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=8F=AD=E7=BA=A7?= =?UTF-8?q?=E4=B8=8D=E5=AE=8C=E6=88=90=E7=82=B9=E8=BF=94=E5=9B=9E=E7=8F=AD?= =?UTF-8?q?=E7=BA=A7=E4=BC=9A=E5=87=BA=E7=8E=B0=E5=86=8D=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E7=9A=84BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/assets/wechat/class_list.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/assets/wechat/class_list.html b/public/assets/wechat/class_list.html index c1e1a2123..b215db763 100644 --- a/public/assets/wechat/class_list.html +++ b/public/assets/wechat/class_list.html @@ -5,7 +5,7 @@
    {{syllabus.title}}
      -
    • +
    • > From d25f401aface7f3bb47f3a16e71e58909a9b14b3 Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 8 Jul 2016 19:16:53 +0800 Subject: [PATCH 72/87] =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=91=98=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=E4=BF=AE=E6=94=B9=E7=8F=AD=E7=BA=A7=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/admin/_rename_course_name.html.erb | 3 +++ app/views/admin/syllabuses.html.erb | 6 ++---- app/views/admin/update_course_name.js.erb | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) create mode 100644 app/views/admin/_rename_course_name.html.erb diff --git a/app/views/admin/_rename_course_name.html.erb b/app/views/admin/_rename_course_name.html.erb new file mode 100644 index 000000000..8cc061c76 --- /dev/null +++ b/app/views/admin/_rename_course_name.html.erb @@ -0,0 +1,3 @@ + + <%= course.name %> + \ No newline at end of file diff --git a/app/views/admin/syllabuses.html.erb b/app/views/admin/syllabuses.html.erb index 1066ac3ef..782f6b01c 100644 --- a/app/views/admin/syllabuses.html.erb +++ b/app/views/admin/syllabuses.html.erb @@ -68,10 +68,8 @@ - - - <%= course.name%> - + + <%= render :partial => 'admin/rename_course_name', :locals => {:course => course} %> <%= link_to(course.try(:teacher).try(:realname).truncate(6, omission: '...'), user_path(course.teacher)) %> diff --git a/app/views/admin/update_course_name.js.erb b/app/views/admin/update_course_name.js.erb index 2da524b5b..45c0cb99d 100644 --- a/app/views/admin/update_course_name.js.erb +++ b/app/views/admin/update_course_name.js.erb @@ -1 +1 @@ -$("#rename_course_name_<%=@course.id %>").html("<%=@course.name %>"); \ No newline at end of file +$("#syllabus_course_name_<%=@course.id %>").html("<%=escape_javascript(render :partial => 'admin/rename_course_name', :locals => {:course => @course}) %>"); From 1a15c0f56707da7fcaf9e991af98189495abd713 Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 8 Jul 2016 19:25:26 +0800 Subject: [PATCH 73/87] =?UTF-8?q?=E6=96=B0=E5=BB=BA=E7=8F=AD=E7=BA=A7?= =?UTF-8?q?=E5=8F=91=E5=B8=83=E4=BD=9C=E4=B8=9A=E6=8A=A5500?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .access_token | 2 +- app/controllers/users_controller.rb | 5 +++-- app/helpers/application_helper.rb | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.access_token b/.access_token index 610b08d2e..2e228963c 100644 --- a/.access_token +++ b/.access_token @@ -1 +1 @@ -{"access_token":"oEEf8ZKAB8Y2G0o_xnTPkPJHKKk8iHkLC-f5ptvQ2nCMj9IpC86ivLD2-p38GfOkuG-HuQp3pWZqhs3NJXUMdPLWsr5k67hPZYuqg4ozLccx0xdLswapj0mn8ovZhK1tKIKiAFAOMO","expires_in":7200,"got_token_at":1467012449} \ No newline at end of file +{"access_token":"b_Pc60Dd5eyg_ut3cHbsjQO9EJJdj2Qj5F99o9LH9ltKSme7_FZ3Of22lWLL-K2V0siWzv-bd9PO0Dn-L1PBvIy9LhXa0qPVaFl6vTtZHR2kA8qjo1ps2ancya0t7KmzURGbAFAAXM","expires_in":7200,"got_token_at":1467976842} \ No newline at end of file diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 5fe7efc51..6bca5753e 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -1046,11 +1046,12 @@ class UsersController < ApplicationController homework_detail_group.save if homework_detail_group if homework.homework_type != 3 - unless homework.course.nil? + students = homework.course.student + if !homework.course.nil? && !students.empty? name = homework.name name_str = name + "的作品提交" str = "" - homework.course.student.each do |student| + students.each do |student| if str != "" str += "," end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 4ebb8eb80..23fd401fd 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -3282,7 +3282,7 @@ end def strip_html(text,len=0,endss="...") ss = "" - if text.length>0 + if !text.nil? && text.length>0 ss=text.gsub(/<\/?.*?>/, '').strip ss = ss.gsub(/ /, ' ') From 6b8b20e12778b09de2c9c90790a7829c771f9f27 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 8 Jul 2016 19:45:15 +0800 Subject: [PATCH 74/87] logger to puts --- lib/tasks/update_homework.rake | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/tasks/update_homework.rake b/lib/tasks/update_homework.rake index c98d6d7b0..3592fe985 100644 --- a/lib/tasks/update_homework.rake +++ b/lib/tasks/update_homework.rake @@ -39,23 +39,23 @@ namespace :update_homework do end end s_time = time - logger.info("latest time is =========================> #{time}") + puts "latest time is =========================> #{time}" if time.strftime('%Y-%m-%d %H:%M:%S') > h.updated_at.strftime('%Y-%m-%d %H:%M:%S') h.update_column('updated_at', s_time) course_activity = CourseActivity.where("course_act_type=? and course_act_id =?", 'HomeworkCommon', h.id).first if course_activity && (time.strftime('%Y-%m-%d %H:%M:%S') > course_activity.updated_at.strftime('%Y-%m-%d %H:%M:%S')) course_activity.update_column('updated_at', s_time) - logger.info("course_activity time is =========================> #{course_activity}") + puts "user_activity time is =========================> #{course_activity}" end user_activity = UserActivity.where("act_type=? and act_id =?", 'HomeworkCommon', h.id).first if user_activity && (time.strftime('%Y-%m-%d %H:%M:%S') > user_activity.updated_at.strftime('%Y-%m-%d %H:%M:%S')) user_activity.update_column('updated_at', s_time) - logger.info("user_activity time is =========================> #{user_activity}") + puts "user_activity time is =========================> #{user_activity}" end org_activity = OrgActivity.where("org_act_type=? and org_act_id =?", 'HomeworkCommon', h.id).first if org_activity && (time.strftime('%Y-%m-%d %H:%M:%S') > org_activity.updated_at.strftime('%Y-%m-%d %H:%M:%S')) org_activity.update_column('updated_at', s_time) - logger.info("org_activity time is =========================> #{s_time}") + puts "org_activity time is =========================> #{org_activity}" end end end From 2604f3f0c7d20a5ef6cf95e834e5f29feb17c43d Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Fri, 8 Jul 2016 19:59:10 +0800 Subject: [PATCH 75/87] =?UTF-8?q?=E8=B5=84=E6=BA=90=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E4=B8=AD=E5=8F=AA=E5=8C=B9=E9=85=8Dname?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/assets/wechat/myresource.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/public/assets/wechat/myresource.html b/public/assets/wechat/myresource.html index 068c503ce..de21b7136 100644 --- a/public/assets/wechat/myresource.html +++ b/public/assets/wechat/myresource.html @@ -11,17 +11,17 @@
    -
    {{r.filename}}发送
    +
    {{r.filename}}发送

    暂无课件,
    请登录Trustie网站,在PC浏览器中上传课件。

    -
    {{r.homework_name}}
    +
    {{r.homework_name}}

    暂无作业,
    请登录Trustie网站,在PC浏览器中创建作业。

    -
    {{r.exercise_name}}
    +
    {{r.exercise_name}}

    暂无测验,
    请登录Trustie网站,在PC浏览器中创建测验。

    From 135b6ca64b2cfcc1cdaca937d1b8eae4fe3a697c Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Fri, 8 Jul 2016 20:04:24 +0800 Subject: [PATCH 76/87] assets --- app/views/wechats/user_activities.html.erb | 50 +++++++++++----------- public/javascripts/wechat/build/app.min.js | 8 ++-- 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/app/views/wechats/user_activities.html.erb b/app/views/wechats/user_activities.html.erb index dfb6e125e..bb7d96d50 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/build/app.min.js b/public/javascripts/wechat/build/app.min.js index bec28a587..7f9e91eb0 100644 --- a/public/javascripts/wechat/build/app.min.js +++ b/public/javascripts/wechat/build/app.min.js @@ -4,19 +4,19 @@ app.filter("safeHtml",["$sce",function(t){return function(n){return t.trustAsHtm app.controller("ActivityController",["$anchorScroll","$location","$scope","$http","$timeout","auth","rms","common","alertService",function(e,a,t,c,o,i,r,s,n){t.replaceUrl=function(e){return e},t.menus=["所有动态","课程动态","项目动态"],t.alertService=n.create(),console.log("ActivityController load"),t.page=r.get("page")||0,t.activities=r.get("activities")||[],t.has_more=r.get("has_more"),t.course_page=r.get("course_page")||0,t.course_activities=r.get("course_activities")||[],t.course_has_more=r.get("course_has_more"),t.project_page=r.get("project_page")||0,t.project_activities=r.get("project_activities")||[],t.project_has_more=r.get("project_has_more"),t.loadActData=function(e,a){switch(container_type="All",e){case 1:container_type="All",t.page=a;break;case 2:container_type="Course",t.course_page=a;break;case 3:container_type="Project",t.project_page=a}c({method:"POST",url:apiUrl+"activities",data:{token:i.token(),page:a,container_type:container_type}}).then(function(e){if(e.data.page>0)switch(e.data.container_type){case"All":t.activities=t.activities.concat(e.data.data);break;case"Course":t.course_activities=t.course_activities.concat(e.data.data);break;case"Project":t.project_activities=t.project_activities.concat(e.data.data);break;case 3:}else switch(e.data.container_type){case"All":t.activities=e.data.data;break;case"Course":t.course_activities=e.data.data;break;case"Project":t.project_activities=e.data.data;break;case 3:}switch(e.data.container_type){case"All":r.save("activities",t.activities),t.has_more=e.data.count+10*e.data.page0?c.alertService_2.showMessage("提示","您确定要删除该班级吗?",function(){e.post(o.apiUrl+"courses/"+t.id+"/del",{token:a.token()}).then(function(e){0!=e.data.status?c.alertService_1.showMessage("出错了",e.data.message):c.alertService_1.showMessage("提示","删除班级成功",function(){c.syllabus.courses.splice(s,1)}),console.log(e.data.data)})}):c.syllabus.courses.splice(s,1)},c.newClass=function(s,t){if(s.$setSubmitted(),console.log(t),!s.$valid)return void console.log(s.$error);var l=[];for(var r in c.syllabus.courses){var n=c.syllabus.courses[r];n.id>0&&l.push(n.name)}e.post(o.apiUrl+"syllabuses",{token:a.token(),id:u,courses:l}).then(function(s){0!=s.data.status?c.alertService_1.showMessage("出错了",s.data.message):c.alertService_1.showMessage("提示","保存课程成功",function(){window.history.back()}),console.log(s.data.data)})}}]); +app.controller("EditClassController",["$scope","$http","auth","config","alertService","$location","$routeParams","rms",function(s,e,a,l,t,o,r,u){var n=s;n.syllabus=u.get("current_edit_syllobus");var i=r.id;if(n.syllabus||e.get(l.apiUrl+"syllabuses/"+i+"?token="+a.token()).then(function(s){if(console.log(s.data),n.syllabus=s.data.data,n.syllabus){for(var e in n.syllabus.courses){var a=n.syllabus.courses[e];a.tmpname=a.name}n.syllabus.tmptitle=n.syllabus.title}}),console.log(n.syllabus),n.syllabus){for(var c in n.syllabus.courses){var d=n.syllabus.courses[c];d.tmpname=d.name}n.syllabus.tmptitle=n.syllabus.title}n.alertService_1=t.create(),n.alertService_2=t.create(),n.addClass=function(){n.syllabus.courses.push({can_setting:!0})},n.deleteClass=function(s){var t=n.syllabus.courses[s];t.id>0?n.alertService_2.showMessage("提示","您确定要删除该班级吗?",function(){e.post(l.apiUrl+"courses/"+t.id+"/del",{token:a.token()}).then(function(e){0!=e.data.status?n.alertService_1.showMessage("出错了",e.data.message):n.alertService_1.showMessage("提示","删除班级成功",function(){n.syllabus.courses.splice(s,1)}),console.log(e.data.data)})}):n.syllabus.courses.splice(s,1)},n.newClass=function(s,t){if(s.$setSubmitted(),console.log(t),!s.$valid)return void console.log(s.$error);var r=[],c=[];for(var d in n.syllabus.courses){var b=n.syllabus.courses[d];b.id?b.tmpname!=b.name&&c.push({id:b.id,name:b.tmpname}):r.push(b.tmpname)}e.post(l.apiUrl+"syllabuses/"+i+"/edit",{token:a.token(),id:i,title:n.syllabus.tmptitle,add_courses:r,modify_courses:c}).then(function(s){0!=s.data.status?n.alertService_1.showMessage("出错了",s.data.message):n.alertService_1.showMessage("提示","保存课程成功",function(){u.save("syllabuses",[]),o.path("/class_list")}),console.log(s.data.data)})}}]); app.controller("HomeworkController",["$scope","$http","$routeParams","auth","common",function(o,e,l,n,r){r.init({id:l.id,scope:o,type:"whomeworks",replyType:"HomeworkCommon",loadCallback:function(e){console.log(e),o.homework=e.data},replyCallback:function(){}})}]); app.controller("InviteCodeController",["$scope","$http","$routeParams","config","auth",function(t,e,i,n,o){var a=t;a.course={};var c=i.id;e.get(n.apiUrl+"courses/"+c+"?token="+o.token()).then(function(t){console.log(t.data),a.course=t.data.data}),a.share=function(){window.WeixinJSBridge.invoke("sendAppMessage",{appid:"wxf694495398c7d470",type:"link",data_url:"",img_url:"http://pnewsapp.tc.qq.com/newsapp_bt/0/9963967/640",img_height:370,img_width:550,link:"http://view.inews.qq.com/a/WXN2013101101385701",desc:"desc",title:"title"},function(t){})}}]); app.controller("IssueController",["$scope","$http","$routeParams","auth","common",function(o,e,l,s,t){t.init({id:l.id,scope:o,type:"issues",replyType:"Issue",loadCallback:function(e){console.log(e),o.issue=e.data},replyCallback:function(){}})}]); app.controller("JournalsController",["$scope","$http","$routeParams","auth","common",function(o,a,e,l,n){n.init({id:e.id,scope:o,type:"journal_for_messages",replyType:"JournalsForMessage",loadCallback:function(a){o.message=a.data},replyCallback:function(){}})}]); app.controller("LoginController",["$scope","$http","$location","$routeParams","alertService","config","auth","session",function(e,o,t,a,i,n,s,l){s.get_bind().then(function(){t.path("/activities")}),a.code&&l.save("code",a.code);var r=e;r.loginFailed=!1,r.alertService=i.create(),r.findPwdDialog=i.create(),r.login=function(a,i){return a.$setSubmitted(),console.log(i),a.$valid?(console.log(apiUrl+"auth"),void o.post(n.apiUrl+"users/wxbind",{login:i.login,password:i.password}).then(function(o){console.log(o.data),r.loginFailed=0!=o.data.status,e.loginFailed?r.alertService.showMessage("出错了",o.data.message):r.alertService.showMessage("提示",o.data.message,function(){t.path("/activities")})})["catch"](function(e){r.alertService.showMessage("出错了",e)})):void console.log(a.$error)},r.showBox=function(){r.findPwdDialog.showMessage("提示","请访问www.trustie.net获取密码,谢谢!")},r.goReg=function(){t.path("/reg")}}]); -app.controller("MyResourceController",["$scope","$http","auth","config","$location",function(e,o,t,n,r){var s=e;s.menus=["课件","作业","测验"],s.resources=null,s.homeworks=null,s.exercise=null,s.tab=function(e){s.currentTab=e,1==e&&(!s.resources||s.resources.length<=0)?o.get(n.apiUrl+"resources?token="+t.token()).then(function(e){console.log(e.data),s.resources=e.data.data}):2==e&&(!s.homeworks||s.homeworks.length<=0)?o.get(n.apiUrl+"resources/homeworks?token="+t.token()).then(function(e){console.log(e.data),s.homeworks=e.data.data}):3==e&&(!s.exercise||s.exercise.length<=0)&&o.get(n.apiUrl+"resources/exercies?token="+t.token()).then(function(e){console.log(e.data),s.exercise=e.data.data})},s.tab(1),s.sendFile=function(e){r.path("/send_class_list").search({id:e.id})}}]); +app.controller("MyResourceController",["$scope","$http","auth","config","$location",function(e,o,t,n,r){var s=e;s.menus=["课件","作业","测验"],s.resources=null,s.homeworks=null,s.exercise=null,s.searchText="",s.tab=function(e){s.currentTab=e,s.searchText="",1==e&&(!s.resources||s.resources.length<=0)?o.get(n.apiUrl+"resources?token="+t.token()).then(function(e){console.log(e.data),s.resources=e.data.data}):2==e&&(!s.homeworks||s.homeworks.length<=0)?o.get(n.apiUrl+"resources/homeworks?token="+t.token()).then(function(e){console.log(e.data),s.homeworks=e.data.data}):3==e&&(!s.exercise||s.exercise.length<=0)&&o.get(n.apiUrl+"resources/exercies?token="+t.token()).then(function(e){console.log(e.data),s.exercise=e.data.data})},s.tab(1),s.sendFile=function(e){r.path("/send_class_list").search({id:e.id})}}]); app.controller("NewClassController",["$scope","$http","auth","config","alertService","$location",function(s,e,a,o,l,t){var r=s;r.alertService=l.create(),r.syllabus={courses:[{name:""}]},r.addClass=function(){r.syllabus.courses.push({})},r.deleteClass=function(s){r.syllabus.courses.splice(s,1)},r.newClass=function(s,l){if(s.$setSubmitted(),console.log(l),!s.$valid)return void console.log(s.$error);var t=[];for(var n in r.syllabus.courses)t.push(r.syllabus.courses[n].name);e.post(o.apiUrl+"syllabuses",{token:a.token(),title:l.title,courses:t}).then(function(s){0!=s.data.status?r.alertService.showMessage("出错了",s.data.message):r.alertService.showMessage("提示","新建课程成功",function(){window.history.back()}),console.log(s.data.data)})}}]); app.controller("RegController",["$scope","$http","$location","alertService","$location",function(e,o,a,s,a){var t=e;t.errDialog=s.create(),t.successDialog=s.create(),t.goLogin=function(){a.path("/login")},t.isagreed=!0,t.agreed=function(e){t.isagreed=!e},t.reg=function(e,s){return e.$setSubmitted(),console.log(e),e.$valid?(console.log(s),void o.post(apiUrl+"users",{login:s.username,password:s.password,mail:s.email}).then(function(e){0!=e.data.status?t.errDialog.showMessage("出错了",e.data.message):t.successDialog.showMessage("提示","注册且绑定微信成功",function(){a.path("/activities")})},function(e){t.errDialog.showMessage("出错了",e.data)})):void console.log(e.$error)}}]); -app.controller("SendClassListController",["$scope","$http","$routeParams","config","auth","alertService",function(e,s,a,o,t,l,r){var c=e,n=a.id;c.alertService=l.create(),c.syllabuses=[];var u=function(){s.get(o.apiUrl+"syllabuses?token="+t.token()).then(function(e){console.log(e.data),c.syllabuses=e.data.data,r.save("syllabuses",c.syllabuses)})};u(),c.selectCourse=function(e){"boolean"!=typeof e.checked&&(e.checked=!1),e.checked=!e.checked},c.sendToCourses=function(){var e=[];for(var a in c.syllabuses)for(var l in c.syllabuses[a].courses)c.syllabuses[a].courses[l].checked&&e.push(c.syllabuses[a].courses[l].id);return e.length<=0?void c.alertService.showMessage("提醒","请先选择班级"):void s.post(o.apiUrl+"resources/send",{token:t.token(),course_ids:e,send_id:n}).then(function(e){console.log(e.data),0==e.data.status?c.alertService.showMessage("提示","发送成功",function(){window.history.back()}):c.alertService.showMessage("发送出错",e.data.message)})}}]); +app.controller("SendClassListController",["$scope","$http","$routeParams","config","auth","alertService","rms",function(e,s,o,a,t,r,c){var n=e,l=o.id;n.alertService=r.create(),n.syllabuses=[];var i=function(){s.get(a.apiUrl+"syllabuses?token="+t.token()).then(function(e){console.log(e.data),n.syllabuses=e.data.data})};i(),n.selectCourse=function(e){"boolean"!=typeof e.checked&&(e.checked=!1),e.checked=!e.checked},n.sendToCourses=function(){var e=[];for(var o in n.syllabuses)for(var r in n.syllabuses[o].courses)n.syllabuses[o].courses[r].checked&&e.push(n.syllabuses[o].courses[r].id);return e.length<=0?void n.alertService.showMessage("提醒","请先选择班级"):void s.post(a.apiUrl+"resources/send",{token:t.token(),course_ids:e,send_id:l}).then(function(e){console.log(e.data),0==e.data.status?n.alertService.showMessage("提示","发送成功",function(){window.history.back()}):n.alertService.showMessage("发送出错",e.data.message)})}}]); app.directive("myAlert",["config",function(t){return{templateUrl:t.rootPath+"templates/alert.html",scope:{title:"=",message:"=",visible:"=",cb:"="},link:function(t){t.dismiss=function(){t.visible=!1,"function"==typeof t.cb&&t.cb()}}}}]),app.directive("myAlert2",["config",function(t){return{templateUrl:t.rootPath+"templates/alert2.html",scope:{title:"=",message:"=",visible:"=",cb:"="},link:function(t){t.dismiss=function(){t.visible=!1},t.confirm=function(){t.visible=!1,"function"==typeof t.cb&&t.cb()}}}}]); app.directive("pwdconfirm",function(){return{require:"ngModel",link:function(r,n,i,e){e.$validators.pwdconfirm=function(n,i){return r.user&&r.user.password==i}}}}); app.directive("inputAuto",function(){return{restrict:"A",scope:{},link:function(n,t){var e=t.parent().children().eq(0),i=t.parent().next();t.on("input",function(){console.log(i),e.html(t[0].value);var n=e[0].scrollHeight;t.css("height",n+"px")}),i.on("click",function(){t.css("height","28px")})}}}); From caecd45fbab3b615f68596ee0a3810ff406dced1 Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Fri, 8 Jul 2016 20:16:42 +0800 Subject: [PATCH 77/87] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E7=89=88=E5=BE=AE?= =?UTF-8?q?=E4=BF=A1=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 +-- config/menu.yml | 2 +- config/wechat.yml | 26 ++++++++++---------------- 3 files changed, 12 insertions(+), 19 deletions(-) diff --git a/.gitignore b/.gitignore index fddb6dc72..fe3677396 100644 --- a/.gitignore +++ b/.gitignore @@ -6,8 +6,7 @@ /config/database.yml /config/configuration.yml /config/additional_environment.rb -/config/menu.yml -/config/wechat.yml + /files/* /log/* diff --git a/config/menu.yml b/config/menu.yml index 213130240..3a55966eb 100644 --- a/config/menu.yml +++ b/config/menu.yml @@ -2,7 +2,7 @@ button: - type: "view" name: "我的动态" - url: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx8e1ab05163a28e37&redirect_uri=http://www.trustie.net/wechat/user_activities&response_type=code&scope=snsapi_base&state=123#wechat_redirect" + url: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx8e1ab05163a28e37&redirect_uri=https://test.forge.trustie.net/wechat/user_activities&response_type=code&scope=snsapi_base&state=123#wechat_redirect" - name: "我的课程" sub_button: diff --git a/config/wechat.yml b/config/wechat.yml index 9bc33029e..3d679c4ce 100644 --- a/config/wechat.yml +++ b/config/wechat.yml @@ -3,25 +3,19 @@ default: &default # corpsecret: "corpsecret" # agentid: 1 # Or if using public account, only need above two line - - # guange test - #appid: "wxf694495398c7d470" - #secret: "743e038392f1d89540e95f8f7645849a" - - appid: "wx8e1ab05163a28e37" - secret: "beb4d3bc4b32b3557811680835357841" - + appid: "wxc09454f171153c2d" + secret: "dff5b606e34dcafe24163ec82c2715f8" token: "123456" - access_token: ".access_token" + access_token: "1234567" encrypt_mode: false # if true must fill encoding_aes_key - encoding_aes_key: "QGfP13YP4BbQGkkrlYuxpn4ZIDXpBJww4fxl8CObvNw" - jsapi_ticket: "tmp/wechat_jsapi_ticket" + encoding_aes_key: "QyocNOkRmrT5HzBpCG54EVPUQjk86nJapXNVDQm6Yy6" + jsapi_ticket: "C:/Users/[user_name]/wechat_jsapi_ticket" #template - binding_succ_notice: "jjpDrgFErnmkrE9tf2M3o0t31ZrJ7mr0YtuE_wyLaMc" - journal_notice: "uC1zAw4F2q6HTA3Pcj8VUO6wKKKiYFwnPJB4iXxpdoM" - homework_message_notice: "tCf7teCVqc2vl2LZ_hppIdWmpg8yLcrI8XifxYePjps" - class_notice: "MQ_mFupbXP-9jWbeHT3C5xqNBvPo8EIlNv4ULakSpJA" + binding_succ_notice: "n4KLwcWNrIMYkKxWL2hUwzunm5RTT54EbWem2MIUapU" + journal_notice: "XpHHYkqSGkwuF9vHthRdmPQLvCFRQ4_NbRBP12T7ciE" + homework_message_notice: "Kom0TsYYKsNKCS6luweYVRo9z-mH0wRPr24b1clGCPQ" + class_notice: "8LVu33l6bP-56SDomVgHn-yJc57YpCwwJ81rAJgRONk" production: <<: *default @@ -30,4 +24,4 @@ development: <<: *default test: - <<: *default + <<: *default \ No newline at end of file From e5c3f1d2619e05dbf64fb9bc6c5e4c22ac59c933 Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Fri, 8 Jul 2016 20:33:23 +0800 Subject: [PATCH 78/87] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/menu.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/menu.yml b/config/menu.yml index 3a55966eb..053343094 100644 --- a/config/menu.yml +++ b/config/menu.yml @@ -2,7 +2,7 @@ button: - type: "view" name: "我的动态" - url: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx8e1ab05163a28e37&redirect_uri=https://test.forge.trustie.net/wechat/user_activities&response_type=code&scope=snsapi_base&state=123#wechat_redirect" + url: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxc09454f171153c2d&redirect_uri=https://test.forge.trustie.net/wechat/user_activities&response_type=code&scope=snsapi_base&state=123#wechat_redirect" - name: "我的课程" sub_button: From 62cb7d456880ba729f91a2a770dffeda10576ece Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 8 Jul 2016 20:35:21 +0800 Subject: [PATCH 79/87] add css --- app/controllers/quality_analysis_controller.rb | 3 +++ app/views/quality_analysis/_show.html.erb | 10 +++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/app/controllers/quality_analysis_controller.rb b/app/controllers/quality_analysis_controller.rb index 1d23c28c2..db5fac9c7 100644 --- a/app/controllers/quality_analysis_controller.rb +++ b/app/controllers/quality_analysis_controller.rb @@ -83,6 +83,9 @@ class QualityAnalysisController < ApplicationController end end + # sonar 缓冲,取数据 + sleep(5) + # 获取sonar output结果 console_build = @client.job.get_console_output("#{job_name}", build_num = 0, start = 0, mode = 'text')["output"] logger.info("@current_build_status is ==> #{@current_build_status}") diff --git a/app/views/quality_analysis/_show.html.erb b/app/views/quality_analysis/_show.html.erb index 3a2b17720..347f33cb5 100644 --- a/app/views/quality_analysis/_show.html.erb +++ b/app/views/quality_analysis/_show.html.erb @@ -78,27 +78,27 @@ <%= @ha["blocker_violations"].nil? ? 0 : @ha["blocker_violations"] %> - %;">
    + %;">
    + %;">
    + %;">
    + %;">
    + %;">
  • From c33bb4709cb96dbba9bbde565b97e63c1bd5d084 Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Fri, 8 Jul 2016 21:01:10 +0800 Subject: [PATCH 80/87] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E6=AD=A3=E5=BC=8F?= =?UTF-8?q?=E7=89=88=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/menu.yml | 2 +- config/wechat.yml | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/config/menu.yml b/config/menu.yml index 053343094..1817ab44d 100644 --- a/config/menu.yml +++ b/config/menu.yml @@ -2,7 +2,7 @@ button: - type: "view" name: "我的动态" - url: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxc09454f171153c2d&redirect_uri=https://test.forge.trustie.net/wechat/user_activities&response_type=code&scope=snsapi_base&state=123#wechat_redirect" + url: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx8e1ab05163a28e37&redirect_uri=https://www.trustie.net/wechat/user_activities&response_type=code&scope=snsapi_base&state=123#wechat_redirect" - name: "我的课程" sub_button: diff --git a/config/wechat.yml b/config/wechat.yml index 3d679c4ce..d9a091db9 100644 --- a/config/wechat.yml +++ b/config/wechat.yml @@ -3,19 +3,19 @@ default: &default # corpsecret: "corpsecret" # agentid: 1 # Or if using public account, only need above two line - appid: "wxc09454f171153c2d" - secret: "dff5b606e34dcafe24163ec82c2715f8" + appid: "wx8e1ab05163a28e37" + secret: "beb4d3bc4b32b3557811680835357841" token: "123456" access_token: "1234567" encrypt_mode: false # if true must fill encoding_aes_key - encoding_aes_key: "QyocNOkRmrT5HzBpCG54EVPUQjk86nJapXNVDQm6Yy6" + encoding_aes_key: "QGfP13YP4BbQGkkrlYuxpn4ZIDXpBJww4fxl8CObvNw" jsapi_ticket: "C:/Users/[user_name]/wechat_jsapi_ticket" #template - binding_succ_notice: "n4KLwcWNrIMYkKxWL2hUwzunm5RTT54EbWem2MIUapU" - journal_notice: "XpHHYkqSGkwuF9vHthRdmPQLvCFRQ4_NbRBP12T7ciE" - homework_message_notice: "Kom0TsYYKsNKCS6luweYVRo9z-mH0wRPr24b1clGCPQ" - class_notice: "8LVu33l6bP-56SDomVgHn-yJc57YpCwwJ81rAJgRONk" + binding_succ_notice: "jjpDrgFErnmkrE9tf2M3o0t31ZrJ7mr0YtuE_wyLaMc" + journal_notice: "uC1zAw4F2q6HTA3Pcj8VUO6wKKKiYFwnPJB4iXxpdoM" + homework_message_notice: "tCf7teCVqc2vl2LZ_hppIdWmpg8yLcrI8XifxYePjps" + class_notice: "MQ_mFupbXP-9jWbeHT3C5xqNBvPo8EIlNv4ULakSpJA" production: <<: *default From f77bad34ad0a681c62125a025c997495ec4c37f1 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 8 Jul 2016 21:29:47 +0800 Subject: [PATCH 81/87] =?UTF-8?q?=E7=BC=A9=E7=9F=AD=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/quality_analysis_controller.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/quality_analysis_controller.rb b/app/controllers/quality_analysis_controller.rb index db5fac9c7..73672d11a 100644 --- a/app/controllers/quality_analysis_controller.rb +++ b/app/controllers/quality_analysis_controller.rb @@ -71,12 +71,12 @@ class QualityAnalysisController < ApplicationController # 判断调用sonar分析是否成功 # 等待启动时间处理, 最长时间为30分钟 - for i in 0..60 do - sleep(30) + for i in 0..360 do + sleep(5) @current_build_status = @client.job.get_current_build_status("#{job_name}") if (@current_build_status == "success" || @current_build_status == "failure") break - if i == 60 + if i == 360 @build_console_result = false break end From 0984c389aed6d58af5ab87c54d7b5361ef166575 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Sat, 9 Jul 2016 09:20:00 +0800 Subject: [PATCH 82/87] =?UTF-8?q?=E8=8F=9C=E5=8D=95=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/menu.yml.production | 32 ++++++++++++++++++++++++++++++++ config/menu.yml.test | 35 +++++++++++++++++++++++++++++++++++ config/wechat.yml | 17 +++++++++++++---- 3 files changed, 80 insertions(+), 4 deletions(-) create mode 100644 config/menu.yml.production create mode 100644 config/menu.yml.test diff --git a/config/menu.yml.production b/config/menu.yml.production new file mode 100644 index 000000000..1128f9961 --- /dev/null +++ b/config/menu.yml.production @@ -0,0 +1,32 @@ +button: + - + type: "view" + name: "我的动态" + url: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx8e1ab05163a28e37&redirect_uri=http://www.trustie.net/wechat/user_activities&response_type=code&scope=snsapi_base&state=activities#wechat_redirect" + - + name: "我的课程" + sub_button: + - + type: "view" + name: "课程" + url: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx8e1ab05163a28e37&redirect_uri=http://www.trustie.net/wechat/user_activities&response_type=code&scope=snsapi_base&state=class_list#wechat_redirect" + - + type: "view" + name: "资源" + url: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx8e1ab05163a28e37&redirect_uri=http://www.trustie.net/wechat/user_activities&response_type=code&scope=snsapi_base&state=myresource#wechat_redirect" + + - + name: "更多" + sub_button: + - + type: "click" + name: "加入班级" + key: "JOIN_CLASS" + - + type: "click" + name: "反馈" + key: "FEEDBACK" + - + type: "view" + name: "历史推文" + url: "http://mp.weixin.qq.com/mp/getmasssendmsg?__biz=MzIwOTM2NDkxMA==#wechat_webview_type=1&wechat_redirect" diff --git a/config/menu.yml.test b/config/menu.yml.test new file mode 100644 index 000000000..a163bac61 --- /dev/null +++ b/config/menu.yml.test @@ -0,0 +1,35 @@ +button: + - + type: "view" + name: "我的动态" + url: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxc09454f171153c2d&redirect_uri=http://test.forge.trustie.net/wechat/user_activities&response_type=code&scope=snsapi_b +ase&state=activities#wechat_redirect" + - + name: "我的课程" + sub_button: + - + type: "view" + name: "课程" + url: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxc09454f171153c2d&redirect_uri=http://test.forge.trustie.net/wechat/user_activities&response_type=code&scope=snsapi +_base&state=class_list#wechat_redirect" + - + type: "view" + name: "资源" + url: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxc09454f171153c2d&redirect_uri=http://test.forge.trustie.net/wechat/user_activities&response_type=code&scope=snsapi +_base&state=myresource#wechat_redirect" + + - + name: "更多" + sub_button: + - + type: "click" + name: "加入班级" + key: "JOIN_CLASS" + - + type: "click" + name: "反馈" + key: "FEEDBACK" + - + type: "view" + name: "历史推文" + url: "http://mp.weixin.qq.com/mp/getmasssendmsg?__biz=MzIwOTM2NDkxMA==#wechat_webview_type=1&wechat_redirect" diff --git a/config/wechat.yml b/config/wechat.yml index 3d679c4ce..a46841a12 100644 --- a/config/wechat.yml +++ b/config/wechat.yml @@ -2,9 +2,18 @@ default: &default # corpid: "corpid" # corpsecret: "corpsecret" # agentid: 1 -# Or if using public account, only need above two line - appid: "wxc09454f171153c2d" - secret: "dff5b606e34dcafe24163ec82c2715f8" +#- # guange test + #appid: "wxf694495398c7d470" + #secret: "743e038392f1d89540e95f8f7645849a" + + #production + appid: "wx8e1ab05163a28e37" + secret: "beb4d3bc4b32b3557811680835357841" + + #test + #appid: "wxc09454f171153c2d" + #secret: "dff5b606e34dcafe24163ec82c2715f8" + token: "123456" access_token: "1234567" encrypt_mode: false # if true must fill encoding_aes_key @@ -24,4 +33,4 @@ development: <<: *default test: - <<: *default \ No newline at end of file + <<: *default From 2a2fe9e81d50ff90fb295a7f93c7e0f397afb81e Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Sat, 9 Jul 2016 09:22:41 +0800 Subject: [PATCH 83/87] =?UTF-8?q?=E8=A7=A3=E5=86=B3android=E7=BC=93?= =?UTF-8?q?=E5=AD=98=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/wechats/user_activities.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/wechats/user_activities.html.erb b/app/views/wechats/user_activities.html.erb index bb7d96d50..240fec434 100644 --- a/app/views/wechats/user_activities.html.erb +++ b/app/views/wechats/user_activities.html.erb @@ -28,7 +28,7 @@ - + From 8279d9385c1a97080cf214e98aa8d633c3236a85 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Sat, 9 Jul 2016 10:13:05 +0800 Subject: [PATCH 84/87] =?UTF-8?q?=E5=8C=BA=E5=88=86=E6=98=AF=E8=AF=BE?= =?UTF-8?q?=E7=A8=8B=E9=82=80=E8=AF=B7=EF=BC=8C=E8=BF=98=E6=98=AF=E6=84=8F?= =?UTF-8?q?=E8=A7=81=E5=8F=8D=E9=A6=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/wechats_controller.rb | 11 ++++++++++- app/models/wechat_log.rb | 4 ++++ .../20160709015740_add_index_openid_to_wechat_logs.rb | 5 +++++ db/schema.rb | 5 ++++- 4 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 app/models/wechat_log.rb create mode 100644 db/migrate/20160709015740_add_index_openid_to_wechat_logs.rb diff --git a/app/controllers/wechats_controller.rb b/app/controllers/wechats_controller.rb index 4a79d6d93..bd4ebaf7f 100644 --- a/app/controllers/wechats_controller.rb +++ b/app/controllers/wechats_controller.rb @@ -8,7 +8,11 @@ class WechatsController < ActionController::Base # default text responder when no other match on :text do |request, content| #邀请码 - sendBindClass(request, {invite_code: content}) + if join_request + sendBindClass(request, {invite_code: content}) + else + request.reply.text '您的意见已收到,感谢您的反馈!' + end end # When receive 'help', will trigger this responder @@ -142,6 +146,11 @@ class WechatsController < ActionController::Base end end + def join_request(request) + openid = request[:FromUserName] + wl = WechatLog.where(openid: openid).order('id desc').first + wl && JSON(wl.request_raw)["EventKey"] == 'JOIN_CLASS' + end def sendBindClass(request, params) begin diff --git a/app/models/wechat_log.rb b/app/models/wechat_log.rb new file mode 100644 index 000000000..118a9fade --- /dev/null +++ b/app/models/wechat_log.rb @@ -0,0 +1,4 @@ +#coding=utf-8 +# +class WechatLog < ActiveRecord::Base +end diff --git a/db/migrate/20160709015740_add_index_openid_to_wechat_logs.rb b/db/migrate/20160709015740_add_index_openid_to_wechat_logs.rb new file mode 100644 index 000000000..845a47b72 --- /dev/null +++ b/db/migrate/20160709015740_add_index_openid_to_wechat_logs.rb @@ -0,0 +1,5 @@ +class AddIndexOpenidToWechatLogs < ActiveRecord::Migration + def change + add_index(:wechat_logs, :openid) + end +end diff --git a/db/schema.rb b/db/schema.rb index 56bb5ad7f..32d29d31a 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,8 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20160708091258) do +ActiveRecord::Schema.define(:version => 20160709015740) do + create_table "activities", :force => true do |t| t.integer "act_id", :null => false t.string "act_type", :null => false @@ -2185,6 +2186,8 @@ ActiveRecord::Schema.define(:version => 20160708091258) do t.datetime "created_at", :null => false end + add_index "wechat_logs", ["openid"], :name => "index_wechat_logs_on_openid" + create_table "wiki_content_versions", :force => true do |t| t.integer "wiki_content_id", :null => false t.integer "page_id", :null => false From 09a97fc9d8a8dad2ddde88b045d8a043127c24cc Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Sat, 9 Jul 2016 10:23:49 +0800 Subject: [PATCH 85/87] . --- app/controllers/wechats_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/wechats_controller.rb b/app/controllers/wechats_controller.rb index bd4ebaf7f..3a8b80883 100644 --- a/app/controllers/wechats_controller.rb +++ b/app/controllers/wechats_controller.rb @@ -8,7 +8,7 @@ class WechatsController < ActionController::Base # default text responder when no other match on :text do |request, content| #邀请码 - if join_request + if join_request(request) sendBindClass(request, {invite_code: content}) else request.reply.text '您的意见已收到,感谢您的反馈!' From 99a27766bebbbd500c4412185673a164cde379cd Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Sat, 9 Jul 2016 10:34:05 +0800 Subject: [PATCH 86/87] . --- app/controllers/wechats_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/wechats_controller.rb b/app/controllers/wechats_controller.rb index 3a8b80883..f49398ff7 100644 --- a/app/controllers/wechats_controller.rb +++ b/app/controllers/wechats_controller.rb @@ -148,7 +148,7 @@ class WechatsController < ActionController::Base def join_request(request) openid = request[:FromUserName] - wl = WechatLog.where(openid: openid).order('id desc').first + wl = WechatLog.where("openid = '#{openid}' and request_raw like '%\"Event\":\"click\"%'").order('id desc').first wl && JSON(wl.request_raw)["EventKey"] == 'JOIN_CLASS' end From c7bb53d2bddaf82da9c07cc0c12990f6d0036c8e Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Sat, 9 Jul 2016 13:39:50 +0800 Subject: [PATCH 87/87] =?UTF-8?q?=E5=9C=A8=E6=9C=8D=E5=8A=A1=E7=AB=AF?= =?UTF-8?q?=E5=8A=A0=E4=B8=8Aimagemagick?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + Gemfile | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index fe3677396..1ef7e63ce 100644 --- a/.gitignore +++ b/.gitignore @@ -35,3 +35,4 @@ vendor/cache public/javascripts/wechat/node_modules/ .ruby-version .access_token +tmux*.log diff --git a/Gemfile b/Gemfile index afe85df1d..3bea83669 100644 --- a/Gemfile +++ b/Gemfile @@ -5,7 +5,7 @@ unless RUBY_PLATFORM =~ /w32/ gem 'iconv' if RUBY_PLATFORM =~ /darwin/ gem "rmagick", "= 2.15.4" ## osx must be this version - else + elsif RUBY_PLATFORM =~ /linux/ #gem "rmagick", "= 2.13.1" ## centos yum install ImageMagick-devel end gem 'certified'