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

dev_new_shixunsrepository
cxt 5 years ago
commit 1a4d08bdda

@ -3,7 +3,7 @@ class Oauth::CasController < Oauth::BaseController
user, is_new_user = Oauth::CreateORFindCasUserService.call(current_user, auth_hash) user, is_new_user = Oauth::CreateORFindCasUserService.call(current_user, auth_hash)
successful_authentication(user) successful_authentication(user)
render_ok(new_user: is_new_user) redirect_to root_url
end end

@ -14,7 +14,7 @@ class Oauth::CreateORFindCasUserService < ApplicationService
return [open_user.user, false] if open_user.persisted? return [open_user.user, false] if open_user.persisted?
@user = User.new(login: User.generate_login('C'), type: 'User', status: User::STATUS_ACTIVE, nickname: @params['comsys_name'], lastname: @params['comsys_name']) @user = User.new(login: User.generate_login('C'), type: 'User', status: User::STATUS_ACTIVE, lastname: @params['comsys_name'])
ActiveRecord::Base.transaction do ActiveRecord::Base.transaction do
@user.save! @user.save!

@ -60,7 +60,7 @@ function requestForSignatrue (callback) {
/** /**
实践课程 平台提供涵盖基础入门案例实践和创新应用的完整实训项目体系通过由浅入深的实训路径帮助学生快速提升实战能力 实践课程 平台提供涵盖基础入门案例实践和创新应用的完整实训项目体系通过由浅入深的实训路径帮助学生快速提升实战能力
实训项目 覆盖不同专业的IT实验和实训每周更新无需配置本机实验环境随时随地开启企业级真实实训 实训项目 覆盖不同专业的IT实验和实训每周更新无需配置本机实验环境随时随地开启企业级真实实训
翻转课堂 自动评测实训任务支持技能统计提供教学活动分析报告减轻教师和助教的辅导压力免去作业发布和批改的困扰实时了解学生学习情况全面提升教师施教效率和水平 教学课堂 自动评测实训任务支持技能统计提供教学活动分析报告减轻教师和助教的辅导压力免去作业发布和批改的困扰实时了解学生学习情况全面提升教师施教效率和水平
单个课程和实训 获取课程/实训的简介 该课程或者实训展示的缩略图 单个课程和实训 获取课程/实训的简介 该课程或者实训展示的缩略图
*/ */
@ -108,7 +108,7 @@ export function configShareForCourses () {
console.log('configShareForCourses', host) console.log('configShareForCourses', host)
var shareData = { var shareData = {
title: 'EduCoder - 翻转课堂', title: 'EduCoder - 教学课堂',
desc: '自动评测实训任务,支持技能统计,提供教学活动分析报告,减轻教师和助教的辅导压力,免去作业发布和批改的困扰,实时了解学生学习情况,全面提升教师施教效率和水平。', desc: '自动评测实训任务,支持技能统计,提供教学活动分析报告,减轻教师和助教的辅导压力,免去作业发布和批改的困扰,实时了解学生学习情况,全面提升教师施教效率和水平。',
link: `${host}/courses`, link: `${host}/courses`,
imgUrl: window.__testImageUrl imgUrl: window.__testImageUrl

@ -250,7 +250,7 @@ class Competitionteams extends Component{
<Content className={"teamsLayoutContent"}> <Content className={"teamsLayoutContent"}>
<Table className="teamsLayoutTable" columns={shixuncolumns} dataSource={this.state.shixundata} bordered pagination={false}/> <Table className="teamsLayoutTable" columns={shixuncolumns} dataSource={this.state.shixundata} bordered pagination={false}/>
</Content> </Content>
<Content className={"teamsLayoutitle mt40"}>翻转课堂</Content> <Content className={"teamsLayoutitle mt40"}>教学课堂</Content>
<Content className={"teamsLayoutContents"}> <Content className={"teamsLayoutContents"}>
<Table className="teamsLayoutTable" columns={coursecolumns} dataSource={this.state.coursedata} bordered pagination={false}/> <Table className="teamsLayoutTable" columns={coursecolumns} dataSource={this.state.coursedata} bordered pagination={false}/>
</Content> </Content>

@ -1,29 +1,15 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import { Redirect } from 'react-router';
import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom";
import PropTypes from 'prop-types';
import classNames from 'classnames'
import axios from 'axios' import axios from 'axios'
import moment from 'moment' import moment from 'moment'
import Comments from '../../comment/Comments' import Comments from '../../comment/Comments'
import update from 'immutability-helper'
import RewardDialog from '../../common/RewardDialog';
import {ImageLayerOfCommentHOC} from '../../page/layers/ImageLayerOfCommentHOC' import {ImageLayerOfCommentHOC} from '../../page/layers/ImageLayerOfCommentHOC'
import MemoDetailMDEditor from '../../forums/MemoDetailMDEditor' import MemoDetailMDEditor from '../../forums/MemoDetailMDEditor'
import { RouteHOC } from './common.js' import { RouteHOC } from './common.js'
import '../../forums/Post.css' import '../../forums/Post.css'
import '../../forums/RightSection.css' import '../../forums/RightSection.css'
import './TopicDetail.css' import './TopicDetail.css'
import '../common/courseMessage.css' import '../common/courseMessage.css'
import { Pagination, Tooltip } from 'antd' import { Pagination, Tooltip,Button } from 'antd'
import { bytesToSize, ConditionToolTip, markdownToHTML, MarkdownToHtml , setImagesUrl } from 'educoder' import { bytesToSize, ConditionToolTip, markdownToHTML, MarkdownToHtml , setImagesUrl } from 'educoder'
import SendToCourseModal from '../coursesPublic/modal/SendToCourseModal' import SendToCourseModal from '../coursesPublic/modal/SendToCourseModal'
import CBreadcrumb from '../common/CBreadcrumb' import CBreadcrumb from '../common/CBreadcrumb'
@ -32,7 +18,8 @@ import { generateComments, generateChildComments, _findById, handleContentBefore
, handleDeleteComment, handleCommentPraise, handleHiddenComment } from '../common/CommentsHelper' , handleDeleteComment, handleCommentPraise, handleHiddenComment } from '../common/CommentsHelper'
const $ = window.$ const $ = window.$
const REPLY_PAGE_COUNT = 10 const REPLY_PAGE_COUNT = 10;
let setTime;
function urlStringify(params) { function urlStringify(params) {
let noParams = true; let noParams = true;
let paramsUrl = ''; let paramsUrl = '';
@ -57,7 +44,8 @@ class TopicDetail extends Component {
pageCount: 1, pageCount: 1,
comments: [], comments: [],
goldRewardDialogOpen: false, goldRewardDialogOpen: false,
author:undefined author:undefined,
commentstype:false
} }
} }
componentDidMount() { componentDidMount() {
@ -512,11 +500,26 @@ class TopicDetail extends Component {
} }
} }
startcomments=()=>{
setTime = setInterval( ()=> {
this.fetchReplies()
}, 5000);
this.setState({
commentstype:true
})
}
clearcomments=()=>{
clearInterval(setTime);
this.setState({
commentstype:false
})
}
render() { render() {
const { match, history } = this.props const { match, history } = this.props
const { recommend_shixun, current_user,author_info } = this.props; const { recommend_shixun, current_user,author_info } = this.props;
const { memo, comments, hasMoreComments, goldRewardDialogOpen, pageCount, total_count , author } = this.state; const { memo, comments, hasMoreComments, commentstype, pageCount, total_count , author } = this.state;
const messageId = match.params.topicId const messageId = match.params.topicId
if (this.state.memoLoading || !current_user) { if (this.state.memoLoading || !current_user) {
return <div className="edu-back-white" id="forum_index_list"></div> return <div className="edu-back-white" id="forum_index_list"></div>
@ -560,7 +563,7 @@ class TopicDetail extends Component {
ref="sendToCourseModal" ref="sendToCourseModal"
{...this.props} {...this.props}
moduleName="帖子" moduleName="帖子"
selectedMessageIds={[messageId]} seletedMessageIds={[messageId]}
></SendToCourseModal> ></SendToCourseModal>
<div className="clearfix"> <div className="clearfix">
<div id="forum_list" className="forum_table mh650"> <div id="forum_list" className="forum_table mh650">
@ -690,9 +693,15 @@ class TopicDetail extends Component {
*/} */}
<div className="padding20 memoReplies commentsDelegateParent comments_hideSecondReplyUserHeader" <div className="padding20 memoReplies commentsDelegateParent comments_hideSecondReplyUserHeader"
style={{ display: (comments && !!comments.length) ? 'block' : 'none', paddingBottom: '0px' }}> style={{ display: (comments && !!comments.length) ? 'block' : 'none', paddingBottom: '0px' }}>
<div className="replies_count"> <div className="replies_count commentstypetop">
{this.props.isAdmin()===true? <span className="commentstypebutton font-16 ">
{this.state.commentstype===false?<Button type="primary" onClick={()=>this.startcomments()}>开启刷新评论</Button>
:<Button type="danger" onClick={()=>this.clearcomments()}>停止刷新</Button>}
</span>:""}
<span className="labal font-16">全部回复</span> <span className="labal font-16">全部回复</span>
<span className="count font-16">({memo.total_replies_count})</span> <span className="count font-16">({memo.total_replies_count})</span>
</div> </div>
<Comments comments={comments} user={current_user} <Comments comments={comments} user={current_user}

@ -57,3 +57,11 @@
.panel-comment_item .comment_content { .panel-comment_item .comment_content {
margin-top: 4px; margin-top: 4px;
} }
.commentstypetop{
position: relative;
}
.commentstypebutton{
position: absolute;
right: 0px;
}

@ -250,7 +250,7 @@ class Competitionteams extends Component{
<Content className={"teamsLayoutContent"}> <Content className={"teamsLayoutContent"}>
<Table className="teamsLayoutTable" columns={shixuncolumns} dataSource={this.state.shixundata} bordered pagination={false}/> <Table className="teamsLayoutTable" columns={shixuncolumns} dataSource={this.state.shixundata} bordered pagination={false}/>
</Content> </Content>
<Content className={"teamsLayoutitle mt40"}>翻转课堂</Content> <Content className={"teamsLayoutitle mt40"}>教学课堂</Content>
<Content className={"teamsLayoutContents"}> <Content className={"teamsLayoutContents"}>
<Table className="teamsLayoutTable" columns={coursecolumns} dataSource={this.state.coursedata} bordered pagination={false}/> <Table className="teamsLayoutTable" columns={coursecolumns} dataSource={this.state.coursedata} bordered pagination={false}/>
</Content> </Content>

@ -55,7 +55,7 @@ class CoursesHome extends Component{
} }
componentDidMount(){ componentDidMount(){
document.title="翻转课堂"; document.title="教学课堂";
const upsystem=`/users/system_update.json`; const upsystem=`/users/system_update.json`;
axios.get(upsystem).then((response)=>{ axios.get(upsystem).then((response)=>{
let updata=response.data; let updata=response.data;
@ -159,7 +159,7 @@ class CoursesHome extends Component{
onClick={ () => this.changeStatus("created_at")}>最新</a> onClick={ () => this.changeStatus("created_at")}>最新</a>
<a className={ order == "visits" ? "fl mr20 font-16 bestChoose active" : "fl mr20 font-16 bestChoose"} <a className={ order == "visits" ? "fl mr20 font-16 bestChoose active" : "fl mr20 font-16 bestChoose"}
onClick={ () => this.changeStatus("visits")}>最热</a> onClick={ () => this.changeStatus("visits")}>最热</a>
{this.props.user&&this.props.user.user_identity==="学生"?"":<span className={ "fr font-16 bestChoose color-blue" } onClick={(url)=>this.getUser("/courses/new")}>+新建翻转课堂</span>} {this.props.user&&this.props.user.user_identity==="学生"?"":<span className={ "fr font-16 bestChoose color-blue" } onClick={(url)=>this.getUser("/courses/new")}>+新建教学课堂</span>}
{/*<div className="fr mr5 search-new">*/} {/*<div className="fr mr5 search-new">*/}
{/*/!* <Search*/} {/*/!* <Search*/}

@ -690,7 +690,7 @@ class CoursesNew extends Component {
<a className="btn colorgrey fl hovercolorblue " <a className="btn colorgrey fl hovercolorblue "
href={this.props.match.params.coursesId === undefined ?"/courses":this.props.current_user&&this.props.current_user.first_category_url} href={this.props.match.params.coursesId === undefined ?"/courses":this.props.current_user&&this.props.current_user.first_category_url}
> >
{this.props.match.params.coursesId === undefined ?"翻转课堂":dataname} {this.props.match.params.coursesId === undefined ?"教学课堂":dataname}
</a> </a>
<span className="color-grey-9 fl ml3 mr3">&gt;</span> <span className="color-grey-9 fl ml3 mr3">&gt;</span>
<span className="fl cdefault">{this.props.match.params.coursesId === undefined ?"新建课堂":"编辑课堂"}</span> <span className="fl cdefault">{this.props.match.params.coursesId === undefined ?"新建课堂":"编辑课堂"}</span>

@ -721,7 +721,7 @@ class Goldsubject extends Component {
{/*</Breadcrumb>*/} {/*</Breadcrumb>*/}
<p className="clearfix mb20 mt10"> <p className="clearfix mb20 mt10">
<a className="btn colorgrey fl hovercolorblue " href={Whethertocreateanewclassroom===true?"/courses":this.props.current_user&&this.props.current_user.first_category_url} <a className="btn colorgrey fl hovercolorblue " href={Whethertocreateanewclassroom===true?"/courses":this.props.current_user&&this.props.current_user.first_category_url}
>{Whethertocreateanewclassroom===true?"翻转课堂":name}</a> >{Whethertocreateanewclassroom===true?"教学课堂":name}</a>
<span className="color-grey-9 fl ml3 mr3">&gt;</span> <span className="color-grey-9 fl ml3 mr3">&gt;</span>
<span className="fl cdefault">{Whethertocreateanewclassroom===true?"新建课堂":"编辑课堂"}</span> <span className="fl cdefault">{Whethertocreateanewclassroom===true?"新建课堂":"编辑课堂"}</span>
</p> </p>

@ -1097,7 +1097,7 @@ submittojoinclass=(value)=>{
{/*<li><a href={this.props.Headertop===undefined?"":'/courses'}>课堂</a></li>*/} {/*<li><a href={this.props.Headertop===undefined?"":'/courses'}>课堂</a></li>*/}
<li className={`${coursestype === true ? 'pr active' : 'pr'}`}> <li className={`${coursestype === true ? 'pr active' : 'pr'}`}>
{/*<a href={this.props.Headertop===undefined?"":this.props.Headertop.course_url}>课堂</a>*/} {/*<a href={this.props.Headertop===undefined?"":this.props.Headertop.course_url}>课堂</a>*/}
<Link to={this.props.Headertop===undefined?"":'/courses'}>翻转课堂</Link> <Link to={this.props.Headertop===undefined?"":'/courses'}>教学课堂</Link>
</li> </li>
<li className={`${activeShixuns === true ? 'pr active' : 'pr'}`}> <li className={`${activeShixuns === true ? 'pr active' : 'pr'}`}>
<Link to="/shixuns">实训项目</Link> <Link to="/shixuns">实训项目</Link>
@ -1183,7 +1183,7 @@ submittojoinclass=(value)=>{
onBlur={(e)=>this.hideshowSearchOpen(e)} onMouseLeave={()=>this.setevaluatinghides()}> onBlur={(e)=>this.hideshowSearchOpen(e)} onMouseLeave={()=>this.setevaluatinghides()}>
<Search <Search
id={"HeaderSearchs"} id={"HeaderSearchs"}
placeholder="实践课程/翻转课堂/实训项目/交流问答" placeholder="实践课程/教学课堂/实训项目/交流问答"
onInput={()=>this.onKeywordSearchKeyDowns()} onInput={()=>this.onKeywordSearchKeyDowns()}
onSearch={(value) => this.onKeywordSearchKeyDown(value)} onSearch={(value) => this.onKeywordSearchKeyDown(value)}
// onPressEnter={this.onKeywordSearchKeyDown} // onPressEnter={this.onKeywordSearchKeyDown}
@ -1229,7 +1229,8 @@ submittojoinclass=(value)=>{
</a> </a>
<ul className="edu-menu-list" style={{top:'60px'}}> <ul className="edu-menu-list" style={{top:'60px'}}>
{/*<span className="bor-bottom-greyE currentName task-hide">{user.username}</span>*/} {/*<span className="bor-bottom-greyE currentName task-hide">{user.username}</span>*/}
{coursestypes===true?"":<li><Link to={`/users/${this.props.current_user===undefined?"":this.props.current_user.login}/courses`}>{this.props.user&&this.props.user.main_site===false?"我的课堂":"我的翻转课堂"}</Link></li>} <li><Link to={`/users/${this.props.current_user.login}/courses`}>我的个人主页</Link></li>
{coursestypes===true?"":<li><Link to={`/users/${this.props.current_user===undefined?"":this.props.current_user.login}/courses`}>{this.props.user&&this.props.user.main_site===false?"我的课堂":"我的教学课堂"}</Link></li>}
{/* p 老师 l 学生 */} {/* p 老师 l 学生 */}
{shixuntype===true?"":<li><Link to={`/users/${this.props.current_user===undefined?"":this.props.current_user.login}/shixuns`}>我的实训项目</Link></li>} {shixuntype===true?"":<li><Link to={`/users/${this.props.current_user===undefined?"":this.props.current_user.login}/shixuns`}>我的实训项目</Link></li>}
{pathstype===true?"":<li><Link to={`/users/${this.props.current_user===undefined?"":this.props.current_user.login}/paths`}>{this.props.user&&this.props.user.main_site===false?"我的课程":"我的实践课程"}</Link></li>} {pathstype===true?"":<li><Link to={`/users/${this.props.current_user===undefined?"":this.props.current_user.login}/paths`}>{this.props.user&&this.props.user.main_site===false?"我的课程":"我的实践课程"}</Link></li>}
@ -1281,7 +1282,7 @@ submittojoinclass=(value)=>{
<div className="overPart"></div> <div className="overPart"></div>
<ul className={coursestypes===true&&this.props.user&&this.props.user.main_site===false?"fl headwith100b edu-txt-center pr ul-leftline":"fl with50 edu-txt-center pr ul-leftline"}> <ul className={coursestypes===true&&this.props.user&&this.props.user.main_site===false?"fl headwith100b edu-txt-center pr ul-leftline":"fl with50 edu-txt-center pr ul-leftline"}>
{this.props.current_user&&this.props.current_user.user_identity==="学生"?"":coursestypes===false? {this.props.current_user&&this.props.current_user.user_identity==="学生"?"":coursestypes===false?
<li><a onClick={(url)=>this.getUser("/courses/new")}>{this.props.user&&this.props.user.main_site===false?"新建课堂":"新建翻转课堂"}</a></li>:"" <li><a onClick={(url)=>this.getUser("/courses/new")}>{this.props.user&&this.props.user.main_site===false?"新建课堂":"新建教学课堂"}</a></li>:""
} }
{shixuntype===true?"": {shixuntype===true?"":
<li><a onClick={(url)=>this.getUser("/shixuns/new","newshixuns")}>新建实训项目</a></li> <li><a onClick={(url)=>this.getUser("/shixuns/new","newshixuns")}>新建实训项目</a></li>
@ -1295,7 +1296,7 @@ submittojoinclass=(value)=>{
{coursestypes===true&&this.props.user&&this.props.user.main_site===false?"":<ul className="fl with50 edu-txt-center"> {coursestypes===true&&this.props.user&&this.props.user.main_site===false?"":<ul className="fl with50 edu-txt-center">
{coursestypes===true?"":<li> {coursestypes===true?"":<li>
<a onClick={this.tojoinclass}>{this.props.user&&this.props.user.main_site===false?"加入课堂":"加入翻转课堂"}</a> <a onClick={this.tojoinclass}>{this.props.user&&this.props.user.main_site===false?"加入课堂":"加入教学课堂"}</a>
</li>} </li>}
{Addcoursestypes===true?<Addcourses {Addcoursestypes===true?<Addcourses

@ -163,7 +163,7 @@ export function TPMIndexHOC(WrappedComponent) {
}else if(this.props.match.path==="/paths"){ }else if(this.props.match.path==="/paths"){
document.title="实践课程"; document.title="实践课程";
}else if(this.props.match.path==="/courses"){ }else if(this.props.match.path==="/courses"){
document.title="翻转课堂"; document.title="教学课堂";
} }
// if(this.props.match.path==="/"){ // if(this.props.match.path==="/"){

@ -49,7 +49,7 @@ class Newshixuns extends Component {
this.setState({ this.setState({
newshixunlist: response.data newshixunlist: response.data
}); });
this.contentMdRef.current.setValue(!response.data.sample[0][1] ? "" : response.data.sample[0][1]); // this.contentMdRef.current.setValue(!response.data.sample[0][1] ? "" : response.data.sample[0][1]);
} }
} }
}).catch((error) => { }).catch((error) => {

@ -120,7 +120,7 @@ class InfosBanner extends Component{
{coursestypes===true?"":<li className={`${moduleName == 'courses' ||moduleName == undefined ? 'active' : '' }`}> {coursestypes===true?"":<li className={`${moduleName == 'courses' ||moduleName == undefined ? 'active' : '' }`}>
<Link <Link
onClick={() => this.setState({moduleName: 'courses'})} onClick={() => this.setState({moduleName: 'courses'})}
to={`/users/${username}/courses`}>翻转课堂</Link> to={`/users/${username}/courses`}>教学课堂</Link>
</li>} </li>}
{shixuntype===true?"":<li className={`${moduleName == 'shixuns' ? 'active' : '' }`}> {shixuntype===true?"":<li className={`${moduleName == 'shixuns' ? 'active' : '' }`}>
<Link <Link

@ -158,7 +158,7 @@ class SearchPage extends Component{
<div className="tabtitles2"> <div className="tabtitles2">
<Menu mode="horizontal" className="tabtitless" selectedKeys={tab} onClick={this.changeTab}> <Menu mode="horizontal" className="tabtitless" selectedKeys={tab} onClick={this.changeTab}>
<Menu.Item className={"tabtitle1"} key="1">实践课程</Menu.Item> <Menu.Item className={"tabtitle1"} key="1">实践课程</Menu.Item>
<Menu.Item className={"tabtitle2"} key="2">翻转课堂</Menu.Item> <Menu.Item className={"tabtitle2"} key="2">教学课堂</Menu.Item>
<Menu.Item className={"tabtitle2"} key="0">实训项目</Menu.Item> <Menu.Item className={"tabtitle2"} key="0">实训项目</Menu.Item>
<Menu.Item className={"tabtitle2"} key="3">交流问答</Menu.Item> <Menu.Item className={"tabtitle2"} key="3">交流问答</Menu.Item>
</Menu> </Menu>

Loading…
Cancel
Save