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/20] 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 2e21a3b98320392afedd5226e6c5ed2bd7b52f6a Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Mon, 1 Jul 2019 09:20:12 +0800 Subject: [PATCH 02/20] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E9=A6=96=E9=A1=B5-?= =?UTF-8?q?=E7=AD=9B=E9=80=89=E6=8F=90=E4=BA=A4=E5=AD=90=E7=BA=A7-?= =?UTF-8?q?=E6=BB=9A=E5=8A=A8=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/stylesheets/educoder/edu-all.css | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/stylesheets/educoder/edu-all.css b/public/stylesheets/educoder/edu-all.css index db1a8de5..24d992c9 100644 --- a/public/stylesheets/educoder/edu-all.css +++ b/public/stylesheets/educoder/edu-all.css @@ -103,7 +103,8 @@ em.vertical-line{display: inline-block;width: 2px;background: #999;height: 10px} /*门户左侧导航栏*/ .user_navlist{position: absolute;left: 0px;width: 160px;top:0px;height: 100%;} .user_navlist_black{position: relative;width: 100%;height: 100%;border-radius: 8px 0px 0px 8px;background: rgba(0,0,0,0.8);} -.user_navlist_white{position: absolute;left: 160px;background: #FFFFff;width: 622px;min-height: 345px;top: 0px;z-index: 1;display: none;padding:0px 30px;box-sizing: border-box;box-shadow: 0px 0px 10px rgba(76,76,76,0.2);z-index: 99} +.user_navlist_white{position: absolute;left: 160px;background: #FFFFff;width: 622px;min-height: 345px;top: 0px;z-index: 1;display: none;padding:0px 30px; + box-sizing: border-box;box-shadow: 0px 0px 10px rgba(76,76,76,0.2);z-index: 99;max-height: 345px;overflow-y: auto;} .user_navlist_white a{color: #989898;margin-right: 15px;font-size: 14px;display: block;float: left;height: 30px;line-height: 30px;} .user_navlist_white a:hover{color: #4cacff} .headIcon{height: 100%;box-sizing: border-box;margin: 0px!important;} From 90ff7854693f81fa6b2253ce7763d13ee7199346 Mon Sep 17 00:00:00 2001 From: p31729568 Date: Mon, 1 Jul 2019 09:30:02 +0800 Subject: [PATCH 03/20] modify competition show page link button --- app/controllers/competitions_controller.rb | 2 + .../_gq_second_code_competition.html.erb | 40 +++++++++++++++---- .../_qg_second_competition.html.erb | 30 ++++++++++++-- app/views/layouts/base_competition.html.erb | 2 +- 4 files changed, 63 insertions(+), 11 deletions(-) diff --git a/app/controllers/competitions_controller.rb b/app/controllers/competitions_controller.rb index c1d918f6..c890ff6b 100644 --- a/app/controllers/competitions_controller.rb +++ b/app/controllers/competitions_controller.rb @@ -20,6 +20,8 @@ class CompetitionsController < ApplicationController def show @images = @competition.attachments + @user = current_user + @enrolled = @user && @user.logged? && @competition.team_members.exists?(user_id: @user.id) end def index diff --git a/app/views/competitions/_gq_second_code_competition.html.erb b/app/views/competitions/_gq_second_code_competition.html.erb index 35c5dd17..8d66af1a 100644 --- a/app/views/competitions/_gq_second_code_competition.html.erb +++ b/app/views/competitions/_gq_second_code_competition.html.erb @@ -12,21 +12,21 @@ description: "Weka是基于Java的机器学习与数据挖掘平台,汇集了最前沿的机器学习算法,包括处理标准数据挖掘问题的几乎所有方法:回归、分类、聚类、关联规则以及属性选择等,是Java机器学习入门的首选平台。

    本项目的Clusters目录中包含了K-Means、层次聚类等多种聚类算法以及相应的聚类效果评估方法的java实现", task: '标注../weka/clusterers/目录下的所有代码文件。', link_name: 'CSDN,经典聚类算法', - link_url: 'javascript:void(0)' + link_url: 'https://blog.csdn.net/qq_30262201/article/details/78799926' }, { name: 'C++项目', description: "该项目是GitHub上最受欢迎的C++语言实现经典算法与数据结构的项目之一,内容涵盖排序、链表、树结构、图搜索、贪心算法等。学习这些算法的代码实现,可以深刻理解和掌握算法的核心思想,感受算法之美,代码之美,是人工智能时代的基础入门一课。

    本项目的sort_search_problems目录涵盖了冒泡排序、快速排序等各类经典排序算法的C++实现。", task: '标注../sort_search_problems目录下的所有代码文件及对应引用的../include目录中自定义的头文件。', link_name: 'CSDN,十大经典排序算法', - link_url: 'javascript:void(0)' + link_url: 'https://blog.csdn.net/wfq784967698/article/details/79551476' }, { name: 'Python项目', description: "该项目是GitHub上最受欢迎的Python语言实现经典算法的项目之一,包含了前沿的神经网络和经典数据结构及算法的Python实现。项目具有兼顾经典和前沿的特点。学习经典算法的源码实现,感受经典算法的思想之美、代码之美。

    本项目的Sorts目录中包含了冒泡排序、快速排序等各类经典排序算法的Python实现。", task: '标注../sorts/目录下的所有代码文件。', link_name: 'CSDN,十大经典排序算法', - link_url: 'javascript:void(0)' + link_url: 'https://blog.csdn.net/wfq784967698/article/details/79551476' }, ], [{},{},{}], @@ -70,8 +70,8 @@ btn_url = is_start ? "#{entry.url}" : "javascript:void(0);" %> first_section.start_time ? 'target="_blank"' : "" %> ><%= entry.name %> + href="javascript:void(0);" + data-url="<%= btn_url %>"><%= entry.name %>

    <% if row_data.present? %> @@ -84,7 +84,9 @@ <%= row_data[:link_name] %>

    - 点击进入代标注模块 + 点击进入代标注模块

    <% end %> @@ -99,4 +101,28 @@ <% index += 1 %>

    <% index += 1 %> -

    \ No newline at end of file +

    + + \ No newline at end of file diff --git a/app/views/competitions/_qg_second_competition.html.erb b/app/views/competitions/_qg_second_competition.html.erb index 7c69854b..aa45d32e 100644 --- a/app/views/competitions/_qg_second_competition.html.erb +++ b/app/views/competitions/_qg_second_competition.html.erb @@ -17,9 +17,9 @@ <% "@urls[i][j][k]表示: 第i个比赛的第j个对象,的第k个url入口" %> <% is_start = Time.now > section.start_time %> <% section.competition_entries.each_with_index do |entry| %> - " - <%= Time.now > section.start_time ? 'target="_blank"' : "" %> ><%= entry.name %> + <%= link_to entry.name, 'javascript:void(0);', + class: "li-1 #{ is_start ? 'active' : ''}", + data: { url: is_start ? entry.url : 'javascript:void(0);' } %> <% end %> @@ -34,3 +34,27 @@
    <% index += 1 %>
    + + diff --git a/app/views/layouts/base_competition.html.erb b/app/views/layouts/base_competition.html.erb index 6124bad8..31185960 100644 --- a/app/views/layouts/base_competition.html.erb +++ b/app/views/layouts/base_competition.html.erb @@ -11,7 +11,7 @@ <%= favicon %> <%= javascript_heads %> <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'educoder/edu-main', 'educoder/edu-all', 'educoder/magic-check' %> - <%= javascript_include_tag 'educoder/edu_application' %> + <%= javascript_include_tag 'educoder/edu_application', 'edu/application' %> \ No newline at end of file diff --git a/app/views/libraries/_form.html.erb b/app/views/libraries/_form.html.erb index a1692e2b..86abea58 100644 --- a/app/views/libraries/_form.html.erb +++ b/app/views/libraries/_form.html.erb @@ -49,7 +49,7 @@
    - <%= 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 13/20] =?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 14/20] 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 15/20] 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 16/20] 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 17/20] 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 18/20] 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 19/20] 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 20/20] 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 %>