From 8f82781e94ab203cecc13c5ca0fe2260f26e8acf 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, 26 Dec 2019 14:12:42 +0800 Subject: [PATCH 01/18] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js b/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js index 63fb974c0..2717ba6b8 100644 --- a/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js +++ b/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js @@ -579,7 +579,7 @@ class Challengesjupyter extends Component {

导入

- {/**/} + {/**/} From f87c8e281558d9c4f2e4662a16da70346de9b6ac Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 26 Dec 2019 15:07:14 +0800 Subject: [PATCH 02/18] add log --- app/controllers/hacks_controller.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/hacks_controller.rb b/app/controllers/hacks_controller.rb index f93b2dab5..3dddf6100 100644 --- a/app/controllers/hacks_controller.rb +++ b/app/controllers/hacks_controller.rb @@ -188,6 +188,7 @@ class HacksController < ApplicationController def param_update_sets sets, all_sets_id delete_set_ids = all_sets_id - sets.map{|set|set[:id]} @hack.hack_sets.where(id: delete_set_ids).destroy_all + logger.info("#######sets:#{sets}") sets.each do |set| if all_sets_id.include?(set[:id]) update_attrs = {input: set[:input], output: set[:output], position: set[:position]} From 5e055cd2081c0795feb41e4c01ebc134b06122a5 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 26 Dec 2019 15:12:43 +0800 Subject: [PATCH 03/18] add log --- app/controllers/hacks_controller.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/controllers/hacks_controller.rb b/app/controllers/hacks_controller.rb index 3dddf6100..bdef733a3 100644 --- a/app/controllers/hacks_controller.rb +++ b/app/controllers/hacks_controller.rb @@ -190,6 +190,8 @@ class HacksController < ApplicationController @hack.hack_sets.where(id: delete_set_ids).destroy_all logger.info("#######sets:#{sets}") sets.each do |set| + logger.info("###set[:id]: #{set[:id]}") + logger.info("###all_sets: #{all_sets_id.include?(set[:id])}") if all_sets_id.include?(set[:id]) update_attrs = {input: set[:input], output: set[:output], position: set[:position]} @hack.hack_sets.find_by!(id: set[:id]).update_attributes(update_attrs) From 937674dc8217e85e5ab88e83f90d51fcc04c00d3 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 26 Dec 2019 15:13:09 +0800 Subject: [PATCH 04/18] add log --- app/controllers/hacks_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/hacks_controller.rb b/app/controllers/hacks_controller.rb index bdef733a3..fec768a19 100644 --- a/app/controllers/hacks_controller.rb +++ b/app/controllers/hacks_controller.rb @@ -194,7 +194,7 @@ class HacksController < ApplicationController logger.info("###all_sets: #{all_sets_id.include?(set[:id])}") if all_sets_id.include?(set[:id]) update_attrs = {input: set[:input], output: set[:output], position: set[:position]} - @hack.hack_sets.find_by!(id: set[:id]).update_attributes(update_attrs) + @hack.hack_sets.find_by!(id: set[:id]).update_attributes!(update_attrs) end end end From c6de7653aed02ea7450f66bbd79af8a9d1abb512 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 26 Dec 2019 15:20:56 +0800 Subject: [PATCH 05/18] 1 --- app/models/hack_set.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/hack_set.rb b/app/models/hack_set.rb index 6afe05663..4f355181d 100644 --- a/app/models/hack_set.rb +++ b/app/models/hack_set.rb @@ -1,6 +1,6 @@ class HackSet < ApplicationRecord - #validates :input, presence: { message: "测试集输入不能为空" } - validates :output, presence: { message: "测试集输出不能为空" } + validates :input, allow_nil:false, message: "测试集输入不能为空" + validates :output, allow_nil: false, message: "测试集输出不能为空" validates_uniqueness_of :input, scope: [:hack_id, :input], message: "多个测试集的输入不能相同" # 编程题测试集 belongs_to :hack From 0d11d2fda87008bd3060b9991a3777fe3c1e2703 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 26 Dec 2019 15:23:07 +0800 Subject: [PATCH 06/18] 1 --- app/models/hack_set.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/hack_set.rb b/app/models/hack_set.rb index 4f355181d..7571f3b92 100644 --- a/app/models/hack_set.rb +++ b/app/models/hack_set.rb @@ -1,6 +1,6 @@ class HackSet < ApplicationRecord - validates :input, allow_nil:false, message: "测试集输入不能为空" - validates :output, allow_nil: false, message: "测试集输出不能为空" + validates :input, allow_nil:false + validates :output, allow_nil: false validates_uniqueness_of :input, scope: [:hack_id, :input], message: "多个测试集的输入不能相同" # 编程题测试集 belongs_to :hack From 606da7f6b2a649794567880fa05ff9e40b96a864 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 26 Dec 2019 15:24:50 +0800 Subject: [PATCH 07/18] 1 --- app/models/hack_set.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/hack_set.rb b/app/models/hack_set.rb index 7571f3b92..6afe05663 100644 --- a/app/models/hack_set.rb +++ b/app/models/hack_set.rb @@ -1,6 +1,6 @@ class HackSet < ApplicationRecord - validates :input, allow_nil:false - validates :output, allow_nil: false + #validates :input, presence: { message: "测试集输入不能为空" } + validates :output, presence: { message: "测试集输出不能为空" } validates_uniqueness_of :input, scope: [:hack_id, :input], message: "多个测试集的输入不能相同" # 编程题测试集 belongs_to :hack From 3de87f607e2ceaa4654d42f3b811ceba998fc61b Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 26 Dec 2019 15:37:20 +0800 Subject: [PATCH 08/18] 1 --- app/models/hack_set.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/hack_set.rb b/app/models/hack_set.rb index 6afe05663..8f4ef3637 100644 --- a/app/models/hack_set.rb +++ b/app/models/hack_set.rb @@ -1,6 +1,6 @@ class HackSet < ApplicationRecord #validates :input, presence: { message: "测试集输入不能为空" } - validates :output, presence: { message: "测试集输出不能为空" } + validates :output, allow_nil: false, message: "测试集输出不能为空" validates_uniqueness_of :input, scope: [:hack_id, :input], message: "多个测试集的输入不能相同" # 编程题测试集 belongs_to :hack From 2abbb13a2904e3bc3ad9fb2adfcfd12ef5fcf44c Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 26 Dec 2019 15:38:11 +0800 Subject: [PATCH 09/18] 1 --- app/models/hack_set.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/hack_set.rb b/app/models/hack_set.rb index 8f4ef3637..6afe05663 100644 --- a/app/models/hack_set.rb +++ b/app/models/hack_set.rb @@ -1,6 +1,6 @@ class HackSet < ApplicationRecord #validates :input, presence: { message: "测试集输入不能为空" } - validates :output, allow_nil: false, message: "测试集输出不能为空" + validates :output, presence: { message: "测试集输出不能为空" } validates_uniqueness_of :input, scope: [:hack_id, :input], message: "多个测试集的输入不能相同" # 编程题测试集 belongs_to :hack From f14069480ed4a2d930f98c3840f2a91ef214881d Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 26 Dec 2019 15:46:55 +0800 Subject: [PATCH 10/18] 1 --- app/controllers/hack_user_lastest_codes_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/hack_user_lastest_codes_controller.rb b/app/controllers/hack_user_lastest_codes_controller.rb index 5f5eddddc..655fea471 100644 --- a/app/controllers/hack_user_lastest_codes_controller.rb +++ b/app/controllers/hack_user_lastest_codes_controller.rb @@ -3,8 +3,8 @@ class HackUserLastestCodesController < ApplicationController before_action :find_my_hack, only: [:show, :code_debug, :code_submit, :update_code, :sync_code, :listen_result, :result, :submit_records, :restore_initial_code] before_action :update_user_hack_status, only: [:code_debug, :code_submit] - before_action :require_auth_identity, only: [:update_code, :restore_initial_code, :sync_code] - before_action :require_manager_identity, only: [:update_code] + #before_action :require_auth_identity, only: [:restore_initial_code, :sync_code] + before_action :require_manager_identity, only: [:show, :update_code, :restore_initial_code, :sync_code] def show @my_hack.update_attribute(:submit_status, 0) if @my_hack.submit_status == 1 From 0a3eee940d96d1d6c44c564cef2a54b68911c4a5 Mon Sep 17 00:00:00 2001 From: tangjiang <465264938@qq.com> Date: Thu, 26 Dec 2019 16:01:33 +0800 Subject: [PATCH 11/18] update debug --- .../common/components/comment/CommentForm.js | 9 +++--- .../common/components/comment/CommentItem.js | 30 ++++++++++++++++--- .../src/common/components/comment/index.scss | 2 ++ .../src/common/components/comment/util.js | 10 ++++--- .../react/src/common/quillForEditor/index.js | 11 +++---- .../components/controlSetting/index.js | 6 ++-- .../components/controlSetting/index.scss | 10 ++++++- .../developer/components/execResult/index.js | 9 +++++- .../components/initTabCtx/index.scss | 2 +- .../components/myMonacoEditor/index.js | 10 +++---- .../components/myMonacoEditor/index.scss | 12 ++++++++ .../leftpane/editorTab/AddTestDemo.js | 6 ++-- .../newOrEditTask/leftpane/editorTab/index.js | 16 ++++++---- .../developer/newOrEditTask/leftpane/index.js | 2 +- .../newOrEditTask/rightpane/index.js | 22 +++++++------- .../rightpane/initTabCtx/index.scss | 2 +- .../modules/developer/recordDetail/index.js | 22 +++++++++----- .../modules/developer/split_pane_resizer.scss | 3 +- .../modules/developer/studentStudy/index.js | 20 ++++++------- .../studentStudy/leftpane/comment/index.js | 2 +- public/react/src/redux/actions/ojForm.js | 9 +++--- .../src/redux/reducers/ojForUserReducer.js | 4 +-- 22 files changed, 145 insertions(+), 74 deletions(-) diff --git a/public/react/src/common/components/comment/CommentForm.js b/public/react/src/common/components/comment/CommentForm.js index 7683e2dea..cc4e4efd9 100644 --- a/public/react/src/common/components/comment/CommentForm.js +++ b/public/react/src/common/components/comment/CommentForm.js @@ -4,14 +4,14 @@ * @Github: * @Date: 2019-12-17 17:32:55 * @LastEditors : tangjiang - * @LastEditTime : 2019-12-24 17:27:41 + * @LastEditTime : 2019-12-26 11:11:57 */ import './index.scss'; import React, { useState } from 'react'; import { Form, Button, Input } from 'antd'; import QuillForEditor from '../../quillForEditor'; // import { QuillDeltaToHtmlConverter } from 'quill-delta-to-html' -import {formatDelta} from './util'; +// import {formatDelta} from './util'; const FormItem = Form.Item; function CommentForm (props) { @@ -68,8 +68,9 @@ function CommentForm (props) { const content = ctx; props.form.setFieldsValue({'comment': ''}); setCtx(''); - const _html = formatDelta(content.ops); - onSubmit && onSubmit(_html); + // const _html = formatDelta(content.ops); + console.log('保存的内容=====》》》》', content); + onSubmit && onSubmit(JSON.stringify(content)); } }); } diff --git a/public/react/src/common/components/comment/CommentItem.js b/public/react/src/common/components/comment/CommentItem.js index 7360ddfd6..6332dbd9a 100644 --- a/public/react/src/common/components/comment/CommentItem.js +++ b/public/react/src/common/components/comment/CommentItem.js @@ -4,14 +4,19 @@ * @Github: * @Date: 2019-12-17 17:35:17 * @LastEditors : tangjiang - * @LastEditTime : 2019-12-25 14:53:41 + * @LastEditTime : 2019-12-26 11:30:32 */ import './index.scss'; +import 'quill/dist/quill.core.css'; // 核心样式 +import 'quill/dist/quill.snow.css'; // 有工具栏 +import 'quill/dist/quill.bubble.css'; // 无工具栏 +import 'katex/dist/katex.min.css'; // katex 表达式样式 import React, { useState } from 'react'; import CommentIcon from './CommentIcon'; import { getImageUrl, CNotificationHOC } from 'educoder' import { Icon } from 'antd'; import CommentForm from './CommentForm'; +import QuillForEditor from '../../quillForEditor'; function CommentItem ({ isAdmin, @@ -81,9 +86,19 @@ function CommentItem ({ }; // 评论内容 - const commentCtx = (ctx) => ( -

- ); + const commentCtx = (ctx) => { + let _ctx = null; + try { + _ctx = JSON.parse(ctx); + } catch (e) { + _ctx = ctx; + } + return ( + + )}; // 加载更多 const handleOnLoadMore = (len) => { @@ -182,6 +197,13 @@ function CommentItem ({ type={!hidden ? "xianshi" : 'yincang1'} iconClick={() => handleShowOrHide(id, !hidden ? 1 : 0)} /> + + deleteComment(id)} + /> {/* 回复 */} { @@ -22,6 +22,8 @@ export const formatDelta = (deltas) => { keys.forEach(key => { text = operate(text, key, element['attributes'][key]); }); + } else if (element['insert']['formula']) { + text = element['insert']['formula']; } } else { const image = element['insert']['image']; @@ -42,7 +44,7 @@ export const formatDelta = (deltas) => { formatted.push(text); }); - + console.log(formatted); return formatted.join(''); } @@ -53,7 +55,7 @@ export const formatDelta = (deltas) => { */ export const operate = (text, key, value) => { let operatedText = null; - + debugger; switch (key) { case 'bold': operatedText = `${text}`; @@ -68,7 +70,7 @@ export const operate = (text, key, value) => { operatedText = `${text}`; break; case 'link': - operatedText = `${text}`; + operatedText = `${text}`; break; default: operatedText = text; diff --git a/public/react/src/common/quillForEditor/index.js b/public/react/src/common/quillForEditor/index.js index 8dcf995f4..8239a0c93 100644 --- a/public/react/src/common/quillForEditor/index.js +++ b/public/react/src/common/quillForEditor/index.js @@ -3,8 +3,8 @@ * @Author: tangjiang * @Github: * @Date: 2019-12-18 08:49:30 - * @LastEditors: tangjiang - * @LastEditTime: 2019-12-20 16:07:37 + * @LastEditors : tangjiang + * @LastEditTime : 2019-12-26 10:22:26 */ import './index.scss'; import 'quill/dist/quill.core.css'; // 核心样式 @@ -32,7 +32,8 @@ function QuillForEditor ({ style = {}, wrapStyle = {}, showUploadImage, - onContentChange + onContentChange, + // getQuillContent }) { // toolbar 默认值 const defaultConfig = [ @@ -54,8 +55,8 @@ function QuillForEditor ({ // 文本内容变化时 const handleOnChange = content => { - // console.log('编辑器内容====》》》》', content); - onContentChange && onContentChange(content); + // getQuillContent && getQuillContent(quill); + onContentChange && onContentChange(content, quill); }; const renderOptions = options || defaultConfig; diff --git a/public/react/src/modules/developer/components/controlSetting/index.js b/public/react/src/modules/developer/components/controlSetting/index.js index 502f3ae09..0fcfc278f 100644 --- a/public/react/src/modules/developer/components/controlSetting/index.js +++ b/public/react/src/modules/developer/components/controlSetting/index.js @@ -3,8 +3,8 @@ * @Author: tangjiang * @Github: * @Date: 2019-11-27 16:02:36 - * @LastEditors: tangjiang - * @LastEditTime: 2019-12-20 14:37:39 + * @LastEditors : tangjiang + * @LastEditTime : 2019-12-26 15:17:28 */ import './index.scss'; import React, { useState, useRef, useEffect } from 'react'; @@ -23,7 +23,7 @@ const ControlSetting = (props) => { submitLoading, identifier, excuteState, - showOrHideControl, + // showOrHideControl, commitTestRecordDetail, changeLoadingState, changeSubmitLoadingStatus, diff --git a/public/react/src/modules/developer/components/controlSetting/index.scss b/public/react/src/modules/developer/components/controlSetting/index.scss index 231358ea0..eaa97bea7 100644 --- a/public/react/src/modules/developer/components/controlSetting/index.scss +++ b/public/react/src/modules/developer/components/controlSetting/index.scss @@ -31,6 +31,14 @@ opacity: 0; } } + + .ant-tabs-bar{ + padding: 0; + } + + .ant-tabs-nav .ant-tabs-tab{ + padding: 12px 0px; + } } @@ -52,7 +60,7 @@ z-index: 20; height: 56px; padding-right: 20px; - padding-left: 10px; + padding-left: 5px; background: rgba(18,28,36,1); // background:rgba(48,48,48,1); } diff --git a/public/react/src/modules/developer/components/execResult/index.js b/public/react/src/modules/developer/components/execResult/index.js index fe90e904b..fad322160 100644 --- a/public/react/src/modules/developer/components/execResult/index.js +++ b/public/react/src/modules/developer/components/execResult/index.js @@ -4,7 +4,7 @@ * @Github: * @Date: 2019-11-28 08:44:54 * @LastEditors : tangjiang - * @LastEditTime : 2019-12-25 11:42:10 + * @LastEditTime : 2019-12-26 08:51:21 */ import './index.scss'; import React, { useState, useEffect } from 'react'; @@ -80,6 +80,13 @@ function ExecResult (props) { ); } else if (state === 4){ + return ( +

+ {/* 系统繁忙,请稍后重试 */} + {error_msg} +

+ ) + } else if (state === 3) { return (

系统繁忙,请稍后重试 diff --git a/public/react/src/modules/developer/components/initTabCtx/index.scss b/public/react/src/modules/developer/components/initTabCtx/index.scss index 5427aa374..992d49534 100644 --- a/public/react/src/modules/developer/components/initTabCtx/index.scss +++ b/public/react/src/modules/developer/components/initTabCtx/index.scss @@ -41,7 +41,7 @@ } } .flex_l{ - padding: 0 10px 0 20px; + padding: 0 10px 0 10px; color: #fff; } .flex_r{ diff --git a/public/react/src/modules/developer/components/myMonacoEditor/index.js b/public/react/src/modules/developer/components/myMonacoEditor/index.js index 261818092..facff0b75 100644 --- a/public/react/src/modules/developer/components/myMonacoEditor/index.js +++ b/public/react/src/modules/developer/components/myMonacoEditor/index.js @@ -3,8 +3,8 @@ * @Author: tangjiang * @Github: * @Date: 2019-11-27 15:02:52 - * @LastEditors: tangjiang - * @LastEditTime: 2019-12-20 20:07:11 + * @LastEditors : tangjiang + * @LastEditTime : 2019-12-26 15:19:34 */ import './index.scss'; import React, { useState, useRef, useEffect } from 'react'; @@ -155,7 +155,7 @@ function MyMonacoEditor (props, ref) { onClick={handleUpdateNotice} > {/* */} - + {/* {renderRestore} */} @@ -174,7 +174,7 @@ function MyMonacoEditor (props, ref) { placement="bottom" title="设置" > - + { const { - key, + // key, // onSubmitTest, onDeleteTest, testCase, diff --git a/public/react/src/modules/developer/newOrEditTask/leftpane/editorTab/index.js b/public/react/src/modules/developer/newOrEditTask/leftpane/editorTab/index.js index 01b78038b..2e345c489 100644 --- a/public/react/src/modules/developer/newOrEditTask/leftpane/editorTab/index.js +++ b/public/react/src/modules/developer/newOrEditTask/leftpane/editorTab/index.js @@ -3,8 +3,8 @@ * @Author: tangjiang * @Github: * @Date: 2019-11-20 10:35:40 - * @LastEditors: tangjiang - * @LastEditTime: 2019-12-20 16:53:55 + * @LastEditors : tangjiang + * @LastEditTime : 2019-12-26 16:00:57 */ import './index.scss'; // import 'katex/dist/katex.css'; @@ -222,10 +222,16 @@ class EditTab extends React.Component { } // 描述信息变化时 - const handleContentChange = (content) => { + const handleContentChange = (content, quill) => { console.log('描述信息为: ', content); - // 保存获取的描述信息至redux中 - this.handleChangeDescription(content); + // if (quill.getText()) + console.log('========>>>>>', quill.getText().length); + if (quill.getText().length === 1) { + this.handleChangeDescription(''); + } else { + // 保存获取的描述信息至redux中 + this.handleChangeDescription(content); + } } // 编辑器配置信息 const quillConfig = [ diff --git a/public/react/src/modules/developer/newOrEditTask/leftpane/index.js b/public/react/src/modules/developer/newOrEditTask/leftpane/index.js index ec0ca1416..53807cfe2 100644 --- a/public/react/src/modules/developer/newOrEditTask/leftpane/index.js +++ b/public/react/src/modules/developer/newOrEditTask/leftpane/index.js @@ -58,7 +58,7 @@ function LeftPane (props) {

    { renderNavItem }
-
+
{ renderComp }
diff --git a/public/react/src/modules/developer/newOrEditTask/rightpane/index.js b/public/react/src/modules/developer/newOrEditTask/rightpane/index.js index 69b67d60e..49d9f9b2a 100644 --- a/public/react/src/modules/developer/newOrEditTask/rightpane/index.js +++ b/public/react/src/modules/developer/newOrEditTask/rightpane/index.js @@ -3,8 +3,8 @@ * @Author: tangjiang * @Github: * @Date: 2019-12-01 10:18:35 - * @LastEditors: tangjiang - * @LastEditTime: 2019-12-09 11:38:15 + * @LastEditors : tangjiang + * @LastEditTime : 2019-12-26 13:51:40 */ import './index.scss'; import React from 'react'; @@ -25,15 +25,15 @@ function RightPane (props, ref) { // let timer = null; // 代码改变时,保存 const handleCodeChange = (updateCode) => { - // 保存用户输入的代码 - // if (!timer) { - // timer = setInterval(() => { - // clearInterval(timer); - // timer = null; - // if (updateCode) { - // console.log('调用更新代码------>>>>>>', updateCode); - // } - // }, 3000); + // if (props.identifier) { + // // 保存用户输入的代码 + // if (!timer) { + // timer = setInterval(() => { + // clearInterval(timer); + // timer = null; + + // }, 3000); + // } // } saveOjFormCode(updateCode); } diff --git a/public/react/src/modules/developer/newOrEditTask/rightpane/initTabCtx/index.scss b/public/react/src/modules/developer/newOrEditTask/rightpane/initTabCtx/index.scss index dc2d07d63..741664ae3 100644 --- a/public/react/src/modules/developer/newOrEditTask/rightpane/initTabCtx/index.scss +++ b/public/react/src/modules/developer/newOrEditTask/rightpane/initTabCtx/index.scss @@ -41,7 +41,7 @@ } } .flex_l{ - padding: 0 10px 0 20px; + padding: 0 10px 0 10px; color: #fff; } .flex_r{ diff --git a/public/react/src/modules/developer/recordDetail/index.js b/public/react/src/modules/developer/recordDetail/index.js index eadc514a2..f57d93f4e 100644 --- a/public/react/src/modules/developer/recordDetail/index.js +++ b/public/react/src/modules/developer/recordDetail/index.js @@ -3,8 +3,8 @@ * @Author: tangjiang * @Github: * @Date: 2019-12-04 08:36:21 - * @LastEditors: tangjiang - * @LastEditTime: 2019-12-20 20:05:57 + * @LastEditors : tangjiang + * @LastEditTime : 2019-12-26 14:04:16 */ import './index.scss'; import React, { useState, useEffect } from 'react'; @@ -15,6 +15,7 @@ import { Link } from 'react-router-dom'; import MonacoEditor from '@monaco-editor/react'; import { connect } from 'react-redux'; // import { getImageUrl } from 'educoder'; +import { withRouter } from 'react-router' import actions from '../../../redux/actions'; import CONST from '../../../constants'; import UserInfo from '../components/userInfo'; @@ -53,6 +54,12 @@ function RecordDetail (props) { } }, [recordDetail]); + const handleReturn = (identifier) => { + if (identifier) { + saveEditorCodeForDetail(''); + props.history.push(`/myproblems/${identifier}`); + } + } return (
@@ -67,8 +74,9 @@ function RecordDetail (props) { {detail.name || 'test'}
-
@@ -89,7 +97,7 @@ function RecordDetail (props) { 语言: {detail.language} - 执行用时: {`${detail.execute_time && (+detail.execute_time * 1000)}ms`} + 执行用时: {`${detail.execute_time && Number(detail.execute_time * 1000).toFixed(2)}ms`}
@@ -134,7 +142,7 @@ const mapDispatchToProps = (dispatch) => ({ saveEditorCodeForDetail: (code) => dispatch(actions.saveEditorCodeForDetail(code)) }); -export default connect( +export default withRouter(connect( mapStateToProps, mapDispatchToProps -)(RecordDetail); \ No newline at end of file +)(RecordDetail)); \ No newline at end of file diff --git a/public/react/src/modules/developer/split_pane_resizer.scss b/public/react/src/modules/developer/split_pane_resizer.scss index cd8ce22ca..8fc8b525f 100644 --- a/public/react/src/modules/developer/split_pane_resizer.scss +++ b/public/react/src/modules/developer/split_pane_resizer.scss @@ -148,8 +148,9 @@ } .Resizer { + position: relative; background: #000; - opacity: 0.2; + // opacity: 0.2; z-index: 1; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; diff --git a/public/react/src/modules/developer/studentStudy/index.js b/public/react/src/modules/developer/studentStudy/index.js index 9039bf3ac..2c7134c5b 100644 --- a/public/react/src/modules/developer/studentStudy/index.js +++ b/public/react/src/modules/developer/studentStudy/index.js @@ -3,8 +3,8 @@ * @Author: tangjiang * @Github: * @Date: 2019-11-23 10:53:19 - * @LastEditors: tangjiang - * @LastEditTime: 2019-12-20 14:54:39 + * @LastEditors : tangjiang + * @LastEditTime : 2019-12-26 15:02:12 */ import './index.scss'; import React, { useEffect, useState } from 'react'; @@ -25,9 +25,9 @@ function StudentStudy (props) { const [hasUpdate, setHasUpdate] = useState(true); const { - // hack, + hack, userInfo, - hack_identifier, + // hack_identifier, // user_program_identifier, restoreInitialCode, changeShowOrHideControl @@ -85,13 +85,13 @@ function StudentStudy (props) { // } // }); } - const _hack_id = hack_identifier || fromStore('hack_identifier'); - + // const _hack_id = hack_identifier || fromStore('hack_identifier'); // 处理编辑 - const handleClickEditor = () => { + const handleClickEditor = (identifier) => { + if (!identifier) return; changeShowOrHideControl(false); props.saveEditorCodeForDetail(); - props.history.push(`/problems/${_hack_id}/edit`); + props.history.push(`/problems/${identifier}/edit`); props.clearOjForUserReducer(); } // 处理退出 @@ -115,13 +115,13 @@ function StudentStudy (props) {
*/}
- 乘积最大序列 {hasUpdate} + {hack.name}
{/* to={`/problems/${_hack_id}/edit`} */} handleClickEditor(hack.identifier)} className={`quit-btn`} > 编辑 diff --git a/public/react/src/modules/developer/studentStudy/leftpane/comment/index.js b/public/react/src/modules/developer/studentStudy/leftpane/comment/index.js index 9b4287e76..25b538bc0 100644 --- a/public/react/src/modules/developer/studentStudy/leftpane/comment/index.js +++ b/public/react/src/modules/developer/studentStudy/leftpane/comment/index.js @@ -4,7 +4,7 @@ * @Github: * @Date: 2019-11-27 09:49:35 * @LastEditors : tangjiang - * @LastEditTime : 2019-12-25 10:55:44 + * @LastEditTime : 2019-12-26 10:43:45 */ import './index.scss'; import React, { useEffect, useState } from 'react'; diff --git a/public/react/src/redux/actions/ojForm.js b/public/react/src/redux/actions/ojForm.js index 68185ed7b..2eb105f34 100644 --- a/public/react/src/redux/actions/ojForm.js +++ b/public/react/src/redux/actions/ojForm.js @@ -4,7 +4,7 @@ * @Github: * @Date: 2019-11-20 16:35:46 * @LastEditors : tangjiang - * @LastEditTime : 2019-12-23 10:55:28 + * @LastEditTime : 2019-12-26 15:45:28 */ import types from './actionTypes'; import CONST from '../../constants'; @@ -58,7 +58,8 @@ const maps = { // 非空校验 const emptyValidate = (key, value) => { - if ([undefined, '', null].includes(value)) { + const reg = /^[\s\S]*.*[^\s][\s\S]*$/; + if (!reg.test(value)) { return { [key]: { validateStatus: 'error', @@ -472,7 +473,7 @@ export const testCaseInputChange = (value, index) => { const bool = testCases.some((item, i) => { if (i !== index) { if (item['input'] === value) { - _errMsg=`与测试用例${index}的输入值重复了,请重新填写`; + _errMsg=`与测试用例${i + 1}的输入值重复了,请重新填写`; } return item['input'] === value; } else { @@ -566,4 +567,4 @@ export const updateOpenTestCaseIndex = (value) => { type: types.UPDATE_OPEN_TESTCASE_INDEX, payload: value } -} \ No newline at end of file +} diff --git a/public/react/src/redux/reducers/ojForUserReducer.js b/public/react/src/redux/reducers/ojForUserReducer.js index 18ffd30c8..e42acefdf 100644 --- a/public/react/src/redux/reducers/ojForUserReducer.js +++ b/public/react/src/redux/reducers/ojForUserReducer.js @@ -4,7 +4,7 @@ * @Github: * @Date: 2019-11-27 13:41:48 * @LastEditors : tangjiang - * @LastEditTime : 2019-12-25 17:09:53 + * @LastEditTime : 2019-12-26 13:39:41 */ import types from "../actions/actionTypes"; import { Base64 } from 'js-base64'; @@ -111,7 +111,7 @@ const ojForUserReducer = (state = initialState, action) => { userCodeTab: action.payload } case types.GET_COMMIT_RECORD_DETAIL_BY_ID: - tempDetail = action.payload; + tempDetail = action.payload.data; if (tempDetail['error_msg']) { tempDetail['error_msg'] = Base64.decode(tempDetail['error_msg']); } From 4e9ea65c2e8a63a70d125314d9265756af1b399d Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 26 Dec 2019 16:23:21 +0800 Subject: [PATCH 12/18] =?UTF-8?q?=E7=A9=BA=E7=99=BD=E5=AD=97=E7=AC=A6?= =?UTF-8?q?=E4=B9=9F=E8=83=BD=E4=BF=9D=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/hack_set.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/hack_set.rb b/app/models/hack_set.rb index 6afe05663..9ef0412ed 100644 --- a/app/models/hack_set.rb +++ b/app/models/hack_set.rb @@ -1,6 +1,6 @@ class HackSet < ApplicationRecord #validates :input, presence: { message: "测试集输入不能为空" } - validates :output, presence: { message: "测试集输出不能为空" } + #validates :output, presence: { message: "测试集输出不能为空" } validates_uniqueness_of :input, scope: [:hack_id, :input], message: "多个测试集的输入不能相同" # 编程题测试集 belongs_to :hack From 847266f9cc0be6337d0243b509c49bca04b5f512 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 26 Dec 2019 16:33:25 +0800 Subject: [PATCH 13/18] 1 --- app/models/hack_set.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/hack_set.rb b/app/models/hack_set.rb index 9ef0412ed..9e2186fb5 100644 --- a/app/models/hack_set.rb +++ b/app/models/hack_set.rb @@ -1,6 +1,6 @@ class HackSet < ApplicationRecord - #validates :input, presence: { message: "测试集输入不能为空" } - #validates :output, presence: { message: "测试集输出不能为空" } + validates :input, presence: { message: "测试集输入不能为空" } + validates :output, presence: { message: "测试集输出不能为空" } validates_uniqueness_of :input, scope: [:hack_id, :input], message: "多个测试集的输入不能相同" # 编程题测试集 belongs_to :hack From 6cc67dbdf914b5ce45cac585e0eb56ad80ddcd14 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 26 Dec 2019 16:46:52 +0800 Subject: [PATCH 14/18] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/hack_user_lastest_codes_controller.rb | 10 +++++++--- app/models/hack_user_lastest_code.rb | 2 ++ app/views/hack_user_lastest_codes/show.json.jbuilder | 1 + config/routes.rb | 1 + ...20191226083915_add_notes_hack_user_lastest_codes.rb | 5 +++++ 5 files changed, 16 insertions(+), 3 deletions(-) create mode 100644 db/migrate/20191226083915_add_notes_hack_user_lastest_codes.rb diff --git a/app/controllers/hack_user_lastest_codes_controller.rb b/app/controllers/hack_user_lastest_codes_controller.rb index 655fea471..ff0af5958 100644 --- a/app/controllers/hack_user_lastest_codes_controller.rb +++ b/app/controllers/hack_user_lastest_codes_controller.rb @@ -1,9 +1,9 @@ class HackUserLastestCodesController < ApplicationController before_action :require_login, except: [:listen_result] - before_action :find_my_hack, only: [:show, :code_debug, :code_submit, :update_code, :sync_code, + before_action :find_my_hack, only: [:show, :code_debug, :code_submit, :update_code, :sync_code, :add_notes, :listen_result, :result, :submit_records, :restore_initial_code] before_action :update_user_hack_status, only: [:code_debug, :code_submit] - #before_action :require_auth_identity, only: [:restore_initial_code, :sync_code] + before_action :require_auth_identity, only: [:add_notes] before_action :require_manager_identity, only: [:show, :update_code, :restore_initial_code, :sync_code] def show @@ -67,7 +67,6 @@ class HackUserLastestCodesController < ApplicationController end - # 提交记录详情 def record_detail @hack_user = HackUserCode.find params[:id] @@ -109,6 +108,11 @@ class HackUserLastestCodesController < ApplicationController end + def add_notes + @my_hack.update_attribute(:notes, params[:notes]) + render_ok + end + private def find_my_hack @my_hack = HackUserLastestCode.find_by(identifier: params[:identifier]) diff --git a/app/models/hack_user_lastest_code.rb b/app/models/hack_user_lastest_code.rb index 830f16dde..99582af41 100644 --- a/app/models/hack_user_lastest_code.rb +++ b/app/models/hack_user_lastest_code.rb @@ -12,4 +12,6 @@ class HackUserLastestCode < ApplicationRecord scope :mine_hack, ->(author_id){ where(user_id: author_id) } scope :passed, -> {where(status: 1)} + validates_length_of :notes, maximum: 5000, message: "笔记不能超过5000个字" + end diff --git a/app/views/hack_user_lastest_codes/show.json.jbuilder b/app/views/hack_user_lastest_codes/show.json.jbuilder index 098c24546..a158d074f 100644 --- a/app/views/hack_user_lastest_codes/show.json.jbuilder +++ b/app/views/hack_user_lastest_codes/show.json.jbuilder @@ -5,6 +5,7 @@ json.hack do json.code @my_hack.code json.pass_count @hack.pass_num json.submit_count @hack.submit_num + json.notes @my_hack.notes json.modify_code @modify json.comments_count @hack.discusses.count json.user_praise @hack.praise_treads.select{|pt| pt.user_id == current_user.id}.length > 0 diff --git a/config/routes.rb b/config/routes.rb index 7a68ed5e2..f9ed12dbe 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -90,6 +90,7 @@ Rails.application.routes.draw do get :submit_records post :restore_initial_code post :sync_code + post :add_notes end collection do diff --git a/db/migrate/20191226083915_add_notes_hack_user_lastest_codes.rb b/db/migrate/20191226083915_add_notes_hack_user_lastest_codes.rb new file mode 100644 index 000000000..518e6d610 --- /dev/null +++ b/db/migrate/20191226083915_add_notes_hack_user_lastest_codes.rb @@ -0,0 +1,5 @@ +class AddNotesHackUserLastestCodes < ActiveRecord::Migration[5.2] + def change + add_column :hack_user_lastest_codes, :notes, :longtext + end +end From 6ea67b6771788cfea48ae5aafe5e9e7df7ec747c Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Thu, 26 Dec 2019 17:25:20 +0800 Subject: [PATCH 15/18] =?UTF-8?q?=E8=AF=BE=E5=A0=82=E4=B8=8D=E8=83=BD?= =?UTF-8?q?=E9=80=89=E7=94=A8jupter=E5=AE=9E=E8=AE=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/shixun_search_service.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/services/shixun_search_service.rb b/app/services/shixun_search_service.rb index 248d7d176..32488a7c3 100644 --- a/app/services/shixun_search_service.rb +++ b/app/services/shixun_search_service.rb @@ -33,6 +33,10 @@ class ShixunSearchService < ApplicationService @shixuns = status == "published" ? @shixuns.where(status: 2) : @shixuns.where(status: [0, 1]) end + if params[:no_jupyter] + @shixuns = @shixuns.where(is_jupyter: 0) + end + ## 筛选 难度 if params[:diff].present? && params[:diff].to_i != 0 @shixuns = @shixuns.where(trainee: params[:diff]) From ac3d87cf93e1500d47135049092621cebe485370 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 26 Dec 2019 17:26:51 +0800 Subject: [PATCH 16/18] =?UTF-8?q?=E8=BF=81=E7=A7=BB=E5=85=AC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20191226092304_modify_task_pass_2_for_challenges.rb | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 db/migrate/20191226092304_modify_task_pass_2_for_challenges.rb diff --git a/db/migrate/20191226092304_modify_task_pass_2_for_challenges.rb b/db/migrate/20191226092304_modify_task_pass_2_for_challenges.rb new file mode 100644 index 000000000..f03039aa2 --- /dev/null +++ b/db/migrate/20191226092304_modify_task_pass_2_for_challenges.rb @@ -0,0 +1,8 @@ +class ModifyTaskPass2ForChallenges < ActiveRecord::Migration[5.2] + def change + challenges = Challenge.where("task_pass like '%frac%'") + challenges.find_each do |c| + c.update_column(:task_pass, c.task_pass.gsub('\f\frac', '\frac')) + end + end +end From 0e7a864e806613c4cf66735ca04f537b760c4e6e Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 26 Dec 2019 17:43:53 +0800 Subject: [PATCH 17/18] =?UTF-8?q?=E6=89=A7=E8=A1=8C=E4=B9=8B=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/challenges/edit.json.jbuilder | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/challenges/edit.json.jbuilder b/app/views/challenges/edit.json.jbuilder index c0ea68d9c..9a135ff56 100644 --- a/app/views/challenges/edit.json.jbuilder +++ b/app/views/challenges/edit.json.jbuilder @@ -14,7 +14,7 @@ if @tab == 0 elsif @tab == 1 # 评测设置的编辑模式 json.(@challenge, :id, :path, :exec_path, :show_type, :original_picture_path, :expect_picture_path, :picture_path, - :web_route, :test_set_score, :test_set_average) + :web_route, :test_set_score, :test_set_average, :exec_time) json.has_web_route @shixun.has_web_route? json.test_sets @challenge.test_sets do |set| json.hidden (set.is_public ? 0 : 1) From 0cb1c540607b1f24c50dd7fbcf67320aa34c7f67 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Thu, 26 Dec 2019 17:58:15 +0800 Subject: [PATCH 18/18] =?UTF-8?q?=E5=90=8E=E5=8F=B0=E5=AE=9E=E8=AE=AD?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E5=92=8C=E5=AE=9E=E8=AE=AD=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E9=A1=B5=E7=9A=84=E7=8A=B6=E6=80=81=E8=BF=87=E6=BB=A4=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admins/shixun_settings_controller.rb | 5 ++-- app/controllers/admins/shixuns_controller.rb | 4 +--- app/queries/admins/shixun_query.rb | 23 +++++-------------- app/queries/admins/shixun_settings_query.rb | 19 ++++++++------- .../admins/shixun_settings/index.html.erb | 2 +- app/views/admins/shixuns/index.html.erb | 8 +------ 6 files changed, 21 insertions(+), 40 deletions(-) diff --git a/app/controllers/admins/shixun_settings_controller.rb b/app/controllers/admins/shixun_settings_controller.rb index fd06fddb3..37ca45674 100644 --- a/app/controllers/admins/shixun_settings_controller.rb +++ b/app/controllers/admins/shixun_settings_controller.rb @@ -5,9 +5,10 @@ class Admins::ShixunSettingsController < Admins::BaseController shixun_settings = Admins::ShixunSettingsQuery.call(params) @editing_shixuns = shixun_settings.where(status:0).size - @pending_shixuns = shixun_settings.where(status:1).size - @processed_shixuns = shixun_settings.where(status:2).size + @processed_shixuns = shixun_settings.where(status:2, public: 0).size @closed_shixuns = shixun_settings.where(status:3).size + @pending_public_shixuns = shixun_settings.where(public:1).size + @processed_pubic_shixuns = shixun_settings.where(public:2).size @sort_json = { can_copy: params[:can_copy].present? ? params[:can_copy] : false, diff --git a/app/controllers/admins/shixuns_controller.rb b/app/controllers/admins/shixuns_controller.rb index 6593f27c2..86cb9b45f 100644 --- a/app/controllers/admins/shixuns_controller.rb +++ b/app/controllers/admins/shixuns_controller.rb @@ -5,10 +5,8 @@ class Admins::ShixunsController < Admins::BaseController params[:sort_direction] = params[:sort_direction].presence || 'desc' shixuns = Admins::ShixunQuery.call(params) @editing_shixuns = shixuns.where(status:0).size - @pending_shixuns = shixuns.where(status:1).size - @processed_shixuns = shixuns.where(status:2).size + @processed_shixuns = shixuns.where(status:2, public: 0).size @closed_shixuns = shixuns.where(status:3).size - @none_public_shixuns = shixuns.where(public:0).size @pending_public_shixuns = shixuns.where(public:1).size @processed_pubic_shixuns = shixuns.where(public:2).size @shixuns_type_check = MirrorRepository.pluck(:type_name,:id) diff --git a/app/queries/admins/shixun_query.rb b/app/queries/admins/shixun_query.rb index 4f9f4676e..29e087332 100644 --- a/app/queries/admins/shixun_query.rb +++ b/app/queries/admins/shixun_query.rb @@ -13,25 +13,14 @@ class Admins::ShixunQuery < ApplicationQuery all_shixuns = Shixun.all status = case params[:status] - when "editing" then [0] - when "pending" then [1] - when "processed" then [2] - when "closed" then [3] - else - [0,1,2,3] + when "editing" then {status: 0} + when "processed" then {status: 2, public: 0} + when "pending" then {public: 1} + when "publiced" then {public: 2} + when "closed" then {status: 3} end - public = - case params[:public] - when "editing" then [0] - when "pending" then [1] - when "processed" then [2] - else - [0,1,2] - end - - all_shixuns = all_shixuns.where(status: status) if status.present? - all_shixuns = all_shixuns.where(public: public) if public.present? + all_shixuns = all_shixuns.where(status) if status.present? if params[:fork_status].present? all_shixuns = all_shixuns.where.not(fork_from: nil) diff --git a/app/queries/admins/shixun_settings_query.rb b/app/queries/admins/shixun_settings_query.rb index 377e7bf60..1e45952bf 100644 --- a/app/queries/admins/shixun_settings_query.rb +++ b/app/queries/admins/shixun_settings_query.rb @@ -15,16 +15,15 @@ class Admins::ShixunSettingsQuery < ApplicationQuery all_shixuns = all_shixuns.where(id: params[:id]) if params[:id].present? status = - case params[:status] - when "editing" then [0] - when "pending" then [1] - when "processed" then [2] - when "closed" then [3] - else - [0,1,2,3] - end - - all_shixuns = all_shixuns.where(status: status) if status.present? + case params[:status] + when "editing" then {status: 0} + when "processed" then {status: 2, public: 0} + when "pending" then {public: 1} + when "publiced" then {public: 2} + when "closed" then {status: 3} + end + + all_shixuns = all_shixuns.where(status) if status.present? if params[:tag].present? all_shixuns = all_shixuns.joins(:mirror_repositories).where("mirror_repositories.id = ?",params[:tag].to_i) diff --git a/app/views/admins/shixun_settings/index.html.erb b/app/views/admins/shixun_settings/index.html.erb index 66286926a..16a02ab96 100644 --- a/app/views/admins/shixun_settings/index.html.erb +++ b/app/views/admins/shixun_settings/index.html.erb @@ -8,7 +8,7 @@
- <% status_options = [['全部', ''], ["编辑中(#{@editing_shixuns})", "editing"], ["待审核(#{@pending_shixuns})", 'pending'], ["已发布(#{@processed_shixuns})", 'processed'],["已关闭(#{@closed_shixuns})",'closed']] %> + <% status_options = [['全部', ''], ["编辑中(#{@editing_shixuns})", "editing"], ["已发布未公开(#{@processed_shixuns})", 'processed'], ["待审核(#{@pending_public_shixuns})", 'pending'], ["已公开(#{@processed_pubic_shixuns})", 'publiced'], ["已关闭(#{@closed_shixuns})",'closed']] %> <%= select_tag(:status, options_for_select(status_options), class: 'form-control') %>
diff --git a/app/views/admins/shixuns/index.html.erb b/app/views/admins/shixuns/index.html.erb index 9bb09f86f..4348f0f45 100644 --- a/app/views/admins/shixuns/index.html.erb +++ b/app/views/admins/shixuns/index.html.erb @@ -8,16 +8,10 @@
- <% status_options = [['全部', ''], ["编辑中(#{@editing_shixuns})", "editing"], ["待审核(#{@pending_shixuns})", 'pending'], ["已发布(#{@processed_shixuns})", 'processed'],["已关闭(#{@closed_shixuns})",'closed']] %> + <% status_options = [['全部', ''], ["编辑中(#{@editing_shixuns})", "editing"], ["已发布未公开(#{@processed_shixuns})", 'processed'], ["待审核(#{@pending_public_shixuns})", 'pending'], ["已公开(#{@processed_pubic_shixuns})", 'publiced'], ["已关闭(#{@closed_shixuns})",'closed']] %> <%= select_tag(:status, options_for_select(status_options), class: 'form-control') %>
-
- - <% public_options = [['全部', ''], ["未公开(#{@none_public_shixuns})", "editing"], ["待审核(#{@pending_public_shixuns})", 'pending'], ["已公开(#{@processed_pubic_shixuns})", 'processed']] %> - <%= select_tag(:public, options_for_select(public_options), class: 'form-control') %> -
-
<%= select_tag(:tag, options_for_select(@shixuns_type_check.unshift(["",nil])), class: 'form-control',id:"tag-choosed") %>