diff --git a/app/controllers/myshixuns_controller.rb b/app/controllers/myshixuns_controller.rb index 7847d58ed..350ee581f 100644 --- a/app/controllers/myshixuns_controller.rb +++ b/app/controllers/myshixuns_controller.rb @@ -3,7 +3,7 @@ class MyshixunsController < ApplicationController before_action :find_myshixun, :except => [:training_task_status, :code_runinng_message] before_action :find_repo_name, :except => [:training_task_status, :code_runinng_message] skip_before_action :verify_authenticity_token, :only => [:html_content] - skip_before_action :check_sign, only: [:training_task_status, :code_runinng_message] + skip_before_action :check_sign, only: [:training_task_status, :code_runinng_message, :html_content] ## TPI关卡列表 def challenges diff --git a/public/images/educoder/xcx/SMIDCard.png b/public/images/educoder/xcx/SMIDCard.png new file mode 100644 index 000000000..cea96596d Binary files /dev/null and b/public/images/educoder/xcx/SMIDCard.png differ diff --git a/public/images/educoder/xcx/ZYIDCard.png b/public/images/educoder/xcx/ZYIDCard.png new file mode 100644 index 000000000..7f2085fce Binary files /dev/null and b/public/images/educoder/xcx/ZYIDCard.png differ diff --git a/public/react/src/common/educoder.js b/public/react/src/common/educoder.js index 9a19c6ee2..b0ef6d692 100644 --- a/public/react/src/common/educoder.js +++ b/public/react/src/common/educoder.js @@ -4,7 +4,7 @@ export { getImageUrl as getImageUrl, getRandomNumber as getRandomNumber,getUrl as getUrl, publicSearchs as publicSearchs,getRandomcode as getRandomcode,getUrlmys as getUrlmys, getUrl2 as getUrl2, setImagesUrl as setImagesUrl , getUploadActionUrl as getUploadActionUrl,getUploadActionUrltwo as getUploadActionUrltwo ,getUploadActionUrlthree as getUploadActionUrlthree, getUploadActionUrlOfAuth as getUploadActionUrlOfAuth - , getTaskUrlById as getTaskUrlById, TEST_HOST ,htmlEncode as htmlEncode } from './UrlTool'; + , getTaskUrlById as getTaskUrlById, TEST_HOST ,htmlEncode as htmlEncode ,getupload_git_file as getupload_git_file} from './UrlTool'; export {setmiyah as setmiyah} from './Component'; export { default as queryString } from './UrlTool2'; diff --git a/public/react/src/common/quillForEditor/FillBlot.js b/public/react/src/common/quillForEditor/FillBlot.js index 144b499ee..2f9414253 100644 --- a/public/react/src/common/quillForEditor/FillBlot.js +++ b/public/react/src/common/quillForEditor/FillBlot.js @@ -4,16 +4,17 @@ * @Github: * @Date: 2020-01-06 09:02:29 * @LastEditors : tangjiang - * @LastEditTime : 2020-01-09 11:58:52 + * @LastEditTime : 2020-01-09 15:00:13 */ import Quill from 'quill'; // let Inline = Quill.import('blots/inline'); -const BlockEmbed = Quill.import('blots/block/embed'); +const BlockEmbed = Quill.import('blots/embed'); class FillBlot extends BlockEmbed { static create (value) { - const node = super.cerate(); + const node = super.cerate(value); // node.classList.add('icon icon-bianji2'); // node.setAttribute('data-fill', 'fill'); + console.log('编辑器值===》》》》》', value); node.setAttribute('data_index', value.data_index); node.nodeValue = value.text; return node; @@ -28,7 +29,7 @@ class FillBlot extends BlockEmbed { } -FillBlot.blotName = "fill"; +FillBlot.blotName = "fill-blot"; FillBlot.tagName = "span"; export default FillBlot; diff --git a/public/react/src/common/quillForEditor/index.js b/public/react/src/common/quillForEditor/index.js index f892e9b8d..525feba09 100644 --- a/public/react/src/common/quillForEditor/index.js +++ b/public/react/src/common/quillForEditor/index.js @@ -4,7 +4,7 @@ * @Github: * @Date: 2019-12-18 08:49:30 * @LastEditors : tangjiang - * @LastEditTime : 2020-01-09 11:56:10 + * @LastEditTime : 2020-01-10 15:05:27 */ import './index.scss'; import 'quill/dist/quill.core.css'; // 核心样式 @@ -31,14 +31,16 @@ Quill.register(ImageBlot); Quill.register(Size); Quill.register(Font, true); // Quill.register({'modules/toolbar': Toolbar}); -Quill.register(FillBlot); +Quill.register({ + 'formats/fill': FillBlot +}); // Quill.register(Color); function QuillForEditor ({ placeholder, readOnly, - autoFocus, + autoFocus = false, options, value, imgAttrs = {}, // 指定图片的宽高 @@ -194,10 +196,11 @@ function QuillForEditor ({ }); _quill.getModule('toolbar').addHandler('fill', (e) => { + // console.log('点击了填空=====>>>>>>', e); setFillCount(fillCount + 1); const range = _quill.getSelection(true); // _quill.insertText(range.index, '▁', { 'data_index': fillCount }); - _quill.insertEmbed(range.index, 'span', { + _quill.insertEmbed(range.index, 'fill', { text: '▁', 'data_index': fillCount }); @@ -229,16 +232,21 @@ function QuillForEditor ({ } const current = value - // console.log('+++++', current); if (!deepEqual(previous, current)) { setSelection(quill.getSelection()) if (typeof value === 'string') { - quill.clipboard.dangerouslyPasteHTML(value, 'api') + quill.clipboard.dangerouslyPasteHTML(value, 'api'); + if (autoFocus) { + quill.focus(); + } else { + quill.blur(); + } } else { quill.setContents(value) + if (autoFocus) quill.focus(); } } - }, [quill, value, setQuill]); + }, [quill, value, setQuill, autoFocus]); // 清除选择区域 useEffect(() => { @@ -272,13 +280,6 @@ function QuillForEditor ({ } }, [quill, handleOnChange]); - useEffect(() => { - if (!quill) return; - if (autoFocus) { - quill.focus(); - } - }, [quill, autoFocus]); - // 返回结果 return (
diff --git a/public/react/src/modules/courses/boards/TopicDetail.js b/public/react/src/modules/courses/boards/TopicDetail.js index e8767fb87..f4df177c7 100644 --- a/public/react/src/modules/courses/boards/TopicDetail.js +++ b/public/react/src/modules/courses/boards/TopicDetail.js @@ -682,6 +682,7 @@ class TopicDetail extends Component {
{!isCourseEnd && } {/* onClick={ this.createNewComment } diff --git a/public/react/src/modules/courses/common/comments/CommonReply.js b/public/react/src/modules/courses/common/comments/CommonReply.js index 42ec3d65a..50f2b60cb 100644 --- a/public/react/src/modules/courses/common/comments/CommonReply.js +++ b/public/react/src/modules/courses/common/comments/CommonReply.js @@ -252,6 +252,7 @@ class CommonReply extends Component{ {/* bor-bottom-greyE */} diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettingReply.js b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettingReply.js index 4281d0ec6..ce0554488 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettingReply.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettingReply.js @@ -18,7 +18,7 @@ import { generateComments, generateChildComments, _findById, handleContentBefore const REPLY_PAGE_COUNT = 10 const $ = window.$; -/* +/* 相比较GraduateTopicReply 改动的地方 列表接口名 /graduation_tasks/${graduation_topic_id}/show_comment.json?parent_id=${parent.id}&limit=500 回复类型名 jour_type: 'GraduationTask', @@ -34,7 +34,7 @@ class GraduationTaskssettingReply extends Component{ componentDidMount(){ this.fetchReplies() - + } _getUser() { const { current_user } = this.props; @@ -58,7 +58,7 @@ class GraduationTaskssettingReply extends Component{ // m_parent_id reply_id: memo.user_id } - } + } ).then((response) => { if (response.data.status === -1) { console.error('服务端异常') @@ -66,18 +66,18 @@ class GraduationTaskssettingReply extends Component{ } // this.props.showNotification('帖子发表成功') - if (response.data && response.data.id) { + if (response.data && response.data.id) { const _id = response.data.id; // md editor.setValue && editor.setValue('') - + const user = this._getUser(); this.setState({ comments: addNewComment(this.state.comments, _id, content, user, this.props.isSuperAdmin(), this), total_count: this.state.total_count + 1 }) this.refs.editor.showEditor(); - + } }).catch((error) => { console.log(error) @@ -95,13 +95,13 @@ class GraduationTaskssettingReply extends Component{ return; } const url = `/users/reply_message.json`; - + const { comments } = this.state; const user = this._getUser(); const graduation_topic_id = this.props.memo.id const commentIndex = this._findById(id, comments); let comment = comments[commentIndex]; - + commentContent = handleContentBeforeCreateSecondLevelComment(commentContent) axios.post(url, { journals_for_message: { @@ -113,9 +113,9 @@ class GraduationTaskssettingReply extends Component{ } }, { - } + } ).then((response) => { - if (response.data.id) { + if (response.data.id) { let newId = response.data.id; this.setState({ @@ -128,7 +128,7 @@ class GraduationTaskssettingReply extends Component{ memo: newMemo2 }) } - + }).catch((error) => { console.log(error) }) @@ -142,7 +142,7 @@ class GraduationTaskssettingReply extends Component{ }) .then((response) => { const { comments } = response.data - + // const memo = Object.assign({}, this.state.memo) // memo.sum_replies_count = sum_replies_count; @@ -160,7 +160,7 @@ class GraduationTaskssettingReply extends Component{ this.fetchReplies() }) } - + fetchReplies = () => { const graduation_topic_id = this.props.memo.id const course_id = this.props.course_id @@ -170,7 +170,7 @@ class GraduationTaskssettingReply extends Component{ }) .then((response) => { const { comments, messages_count } = response.data - + this.setState({ comments: generateComments(comments, this.transformReply), // : this.state.comments.concat(comments), @@ -180,7 +180,7 @@ class GraduationTaskssettingReply extends Component{ console.log(error) }) } - + transformReply = (reply, children = []) => { const isAdmin = this.props.isAdmin() const isSuperAdmin = this.props.isSuperAdmin() @@ -189,7 +189,7 @@ class GraduationTaskssettingReply extends Component{ isSuperAdmin: isSuperAdmin, permission: true, // children: children, - hidden: reply.hidden, + hidden: reply.hidden, id: reply.id, image_url: reply.author.image_url, reward: null, // @@ -235,7 +235,7 @@ class GraduationTaskssettingReply extends Component{ -
- - - {/* { true ? : + + + {/* { true ? :
写评论
} */}
- - { total_count > REPLY_PAGE_COUNT && + + { total_count > REPLY_PAGE_COUNT &&
写评论
diff --git a/public/react/src/modules/courses/graduation/topics/GraduateTopicReply.js b/public/react/src/modules/courses/graduation/topics/GraduateTopicReply.js index df6152c04..f08938b4e 100644 --- a/public/react/src/modules/courses/graduation/topics/GraduateTopicReply.js +++ b/public/react/src/modules/courses/graduation/topics/GraduateTopicReply.js @@ -226,7 +226,7 @@ class GraduateTopicReply extends Component{ return( -
{ window.__useKindEditor === true ? - + : - + } {/* onClick={ this.createNewComment } */} diff --git a/public/react/src/modules/forums/MemoDetailMDEditor.js b/public/react/src/modules/forums/MemoDetailMDEditor.js index 8076c5e6a..b8bcc47fb 100644 --- a/public/react/src/modules/forums/MemoDetailMDEditor.js +++ b/public/react/src/modules/forums/MemoDetailMDEditor.js @@ -75,7 +75,10 @@ class MemoDetailMDEditor extends Component { } onCommit = () => { - + if(this.props.checkIfLogin()===false){ + this.props.showLoginDialog() + return + } if(this.props.checkIfProfileCompleted()===false){ this.props.showhideAccountPhoneemailDialog() return diff --git a/public/react/src/modules/tpm/component/TPMRightSection.js b/public/react/src/modules/tpm/component/TPMRightSection.js index e6dc1da98..2cfe0047a 100644 --- a/public/react/src/modules/tpm/component/TPMRightSection.js +++ b/public/react/src/modules/tpm/component/TPMRightSection.js @@ -64,7 +64,7 @@ class TPMRightSection extends Component { Progresssum=(parseInt(TPMRightSectionData&&TPMRightSectionData.complete_count) / parseInt(TPMRightSectionData&&TPMRightSectionData.challenge_count))*100; } - + // console.log(this.props&&this.props.is_jupyter===true) return (
- {this.state.isopentitletype==="Less"?"":this.state.opentitletype===true?this.opentitle()} className={"pointer Breadcrumbfont color-grey-9 "}> + + {this.props&&this.props.is_jupyter===true&&this.props&&this.props.user.user_identity==="学生"?"":this.state.isopentitletype==="Less"?"":this.state.opentitletype===true?this.opentitle()} className={"pointer Breadcrumbfont color-grey-9 "}> 阅读全文 :this.opentitle()} className={"pointer Breadcrumbfont color-grey-9 "}> 收起全文 diff --git a/public/react/src/modules/tpm/shixuns/ShixunCard.js b/public/react/src/modules/tpm/shixuns/ShixunCard.js index 5086dd14d..a292f4d87 100644 --- a/public/react/src/modules/tpm/shixuns/ShixunCard.js +++ b/public/react/src/modules/tpm/shixuns/ShixunCard.js @@ -193,11 +193,11 @@ class ShixunCard extends Component {

- + {item.is_jupyter===false? {item.challenges_count} - + :""} {/**/} {/**/} diff --git a/public/react/src/modules/tpm/shixuns/ShixunCardList.js b/public/react/src/modules/tpm/shixuns/ShixunCardList.js index 948bbed48..46abc5bf0 100644 --- a/public/react/src/modules/tpm/shixuns/ShixunCardList.js +++ b/public/react/src/modules/tpm/shixuns/ShixunCardList.js @@ -75,17 +75,18 @@ class ShixunCardList extends Component { type="new"; } + if(typekeyid===key){ if(upcircle===true){ this.setState({ upcircle:false, }) - this.props.Shixunsupcircles("desc") + // this.props.Shixunsupcircles("desc") }else if(upcircle===false){ this.setState({ upcircle:true, }) - this.props.Shixunsupcircles("asc") + // this.props.Shixunsupcircles("desc") } }else{ this.setState({ @@ -93,8 +94,8 @@ class ShixunCardList extends Component { }) } - //allevent - this.props.ShixunsState(false,type); + + this.props.ShixunsState(false,type,"desc"); } diff --git a/public/react/src/modules/tpm/shixuns/ShixunsIndex.js b/public/react/src/modules/tpm/shixuns/ShixunsIndex.js index f14afb0ac..82fa6a3f9 100644 --- a/public/react/src/modules/tpm/shixuns/ShixunsIndex.js +++ b/public/react/src/modules/tpm/shixuns/ShixunsIndex.js @@ -296,21 +296,23 @@ class ShixunsIndex extends Component { console.log(error) }); } - ShixunsState=(val,type)=>{ + ShixunsState=(val,type,sorts)=>{ // sort, let {tag_level, tag_id, page, limit, keyword, status, diff,sort} = this.state; - let newsort=sort; + let newsort=sorts?sorts:sort; this.setState({ order_by:type, typepvisible:true, pages:1, - // sort:sort + sort:sorts?sorts:sort }) let params // let vals=false if(newsort===undefined){ newsort="desc" + }else{ + newsort=sorts?sorts:sort } params= { order_by:type,