From 668555626d5a48916f095948fae97042f07415a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Sat, 29 Jun 2019 18:06:43 +0800 Subject: [PATCH 01/34] b --- public/react/src/modules/tpm/NewHeader.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/tpm/NewHeader.js b/public/react/src/modules/tpm/NewHeader.js index 79eccf2b..9969141a 100644 --- a/public/react/src/modules/tpm/NewHeader.js +++ b/public/react/src/modules/tpm/NewHeader.js @@ -294,7 +294,7 @@ class NewHeader extends Component { -
  • 教学案例
  • + {/*
  • 教学案例
  • */}
  • 竞赛
  • 问答
  • {ecUrl===null||ecUrl===undefined||ecUrl===""?'':'认证'}
  • From 53363b00d3a773af4c15f4c3b522d4b990b90f7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Mon, 1 Jul 2019 11:10:48 +0800 Subject: [PATCH 02/34] =?UTF-8?q?=E9=A1=B6=E9=83=A8=E5=AF=BC=E8=88=AA?= =?UTF-8?q?=E6=96=87=E5=AD=97=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/NewHeader.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/public/react/src/modules/tpm/NewHeader.js b/public/react/src/modules/tpm/NewHeader.js index 9969141a..30d8572c 100644 --- a/public/react/src/modules/tpm/NewHeader.js +++ b/public/react/src/modules/tpm/NewHeader.js @@ -272,7 +272,7 @@ class NewHeader extends Component { - {/*
  • 教学案例
  • */} -
  • 竞赛
  • -
  • 问答
  • -
  • {ecUrl===null||ecUrl===undefined||ecUrl===""?'':'认证'}
  • + {/*
  • 教学案例
  • */} +
  • 在线竞赛
  • +
  • 交流问答
  • +
  • {ecUrl===null||ecUrl===undefined||ecUrl===""?'':'工程认证'}
  • - <%= link_to '确认提交', 'javascript:void(0)', class: 'white-btn edu-blueback-btn changebtn mr20 fl apply-publish-btn' %> + <%= link_to '申请发布', 'javascript:void(0)', class: 'white-btn edu-blueback-btn changebtn mr20 fl apply-publish-btn' %> <%= link_to '保存', 'javascript:void(0)', class: 'white-btn edu-blueline-btn changebtn mr20 fl submit-btn' %>
    <% end %> @@ -86,43 +86,38 @@ imageUploadURL: "<%= upload_with_markdown_path(container_id: 0, container_type: 'MarkDown') %>" //url }); - $(function(){ - var submitForm = function(){ - var title = $("input[name='library[title]']").val(); - var content = $("textarea[name='library[content]']").val(); + var submitForm = function(){ + var title = $("input[name='library[title]']").val(); + var content = $("textarea[name='library[content]']").val(); - if (!title || title.length == 0) { - $("#title_notice").removeClass("none"); - return - }else{ - $("#title_notice").addClass("none"); - } - if (!content || content.length == 0) { - $("#des_notice").removeClass("none"); - return - }else{ - $("#des_notice").addClass("none"); - } + if (!title || title.length == 0) { + $("#title_notice").removeClass("none"); + return + }else{ + $("#title_notice").addClass("none"); + } + if (!content || content.length == 0) { + $("#des_notice").removeClass("none"); + return + }else{ + $("#des_notice").addClass("none"); + } - if($('.attachments_fields .attachment').length == 0){ - $("#file_notice").removeClass("none"); - return - }else{ - $("#file_notice").addClass("none"); - } + if($('.attachments_fields .attachment').length == 0){ + $("#file_notice").removeClass("none"); + return + }else{ + $("#file_notice").addClass("none"); + } - $('.library-form-container form').submit(); - }; + $('.library-form-container form').submit(); + }; + $(function(){ $('.apply-publish-btn').on('click', function(){ - $('input[name="apply_publish"]').val(true); + $("input[name='apply_publish']").val(true); submitForm(); }); $('.submit-btn').on('click', submitForm); - - var message = '<%= flash[:message] %>'; - if (message.length > 0) { - sure_confirm_box("提示",450,200,message); - } - }) + }); \ No newline at end of file diff --git a/app/views/libraries/index.html.erb b/app/views/libraries/index.html.erb index 7c8d099f..cc34dc81 100644 --- a/app/views/libraries/index.html.erb +++ b/app/views/libraries/index.html.erb @@ -16,7 +16,7 @@
    <%= hidden_field_tag(:type, params[:type]) %> - +
    @@ -36,7 +36,7 @@ var search = $("#search_name").val(); var type = $("input[name='type']").val(); $.ajax({ - url: "/libraries", + url: "<%= libraries_path %>", dataType: 'script', data: {search: search, type: type} }); diff --git a/app/views/libraries/show.html.erb b/app/views/libraries/show.html.erb index 5b196712..9de5e65e 100644 --- a/app/views/libraries/show.html.erb +++ b/app/views/libraries/show.html.erb @@ -1,5 +1,5 @@ <% - admin_or_self = User.current.admin? || @library.user_id == User.current.id + admin_or_self = admin_or_business? || @library.user_id == User.current.id %>

    @@ -42,7 +42,11 @@

    详情 - <% if admin_or_self && @library.editable? %> + <% if admin_or_business? || @library.user_id == User.current.id && @Library.pending? %> + <%= link_to '删除', 'javascript:void(0);', data: { id: @library.id }, + class: 'white-btn edu-blueline-btn fr ml20 delete-btn' %> + <% end %> + <% if admin_or_self %> <%= link_to '编辑', edit_library_path(id: @library.id), class: 'white-btn edu-blueline-btn fr' %> <% end %>

    @@ -99,13 +103,35 @@ sequenceDiagram: true // 默认不解析 }); $(function(){ + // 删除 + $('.delete-btn').on('click', function(){ + var id = $(this).data('id'); + op_confirm_tip_1("是否确认删除?", "destroyLibrary(" + id + ");") + }); + + if ($('#private_reason_ul').length != 0) { var height=document.getElementById("private_reason_ul").offsetHeight; var one=parseInt($("#private_reason_ul").find("li").eq(0).height())+10; var two=parseInt($("#private_reason_ul").find("li").eq(1).height()); var plus=one+two; if(parseInt(height)>166){ - $("#actionPanel").html('点击展开'); - $(".private_reason").css({maxHeight:plus+"px"}); + $("#actionPanel").html('点击展开'); + $(".private_reason").css({maxHeight:plus+"px"}); } + } }) + + function destroyLibrary (id) { + $.ajax({ + type: "DELETE", + url: "<%= libraries_path %>/" + id, + success: function (data) { + if(data && data.status == 0){ + notice_box_redirect("<%= libraries_path %>", "删除成功"); + } else { + notice_box(data.message); + } + } + }); + } \ No newline at end of file From 73cb709cccb14c9ada1692e81c685032b03dab42 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Mon, 1 Jul 2019 15:03:35 +0800 Subject: [PATCH 07/34] =?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/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 221acf3c..b830776b 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -2550,7 +2550,7 @@ class CoursesController < ApplicationController sheet2[count_row,1] = act_member.user.show_real_name sheet2[count_row,2] = act_member.user.login sheet2[count_row,3] = act_member.user.user_extensions.student_id - sheet2[count_row,4] = act_member.course_group_id == 0 ? "暂无" : act_member.course_group.name + sheet2[count_row,4] = act_member.course_group_id == 0 ? "暂无" : act_member.course_group.try(:name) sheet2[count_row,5]= act_member.homework_num.to_i + act_member.graduation_num.to_i sheet2[count_row,6]= act_member.exercise_num sheet2[count_row,7]= act_member.poll_num From 7164af459a4c0f1763f1e0ab191c90d79df30ba4 Mon Sep 17 00:00:00 2001 From: p31729568 Date: Mon, 1 Jul 2019 15:11:33 +0800 Subject: [PATCH 08/34] fix --- app/views/libraries/show.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/libraries/show.html.erb b/app/views/libraries/show.html.erb index 9de5e65e..f857a8ec 100644 --- a/app/views/libraries/show.html.erb +++ b/app/views/libraries/show.html.erb @@ -42,7 +42,7 @@

    详情 - <% if admin_or_business? || @library.user_id == User.current.id && @Library.pending? %> + <% if admin_or_business? || @library.user_id == User.current.id && @library.pending? %> <%= link_to '删除', 'javascript:void(0);', data: { id: @library.id }, class: 'white-btn edu-blueline-btn fr ml20 delete-btn' %> <% end %> From 763dac6cd5b8b2521f78a41c7f6228e1f08ca371 Mon Sep 17 00:00:00 2001 From: p31729568 Date: Mon, 1 Jul 2019 15:24:36 +0800 Subject: [PATCH 09/34] fix library --- app/controllers/libraries_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/libraries_controller.rb b/app/controllers/libraries_controller.rb index 68b36df0..1d72f158 100644 --- a/app/controllers/libraries_controller.rb +++ b/app/controllers/libraries_controller.rb @@ -40,7 +40,7 @@ class LibrariesController < ApplicationController redirect_to publish_success_libraries_path else flash[:message] = '保存成功' - render 'new' + redirect_to edit_library_path(id: @library.id) end rescue ActiveRecord::RecordInvalid => _ render 'new' @@ -64,7 +64,7 @@ class LibrariesController < ApplicationController redirect_to publish_success_libraries_path else flash[:message] = '保存成功' - render 'edit' + redirect_to edit_library_path(id: @library.id) end rescue ActiveRecord::RecordInvalid => _ render 'edit' From 9a87534f1c17943e900ffee2079d7bf4461b4249 Mon Sep 17 00:00:00 2001 From: p31729568 Date: Mon, 1 Jul 2019 15:32:39 +0800 Subject: [PATCH 10/34] published library disable publish action --- app/views/libraries/_form.html.erb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/views/libraries/_form.html.erb b/app/views/libraries/_form.html.erb index 86abea58..b3ed4721 100644 --- a/app/views/libraries/_form.html.erb +++ b/app/views/libraries/_form.html.erb @@ -49,7 +49,9 @@

    - <%= link_to '申请发布', 'javascript:void(0)', class: 'white-btn edu-blueback-btn changebtn mr20 fl apply-publish-btn' %> + <% unless @library.published? %> + <%= link_to '申请发布', 'javascript:void(0)', class: 'white-btn edu-blueback-btn changebtn mr20 fl apply-publish-btn' %> + <% end %> <%= link_to '保存', 'javascript:void(0)', class: 'white-btn edu-blueline-btn changebtn mr20 fl submit-btn' %>
    <% end %> From 48e34a40b5a6b077f7b5f3a578de29ba93539bb1 Mon Sep 17 00:00:00 2001 From: p31729568 Date: Mon, 1 Jul 2019 15:33:39 +0800 Subject: [PATCH 11/34] modify --- app/services/libraries/submit_service.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/services/libraries/submit_service.rb b/app/services/libraries/submit_service.rb index 6af3284b..0beec7de 100644 --- a/app/services/libraries/submit_service.rb +++ b/app/services/libraries/submit_service.rb @@ -8,7 +8,7 @@ class Libraries::SubmitService end def call - return if library.processing? + return if library.processing? || library.published? raise Error, '该状态下不能提交审核' unless library.may_submit? From eaa56819b441b6bfa87729f1673963fdabbf442c Mon Sep 17 00:00:00 2001 From: p31729568 Date: Tue, 2 Jul 2019 08:43:43 +0800 Subject: [PATCH 12/34] modify --- app/views/competitions/_qg_second_course_competition.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/competitions/_qg_second_course_competition.html.erb b/app/views/competitions/_qg_second_course_competition.html.erb index b808deab..3ac9fbc0 100644 --- a/app/views/competitions/_qg_second_course_competition.html.erb +++ b/app/views/competitions/_qg_second_course_competition.html.erb @@ -17,9 +17,9 @@
    <%= first_section.competition_entries[0].name %> + class="<%= is_start ? 'active' : '' %>" target="_blank"><%= first_section.competition_entries[0].name %> <%= first_section.competition_entries[1].name %> + class="<%= is_start ? 'active' : '' %>" target="_blank"><%= first_section.competition_entries[1].name %>
    <%= first_section.competition_entries[2].name %> From 23e2c3669ba2767421094370c90f5cbfb5fe75b2 Mon Sep 17 00:00:00 2001 From: p31729568 Date: Tue, 2 Jul 2019 09:43:36 +0800 Subject: [PATCH 13/34] modify management school statistic list --- app/views/managements/schools/_statistics_list.html.erb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/views/managements/schools/_statistics_list.html.erb b/app/views/managements/schools/_statistics_list.html.erb index 7fb6300d..5d21f1cc 100644 --- a/app/views/managements/schools/_statistics_list.html.erb +++ b/app/views/managements/schools/_statistics_list.html.erb @@ -2,8 +2,7 @@ 序号 - ID - 单位名称 + 单位名称 <%= sort_tag('教师总人数', name: 'teacher_count', path: school_report_managements_path) %> <%= sort_tag('学生总人数', name: 'student_count', path: school_report_managements_path) %> @@ -23,8 +22,7 @@ <% @schools.each_with_index do |school, index| %> <%= (@obj_pages.page - 1) * @obj_pages.per_page + index + 1 %> - <%= school[:id] %> - <%= school[:name] %> + <%= link_to school[:name], statistics_college_path(id: school[:id]), target: '_blank', data: { tip_down: '点击查看学校统计概况'} %> <%= school[:teacher_count].to_i %> <%= school[:student_count].to_i %> <%= school[:course_count].to_i %> From 1624e9321c53e913bd10e8f1242a06295afd97af Mon Sep 17 00:00:00 2001 From: p31729568 Date: Tue, 2 Jul 2019 10:00:41 +0800 Subject: [PATCH 14/34] modify school statistic page --- .../managements/schools/_data_contrast_list.html.erb | 9 +++++---- app/views/managements/schools/_data_grow_list.html.erb | 8 ++++---- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/app/views/managements/schools/_data_contrast_list.html.erb b/app/views/managements/schools/_data_contrast_list.html.erb index c25a8bc4..a4a7919b 100644 --- a/app/views/managements/schools/_data_contrast_list.html.erb +++ b/app/views/managements/schools/_data_contrast_list.html.erb @@ -19,8 +19,7 @@ 序号 - ID - 单位名称 + 单位名称 时段一
    <%= "(#{params[:begin_date]} 05:00至#{(Time.zone.parse(params[:end_date]) + 1.days).strftime('%Y-%m-%d')} 05:00)" %> 时段二
    <%= "(#{params[:other_begin_date]} 05:00至#{(Time.zone.parse(params[:other_end_date]) + 1.days).strftime('%Y-%m-%d')} 05:00)" %> @@ -33,8 +32,10 @@ <% @reports.each_with_index do |report, index| %> <%= (@obj_pages.page - 1) * @obj_pages.per_page + index + 1 %> - <%= report.school_id %> - <%= report.school_name %> + + <%= link_to report.school_name, statistics_college_path(id: report.school_id), + target: '_blank', data: { tip_down: '点击查看学校统计概况'} %> + <%= report['total'] %> <%= report['other_total'] %> <% diff --git a/app/views/managements/schools/_data_grow_list.html.erb b/app/views/managements/schools/_data_grow_list.html.erb index af1fc200..708be475 100644 --- a/app/views/managements/schools/_data_grow_list.html.erb +++ b/app/views/managements/schools/_data_grow_list.html.erb @@ -20,9 +20,7 @@ 序号 - ID 单位名称 - <%= sort_tag('新增教师', name: 'teacher_increase_count', path: school_data_grow_managements_path) %> <%= sort_tag('新增学生', name: 'student_increase_count', path: school_data_grow_managements_path) %> <%= sort_tag('新增课堂', name: 'course_increase_count', path: school_data_grow_managements_path) %> @@ -36,8 +34,10 @@ <% @reports.each_with_index do |report, index| %> <%= (@obj_pages.page - 1) * @obj_pages.per_page + index + 1 %> - <%= report.school_id %> - <%= report.school_name %> + + <%= link_to report.school_name, statistics_college_path(id: report.school_id), + target: '_blank', data: { tip_down: '点击查看学校统计概况'} %> + <%= report.teacher_increase_count.to_i %> <%= report.student_increase_count.to_i %> <%= report.course_increase_count.to_i %> From a45038a1e7398207a640507d031bd8a11d424343 Mon Sep 17 00:00:00 2001 From: jingquan huang Date: Tue, 2 Jul 2019 15:03:30 +0800 Subject: [PATCH 15/34] =?UTF-8?q?rake=20=E4=BB=BB=E5=8A=A1=E5=AF=BC?= =?UTF-8?q?=E5=87=BA=E7=89=88=E6=9C=AC=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/tasks/homework_git_file.rake | 43 ++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 lib/tasks/homework_git_file.rake diff --git a/lib/tasks/homework_git_file.rake b/lib/tasks/homework_git_file.rake new file mode 100644 index 00000000..f8a5253a --- /dev/null +++ b/lib/tasks/homework_git_file.rake @@ -0,0 +1,43 @@ +namespace :homework do + def tran_base64_decode64 str + if str.blank? + str + else + s_size = str.size % 4 + if s_size != 0 + str += "=" * (4 - s_size) + end + Base64.decode64(str.tr("-_", "+/")).force_encoding("utf-8") + end + end + + task :gitfiledown => :environment do + begin + puts ENV['args'] + system("tmp/homework_file") if File.exist?("tmp/homework_file") + homework_common = HomeworkCommon.find(ENV['args']) + student_works = homework_common.student_works + student_works.each do |sw| + username = sw.user.try(:show_real_name) + myshixun = sw.try(:myshixun) + puts myshixun.try(:gpid) + if myshixun.try(:gpid) + content = g.files(myshixun.gpid, "PL/PL.cpp", "master").try(:content) + tran_content = tran_base64_decode64(content) + path = "tmp/homework_file/#{username}" + FileUtils.mkdir_p(path) unless File.exist?(path) + system("cd #{path}; touch PL.cpp") + aFile = File.new("#{path}/PL.cpp", "r+") + if aFile + aFile.syswrite(tran_content) + else + puts "Unable to open file!" + end + end + end + rescue Exception => e + Rails.logger.error(e.message) + end + end +end + From 3a9700b3525d74a8caaad7392e9b61158eef7ef6 Mon Sep 17 00:00:00 2001 From: jingquan huang Date: Tue, 2 Jul 2019 15:19:59 +0800 Subject: [PATCH 16/34] rescue --- lib/tasks/homework_git_file.rake | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/tasks/homework_git_file.rake b/lib/tasks/homework_git_file.rake index f8a5253a..30169735 100644 --- a/lib/tasks/homework_git_file.rake +++ b/lib/tasks/homework_git_file.rake @@ -12,7 +12,7 @@ namespace :homework do end task :gitfiledown => :environment do - begin + # begin puts ENV['args'] system("tmp/homework_file") if File.exist?("tmp/homework_file") homework_common = HomeworkCommon.find(ENV['args']) @@ -35,9 +35,9 @@ namespace :homework do end end end - rescue Exception => e - Rails.logger.error(e.message) - end + # rescue Exception => e + # Rails.logger.error(e.message) + # end end end From 9c7523a7957d41904edea4b6dc05ca093b40aa8c Mon Sep 17 00:00:00 2001 From: jingquan huang Date: Tue, 2 Jul 2019 15:22:08 +0800 Subject: [PATCH 17/34] gitlab client --- lib/tasks/homework_git_file.rake | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/tasks/homework_git_file.rake b/lib/tasks/homework_git_file.rake index 30169735..f0102c37 100644 --- a/lib/tasks/homework_git_file.rake +++ b/lib/tasks/homework_git_file.rake @@ -17,6 +17,7 @@ namespace :homework do system("tmp/homework_file") if File.exist?("tmp/homework_file") homework_common = HomeworkCommon.find(ENV['args']) student_works = homework_common.student_works + g = Gitlab.client student_works.each do |sw| username = sw.user.try(:show_real_name) myshixun = sw.try(:myshixun) From a75b92e574a9728a4895a7c3e6bf566d163f7f59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Wed, 3 Jul 2019 10:44:18 +0800 Subject: [PATCH 18/34] =?UTF-8?q?=E5=88=97=E8=A1=A8=E5=A4=9A=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E9=97=AE=E9=A2=98=E8=B0=83=E6=95=B4=EF=BC=8C=E9=82=80?= =?UTF-8?q?=E8=AF=B7=E7=A0=81=E6=96=87=E5=AD=97=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/courses/_join_private_course.html.erb | 4 ++-- app/views/student_work/_evaluation_un_group_title.html.erb | 4 ++-- public/stylesheets/educoder/edu-all.css | 3 +++ 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/app/views/courses/_join_private_course.html.erb b/app/views/courses/_join_private_course.html.erb index f8876ae8..575ded92 100644 --- a/app/views/courses/_join_private_course.html.erb +++ b/app/views/courses/_join_private_course.html.erb @@ -8,9 +8,9 @@
    • - +
    • -

      请输入五位课堂邀请码

      +

      请输入5位课堂邀请码或6位分班邀请码

    • diff --git a/app/views/student_work/_evaluation_un_group_title.html.erb b/app/views/student_work/_evaluation_un_group_title.html.erb index d782fe7f..f3ca6649 100644 --- a/app/views/student_work/_evaluation_un_group_title.html.erb +++ b/app/views/student_work/_evaluation_un_group_title.html.erb @@ -50,11 +50,11 @@ <%= student_work.group_id == 0 ? '--' : '分组'+student_work.group_id.to_s %> <% if @homework.homework_detail_group.base_on_project == 1 %> - + <% if student_work.project %> <% project = student_work.project %> <% if project.status != 9 && (project.is_public || User.current.member_of?(project) || @is_teacher) %> - <%= link_to project.name, project_path(project.id), :class => 'color-grey3 task-hide', :style => "max-width:120px;", :title => "项目名称", :target => "_blank" %> + <%= link_to project.name, project_path(project.id), :class => 'color-grey3 task-hide inlineblock', :style => "max-width:120px;", :title => "项目名称", :target => "_blank" %> <% elsif project.status != 9 %> <%= project.name %> <% else %> diff --git a/public/stylesheets/educoder/edu-all.css b/public/stylesheets/educoder/edu-all.css index 24d992c9..c550bac6 100644 --- a/public/stylesheets/educoder/edu-all.css +++ b/public/stylesheets/educoder/edu-all.css @@ -3423,4 +3423,7 @@ line-height: 16px;display: inline-block;color: rgba(65, 140, 205, 1) !important; } .width698{ width: 698px; +} +.inlineblock{ + display:inline-block; } \ No newline at end of file From 5d1ad32eb8f59992354d37249b23cbb528c48691 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Wed, 3 Jul 2019 10:49:40 +0800 Subject: [PATCH 19/34] =?UTF-8?q?=E6=B6=88=E6=81=AF=E6=8A=A5500?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/tiding.rb | 2 +- app/services/games_service.rb | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/app/models/tiding.rb b/app/models/tiding.rb index c5b2e6a3..5107374e 100644 --- a/app/models/tiding.rb +++ b/app/models/tiding.rb @@ -252,7 +252,7 @@ class Tiding < ActiveRecord::Base if self.tiding_type == "Mentioned" "@了你:" + message_content(container.notes) elsif self.tiding_type == "Comment" - "评论了你" + (container.parent.present? ? "的回复:" : "发布的项目issue:") + message_content(container.notes) + container.present? ? ("评论了你" + (container.parent.present? ? "的回复:" : "发布的项目issue:") + message_content(container.notes)) : "" else "更新了Issue:#{container.issue.subject}" end diff --git a/app/services/games_service.rb b/app/services/games_service.rb index 8589023a..7cfe9107 100644 --- a/app/services/games_service.rb +++ b/app/services/games_service.rb @@ -568,7 +568,6 @@ class GamesService testCases = Base64.urlsafe_encode64(testSet.to_json) unless testSet.blank? - # 注意:这个地方的参数写的时候不能换行 content_modified = params[:content_modified] # 决定文件内容是否有修改,有修改如果中间成pull没有更新,则轮询等待更新 params = {:tpiID => "#{myshixun.id}", :tpiGitURL => "#{gitUrl}", :buildID => "#{taskId}",:instanceChallenge => "#{step}", From b3fe83f61b17dc8aa394e3d71578c16bf2fb2966 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Wed, 3 Jul 2019 11:34:05 +0800 Subject: [PATCH 20/34] =?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/views/student_work/_evaluation_un_group_title.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/student_work/_evaluation_un_group_title.html.erb b/app/views/student_work/_evaluation_un_group_title.html.erb index d782fe7f..45756245 100644 --- a/app/views/student_work/_evaluation_un_group_title.html.erb +++ b/app/views/student_work/_evaluation_un_group_title.html.erb @@ -36,7 +36,7 @@ <%= student_work.user.show_real_name %> <% group_id = @members.select{|m|m.user_id==student_work.user_id}.first.try(:course_group_id) %> - <% group_name = group_id.to_i == 0 ? '未分班' : @course.course_groups.find_by_id(group_id).name %> + <% group_name = group_id.to_i == 0 ? '未分班' : @course.course_groups.find_by_id(group_id).try(:name) %> <%= group_name %> From 4e90213802ca54dd2b8234c21fafe8d775bfbadd Mon Sep 17 00:00:00 2001 From: p31729568 Date: Wed, 3 Jul 2019 15:40:54 +0800 Subject: [PATCH 21/34] competition setting support 0 teacher --- app/models/competition_staff.rb | 2 +- .../competition_teams/_competition_team_form.html.erb | 8 ++++---- app/views/competition_teams/_search_member_list.html.erb | 2 ++ app/views/competition_teams/_search_teacher_list.html.erb | 1 + app/views/managements/_competition_list_page.html.erb | 8 ++++---- 5 files changed, 12 insertions(+), 9 deletions(-) diff --git a/app/models/competition_staff.rb b/app/models/competition_staff.rb index bfa1daba..1a949460 100644 --- a/app/models/competition_staff.rb +++ b/app/models/competition_staff.rb @@ -6,7 +6,7 @@ class CompetitionStaff < ActiveRecord::Base belongs_to :competition validates :position, numericality: { only_integer: true } - validates :minimum, numericality: { only_integer: true, greater_than: 0 } + validates :minimum, numericality: { only_integer: true, greater_than_or_equal_to: 0 } validates :maximum, numericality: { only_integer: true, greater_than_or_equal_to: lambda { |obj| obj.minimum } } validates :category, presence: true, inclusion: { in: %w(all teacher student profession) } diff --git a/app/views/competition_teams/_competition_team_form.html.erb b/app/views/competition_teams/_competition_team_form.html.erb index c182c138..359a1d11 100644 --- a/app/views/competition_teams/_competition_team_form.html.erb +++ b/app/views/competition_teams/_competition_team_form.html.erb @@ -16,7 +16,7 @@
      - maxlength="20" value="<%= @team.try(:name) %>" class="input-flex-35" style="margin-right: 102px;" placeholder="请输入您的组队名称"/> + maxlength="20" value="<%= @team.try(:name) %>" class="input-flex-35" placeholder="请输入您的组队名称"/>

      @@ -24,7 +24,7 @@
      - autocomplete="off" placeholder="请您输入老师姓名进行搜索" id="teacher_search_input" + autocomplete="off" placeholder="请您输入老师姓名进行搜索;可以后续再添加导师" id="teacher_search_input" value="<%= @team.try(:id).present? ? @team.teacher.try(:show_name) : (@team_user.user_extensions.identity == 0 ? @team_user.show_name : "") %>"> "> "> @@ -34,7 +34,7 @@
      - 添加导师 +

      <% end %> @@ -52,7 +52,7 @@
    - 添加成员 +

    <% end %> diff --git a/app/views/competition_teams/_search_member_list.html.erb b/app/views/competition_teams/_search_member_list.html.erb index 901b034d..bf4a9b8d 100644 --- a/app/views/competition_teams/_search_member_list.html.erb +++ b/app/views/competition_teams/_search_member_list.html.erb @@ -28,6 +28,8 @@ $("#member_notice").hide(); $("#pointerStudent").hide(); e.stopPropagation(); + + $('.add-member-btn').trigger('click'); }); $("body").click(function(){ $(".pointerTeacher").hide(); diff --git a/app/views/competition_teams/_search_teacher_list.html.erb b/app/views/competition_teams/_search_teacher_list.html.erb index de62c131..54538382 100644 --- a/app/views/competition_teams/_search_teacher_list.html.erb +++ b/app/views/competition_teams/_search_teacher_list.html.erb @@ -25,6 +25,7 @@ $("#pointerTeacher").hide(); $("#teacher_notice").hide(); e.stopPropagation(); + $('.add-teacher-btn').trigger('click'); }); $("body").click(function(){ $(".pointerTeacher").hide(); diff --git a/app/views/managements/_competition_list_page.html.erb b/app/views/managements/_competition_list_page.html.erb index 94cacc8d..073d1133 100644 --- a/app/views/managements/_competition_list_page.html.erb +++ b/app/views/managements/_competition_list_page.html.erb @@ -79,9 +79,9 @@ <% @competition.competition_staffs.each do |staff| %>
    <%= select_tag('competition_staffs[][category]', options_for_select(CompetitionStaff.category_options, staff.category), class: 'winput-120-30') %> - +   ~   - + @@ -168,9 +168,9 @@ - <%=render :partial =>"users/intro_content", :locals=>{:user_activity_id => user_activity_id, :content => activity.description} %> - -
    <%# 局部刷新:修改xissue属性 %> <% if User.current.member_of?(activity.project) && !activity.nil? && !activity.status.nil? %> @@ -74,15 +47,10 @@ <% end %> <% end %>
    -
    - <%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %> -
    -
    - <%= render :partial => 'projects/project_issue_reply', :locals => {:activity => activity, :user_activity_id => user_activity_id} %> -
    +