From ad89afb4ac1003b327913bfc90a1b728f094b6c3 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Thu, 22 Aug 2019 14:37:17 +0800 Subject: [PATCH 01/19] =?UTF-8?q?=E6=96=B0=E5=BB=BA=E8=AF=BE=E5=A0=82?= =?UTF-8?q?=E7=9A=84=E6=97=B6=E9=97=B4=E8=BD=AC=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/courses_controller.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index d6694baa6..d05866af3 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -1193,8 +1193,8 @@ class CoursesController < ApplicationController @subject = @course.present? ? @course.subject : Subject.find_by!(id: params[:subject_id]) tip_exception("开始时间不能为空") if params[:start_date].blank? tip_exception("结束时间不能为空") if params[:end_date].blank? - tip_exception("结束时间必须晚于开始时间") if params[:end_date] <= params[:start_date] - tip_exception("开始时间和结束时间不能与往期开课时间重叠") if @course.nil? && @subject.max_course_end_date && params[:start_date] <= strf_date(@subject.max_course_end_date) + tip_exception("结束时间必须晚于开始时间") if strf_date(params[:end_date]) <= strf_date(params[:start_date]) + tip_exception("开始时间和结束时间不能与往期开课时间重叠") if @course.nil? && @subject.max_course_end_date && strf_date(params[:start_date]) <= strf_date(@subject.max_course_end_date) validate_start_end_date if @course.present? tip_exception("开放课堂必须包含公告栏和在线学习模块") unless params[:course_module_types].include?("announcement") && params[:course_module_types].include?("online_learning") end @@ -1206,8 +1206,8 @@ class CoursesController < ApplicationController def validate_start_end_date prev_course = @subject.courses.where("id < #{@course.id}").last next_course = @subject.courses.where("id > #{@course.id}").first - tip_exception("开始时间不能与往期开课时间重叠") if prev_course && params[:start_date] <= strf_date(prev_course.end_date) - tip_exception("结束时间不能与后期开课时间重叠") if next_course && params[:end_date] >= strf_date(next_course.start_date) + tip_exception("开始时间不能与往期开课时间重叠") if prev_course && strf_date(params[:start_date]) <= strf_date(prev_course.end_date) + tip_exception("结束时间不能与后期开课时间重叠") if next_course && strf_date(params[:end_date]) >= strf_date(next_course.start_date) end # 超级管理员和课堂管理员的权限判断 From 629aa10a52da6273e53a4fdd92a043dfa1e52f6e Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Thu, 22 Aug 2019 14:50:02 +0800 Subject: [PATCH 02/19] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/subjects_helper.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/helpers/subjects_helper.rb b/app/helpers/subjects_helper.rb index 8aff41d25..75ae9f041 100644 --- a/app/helpers/subjects_helper.rb +++ b/app/helpers/subjects_helper.rb @@ -24,8 +24,8 @@ module SubjectsHelper elsif course.start_date && course.start_date > Date.today {status: 0, time: ""} elsif course.start_date && course.start_date <= Date.today && course.end_date >= Date.today - sum_week = ((course.end_date - course.start_date).to_i / 7.0).ceil - curr_week = ((Date.today - course.start_date).to_i / 7.0).ceil + sum_week = (((course.end_date - course.start_date).to_i + 1) / 7.0).ceil + curr_week = (((Date.today - course.start_date).to_i + 1) / 7.0).ceil {status: 1, time: "进行至第#{curr_week}周,共#{sum_week}周"} else {status: -1, time: ""} From b60c55b6d0d2d707010dfec6627e2901bed2d4e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Thu, 22 Aug 2019 14:51:01 +0800 Subject: [PATCH 03/19] =?UTF-8?q?=E8=B0=83=E6=95=B4=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/public/css/edu-all.css | 4 +++ .../paths/PathDetail/DetailCardsEditAndAdd.js | 2 +- .../src/modules/paths/PathDetail/DetailTop.js | 3 ++- .../paths/PathDetail/PathDetailIndex.js | 27 ++----------------- 4 files changed, 9 insertions(+), 27 deletions(-) diff --git a/public/react/public/css/edu-all.css b/public/react/public/css/edu-all.css index 97b5d753a..b57d4db42 100644 --- a/public/react/public/css/edu-all.css +++ b/public/react/public/css/edu-all.css @@ -3443,4 +3443,8 @@ a.singlepublishtwo{ .ant-tooltip{ max-width: 100% !important; +} + +.square-main p{ + margin-bottom: 0 !important; } \ No newline at end of file diff --git a/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js b/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js index 49b1891ef..e9770e969 100644 --- a/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js +++ b/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js @@ -242,7 +242,7 @@ class DetailCardsEditAndAdd extends Component{ //保存 clickShixunsaves=()=>{ - debugger + let{stage_names,stage_descriptions,shixuns_listeditlist}=this.state; let newstage_descriptions=stage_descriptions; diff --git a/public/react/src/modules/paths/PathDetail/DetailTop.js b/public/react/src/modules/paths/PathDetail/DetailTop.js index c0b969543..d530319ff 100644 --- a/public/react/src/modules/paths/PathDetail/DetailTop.js +++ b/public/react/src/modules/paths/PathDetail/DetailTop.js @@ -200,7 +200,8 @@ class DetailTop extends Component{ }) this.setState({ MenuItemskey:keys, - courseslist:courseslist + courseslist:courseslist, + onVisibleChangestype:!this.state.onVisibleChangestype }) } diff --git a/public/react/src/modules/paths/PathDetail/PathDetailIndex.js b/public/react/src/modules/paths/PathDetail/PathDetailIndex.js index edac5ca01..5d63d5cf8 100644 --- a/public/react/src/modules/paths/PathDetail/PathDetailIndex.js +++ b/public/react/src/modules/paths/PathDetail/PathDetailIndex.js @@ -203,32 +203,9 @@ class PathDetailIndex extends Component{ } updatadetailInfoList=()=>{ - let pathid=this.props.match.params.pathId; - let url="/paths/"+pathid+".json"; - axios.get(url).then((result)=>{ - // TODO 403 让后台返回status 403 比较好 - if (result.data.status == 407 || result.data.status == 401) { - debugger - return; - } - if (result.data.status === 403 ) { - debugger - // window.location.href = "/403"; - return; - } - - if(result.data.allow_visit===true){ - this.setState({ - detailInfoList:result.data, - items: getItems(result.data.members.length), - user_id:undefined, - }) - } - - }).catch((error)=>{ - console.log(error); - }) + this.getdatasindex(); } + clickNewsubscript=(val)=>{ if(val===0){ this.setState({ From e3b558559a37774547c67756f6f91806124a1935 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Thu, 22 Aug 2019 14:52:26 +0800 Subject: [PATCH 04/19] =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/stylesheets/educoder/edu-all.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/public/stylesheets/educoder/edu-all.css b/public/stylesheets/educoder/edu-all.css index bc6af002c..789789171 100644 --- a/public/stylesheets/educoder/edu-all.css +++ b/public/stylesheets/educoder/edu-all.css @@ -3739,4 +3739,8 @@ a.singlepublishtwo{ .ant-tooltip{ max-width: 100% !important; +} + +.square-main p{ + margin-bottom: 0 !important; } \ No newline at end of file From c2939c6a8aa10fe6da782a9a5f012813577d68b5 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Thu, 22 Aug 2019 14:54:12 +0800 Subject: [PATCH 05/19] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/application_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index bea9e6173..bb053d9c0 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -568,7 +568,7 @@ class ApplicationController < ActionController::Base end def strf_date(date) - date.blank? ? '' : date.strftime("%Y-%m-%d") + date.blank? ? '' : Time.parse(date).strftime("%Y-%m-%d") end def logger_error(error) From 2bfa36d0868c3f1dfe21a87b7bb060dc7a934c41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Thu, 22 Aug 2019 14:54:53 +0800 Subject: [PATCH 06/19] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/stylesheets/educoder/edu-all.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/stylesheets/educoder/edu-all.css b/public/stylesheets/educoder/edu-all.css index 789789171..1278ef618 100644 --- a/public/stylesheets/educoder/edu-all.css +++ b/public/stylesheets/educoder/edu-all.css @@ -3742,5 +3742,5 @@ a.singlepublishtwo{ } .square-main p{ - margin-bottom: 0 !important; + margin-bottom: 0em; } \ No newline at end of file From c09f699f0a9ae369f03ea060f96e5fc4854cc3fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Thu, 22 Aug 2019 14:58:25 +0800 Subject: [PATCH 07/19] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/public/css/edu-all.css | 2 +- public/stylesheets/educoder/edu-all.css | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/public/react/public/css/edu-all.css b/public/react/public/css/edu-all.css index b57d4db42..c8a4aeaf6 100644 --- a/public/react/public/css/edu-all.css +++ b/public/react/public/css/edu-all.css @@ -121,7 +121,7 @@ em.vertical-line{display: inline-block;width: 2px;background: #999;height: 10px} background: #000000; border: 1px solid #fff; border-radius: 3px; - font-size: 14px; + font-size: 12px; opacity: 0.56; background-size: 100% 100%;padding: 0px 8px;color: #fff;float: left;} .tag-orange{position: absolute;right: 0px;top:12px;} diff --git a/public/stylesheets/educoder/edu-all.css b/public/stylesheets/educoder/edu-all.css index 1278ef618..4f6dadcf9 100644 --- a/public/stylesheets/educoder/edu-all.css +++ b/public/stylesheets/educoder/edu-all.css @@ -123,7 +123,7 @@ em.vertical-line{display: inline-block;width: 2px;background: #999;height: 10px} background: #000000; border: 1px solid #fff; border-radius: 3px; - font-size: 14px; + font-size: 12px; opacity: 0.56; background-size: 100% 100%;padding: 0px 8px;color: #fff;float: left;} .tag-orange{position: absolute;right: 0px;top:12px;} From 87250ea5ff016813630f585ef52c9201537b1bb1 Mon Sep 17 00:00:00 2001 From: p31729568 Date: Thu, 22 Aug 2019 15:02:28 +0800 Subject: [PATCH 08/19] modify tiding subject message --- config/locales/tidings/zh-CN.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/config/locales/tidings/zh-CN.yml b/config/locales/tidings/zh-CN.yml index 347b0139a..e6e8e676d 100644 --- a/config/locales/tidings/zh-CN.yml +++ b/config/locales/tidings/zh-CN.yml @@ -49,9 +49,9 @@ Apply_end: "申请发布实训:%{name}" ApplySubject: System: - "1_end": "你提交的实训课程发布申请:%{name},审核已通过" - "2_end": "你提交的实训课程发布申请:%{name},审核未通过
原因:%{reason}" - Apply_end: "申请发布实训课程:%{name}" + "1_end": "你提交的实践课程发布申请:%{name},审核已通过" + "2_end": "你提交的实践课程发布申请:%{name},审核未通过
原因:%{reason}" + Apply_end: "申请发布实践课程:%{name}" TrialAuthorization: System: "1_end": "你提交的试用授权申请,审核已通过" @@ -61,7 +61,7 @@ Course: Delete_end: "你删除了课堂:%s" Shixun_end: "你创建了实训:%s" - Subject_end: "你创建了实训课程:%s" + Subject_end: "你创建了实践课程:%s" ArchiveCourse_end: "你的课堂已经归档:%s" JournalsForMessage: Mentioned_end: "@了你:%s" From 28d779d173e883f05063398dc8260d318a08389d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Thu, 22 Aug 2019 15:02:47 +0800 Subject: [PATCH 09/19] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/tpm/component/TPMright.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/tpm/component/TPMright.css b/public/react/src/modules/tpm/component/TPMright.css index b0f8315e6..41b87c0d0 100644 --- a/public/react/src/modules/tpm/component/TPMright.css +++ b/public/react/src/modules/tpm/component/TPMright.css @@ -45,12 +45,12 @@ } .newedboxheight{ max-height:204px; - overflow-y: auto; + overflow-y: hidden; } .newminheight{ /*max-height: 670px;*/ max-height: 300px; - overflow: auto; + overflow-y: auto; } .delSubentry{ From 9e13ffd316042691cccde6f3e843f7d56bb84480 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Thu, 22 Aug 2019 15:14:03 +0800 Subject: [PATCH 10/19] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/application_controller.rb | 2 +- app/controllers/courses_controller.rb | 2 +- dump.rdb | Bin 2086 -> 2197 bytes 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index bb053d9c0..746fb1b02 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -568,7 +568,7 @@ class ApplicationController < ActionController::Base end def strf_date(date) - date.blank? ? '' : Time.parse(date).strftime("%Y-%m-%d") + date.blank? ? '' : date.to_date.strftime("%Y-%m-%d") end def logger_error(error) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index d05866af3..de9ba7571 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -26,7 +26,7 @@ class CoursesController < ApplicationController :base_info, :get_historical_courses, :create_group_by_importing_file, :attahcment_category_list,:export_member_scores_excel, :duplicate_course, :switch_to_teacher, :switch_to_assistant, :switch_to_student, :exit_course, - :informs, :update_informs, :online_learning, :update_task_position, :tasks_list] + :informs, :update_informs, :online_learning, :update_task_position, :tasks_list, :join_excellent_course] before_action :user_course_identity, except: [:join_excellent_course, :index, :create, :new, :apply_to_join_course, :search_course_list, :get_historical_course_students, :mine, :search_slim] before_action :teacher_allowed, only: [:update, :destroy, :settings, :search_teacher_candidate, diff --git a/dump.rdb b/dump.rdb index f7b65ded0f6f907e3c844f02d8fb1c6dbac91345..6d0966fe01363d6fdffde4613c80093b36eeed0d 100644 GIT binary patch delta 486 zcmWO0y=zlJ008iN?_J_c`axnPj(JIF#L9(x_kB)nsSr^IC4++>+{1y<6ON|Eg8>GHla8_wP~8{P9c7lLuA86LREQBhY<5Fm@ z*nktNu?%&%A7xcWNWOIhR}=6z>?So*V5*9eBHL@V5YyTqMVLmoFh*Lbw4kz+g?Gs* zO3G4GV+;Q=X~S>niBO5&abbN|DCOiGXMYp delta 365 zcmV~$J4+lv007|GncKbdFvnd`Qi$GWB@hBD^L|)qp`;N4Ns)jd%-+m(r{IGm#i5mr zg@*AOK}eNGLll327%VN!KL|^ZGyzKqQSyC*)|cikZXI8~eEYYyzUp1x^S$p^t0%MH zqSpHt6YYs60AmdRY5>gMg$Qniee@(8!I?;hKk)U&BPodMXiTi?QcJsrD@&YaJl!7e zta!WT-8;LMO%ox7l16AgB`7mk(R3Ls*^fW#X_Zq-`u6~42>dG#QJWT+>7v7O*C9pD zjj_3=+~l~hRyn1SkxV^K%QG|*MCB(O5{D=)Kk3%EL;)r(3^B|MOcrv@5tDX*$+o;z1yz}+uQ@{Bi D4+Cm! From 509ec819b01079bb9683e7ac79e63f1d5a77560b Mon Sep 17 00:00:00 2001 From: jingquan huang Date: Thu, 22 Aug 2019 15:19:27 +0800 Subject: [PATCH 11/19] =?UTF-8?q?=E8=AE=A8=E8=AE=BA=E5=8C=BA=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E8=BF=81=E7=A7=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/tasks/public_message.rake | 37 ++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/lib/tasks/public_message.rake b/lib/tasks/public_message.rake index ca54fbd7b..5a2cd5e74 100644 --- a/lib/tasks/public_message.rake +++ b/lib/tasks/public_message.rake @@ -32,6 +32,41 @@ namespace :sync do MessageDetail.create!(message_id: new_message.id, content: discuss.try(:content)) end end + end + + task :sigle_message => :environment do + shixun_id = ENV['args'].split(",")[0] # 对应课程的id + board_id = ENV['args'].split(",")[1] + message_id = ENV['args'].split(",")[2] + status = ENV['args'].split(",")[3] # 表示相应的期数 + + if status.to_i == 1 + start_time = '2018-12-16' + end_time = '2019-04-01' + elsif status.to_i == 2 + start_time = '2019-04-07' + end_time = '2019-07-28' + else + # 这种情况是取所有的 + start_time = '2015-01-01' + end_time = '2022-07-28' + end + + discusses = Discuss.where(dis_id: shixun_ids).where("parent_id is null and created_at >? and created_at Date: Thu, 22 Aug 2019 15:19:27 +0800 Subject: [PATCH 12/19] =?UTF-8?q?=E5=9C=A8=E6=96=B0=E5=BB=BA=E5=BC=80?= =?UTF-8?q?=E6=94=BE=E8=AF=BE=E5=A0=82=E7=9A=84=E6=97=B6=E5=80=99=EF=BC=8C?= =?UTF-8?q?=E5=B0=86=E5=AE=9E=E8=B7=B5=E8=AF=BE=E7=A8=8B=E7=9A=84=E2=80=9C?= =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E9=A1=BB=E7=9F=A5=E2=80=9D=E5=86=99=E5=85=A5?= =?UTF-8?q?=E8=AF=BE=E5=A0=82=E5=85=AC=E5=91=8A=E6=A0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/courses_controller.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index de9ba7571..cb3ff0d2f 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -158,6 +158,8 @@ class CoursesController < ApplicationController @course.subject.subject_members.where.not(user_id: current_user.id).each do |s_member| CourseMember.create!(course_id: @course.id, user_id: s_member.user_id, role: 2) end + + Inform.create(container: @course, description: @subject.learning_notes) end course_module_types = params[:course_module_types] From 84f498e5bfcad2dff4541c18f3cc51af084267a6 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Thu, 22 Aug 2019 15:22:24 +0800 Subject: [PATCH 13/19] tiaoz --- app/controllers/courses_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index cb3ff0d2f..6194b7b41 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -181,7 +181,7 @@ class CoursesController < ApplicationController extra_params = Hash.new extra_params[:school_id] = @school.id - if @course.is_end && (course_params[:end_date].blank? || course_params[:end_date].to_date > Date.today) + if @course.is_end && (course_params[:end_date].blank? || course_params[:end_date].to_date >= Date.today) extra_params[:is_end] = 0 elsif !@course.is_end && !course_params[:end_date].blank? && course_params[:end_date].to_date < Date.today extra_params[:is_end] = 1 From f58593da620f1302fe3f44eebd3b7a0c2e23ea4e Mon Sep 17 00:00:00 2001 From: jingquan huang Date: Thu, 22 Aug 2019 15:24:37 +0800 Subject: [PATCH 14/19] shixun_id --- lib/tasks/public_message.rake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tasks/public_message.rake b/lib/tasks/public_message.rake index 5a2cd5e74..94e53a228 100644 --- a/lib/tasks/public_message.rake +++ b/lib/tasks/public_message.rake @@ -52,7 +52,7 @@ namespace :sync do end_time = '2022-07-28' end - discusses = Discuss.where(dis_id: shixun_ids).where("parent_id is null and created_at >? and created_at ? and created_at Date: Thu, 22 Aug 2019 15:28:16 +0800 Subject: [PATCH 15/19] =?UTF-8?q?=E6=9D=83=E9=99=90=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/paths/PathDetail/DetailTop.js | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/public/react/src/modules/paths/PathDetail/DetailTop.js b/public/react/src/modules/paths/PathDetail/DetailTop.js index d530319ff..0256cfb33 100644 --- a/public/react/src/modules/paths/PathDetail/DetailTop.js +++ b/public/react/src/modules/paths/PathDetail/DetailTop.js @@ -410,14 +410,15 @@ class DetailTop extends Component{ - {this.props.courses===undefined?"":detailInfoList.is_creator===true?this.state.courseslist.map((item,key)=>{ - return( - + {this.props.courses===undefined?"":this.state.courseslist.map((item,key)=>{ + if(item.course_identity<4){ + return( + - + - - )}):"" + + )}}) } @@ -530,22 +531,20 @@ class DetailTop extends Component{
已结束
:"":""} {item.course_status.status===0? - detailInfoList.is_creator===true||detailInfoList.allow_add_member===true? + item.course_identity<5? 进入课堂 :item.course_identity<6?
报名成功
:this.JoinnowCourse(item.course_id)}>立即报名:""} {item.course_status.status===1? - detailInfoList.is_creator===true||detailInfoList.allow_add_member===true? + item.course_identity<5? 进入课堂 :item.course_identity<6? 立即学习 :this.JoinnowCourse(item.course_id)}>立即加入:""} {item.course_status.status===2? - detailInfoList.is_creator===true||detailInfoList.allow_add_member===true? - 进入课堂 - :item.course_identity<6? + item.course_identity<6? 进入课堂 :
已结束
:""} From 0a65760c208abbaf2ad278eaaccdefc2f2ad507d Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Thu, 22 Aug 2019 15:41:50 +0800 Subject: [PATCH 16/19] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/application_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 746fb1b02..57eed15fd 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -40,7 +40,7 @@ class ApplicationController < ActionController::Base if @user_course_identity > Course::STUDENT && @course.is_public == 0 tip_exception(401, "..") unless User.current.logged? check_account - tip_exception(409, "您没有权限进入") + tip_exception(@course.excellent ? 410 : 409, "您没有权限进入") end uid_logger("###############user_course_identity:#{@user_course_identity}") end From cd33cc275f2bf035cd76777401f4b936fc90c7bf Mon Sep 17 00:00:00 2001 From: p31729568 Date: Thu, 22 Aug 2019 15:42:37 +0800 Subject: [PATCH 17/19] admins: fix tooltip ineffect after ajax render partial --- app/assets/javascripts/admin.js | 2 ++ app/controllers/admins/base_controller.rb | 14 ++++++++++++++ .../shared/_list.html.erb | 17 ++++++++--------- .../shared/_contrast_list.html.erb | 3 ++- .../school_statistics/shared/_list.html.erb | 3 ++- .../admins/shared/after_render_js_hook.js.erb | 3 +++ 6 files changed, 31 insertions(+), 11 deletions(-) create mode 100644 app/views/admins/shared/after_render_js_hook.js.erb diff --git a/app/assets/javascripts/admin.js b/app/assets/javascripts/admin.js index 1e1f384ff..27844be53 100644 --- a/app/assets/javascripts/admin.js +++ b/app/assets/javascripts/admin.js @@ -19,6 +19,8 @@ $.fn.select2.defaults.set('theme', 'bootstrap4'); $.fn.select2.defaults.set('language', 'zh-CN'); +Turbolinks.setProgressBarDelay(200); + $(document).on('turbolinks:load', function(){ $('[data-toggle="tooltip"]').tooltip(); $('[data-toggle="popover"]').popover(); diff --git a/app/controllers/admins/base_controller.rb b/app/controllers/admins/base_controller.rb index 43f18b39c..6f89e7afa 100644 --- a/app/controllers/admins/base_controller.rb +++ b/app/controllers/admins/base_controller.rb @@ -7,6 +7,8 @@ class Admins::BaseController < ApplicationController before_action :require_login, :require_admin! + after_action :rebind_event_if_ajax_render_partial + private def require_login @@ -21,4 +23,16 @@ class Admins::BaseController < ApplicationController render_forbidden end + + # 触发after ajax render partial hooks,执行一些因为局部刷新后失效的绑定事件 + def rebind_event_if_ajax_render_partial + return if request.format.symbol != :js + return if response.content_type != 'text/javascript' + + path = Rails.root.join('app/views/admins/shared/after_render_js_hook.js.erb') + return unless File.exists?(path) + + append_js = ERB.new(File.open(path).read).result + response.body += append_js + end end \ No newline at end of file diff --git a/app/views/admins/daily_school_statistics/shared/_list.html.erb b/app/views/admins/daily_school_statistics/shared/_list.html.erb index b71be485e..af23e09f6 100644 --- a/app/views/admins/daily_school_statistics/shared/_list.html.erb +++ b/app/views/admins/daily_school_statistics/shared/_list.html.erb @@ -1,12 +1,12 @@ - + - - + + - + - + <% if statistics.present? %> <% statistics.each do |statistic| %> - diff --git a/app/views/admins/school_statistics/shared/_contrast_list.html.erb b/app/views/admins/school_statistics/shared/_contrast_list.html.erb index 049711ca2..928340c80 100644 --- a/app/views/admins/school_statistics/shared/_contrast_list.html.erb +++ b/app/views/admins/school_statistics/shared/_contrast_list.html.erb @@ -30,7 +30,8 @@ <% statistics.each do |statistic| %> diff --git a/app/views/admins/school_statistics/shared/_list.html.erb b/app/views/admins/school_statistics/shared/_list.html.erb index 72b92c13d..aa043f097 100644 --- a/app/views/admins/school_statistics/shared/_list.html.erb +++ b/app/views/admins/school_statistics/shared/_list.html.erb @@ -35,7 +35,8 @@ <% statistics.each do |statistic| %> diff --git a/app/views/admins/shared/after_render_js_hook.js.erb b/app/views/admins/shared/after_render_js_hook.js.erb new file mode 100644 index 000000000..9ceb13f5c --- /dev/null +++ b/app/views/admins/shared/after_render_js_hook.js.erb @@ -0,0 +1,3 @@ +; +$('[data-toggle="tooltip"]').tooltip(); +$('[data-toggle="popover"]').popover(); \ No newline at end of file From 1e631cb11a996164003a3a0a4a8a5f28ede9aace Mon Sep 17 00:00:00 2001 From: jingquan huang Date: Thu, 22 Aug 2019 15:42:47 +0800 Subject: [PATCH 18/19] =?UTF-8?q?discuss=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/tasks/public_message.rake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tasks/public_message.rake b/lib/tasks/public_message.rake index 94e53a228..76b780ccd 100644 --- a/lib/tasks/public_message.rake +++ b/lib/tasks/public_message.rake @@ -53,7 +53,7 @@ namespace :sync do end discusses = Discuss.where(dis_id: shixun_id).where("parent_id is null and created_at >? and created_at Date: Thu, 22 Aug 2019 15:45:00 +0800 Subject: [PATCH 19/19] .. --- lib/tasks/public_message.rake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/tasks/public_message.rake b/lib/tasks/public_message.rake index 76b780ccd..ace16dbdf 100644 --- a/lib/tasks/public_message.rake +++ b/lib/tasks/public_message.rake @@ -54,9 +54,9 @@ namespace :sync do discusses = Discuss.where(dis_id: shixun_id).where("parent_id is null and created_at >? and created_at
单位名称单位名称<%= sort_tag('教师总人数', name: 'teacher_count', path: admins_daily_school_statistics_path) %><%= sort_tag('学生总人数', name: 'student_count', path: admins_daily_school_statistics_path) %><%= sort_tag('教师总数', name: 'teacher_count', path: admins_daily_school_statistics_path) %><%= sort_tag('学生总数', name: 'student_count', path: admins_daily_school_statistics_path) %> <%= sort_tag('课堂总数', name: 'course_count', path: admins_daily_school_statistics_path) %><%= sort_tag('正在进行课堂数', name: 'active_course_count', path: admins_daily_school_statistics_path) %><%= sort_tag('正在进行课堂数', name: 'active_course_count', path: admins_daily_school_statistics_path) %> <%= sort_tag('实训总数', name: 'shixun_count', path: admins_daily_school_statistics_path) %> <%= sort_tag('实训评测总数', name: 'shixun_evaluate_count', path: admins_daily_school_statistics_path) %> @@ -14,17 +14,16 @@ <%= sort_tag('实训作业总数', name: 'homework_count', path: admins_daily_school_statistics_path) %> <%= sort_tag('其它作业总数', name: 'other_homework_count', path: admins_daily_school_statistics_path) %><%= sort_tag('动态时间', name: 'nearly_course_time', path: admins_daily_school_statistics_path) %><%= sort_tag('动态时间', name: 'nearly_course_time', path: admins_daily_school_statistics_path) %>
- <%= link_to '#' do %> - <%= overflow_hidden_span statistic[:name], width: '200px' %> - <% end %> + + <%= link_to statistic[:name], "/colleges/#{statistic[:id]}/statistics", + target: '_blank', data: { toggle: 'tooltip', title: '点击查看学校统计概况' } %> <%= statistic[:teacher_count].to_i %> <%= statistic[:student_count].to_i %>
- <%= link_to statistic.school_name, '' %> + <%= link_to statistic.school_name, "/colleges/#{statistic.school_id}/statistics", + target: '_blank', data: { toggle: 'tooltip', title: '点击查看学校统计概况' } %> <%= statistic['total'] %> <%= statistic['other_total'] %>
- <%= link_to statistic.school_name, '' %> + <%= link_to statistic.school_name, "/colleges/#{statistic.school_id}/statistics", + target: '_blank', data: { toggle: 'tooltip', title: '点击查看学校统计概况' } %> <%= statistic.teacher_increase_count.to_i %> <%= statistic.student_increase_count.to_i %>