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

dev_cs_new
cxt 6 years ago
commit b77c15cab7

@ -234,6 +234,8 @@ class CoursesController < ApplicationController
def destroy
if @course.is_delete == 0
@course.delete!
Tiding.create!(user_id: @course.tea_id, trigger_user_id: 1, container_id: @course.id,
container_type: 'Course', tiding_type: 'Delete', extra: @course.name)
normal_status(0, "成功")
else
normal_status(-1, "课堂已删除,无需重复操作")

@ -1,7 +1,7 @@
class ProjectPackagesController < ApplicationController
include PaginateHelper
before_action :require_login, :check_auth, only: %i[create update destroy]
before_action :require_login, :check_auth, only: %i[show create update destroy]
helper_method :current_package, :package_manageable?

@ -1,6 +1,7 @@
class TidingsController < ApplicationController
include PaginateHelper
before_action :require_login
after_action :update_onclick_time!, only: [:index]
def index

@ -126,7 +126,11 @@ module TidingDecorator
end
def course_content
I18n.t(locale_format) % container.name
if tiding_type == 'Delete'
I18n.t(locale_format(tiding_type)) % extra
else
I18n.t(locale_format) % container.name
end
end
def shixun_content

@ -5,8 +5,8 @@ class Users::UpdateAccountForm
attr_accessor :nickname, :name, :show_realname, :gender, :location, :location_city,
:identity, :student_id, :technical_title, :school_id, :department_id
validates :nickname, presence: true
validates :name, presence: true
validates :nickname, presence: true, length: { maximum: 20 }
validates :name, presence: true, length: { maximum: 10 }
validates :gender, presence: true, numericality: { only_integer: true }, inclusion: { in: [0, 1] }
validates :location, presence: true
validates :location_city, presence: true

@ -28,7 +28,7 @@ class CourseMessage < ApplicationRecord
def send_deal_tiding
# 发送申请处理结果消息
Tiding.create!(
user_id: user_id, trigger_user: User.current, container_id: course_id, container_type: 'DealCourse',
user_id: course_message_id, trigger_user: User.current, container_id: course_id, container_type: 'DealCourse',
belong_container: course, extra: content.to_i == 2 ? '7' : '9', tiding_type: 'System', status: status == :PASSED ? 1 : 2
)
# 将申请消息置为已处理

@ -1,8 +1,10 @@
json.extract! tiding, :id, :status, :viewed, :user_id, :tiding_type, :container_id, :container_type, :parent_container_id, :parent_container_type
json.extract! tiding, :id, :status, :viewed, :user_id, :tiding_type, :container_id, :container_type,
:parent_container_id, :parent_container_type, :belong_container_id, :belong_container_type
json.content tiding.content
json.identifier tiding.identifier
json.auth_type tiding.container_type == 'ApplyUserAuthentication' ? tiding.container.auth_type : nil
json.homework_type tiding.container_type == 'HomeworkCommon' ? tiding.container.homework_type : nil
json.time tiding.how_long_time
json.new_tiding tiding.unread?(@onclick_time)

@ -6,9 +6,9 @@
"2_end": "申请职业认证:%s %s"
System:
"1_1_end": "你提交的实名认证申请,审核已通过"
"1_2_end": "你提交的实名认证申请,审核未通过&nbsp;&nbsp;&nbsp;&nbsp;原因:%{reason}"
"1_2_end": "你提交的实名认证申请,审核未通过<br/><span>原因:%{reason}</span>"
"2_1_end": "你提交的职业认证申请,审核已通过"
"2_2_end": "你提交的职业认证申请,审核未通过&nbsp;&nbsp;&nbsp;&nbsp;原因:%{reason}"
"2_2_end": "你提交的职业认证申请,审核未通过<br/><span>原因:%{reason}</span>"
CancelUserAuthentication_end: "取消了你的实名认证:%s %s"
CancelUserProCertification_end: "取消了你的实名认证:%s %s"
JoinCourse:
@ -21,6 +21,9 @@
"7_2_end": "你提交的加入课堂申请:%s助教, 审核未通过"
StudentJoinCourse_end: "加入了课堂:%s学生"
TeacherJoinCourse:
"2_end": "%s将你加入课堂%s教师"
"3_end": "%s将你加入课堂%s助教"
"4_end": "%s将你加入课堂%s学生"
"9_end": "%s将你加入课堂%s教师"
"7_end": "%s将你加入课堂%s助教"
"10_end": "%s将你加入课堂%s学生"
@ -28,33 +31,35 @@
Apply_end: "申请添加二级单位:%s%s"
System:
"1_end": "你提交的添加二级单位申请:%s%s审核已通过"
"2_false_end": "你提交的添加二级单位申请:%s%s审核未通过&nbsp;&nbsp;&nbsp;&nbsp;原因:%{reason}"
"2_false_end": "你提交的添加二级单位申请:%s%s审核未通过<br/><span>原因:%{reason}</span>"
"2_true_end": "你提交的添加二级单位申请:%s%s审核未通过"
"3_end": "你提交的添加二级单位申请:%s%s已被更改为%{reason}"
ApplyAddSchools:
Apply_end: "申请添加单位:%s"
System:
"1_end": "你提交的添加单位申请:%{name},审核已通过"
"2_reason_end": "你提交的添加单位申请:%{name},审核未通过&nbsp;&nbsp;&nbsp;&nbsp;原因:%{reason}"
"2_reason_end": "你提交的添加单位申请:%{name},审核未通过<br/><span>原因:%{reason}</span>"
"2_no_reason_end": "你提交的添加单位申请:%{name},审核未通过"
"3_end": "你提交的添加单位申请:%{name},已被更改为:%{reason}"
ApplyAction:
ApplyShixun:
System:
"1_end": "你提交的实训发布申请:%{name},审核已通过"
"2_end": "你提交的实训发布申请:%{name},审核未通过&nbsp;&nbsp;&nbsp;&nbsp;原因:%{reason}"
"2_end": "你提交的实训发布申请:%{name},审核未通过<br/><span>原因:%{reason}</span>"
Apply_end: "申请发布实训:%{name}"
ApplySubject:
System:
"1_end": "你提交的实训课程发布申请:%{name},审核已通过"
"2_end": "你提交的实训课程发布申请:%{name},审核未通过&nbsp;&nbsp;&nbsp;&nbsp;原因:%{reason}"
"2_end": "你提交的实训课程发布申请:%{name},审核未通过<br/><span>原因:%{reason}</span>"
Apply_end: "申请发布实训课程:%{name}"
TrialAuthorization:
System:
"1_end": "你提交的试用授权申请,审核已通过"
"2_end": "你提交的试用授权申请,审核未通过&nbsp;&nbsp;&nbsp;&nbsp;原因:%{reason}"
"2_end": "你提交的试用授权申请,审核未通过<br/><span>原因:%{reason}</span>"
Apply_end: "提交了试用授权申请"
Course_end: "成功创建了课堂:%s"
Course:
Delete_end: "你删除了课堂:%s"
Shixun_end: "成功创建了实训:%s"
Subject_end: "成功创建了实训课程:%s"
ArchiveCourse_end: "你的课堂已经归档:%s"
@ -174,7 +179,7 @@
GraduationWorkScore_end: "评阅了你的作品:%s"
HomeworkCommon:
AnonymousComment_end: "开启了作业匿评:%{name}"
AnonymousCommentFail_end: "开启作业匿评失败:%{name}<br/>原因:%{reason}"
AnonymousCommentFail_end: "开启作业匿评失败:%{name}<br/><span>原因:%{reason}</span>"
AnonymousAppeal_end: "开启了匿评申诉:%{name}"
HomeworkPublish_end: "发布了作业:%{name}"
NearlyEnd_end: "作业的提交截止时间快到啦:%{name}"
@ -203,12 +208,12 @@
Apply_end: "申请发布教学案例:%s"
System:
1_end: "你提交的发布教学案例申请:%s审核已通过"
2_end: "你提交的发布教学案例申请:%s审核未通过,原因:%{reason}"
2_end: "你提交的发布教学案例申请:%s审核未通过<br/><span>原因:%{reason}</span>"
ProjectPackage:
Apply_end: "申请发布众包需求:%s"
System:
1_end: "你提交的众包需求申请:%s审核已通过"
2_end: "你提交的众包需求申请:%s审核未通过,原因:%{reason}"
2_end: "你提交的众包需求申请:%s审核未通过<br/><span>原因:%{reason}</span>"
Created_end: "你创建了众包需求:%s"
Destroyed_end: "你删除了众包需求:%s"
Bidding_end: "应征了你发布的众包任务:%s"

@ -209,6 +209,7 @@ $(function(){
// window resize
$(window).on('resize', function() {
window._tpiWidthResize && window._tpiWidthResize()
$('#games_repository_contents .CodeMirror.cm-s-railscasts').css("height", $("#games_repository_contents").height() - repositoryTabHeight);
})
@ -1221,6 +1222,7 @@ $(function(){ // 这里重新加一次事件监听,不在原有事件的基
);
doc.live("mousemove", function(e) {
if (dragging === true && lab == dragDom) {
window._tpiWidthResize && window._tpiWidthResize()
// React 组件中需要resize搜索该引用可以找到初始化的位置
window._currentChildcommentMDEditor && window._currentChildcommentMDEditor.resize()
}

@ -90,12 +90,19 @@ class Clappr extends Component{
<React.Fragment>
{/* https://github.com/CookPete/react-player/issues/686 */}
<ReactPlayer url={source} playing={false} controls={true} width={400} height={ type == 'mp3' ? 55 : 290}/>
{/* <style>{`
.playback_rate {
margin-right: 16px;
}
`}</style>
<div id={_id} className={className + ' ' + type}></div> */}
{/* 原生 */}
{/* { type == 'mp3' ? <audio src={source} preload controls></audio>
: <video src={source} controls="controls">
您的浏览器不支持 video 标签
</video>} */}
</React.Fragment>
)
}

@ -950,7 +950,7 @@ class Fileslists extends Component{
<div className="alltask edu-back-white"
style={
{
display: files===undefined?'block' :files.length===0? 'block' : 'none'
display: files===undefined?'none' :files.length===0? 'block' : 'none'
}
}
>

@ -416,7 +416,7 @@ class BoardsNew extends Component{
max: 10000, message: '最大限制为10000个字符',
}],
})(
<TPMMDEditor ref={this.mdRef} placeholder={'请在此输入帖子详情最大限制为10000个字符'} watch={false}
<TPMMDEditor ref={this.mdRef} placeholder={'请在此输入帖子详情最大限制为10000个字符'}
mdID={'courseMessageMD'} initValue={this.editTopic ? this.editTopic.content : ''} className="courseMessageMD"></TPMMDEditor>
)}
</Form.Item>

@ -440,7 +440,7 @@ class Boards extends Component{
</div>
</Spin>
{
( !messages || messages.length == 0 ) && <NoneData></NoneData>
( !this.state.isSpin && (!messages || messages.length == 0) ) && <NoneData></NoneData>
}
{/* { haveMore && <p className="edu-txt-center pt30 pb10 clearfix">

@ -446,7 +446,7 @@ class NewWork extends Component{
}],
})(
<TPMMDEditor ref={this.contentMdRef} placeholder="请在此输入作业内容和要求,最大限制5000个字符" mdID={'courseContentMD'} refreshTimeout={1500}
watch={false} className="courseMessageMD" initValue={this.state.description}></TPMMDEditor>
className="courseMessageMD" initValue={this.state.description}></TPMMDEditor>
)}
</Form.Item> }
<Upload {...uploadProps} className="upload_1 newWorkUpload">
@ -508,7 +508,7 @@ class NewWork extends Component{
required: false
}],
})(
<TPMMDEditor ref={this.answerMdRef} placeholder="请在此输入作业的参考答案,最大限制5000个字符" mdID={'workAnswerMD'} watch={false}
<TPMMDEditor ref={this.answerMdRef} placeholder="请在此输入作业的参考答案,最大限制5000个字符" mdID={'workAnswerMD'}
className="courseMessageMD" refreshTimeout={1500} initValue={this.state.reference_answer || ''}></TPMMDEditor>
)}
<Upload {...answerUploadProps} className="upload_1">

@ -467,7 +467,7 @@ class Sendresource extends Component{
{/*)*/}
{/*})}*/}
{newfileListtype===true?<p className={"color-red"}>请先上传资源</p>:""}
{newfileListtype===true&&this.state.fileListtype===false?<p className={"color-red"}>请先上传资源</p>:""}
<p className={"winth540"}>
<style>{`

@ -187,7 +187,7 @@ class SingleEditor extends Component{
<span className="color-grey-9 font-12 fl">客观题由系统自动评分请设置标准答案</span>
</p>
<TPMMDEditor mdID={`question_${question_id}`} placeholder="请您输入题目" height={155} watch={false}
<TPMMDEditor mdID={`question_${question_id}`} placeholder="请您输入题目" height={155}
initValue={question_title} onChange={(val) => this.setState({ question_title: val})}
ref="titleEditor"
></TPMMDEditor>

@ -152,14 +152,14 @@ class MainEditor extends Component{
<span className="color-grey-9 font-12 fl">主观题未作答的情况下自动评为零分</span>
</p>
<TPMMDEditor mdID={`question_${question_id}`} placeholder="请您输入题目" height={155} watch={false}
<TPMMDEditor mdID={`question_${question_id}`} placeholder="请您输入题目" height={155}
initValue={question_title} onChange={(val) => this.setState({ question_title: val})}
noStorage={true} ref="titleEditor"
></TPMMDEditor>
<div>
<div className="mb10 font-16">参考答案</div>
<TPMMDEditor mdID={`question_answer_${question_id}`} placeholder="请输入参考答案(可选)" height={155} watch={false}
<TPMMDEditor mdID={`question_answer_${question_id}`} placeholder="请输入参考答案(可选)" height={155}
initValue={standard_answers[0] || ''} onChange={(val) => this.setState({ standard_answers: [val]})}
noStorage={true}
></TPMMDEditor>

@ -57,7 +57,7 @@ class NullChildEditor extends Component{
className={'nullChildEditor'}
placeholder={`请输入参考答案${itemIndex == 0 ?'':'(可选)'}`}
toMDMode={toMDMode} noStorage={true}
mdID={`answer_${index}${itemIndex}`} height={155} watch={false}
mdID={`answer_${index}${itemIndex}`} height={155}
initValue={item} onChange={(val) => onAnswerChange(index, itemIndex, val)}
></DMDEditor>
</div>

@ -297,7 +297,7 @@ class NullEditor extends Component{
<span className="color-grey-9 font-12 fl">客观题由系统自动评分允许手动调分请设置标准答案 支持最多5个空每空得分按照本题的总分平均计算</span>
</p>
<NullMDEditor {...this.props} mdID={`question_${question_id}`} placeholder="请您输入题目" height={155} watch={false}
<NullMDEditor {...this.props} mdID={`question_${question_id}`} placeholder="请您输入题目" height={155}
initValue={question_title} onChange={(val) => this.setState({ question_title: val})}
onPlaceholderChange={this.onPlaceholderChange} showNullButton={exerciseIsPublish ? false : true}
ref="titleEditor"

@ -250,7 +250,7 @@ class ShixunEditor extends Component{
style={{ marginBottom: '10px'}}
></Input>
{/* <div style={{color: blackColor}} className="font-16 mb5">{shixun_name}</div> */}
<TPMMDEditor mdID={`question_${question_id}`} placeholder="请输入实训题完成要求" height={155} watch={false}
<TPMMDEditor mdID={`question_${question_id}`} placeholder="请输入实训题完成要求" height={155}
initValue={question_title} onChange={(val) => this.setState({ question_title: val})}
noStorage={true}
></TPMMDEditor>

@ -242,7 +242,7 @@ class SingleEditor extends Component{
<span className="color-grey-9 font-12 fl">客观题由系统自动评分请设置标准答案</span>
</p>
<TPMMDEditor mdID={qNumber} placeholder="请您输入题目" height={155} watch={false} className="mb20"
<TPMMDEditor mdID={qNumber} placeholder="请您输入题目" height={155} className="mb20"
initValue={question_title} onChange={(val) => this.setState({ question_title: val})}
ref="titleEditor"
@ -265,7 +265,7 @@ class SingleEditor extends Component{
<DMDEditor
ref={`optionEditor${index}`}
toMDMode={this.toMDMode} toShowMode={this.toShowMode}
height={166} className={'optionMdEditor'} watch={false} noStorage={true}
height={166} className={'optionMdEditor'} noStorage={true}
mdID={qNumber + index} placeholder="" onChange={(value) => this.onOptionContentChange(value, index)}
initValue={item}
></DMDEditor>

@ -767,7 +767,7 @@ class GraduationTasks extends Component{
<div className="alltask edu-back-white"
style={
{
display: all_count===undefined?'block' :all_count===0? 'block' : 'none'
display: all_count===undefined?'none' :all_count===0? 'block' : 'none'
}
}
>

@ -28,7 +28,7 @@ class Boards extends Component{
checkAllValue: false,
checkBoxValues: [],
data:[],
topicList: [],
topicList: undefined,
course_public:1,
page:1,
totalCount:undefined,
@ -412,7 +412,7 @@ onBoardsNew=()=>{
}
onPressEnter={this.onPressEnter}
searchPlaceholder={"请输入名称进行搜索"}
showSearchInput={topicList.length >= pageSize}
showSearchInput={topicList&&topicList.length >= pageSize}
></Titlesearchsection>
<Spin size="large" spinning={this.state.isSpin}>
{
@ -475,7 +475,7 @@ onBoardsNew=()=>{
>
</Modals>
</div>
):(<NoneData></NoneData>)
):(topicList && topicList.length===0?<NoneData></NoneData>:<div className="clearfix stu_table mt20"></div>)
}
</Spin>
{

@ -677,9 +677,9 @@ class studentsList extends Component{
</div>
<Spin size="large" spinning={this.state.isSpin}>
<div className="clearfix stu_table">
<Checkbox.Group style={{ width: '100%' }} onChange={this.onCheckBoxChange} value={checkBoxValues}>
{!this.state.isSpin && <Checkbox.Group style={{ width: '100%' }} onChange={this.onCheckBoxChange} value={checkBoxValues}>
<Table columns={buildColumns(this)} dataSource={students} pagination={false}></Table>
</Checkbox.Group>
</Checkbox.Group> }
</div>
</Spin>
</div>

@ -143,6 +143,7 @@ class CoursesNew extends Component {
handleSubmit = (e) => {
e.preventDefault();
let first_category_url=this.props.current_user.first_category_url;
let coursesId = this.props.match.params.coursesId;
let {is_public,datatime} = this.state
// console.log(is_public)
@ -201,7 +202,8 @@ class CoursesNew extends Component {
).then((response) => {
// debugger
if (response.data.status === 0) {
this.goback()
// this.goback()
this.props.history.push(first_category_url);
}
}).catch((error) => {
console.log(error)
@ -244,7 +246,8 @@ class CoursesNew extends Component {
}
).then((response) => {
if (response.status === 200) {
this.goback()
// this.goback
this.props.history.push(response.data.first_category_url);
}
}).catch((error) => {
console.log(error)

@ -1205,7 +1205,7 @@ class ShixunHomework extends Component{
<div className="alltask "
style={
{
display: datas===undefined?'block' :datas.task_count===0? 'block' : 'none'
display: datas===undefined?'none' :datas.task_count===0? 'block' : 'none'
}
}
>

@ -398,23 +398,23 @@ class LoginDialog extends Component {
});
}
handleDialogClose = () => {
// if(this.props.match===undefined){
// window.location.href="/";
// }else if(this.props.match.path==="/"){
// this.setState({
// isRender: false
// })
// }else{
// window.location.href="/";
// }
this.setState({
isRender: false
})
try {
this.props.Modifyloginvalue();
}catch (e) {
if(this.props.match===undefined){
window.location.href="/";
}else{
this.setState({
isRender: false
})
this.props.Modifyloginvalue();
}
// this.setState({
// isRender: false
// })
// try {
// this.props.Modifyloginvalue();
// }catch (e) {
//
// }
}
loginEDU=()=>{

@ -5,7 +5,7 @@ import {
} from "antd";
import axios from 'axios';
import moment from 'moment';
import {getImageUrl,markdownToHTML} from 'educoder';
import {getImageUrl,markdownToHTML,ImageLayerHook} from 'educoder';
import "../css/messagemy.css"
import WriteaprivateletterModal from '../messagemodal/WriteaprivateletterModal';
//私信页面
@ -46,12 +46,14 @@ class Leftdialogue extends Component{
{
this.props.objeysl&&this.props.objeysl.sender.image_url ?
<img alt="头像" className="mr10 radius fl myimgw48 myimgh48"
src={getImageUrl("/images/" + this.props.objeysl.sender.image_url)} />:""
src={getImageUrl("images/" + this.props.objeysl.sender.image_url)} />:""
}
</a>
<div className="fl pr OtherSide-info">
<span className="trangle"></span>
<div className="sms break_word" id="message_content_show_25148" dangerouslySetInnerHTML={{__html: markdownToHTML(this.props.objeysl.content).replace(/▁/g, "▁▁▁")}}></div>
<ImageLayerHook parentSel={`#Leftdialogue${this.props.keys}`} parentSel={`#Leftdialogue${this.props.keys}`}>
</ImageLayerHook>
<div className="sms break_word" id={`Leftdialogue${this.props.keys}`} dangerouslySetInnerHTML={{__html: markdownToHTML(this.props.objeysl.content).replace(/▁/g, "▁▁▁")}}></div>
<div className="edu-txt-right mt5">
<a className="color-grey-c" onClick={()=>this.mydelete(this.props.objeysl.sender.id,this.props.objeysl.id)} >删除</a>
</div>

@ -575,12 +575,12 @@ class MessagChat extends Component{
}
{
parseInt(item.sender_id)===parseInt(this.props.match.params.userid)?
<Rightdialogue objeysl={item} {...this.state} {...this.props} DELETEsetreplyfun={(user_id,id)=>this.DELETEsetreplyfun(user_id,id)}>
<Rightdialogue keys={key} objeysl={item} {...this.state} {...this.props} DELETEsetreplyfun={(user_id,id)=>this.DELETEsetreplyfun(user_id,id)}>
{/*自己的*/}
</Rightdialogue>
:<Leftdialogue objeysl={item} {...this.state} {...this.props} DELETEsetreplyfun={(user_id,id)=>this.DELETEsetreplyfun(user_id,id)}>
:<Leftdialogue keys={key} objeysl={item} {...this.state} {...this.props} DELETEsetreplyfun={(user_id,id)=>this.DELETEsetreplyfun(user_id,id)}>
{/*他人的*/}
@ -639,7 +639,7 @@ class MessagChat extends Component{
return(
<div className="private-part clearfix" key={key} onClick={(i)=>this.Clickedontheuser(item.target)}>
<div className="part-line df">
<img src={getImageUrl("/images/"+item.target.image_url)} className="radius mr10 myimgw48 myimgh48"/>
<img src={getImageUrl("images/"+item.target.image_url)} className="radius mr10 myimgw48 myimgh48"/>
<div className="flex1">
<p className="clearfix mb15 lineh-17">
<span className="fl pr">
@ -650,7 +650,10 @@ class MessagChat extends Component{
</span>
<span className="color-grey-c fr">{moment(item.send_time).fromNow()}</span>
</p>
<p className="color-grey-6 lineh-20 justify break_word task-hide-2" style={{wordBreak:"break-word"}} dangerouslySetInnerHTML={{__html:item.content}}></p>
<p className="color-grey-6 lineh-20 justify break_word task-hide-2" style={{wordBreak:"break-word"}} id="MakedownHTML" dangerouslySetInnerHTML={{__html:item.content}}>
</p>
</div>
</div>

@ -121,7 +121,7 @@ class MessagSub extends Component{
return(
<div className="pl25 ridinglist edu-back-white" key={key}>
<div className="ridinglist-sub clearfix df tiding_item">
<img onMouseDown={()=>this.myCome(item)} src={getImageUrl("/images/"+item.trigger_user.image_url)} className="radius mr10 fl myimgw48 myimgh48"/>
<img onMouseDown={()=>this.myCome(item)} src={getImageUrl("images/"+item.trigger_user.image_url)} className="radius mr10 fl myimgw48 myimgh48"/>
<div className="fl flex1">
<p>
<a className="mr20 private_message_a" onMouseDown={()=>this.myCome(item)}>{item.trigger_user.name}</a>

@ -135,7 +135,7 @@ class MessagePrivate extends Component{
<div className="private-item clearfix df" key={key} onClick={()=>this.smyJump(3,item.target.id)}>
<a className="fl mr10 private_message_a" onMouseDown={()=>this.myCome(item)}>
<img onMouseDown={()=>this.myCome(item)} src={getImageUrl("/images/"+item.target.image_url)} className="radius myimgw48 myimgh48"/>
<img onMouseDown={()=>this.myCome(item)} src={getImageUrl("images/"+item.target.image_url)} className="radius myimgw48 myimgh48"/>
</a>
<div className="fl flex1">
<p>

@ -160,7 +160,7 @@ class Messagerouting extends Component{
<a >
{
this.props.current_user!== undefined?
<img className="person radius myw120 myh120" src={getImageUrl("/images/"+this.props.current_user.image_url)}/>
<img className="person radius myw120 myh120" src={getImageUrl("images/"+this.props.current_user.image_url)}/>
:""
}

@ -5,7 +5,7 @@ import {
} from "antd";
import axios from 'axios';
import moment from 'moment';
import {getImageUrl,markdownToHTML} from 'educoder';
import {getImageUrl,markdownToHTML,ImageLayerHook} from 'educoder';
import "../css/messagemy.css"
import WriteaprivateletterModal from '../messagemodal/WriteaprivateletterModal';
//私信页面
@ -46,12 +46,14 @@ class Rightdialogue extends Component{
<a onMouseDown={()=>this.myCome(this.props.objeysl.sender)}>
{this.props.objeysl&&this.props.objeysl.sender.image_url ?
<img alt="头像" className="ml10 radius fr myimgw48 myimgh48"
src={getImageUrl("/images/" + this.props.objeysl.sender.image_url)}/>:""
src={getImageUrl("images/" + this.props.objeysl.sender.image_url)}/>:""
}
</a>
<div className="fr pr ThisSide-info">
<span className="trangle"></span>
<div className="sms break_word" id="message_content_show_25137" dangerouslySetInnerHTML={{__html: markdownToHTML(this.props.objeysl.content).replace(/▁/g, "▁▁▁")}}></div>
<ImageLayerHook parentSel={`#Rightdialogue${this.props.keys}`} parentSel={`#Rightdialogue${this.props.keys}`}>
</ImageLayerHook>
<div className="sms break_word" id={`Rightdialogue${this.props.keys}`} dangerouslySetInnerHTML={{__html: markdownToHTML(this.props.objeysl.content).replace(/▁/g, "▁▁▁")}}></div>
<div className="edu-txt-left mt5">
<a className="color-grey-c" onClick={()=>this.mydelete(this.props.objeysl.sender.id,this.props.objeysl.id)}
>删除</a>

@ -283,7 +283,7 @@ class WriteaprivateletterModal extends Component {
onFocus={this.myonFocus}
onChange={this.setdatafunsval}
suffix={
<img src={getImageUrl("/images/"+"educoder/icon/search.svg")} onClick={()=>this.search_message_person()}/>
<img src={getImageUrl("images/"+"educoder/icon/search.svg")} onClick={()=>this.search_message_person()}/>
}
/>
</div>
@ -296,7 +296,7 @@ class WriteaprivateletterModal extends Component {
users.map((item,key)=>{
return(
<p className="clearfix recently_item" key={key} onMouseDown={(c)=>this.Getuserinformation(item)}>
<img alt="1?1558048024" className="radius fl mr10 myimgw48 myimgh48" src={getImageUrl("/images/"+item.image_url)}
<img alt="头像" className="radius fl mr10 myimgw48 myimgh48" src={getImageUrl("images/"+item.image_url)}
/>
<span className="recently_name">{item.name}</span>
</p>

@ -51,6 +51,13 @@ class ActionView extends Component {
componentDidMount() {
// request
window._tpiWidthResize = () => {
if (window.$('#actionView').width() < 580) {
window.$('.time_limit').hide()
} else {
window.$('.time_limit').show()
}
}
}
showWebDisplay(challenge) {
@ -59,10 +66,17 @@ class ActionView extends Component {
/*<span className="mt10 -flex c_grey ml15" id="time-consuming">耗时0 天 3 小时 11 分钟 57 秒 </span>*/
render() {
const { onRunCodeTest, onShowPrevStage, onShowNextStage, gameBuilding
, game, classes, st, shixun, record, challenge } = this.props;
, game, classes, st, shixun, record, challenge, time_limit } = this.props;
return (
<div className="-flex -layout-h" id="game_operate_action">
<style>{`
.time_limit {
margin-right: 16px;
}
`}</style>
<span className="mt10 -flex c_grey ml15" id="time-consuming">
{!!time_limit &&
<span className="time_limit">{`本关最大执行时间:${time_limit}`}</span>}
{!gameBuilding && record ?
<Tooltip title={ "本次评测耗时(编译、运行总时间)" }>
<span>{ record } </span>
@ -73,7 +87,10 @@ class ActionView extends Component {
{/*将第一个按钮改为visibility方式隐藏不然加载时测评按钮会出现没有垂直居中的情况*/}
<Tooltip title={ "倒计时为0时服务将被关闭" }>
<Button size="small" className={classes.button + ' actionViewfirstButton'} onClick={()=>this.showWebDisplay(challenge)}
style={{ visibility: challenge.showWebDisplayButton ? '': 'hidden'}} id="showWebDisplayButton">
style={{ visibility: challenge.showWebDisplayButton ? '': 'hidden'}}
id="showWebDisplayButton"
// style={{ display: challenge.showWebDisplayButton ? 'flex': 'none'}}
>
查看效果
</Button>
</Tooltip>

@ -14,7 +14,7 @@
min-width: 280px;
}
#time-consuming span{
#time-consuming .time_limit {
display: none;
}
.actionViewfirstButton {

@ -18,7 +18,7 @@ let categorylist=[
{name:"云计算和大数据",value:"cloud_compute_and_big_data"},
{name:"人工智能",value:"ai"},
{name:"运维与测试",value:"devops_and_test"},
{name:"其",value:"other"},
{name:"其",value:"other"},
]
//
function setcategorylist(val){
@ -30,7 +30,6 @@ function setcategorylist(val){
}
}
)
return vals
}
@ -185,6 +184,17 @@ class PackageConcent extends Component {
})
}
onChangePagelist=(pageNum)=> {
this.setState({
page: pageNum
})
let {category, keyword, sort_by, sort_direction} = this.state;
this.setdatas(category, keyword, sort_by, sort_direction, pageNum)
}
render() {
let {data,page,category,sort_by,sort_direction,project_packages,
isRender,AccountProfiletype
@ -270,7 +280,7 @@ class PackageConcent extends Component {
</p>
</div>
<Spin size="large" spinning={this.state.isSpin}>
<Spin size="large" className="educontent project-packages-list" spinning={this.state.isSpin}>
{project_packages&&project_packages.map((item,key)=>{
return(
<div className="educontent project-packages-list mb30" key={key}>
@ -286,7 +296,7 @@ class PackageConcent extends Component {
<div className=" item-head mbf10">
<div className=" item-head-title">
<a className={"fl mt3 font-20 font-bd color-dark maxwidth700 "}
<a className={"fl mt3 font-20 font-bd color-dark maxwidth670 "}
onClick={()=>this.onReleaseRequirements("/crowdsourcing/"+item.id)}
title={item.title}
>{item.title}</a>
@ -338,6 +348,7 @@ class PackageConcent extends Component {
)
})}
</Spin>
{project_packages&&project_packages.length===0?<div className="edu-back-white">
<div className="edu-tab-con-box clearfix edu-txt-center">
<img className="edu-nodata-img mb20" src="https://www.educoder.net/images/educoder/nodata.png" />
@ -345,7 +356,7 @@ class PackageConcent extends Component {
</div>:""}
<div className={"mt40"}>
<Pagination className="edu-txt-center" hideOnSinglePage={true} pageSize={20} current={page} total={data&&data.count} />
<Pagination className="edu-txt-center" onChange={this.onChangePagelist} hideOnSinglePage={true} pageSize={20} current={page} total={data&&data.count} />
</div>

@ -55,9 +55,11 @@ class PackageIndexNEITaskDetails extends Component {
getdatas=()=>{
let url =`/project_packages/${this.props.match.params.id}.json`;
axios.get(url).then((response) => {
this.setState({
data:response.data
})
if(response.data.status!=401&&response.data.status!=403&&response.data.status!=408&&response.data.status!=409)[
this.setState({
data:response.data
})
]
}).catch((error) => {
console.log(error);
@ -236,8 +238,12 @@ class PackageIndexNEITaskDetails extends Component {
render() {
let {overtype,data}=this.state;
// console.log(data&&data.creator.login)
console.log(data)
// console.log(data&&data.creator.id)
let datalogin=data&&data.creator.id;
let userlogin=this.props.current_user&&this.props.current_user.user_id;
console.log(datalogin===userlogin)
// console.log(this.props.current_user&&this.props.current_user.user_id)
return (
data===undefined?"":<div>
<div className="clearfix">
@ -258,11 +264,9 @@ class PackageIndexNEITaskDetails extends Component {
<Breadcrumb.Item><span className={"tabelcli"} title={data&&data.title}>{data&&data.title}</span></Breadcrumb.Item>
</Breadcrumb>
<a className="color-grey-6 fr font-15 mr20" onClick={this.goback}>返回</a>
<a className="color-grey-6 fr font-18 mr20" onClick={this.goback}>返回</a>
<div className="mb20">
<p className="clearfix ">
<p className="clearfix">
<div className={"stud-class-set coursenavbox edu-back-white mt20"}>
<div className={"ant-row contentbox mdInForm "}>
@ -289,12 +293,12 @@ class PackageIndexNEITaskDetails extends Component {
{data&&data.creator.name}
</div>
{data&&data.creator.login===this.props.current_user&&this.props.current_user.login?"":<div className=" edu-back-white ml5 mt10 "
{datalogin===userlogin===true?"":<div className=" edu-back-white ml5 mt10 "
onMouseOver={this.setover}
onMouseOut={this.setout}
>
{overtype===false?<a className="ContacttheTA fl" target="_blank" href={`/message/${data&&data.creator.login}/message_detail?target_ids=${data&&data.creator.id}`}> <img alt="头像" class="mr5" src={require('./newsone.png')} />联系TA</a>:
<a className="ContacttheTAs fl" target="_blank" href={`/message/${data&&data.creator.login}/message_detail?target_ids=${data&&data.creator.id}`}> <img alt="头像" className="mr5"
{overtype===false?<a className="ContacttheTA fl" target="_blank" href={`/message/${this.props.current_user&&this.props.current_user.user_id}/message_detail?target_ids=${data&&data.creator.id}`}> <img alt="头像" class="mr5" src={require('./newsone.png')} />联系TA</a>:
<a className="ContacttheTAs fl" target="_blank" href={`/message/${this.props.current_user&&this.props.current_user.user_id}/message_detail?target_ids=${data&&data.creator.id}`}> <img alt="头像" className="mr5"
src={require('./newstwo.png')}/>联系TA</a>}
</div>}
</div>
@ -304,10 +308,10 @@ class PackageIndexNEITaskDetails extends Component {
<div className=" item-body">
<div className=" item-head mbf10">
<div className=" item-head mbf10 mt15 ">
<div className=" item-head-title ">
<span className={"fl mt3 font-18 font-bd color-dark maxwidth700 "}
<span className={"fl mt3 font-18 font-bd color-dark maxwidth670 "}
title={data&&data.title}
>{data&&data.title}
</span>
@ -407,7 +411,7 @@ class PackageIndexNEITaskDetails extends Component {
{item.status==="bidding_won"?<img src={gouxuan} className="yslgouxuanimg"/>:""}
<a href={`/users/${item.login}`}><img className="div1imgs" src={getImageUrl("images/"+item.image_url)}/></a>
<div className="textall mt10" title={item.name}> <p className="ptext">{item.name}</p></div>
{this.props.current_user&&this.props.current_user.login!=item.login?<a className="ContacttheTAs fl none" target="_blank" href={`/message/${item.login}/message_detail?target_ids=${item.id}`}>
{this.props.current_user&&this.props.current_user.login!=item.login?<a className="ContacttheTAs fl none" target="_blank" href={`/message/${this.props.current_user&&this.props.current_user.user_id}/message_detail?target_ids=${item.id}`}>
<img alt="头像" className="mr5" src={require('./newstwo.png')}/>联系TA
</a>:""}
</div>

@ -36,7 +36,8 @@ class ProjectPackageIndex extends Component {
}
render() {
console.log(this.props)
console.log(this.state)
return (
<div className="newMain clearfix">

@ -31,8 +31,8 @@
color:#8F8F8F !important;
}
.maxwidth700{
max-width: 700px;
.maxwidth670{
max-width: 670px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;

@ -692,7 +692,7 @@ class TPMBanner extends Component {
</div>
{
startbtn === false ?
startbtn === false && shixunsDetails.shixun_status != -1 ?
<Tooltip placement="bottom" title={
shixunsDetails.task_operation === undefined ? "" : shixunsDetails.task_operation[0] === "开始实战" ? "开始学习并完成实战任务" : shixunsDetails.task_operation[0] === "继续挑战" ? "继续完成后续学习和实战任务" :
shixunsDetails.task_operation[0] === "查看实战" ? "查看我的实战光辉历史" :
@ -843,7 +843,7 @@ class TPMBanner extends Component {
<a onClick={this.Senttothe}
className="fr user_default_btn user_blue_btn mr20 font-18"
data-tip-down=""
style={{display: shixunsDetails.shixun_status === 0 || shixunsDetails.shixun_status === 3 ||shixunsDetails.shixun_status === 1 ? "none" : "block"}}
style={{display: shixunsDetails.shixun_status === 0 || shixunsDetails.shixun_status === 3 ||shixunsDetails.shixun_status === 1 ||shixunsDetails.shixun_status === -1 ? "none" : "block"}}
data-remote="true">
<Tooltip placement="bottom" title={"以实训作业的形式发送到我的课堂"}>
发送至
@ -874,9 +874,17 @@ class TPMBanner extends Component {
style={{width: '100%'}}
/>
</div>
<style>
{`
.edu-h270{
height:270px;
overflow-y: auto;
}
`}
</style>
<div id="search_course_list" className={courses_count > 12?"cdefault ":"cdefault "}>
<div className="clearfix mb5 edu-bg-light-blue edu-h315">
<div className="clearfix mb20 edu-bg-light-blue edu-h270">
<ul>
<RadioGroup onChange={this.onChangeSenttothevcalue} value={Senttothevcalue}>
{
@ -913,7 +921,12 @@ class TPMBanner extends Component {
<a className="fr user_default_btn edu-greyback-btn mr15 font-18">已关闭</a>
}
{this.props.identity < 8?<div className="fr user_default_btn user_blue_btn mr20"
{shixunsDetails.shixun_status === -1 &&
<a className="fr user_default_btn edu-greyback-btn mr15 font-18">已删除</a>
}
{this.props.identity < 8&&shixunsDetails.shixun_status != -1 ?<div className="fr user_default_btn user_blue_btn mr20"
style={{display: shixunsDetails.can_copy === false || shixunsDetails.can_copy === null ? "none" : "flex"}}>
<Tooltip placement="bottom" title={"基于这个实训修改形成新的实训"}>
<span className="flex1 edu-txt-center fl font-18"

@ -200,6 +200,10 @@ body>.-task-title {
.HeaderSearch{
width: 325px;
/*right: 20px;*/
}
.HeaderSearch .ant-input-search{
right: 20px;
}
.mainheighs{
height: 100%;

@ -727,6 +727,12 @@ export default class TPMsettings extends Component {
// });
// }
submit_edit_shixun = () => {
if(this.state.status===-1){
this.props.showSnackbar("该实训已被删除,保存失败!");
return
}
let {
name, choice_main_type, choice_small_type, choice_standard_scripts, scope_partment, choice_standard_scriptssum,
evaluate_script, webssh, use_scope, trainee, can_copy, task_pass, test_set_permission, hide_code, code_hidden, forbid_copy, vnc,multi_webssh,
@ -739,13 +745,15 @@ export default class TPMsettings extends Component {
return v1
});
let operateauthority=this.props.identity<5&&this.state.status==0||this.props.identity===1&&this.state.status==2||this.props.identity===1&&this.state.status==1;
// let operateauthority=
// this.props.identity===1?true:this.props.identity<5&&this.state.status==0?true:false;
// this.props.identity<5&&this.state.status==0||this.props.identity===1&&this.state.status==2||this.props.identity===1&&this.state.status==1;
const description_editormd = this.description_editormd.getValue();
let evaluate_script_editormd;
if(operateauthority===true){
if(this.state.status==0||this.state.status==1||this.state.status==2&&this.props.identity===1){
// evaluate_script_editormd = this.evaluate_script_editormd.getValue();
evaluate_script_editormd = shixunmemoMDvalue
}else{
@ -753,6 +761,7 @@ export default class TPMsettings extends Component {
}
if (name === "") {
this.setState({
shixunnametype: true
@ -826,6 +835,7 @@ export default class TPMsettings extends Component {
if(newmulti_webssh===null){
newmulti_webssh=false
}
//exec_time: exec_time,
let Url = `/shixuns/` + id + `.json`;
let data = {
@ -1625,8 +1635,8 @@ export default class TPMsettings extends Component {
options={ {
selectOnLineNumbers: true
}}
onChange={operateauthority===true?this.getshixunmemoMDvalue:""}
// onChange={this.getshixunmemoMDvalue}
/>
</div>

@ -83,7 +83,7 @@ class AccountCertification extends Component {
<div className="flexTable">
<div className="flexRow lineh-20 mb20">
<div className="name">实名认证</div>
<div className="description">有些课程需要实名认证才能加入哟还能获得500金币的奖励~ </div>
<div className="description">实名认证可以增强你在平台的江湖地位还可以获得500金币的奖励~ </div>
<div className="status">
{
basicInfo && basicInfo.authentication =="uncertified" ?
@ -96,7 +96,10 @@ class AccountCertification extends Component {
<div className="flexRow lineh-20">
<div className="name">职业认证</div>
<div className="description">教师认证完毕之后可创建课堂发布实训免金币查看所有实训答案.. </div>
{basicInfo && (basicInfo.identity == "teacher"
? <div className="description">教师通过认证可以克隆实训免金币查看实训答案和隐藏测试集... </div>
: <div className="description">通过认证可以获得500金币的奖励~ </div>)}
<div className="status">
{
basicInfo && basicInfo.professional_certification =="uncertified" ?

@ -384,11 +384,11 @@ class Infos extends Component{
to={`/users/${username}/projects`}>项目</Link>
</li>
{/*<li className={`${moduleName == 'package' ? 'active' : '' }`}>*/}
{/*<Link*/}
{/*onClick={() => this.setState({moduleName: 'package'})}*/}
{/*to={`/users/${username}/package`}>众包</Link>*/}
{/*</li>*/}
<li className={`${moduleName == 'package' ? 'active' : '' }`}>
<Link
onClick={() => this.setState({moduleName: 'package'})}
to={`/users/${username}/package`}>众包</Link>
</li>
{/*{ data && data.identity!="学生" && <li> <a href={`${this.props.Headertop && this.props.Headertop.old_url}/users/${username}?type=m_bank`}>题库</a></li>}*/}
@ -404,11 +404,11 @@ class Infos extends Component{
{/* 众包 */}
{/* http://localhost:3007/courses/1309/homework/9300/setting */}
{/*<Route exact path="/users/:username/package"*/}
{/*render={*/}
{/*(props) => (<InfosPackage {...this.props} {...props} {...this.state} />)*/}
{/*}*/}
{/*></Route>*/}
<Route exact path="/users/:username/package"
render={
(props) => (<InfosPackage {...this.props} {...props} {...this.state} />)
}
></Route>
{/* 课堂 */}
{/* http://localhost:3007/courses/1309/homework/9300/setting */}

@ -4,7 +4,8 @@ import {BrowserRouter as Router,Route,Switch} from 'react-router-dom';
import {Tooltip,Menu,Pagination,Spin} from 'antd';
import axios from 'axios';
import {getImageUrl} from 'educoder';
import NoneData from '../../courses/coursesPublic/NoneData'
import Modals from '../../modals/Modals';
import NoneData from '../../courses/coursesPublic/NoneData';
import "./usersInfo.css"
import moment from 'moment';
let categorylist=[
@ -113,6 +114,37 @@ class InfosPackage extends Component{
}
}
delectprojectModal=(id)=>{
this.setState({
Modalstype: true,
Modalstopval: '是否确认删除?',
ModalSave: () => this.delectproject(id),
ModalCancel: this.cancelProject
})
}
cancelProject=()=>{
this.setState({
Modalstype: false,
})
}
delectproject=(id)=>{
let {cate,status}=this.state;
let url=`/project_packages/${id}.json`
axios.delete(url).then((response) => {
if (response.data.status == 0) {
this.getCourses(cate,status,1);
}
})
.catch(function (error) {
console.log(error);
});
this.cancelProject;
}
render(){
let{
category,
@ -127,6 +159,13 @@ class InfosPackage extends Component{
// console.log(data)
return(
<div className="educontent mb50">
{/*提示*/}
<Modals
modalsType={this.state.Modalstype}
modalsTopval={this.state.Modalstopval}
modalCancel={this.state.ModalCancel}
modalSave={this.state.ModalSave}
/>
<Spin size="large" spinning={isSpin}>
<div className="white-panel edu-back-white pt25 pb25 clearfix ">
<li className={category ? "" : "active"}><a onClick={()=>this.changeCategory()}>全部</a></li>
@ -160,21 +199,27 @@ class InfosPackage extends Component{
{/*type: "bidden"*/}
{data===undefined?<NoneData></NoneData>:data.project_packages.length===0?<NoneData></NoneData>:data.project_packages.map((item,key)=>{
return(
<div className="educontent project-packages-list" key={key}>
<div className="project-package-item project-package-11">
<div className="project-package-item with-operator project-package-11">
<div className="item-image">
<img alt="图片" src={`/images/educoder/project_packages/${setcategorylist(item.category_name)}.png`} />
</div>
<div className="item-body">
<div className="item-head">
<div className="item-head-title" title={item.title}>
<a href={`/crowdsourcing/${item.id}`}>{item.title}</a>
</div>
<div className="item-head-tags">
{item.bidden_status==="pending"?<span className="pending">竞标中</span>:""}
{item.bidden_status==="bidding_won"?<span className="bidding_won">已中标</span>:""}
{item.bidden_status==="bidding_lost"?<span className="bidding_lost">未中标</span>:""}
</div>
<div className="item-head-blank"></div>
<div className="item-head-price mtf15">
{item.min_price===null?"":<span>{item.min_price}</span>}
@ -205,6 +250,28 @@ class InfosPackage extends Component{
</div>
</div>
</div>
{category=="manage"?item.operation.can_edit===true&&item.operation.can_delete===true?
<div className="item-operator none">
<a href={`/crowdsourcing/${item.id}/edit`} title="编辑">
<i className="fa fa-pencil"></i>
</a>
<a className="delete-project-package-btn" onClick={()=>this.delectprojectModal(item.id)} data-id="10" title="删除">
<i className="fa fa-trash-o"></i>
</a>
</div>:"":""}
{category=="manage"?item.operation.can_edit===true&&item.operation.can_delete===false?
<div className="item-operator none">
<a href={`/crowdsourcing/${item.id}/edit`} title="编辑">
<i className="fa fa-pencil"></i>
</a>
</div>:"":""}
</div>
</div>
)})}

@ -94,4 +94,29 @@
.mtf15{
margin-top:-15px;
}
.project-package-item.with-operator .item-operator {
width: 0;
transition: width .2s;
-moz-transition: width .2s; /* Firefox 4 */
-webkit-transition: width .2s; /* Safari 和 Chrome */
-o-transition: width .2s; /* Opera */
}
.project-package-item.with-operator:hover .item-operator {
margin: -20px -20px -20px 20px;
padding: 20px 0;
width: 100px;
display: flex;
justify-content: space-around;
flex-direction: column;
align-items: center;
background: #f0f0f0;
}
.project-package-item.with-operator .item-operator a {
display: none;
}
.project-package-item.with-operator:hover .item-operator a {
display: block;
font-size: 20px;
}

@ -3122,7 +3122,7 @@ a.singlepublishtwo{
height: 40px;
}
.project-package-item .item-head-title {
max-width: 700px;
max-width: 650px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
@ -3213,7 +3213,7 @@ a.singlepublishtwo{
font-size: 20px;
}
.project-package-item.with-operator:hover .item-head-title {
max-width: 600px;
max-width: 650px;
}
.list-count {

Loading…
Cancel
Save