From 79d1acd0164f6d8958919698d79e1880ea29528c Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Tue, 24 Dec 2019 17:41:19 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E9=9A=90=E8=97=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/comments_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/comments_controller.rb b/app/controllers/comments_controller.rb index c011d53ec..c5d3082ba 100644 --- a/app/controllers/comments_controller.rb +++ b/app/controllers/comments_controller.rb @@ -52,7 +52,7 @@ class CommentsController < ApplicationController def hidden if current_user.admin_or_business? @discuss = @hack.discusses.where(id: params[:id]).first - @discuss.update_attribute(:hidden, params[:hidden] == "1") + @discuss.update_attribute(:hidden, params[:hidden].to_i == 1) sucess_status else Educoder::TipException(403, "..") From 0d6004562513637b81ead101b8d33989a91b6f6e Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Tue, 24 Dec 2019 17:49:44 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fork=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/shixuns/get_data_sets.json.jbuilder | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/views/shixuns/get_data_sets.json.jbuilder b/app/views/shixuns/get_data_sets.json.jbuilder index 20ced2acd..82ef309f7 100644 --- a/app/views/shixuns/get_data_sets.json.jbuilder +++ b/app/views/shixuns/get_data_sets.json.jbuilder @@ -5,7 +5,9 @@ json.data_sets do json.author set.author.real_name json.created_on set.created_on json.filesize number_to_human_size(set.filesize) - json.file_path "#{@absolute_folder}/#{set.relative_path_filename}" + # 这里需要去除shixunfiles目录后的标识;因为Jupyter代码里面会写死这样的路径,当实训fork后,这个版本库的路径无法修改,因此给用户展示的 + # 还是/data/shixunfiles/+文件名这种形式 + json.file_path "#{@absolute_folder}/#{set.relative_path_filename}".gsub("/#{@shixun.identifier}", "") end end json.data_sets_count @data_count \ No newline at end of file