From 40dfc7d490ed6d8b0b1123af9152fe4b9622c09a Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Wed, 23 Oct 2019 17:27:15 +0800 Subject: [PATCH 01/31] =?UTF-8?q?python=E6=96=87=E4=BB=B6=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/myshixuns_controller.rb | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/app/controllers/myshixuns_controller.rb b/app/controllers/myshixuns_controller.rb index 4e587513a..4b2e3f54f 100644 --- a/app/controllers/myshixuns_controller.rb +++ b/app/controllers/myshixuns_controller.rb @@ -264,11 +264,13 @@ class MyshixunsController < ApplicationController unless @hide_code || (@myshixun.shixun&.vnc_evaluate && params[:evaluate].present?) # 远程版本库文件内容 last_content = GitService.file_content(repo_path: @repo_path, path: path)["content"] - content = if @myshixun.mirror_name.select {|a| a.include?("MachineLearning") || a.include?("Python")}.present? && params[:content].present? - params[:content].gsub(/\t/, ' ').gsub(/ /, ' ') # 这个不是空格,在windows机器上带来的问题 - else - params[:content] - end + + content = + if python_file?(path) + params[:content].gsub(/\t/, ' ').gsub(/ /, ' ') + else + params[:content] + end uid_logger_dubug("###11222333####{content}") uid_logger_dubug("###222333####{last_content}") @@ -374,4 +376,9 @@ class MyshixunsController < ApplicationController @repo_path = @myshixun.try(:repo_path) @path = params[:path] end + + def python_file?(path) + false if path.blank? + path.to_s.split(".").last.downcase == "py" + end end From b1658ead34f88911e29fb6492b1afe11de422dfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Thu, 24 Oct 2019 12:23:17 +0800 Subject: [PATCH 02/31] tiaozheng --- .../src/modules/courses/coursesDetail/CoursesBanner.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/public/react/src/modules/courses/coursesDetail/CoursesBanner.js b/public/react/src/modules/courses/coursesDetail/CoursesBanner.js index 9ebd3f767..f6e3ce781 100644 --- a/public/react/src/modules/courses/coursesDetail/CoursesBanner.js +++ b/public/react/src/modules/courses/coursesDetail/CoursesBanner.js @@ -481,9 +481,9 @@ class CoursesBanner extends Component { document.title=coursedata===undefined || coursedata.status===401 || coursedata.status===407?"":coursedata.name; return (
{item.name === undefined || item.name === null || item.name === "" ? "--" : item.name}
-{item.identity === undefined || item.identity === null || item.identity === "" ? "--" : item.identity}
-{item.school_name === undefined || item.school_name === null || item.school_name === "" ? "--" : item.school_name}
+ + {item.name === undefined || item.name === null || item.name === "" ? + -- + : + {item.name} + } + {item.identity === undefined || item.identity === null || item.identity === "" ? +--
+ : + {item.identity}} + {item.school_name === undefined || item.school_name === null || item.school_name === "" ? + +--
+ : + {item.school_name} + } + + { + this.props.teamutiple_limited === undefined || this.props.teamutiple_limited === null ? +{""}
+ : + ( + this.props.teamutiple_limited === true ? +{item.enrollable === false ? "已加入其他战队" : ""}
+ : +{""}
+ ) + + } + + + + ); } @@ -953,24 +1023,62 @@ class PersonModal extends Component { }} onClick={() => this.getdatacpersondiv1Items2(item)} > -{item.name === undefined || item.name === null || item.name === "" ? "--" : item.name}
-{item.identity === undefined || item.identity === null || item.identity === "" ? "--" : item.identity}
-{item.school_name === undefined || item.school_name === null || item.school_name === "" ? "--" : item.school_name}
+ + {item.name === undefined || item.name === null || item.name === "" ? + -- + : + {item.name} + } + {item.student_id === undefined || item.student_id === null || item.student_id === "" ? +--
+ : + {"学号:" + item.student_id}} + {item.school_name === undefined || item.school_name === null || item.school_name === "" ? + +--
+ : + {item.school_name} + } + { this.props.mutiple_limited === undefined || this.props.mutiple_limited === null ?
- {/*
创建者
: -{item.type === undefined || item.type === null || item.type === "" ? "--" : item.type}
+ >{item.type === undefined || item.type === null || item.type === "" ? "--" : item.type} } -{item.school_name === undefined || item.school_name === null || item.school_name === "" ? "--" : item.school_name}
-{item.school_name === undefined || item.school_name === null || item.school_name === "" ? "--" : item.school_name} + {item.identity === undefined || item.identity === null || item.identity === "" ? "--" : item.identity}
+ >{item.identity === undefined || item.identity === null || item.identity === "" ? "--" : item.identity} { index === 0 ? - : -
-
+