Merge branch 'dev_aliyun' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

dev_forum
杨树明 5 years ago
commit bdfa4b5608

@ -35,7 +35,7 @@ class HomeworkCommon < ApplicationRecord
has_many :homework_review_results, :dependent => :destroy has_many :homework_review_results, :dependent => :destroy
validates :name, length: { maximum: 60 } validates :name, length: { maximum: 60 }
validates :description, length: { maximum: 5000 } validates :description, length: { maximum: 15000 }
validates :reference_answer, length: { maximum: 5000 } validates :reference_answer, length: { maximum: 5000 }
# after_update :update_activity # after_update :update_activity

@ -0,0 +1,12 @@
class AddIsMdForHomeworks < ActiveRecord::Migration[5.2]
def change
# add_column :homework_commons, :is_md, :boolean, :default => true
# add_column :homework_banks, :is_md, :boolean, :default => true
#
#
# add_column :exercise_questions,:is_md, :boolean, :default => true
# add_column :poll_questions,:is_md, :boolean, :default => true
#
# add_column :exercise_bank_questions, :is_md, :boolean, :default => true
end
end

@ -0,0 +1,14 @@
class MigrateCourseIsMd < ActiveRecord::Migration[5.2]
def change
# HomeworkCommon.where(homework_type: [1, 3]).where("created_at < '2019-07-21 00:00:00'").update_all(is_md: false)
# HomeworkBank.where(homework_type: [1, 3]).where("created_at < '2019-07-21 00:00:00'").update_all(is_md: false)
#
# HomeworkCommon.where(homework_type: [1, 3]).where("created_at >= '2019-07-21 00:00:00' and homework_bank_id is not null").each do |homework|
#
# end
#
# ExerciseQuestion.where("created_at < '2019-07-21 00:00:00'").update_all(is_md: false)
# PollQuestion.where("created_at < '2019-07-21 00:00:00'").update_all(is_md: false)
# ExerciseBankQuestion.where("created_at < '2019-07-21 00:00:00'").update_all(is_md: false)
end
end

@ -6,6 +6,9 @@ export function isImageExtension(fileName) {
export function markdownToHTML(oldContent, selector) { export function markdownToHTML(oldContent, selector) {
window.$('#md_div').html('') window.$('#md_div').html('')
// markdown to html // markdown to html
if (selector && oldContent && oldContent.startsWith('<p')) { // 普通html处理
window.$(selector).html(oldContent)
} else {
try { try {
var markdwonParser = window.editormd.markdownToHTML("md_div", { var markdwonParser = window.editormd.markdownToHTML("md_div", {
markdown: oldContent, // .replace(/▁/g,"▁▁▁"), markdown: oldContent, // .replace(/▁/g,"▁▁▁"),
@ -27,6 +30,7 @@ export function markdownToHTML(oldContent, selector) {
} }
return content return content
} }
}
export function appendFileSizeToUploadFile(item) { export function appendFileSizeToUploadFile(item) {
return `${item.title}${uploadNameSizeSeperator}${item.filesize}` return `${item.title}${uploadNameSizeSeperator}${item.filesize}`

@ -87,7 +87,7 @@ class CommonWorkQuestion extends Component{
{/* 内容区 */} {/* 内容区 */}
<div className="padding40 memoContent new_li"> <div className="padding40 memoContent new_li">
<MarkdownToHtml content={description}></MarkdownToHtml> <MarkdownToHtml content={description} selector="work_content"></MarkdownToHtml>
{ attachments && attachments.map((item) => { { attachments && attachments.map((item) => {
return ( <div className="color-grey"> return ( <div className="color-grey">

@ -13,6 +13,7 @@ import axios from 'axios';
import './LoginDialog.css'; import './LoginDialog.css';
import { broadcastChannelPostMessage } from 'educoder' import { broadcastChannelPostMessage } from 'educoder'
import Notcompletedysl from "../user/Notcompletedysl";
const $ = window.$; const $ = window.$;
var wait = 60; var wait = 60;
@ -100,6 +101,7 @@ class LoginDialog extends Component {
authCodeType:true, authCodeType:true,
authCodeclass:'log-botton mt5', authCodeclass:'log-botton mt5',
isRender: false, isRender: false,
MyEduCoderModals:false,
}; };
} }
@ -365,10 +367,11 @@ class LoginDialog extends Component {
description:response.data.message, description:response.data.message,
}); });
}else{ }else{
if(response.data.identity === null || response.data.identity === undefined){ if(response.data.profile_completed !== null || response.data.profile_completed === false){
this.props.history.push("/interesse"); this.setMyEduCoderModals();
return; return;
} }
broadcastChannelPostMessage('refreshPage') broadcastChannelPostMessage('refreshPage')
this.setState({ this.setState({
isRender:false isRender:false
@ -388,17 +391,28 @@ class LoginDialog extends Component {
console.log(error) console.log(error)
}) })
} };
setNotcompleteds=()=>{
this.setState({
Notcompleteds:true,
MyEduCoderModals:false
})
};
setMyEduCoderModals=()=>{
this.setState({
MyEduCoderModals:true
})
};
onKeydowns=(e)=>{ onKeydowns=(e)=>{
let {disabled}=this.state; let {disabled}=this.state;
if( disabled===false&& e.keyCode === 13){ if( disabled===false&& e.keyCode === 13){
this.loginEDU() this.loginEDU()
console.log(1) console.log(1)
} }
} };
getloginurl=(url)=>{ getloginurl=(url)=>{
window.location.href = url; window.location.href = url;
} };
render() { render() {
let{open,login,speedy,loginValue,regular,isGoing,isGoingValue,disabled,bottonclass, let{open,login,speedy,loginValue,regular,isGoing,isGoingValue,disabled,bottonclass,
dialogBox,shortcutnum,disabledType,gaincode,authCodeType,authCodeclass, isRender}=this.state; dialogBox,shortcutnum,disabledType,gaincode,authCodeType,authCodeclass, isRender}=this.state;
@ -414,6 +428,10 @@ class LoginDialog extends Component {
disableBackdropClick={true} disableBackdropClick={true}
onClose={() => this.handleDialogClose()} onClose={() => this.handleDialogClose()}
> >
<Notcompletedysl
modalsType={this.state.MyEduCoderModals}
setNotcompleteds={()=>{this.setNotcompleteds()}}
/>
{isRender===true? {isRender===true?
<div className={dialogBox}> <div className={dialogBox}>
<div id="closeIcon" onClick={()=>{this.handleDialogClose()}}> <div id="closeIcon" onClick={()=>{this.handleDialogClose()}}>

@ -691,7 +691,7 @@ class LoginRegisterComponent extends Component {
<Input style={loginInputsyl} type="text" autoComplete="off" onClick={this.changeTypey} <Input style={loginInputsyl} type="text" autoComplete="off" onClick={this.changeTypey}
className={Phonenumberisnotco && Phonenumberisnotco !== "" ?" color-grey-9 loginInputzhucheyslass bor-reds":" color-grey-9 loginInputzhuche"} className={Phonenumberisnotco && Phonenumberisnotco !== "" ?" color-grey-9 loginInputzhucheyslass bor-reds":" color-grey-9 loginInputzhuche"}
placeholder="输入注册手机号或邮箱" value={this.state.login} placeholder="输入注册手机号或邮箱" value={this.state.login}
onBlur={(e) => this.inputOnBlurzhuche(e)} // onBlur={(e) => this.inputOnBlurzhuche(e)}
onChange={this.loginInputonChange} style={{marginTop: '10px', height: "38px"}}></Input> onChange={this.loginInputonChange} style={{marginTop: '10px', height: "38px"}}></Input>
{ {
Phonenumberisnotco && Phonenumberisnotco !== "" ? Phonenumberisnotco && Phonenumberisnotco !== "" ?

@ -340,8 +340,8 @@ class LoginRegisterComponent extends Component {
} }
if(response.data.identity === null || response.data.identity === undefined){ if(response.data.profile_completed !== null || response.data.profile_completed === false){
this.props.history.push("/interesse"); this.setMyEduCoderModals();
return; return;
} }
@ -1028,7 +1028,7 @@ class LoginRegisterComponent extends Component {
value={this.state.logins} value={this.state.logins}
type="text" autoComplete="off" type="text" autoComplete="off"
onChange={this.loginInputonChanges} onChange={this.loginInputonChanges}
onBlur={(e) => this.inputOnBlurzhuche(e, 2)} // onBlur={(e) => this.inputOnBlurzhuche(e, 2)}
style={{marginTop: '30px' , height: '38px',color:'#999999',fontSize:"14px"}}></Input> style={{marginTop: '30px' , height: '38px',color:'#999999',fontSize:"14px"}}></Input>
{ {
Phonenumberisnotcos && Phonenumberisnotcos !== "" ? Phonenumberisnotcos && Phonenumberisnotcos !== "" ?

@ -402,6 +402,7 @@ class AccountBasic extends Component {
filterDepartments, filterDepartments,
school, school,
school_id, school_id,
departments,
departmentsName, departmentsName,
identity identity
}=this.state; }=this.state;
@ -718,7 +719,9 @@ class AccountBasic extends Component {
</Form.Item> </Form.Item>
{ {
(!filterDepartments || (filterDepartments && filterDepartments.length==0 ) || (departmentsName == '' && !this.state.department_id)) && (!filterDepartments || (filterDepartments && filterDepartments.length==0 )
|| (departmentsName == '' && !this.state.department_id
&& (!departments || departments.length == 0) )) &&
<div style={{marginLeft: '113px',height:"20px",lineHeight:"20px"}}> <div style={{marginLeft: '113px',height:"20px",lineHeight:"20px"}}>
<span> <span>
<span style={{color: '#CDCDCD'}}>{departmentsName ? `未找到包含“${departmentsName}”的院系/部门` : '未找到院系'}</span> <span style={{color: '#CDCDCD'}}>{departmentsName ? `未找到包含“${departmentsName}”的院系/部门` : '未找到院系'}</span>

Loading…
Cancel
Save