Merge branch 'dev_aliyun' of http://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun
commit
13c1954810
@ -1,10 +1,2 @@
|
||||
class ProjectsController < ApplicationController
|
||||
def search
|
||||
query_params = { keyword: params[:keyword], category: 'manage' }
|
||||
projects = Users::ProjectService.new(current_user, query_params).call
|
||||
|
||||
params[:limit] = params[:per_page].to_i.zero? ? 20 : params[:per_page].to_i
|
||||
@count = projects.count
|
||||
@projects = paginate projects
|
||||
end
|
||||
end
|
After Width: | Height: | Size: 53 KiB |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,79 @@
|
||||
import React,{ Component } from "react";
|
||||
import { getUrl2 } from "educoder";
|
||||
|
||||
const $ = window.$
|
||||
let _url_origin = getUrl2()
|
||||
|
||||
class Clappr extends Component{
|
||||
constructor(props){
|
||||
super(props);
|
||||
this.state={
|
||||
}
|
||||
}
|
||||
componentDidMount() {
|
||||
const source = this.props.source || "http://your.video/here.mp4"
|
||||
const { id } = this.props
|
||||
const _id = `#_player${id}`
|
||||
if (window['Clappr']) {
|
||||
const player = new window.Clappr.Player({
|
||||
source: source, parentId: _id,
|
||||
plugins: {
|
||||
'core': [window.Clappr.MediaControl, window.Clappr.Playback]
|
||||
}
|
||||
});
|
||||
} else {
|
||||
$.getScript(
|
||||
`${_url_origin}/javascripts/media/clappr.min.js`,
|
||||
(data, textStatus, jqxhr) => {
|
||||
window.clappr = window.Clappr
|
||||
$.getScript(
|
||||
`${_url_origin}/javascripts/media/clappr-playback-rate-plugin.min.js`,
|
||||
(data, textStatus, jqxhr) => {
|
||||
const player = new window.Clappr.Player({
|
||||
source: source, parentId: _id,
|
||||
plugins: {
|
||||
'core': [window.Clappr.MediaControl, window['clappr-playback-rate-plugin'].default]
|
||||
}
|
||||
});
|
||||
|
||||
})
|
||||
|
||||
});
|
||||
|
||||
//
|
||||
// $.when(
|
||||
// $.getScript( `${_url_origin}/javascripts/media/clappr.min.js` ),
|
||||
// // $.getScript( `${_url_origin}/javascripts/media/clappr-thumbnails-plugin.js` ),
|
||||
// $.getScript( `${_url_origin}/javascripts/media/clappr-playback-rate-plugin.min.js` ),
|
||||
// $.Deferred(function( deferred ){
|
||||
// $( deferred.resolve );
|
||||
// })
|
||||
// ).done(function(){
|
||||
// //place your code here, the scripts are all loaded
|
||||
// const player = new window.Clappr.Player({
|
||||
// source: source, parentId: _id,
|
||||
// plugins: {
|
||||
// 'core': [window.Clappr.MediaControl, window.Clappr.Playback]
|
||||
// }
|
||||
// });
|
||||
// });
|
||||
}
|
||||
}
|
||||
|
||||
render(){
|
||||
|
||||
let { source, id, className } = this.props;
|
||||
const _id = `_player${id}`
|
||||
return(
|
||||
<React.Fragment>
|
||||
<style>{`
|
||||
.playback_rate {
|
||||
margin-right: 16px;
|
||||
}
|
||||
`}</style>
|
||||
<div id={_id} className={className}></div>
|
||||
</React.Fragment>
|
||||
)
|
||||
}
|
||||
}
|
||||
export default Clappr;
|
@ -0,0 +1,50 @@
|
||||
import React, { Component } from 'react';
|
||||
|
||||
class EffectDisplayContent extends Component {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
this.state = {
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
const { typeName, content1, content2, content3 } = this.props;
|
||||
return (
|
||||
<div className="task-popup-content effectDisplay">
|
||||
<style>{`
|
||||
.effectDisplay .content_title {
|
||||
flex: 1 1 0
|
||||
}
|
||||
.effectDisplay .content>div {
|
||||
flex: 1
|
||||
}
|
||||
.effectDisplay .clappr {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
.effectDisplay .clappr>div {
|
||||
width: 400px !important;
|
||||
}
|
||||
`}</style>
|
||||
<div className="clearfix df">
|
||||
{content1 && <p className="content_title edu-txt-center fl mr03precent font-18">原始{typeName}</p>}
|
||||
{content2 && <p className="content_title edu-txt-center fl font-18 mr03precent">实际输出{typeName}</p>}
|
||||
{content3 && <p className="content_title edu-txt-center fl font-18 mr03precent">预期输出{typeName}</p>}
|
||||
</div>
|
||||
<div className="clearfix df content" >
|
||||
{content1 && <div className="fl mr03precent pt10 mb50">
|
||||
{content1}
|
||||
</div>}
|
||||
{content2 && <div className="fl mr03precent pt10 mb50">
|
||||
{content2}
|
||||
</div>}
|
||||
{content3 && <div className="fl mr03precent pt10 mb50">
|
||||
{content3}
|
||||
</div>}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default EffectDisplayContent;
|
@ -0,0 +1,126 @@
|
||||
import React, { Component } from 'react';
|
||||
import { SnackbarHOC } from 'educoder';
|
||||
import {BrowserRouter as Router,Route,Switch} from 'react-router-dom';
|
||||
import {Tooltip,Menu,Pagination,Spin} from 'antd';
|
||||
import Loadable from 'react-loadable';
|
||||
import Loading from '../../../Loading';
|
||||
import axios from 'axios';
|
||||
import NoneData from '../../courses/coursesPublic/NoneData'
|
||||
import {getImageUrl} from 'educoder';
|
||||
import { TPMIndexHOC } from '../../tpm/TPMIndexHOC';
|
||||
import { CNotificationHOC } from '../../courses/common/CNotificationHOC'
|
||||
import "./usersInfo.css"
|
||||
import Create from './publicCreatNew'
|
||||
|
||||
class InfosPackage extends Component{
|
||||
constructor(props){
|
||||
super(props);
|
||||
this.state={
|
||||
category:undefined,
|
||||
status:undefined,
|
||||
page:1,
|
||||
per_page:16,
|
||||
|
||||
totalCount:undefined,
|
||||
data:undefined,
|
||||
isSpin:false
|
||||
}
|
||||
}
|
||||
|
||||
componentDidMount=()=>{
|
||||
this.setState({
|
||||
isSpin:true
|
||||
})
|
||||
let{category,status,page}=this.state;
|
||||
this.getCourses(category,status,page);
|
||||
}
|
||||
|
||||
getCourses=(category,status,page)=>{
|
||||
let url=`/users/${this.props.match.params.username}/courses.json`;
|
||||
axios.get((url),{params:{
|
||||
category,
|
||||
status,
|
||||
page,
|
||||
per_page: this.props.is_current && category && page ==1?17:16
|
||||
}}).then((result)=>{
|
||||
if(result){
|
||||
this.setState({
|
||||
totalCount:result.data.count,
|
||||
data:result.data,
|
||||
isSpin:false
|
||||
})
|
||||
}
|
||||
}).catch((error)=>{
|
||||
console.log(error);
|
||||
})
|
||||
}
|
||||
|
||||
//切换种类
|
||||
changeCategory=(cate)=>{
|
||||
this.setState({
|
||||
category:cate,
|
||||
page:1,
|
||||
isSpin:true
|
||||
})
|
||||
let{status}=this.state;
|
||||
this.getCourses(cate,status,1);
|
||||
}
|
||||
//切换状态
|
||||
changeStatus=(status)=>{
|
||||
this.setState({
|
||||
status:status,
|
||||
page:1,
|
||||
isSpin:true
|
||||
})
|
||||
let{category}=this.state;
|
||||
this.getCourses(category,status,1);
|
||||
}
|
||||
//切换页数
|
||||
changePage=(page)=>{
|
||||
this.setState({
|
||||
page,
|
||||
isSpin:true
|
||||
})
|
||||
let{category,status}=this.state;
|
||||
this.getCourses(category,status,page);
|
||||
}
|
||||
|
||||
// 进入课堂
|
||||
turnToCourses=(url,flag)=>{
|
||||
if(flag){
|
||||
this.props.history.push(url);
|
||||
}
|
||||
}
|
||||
|
||||
render(){
|
||||
let{
|
||||
category,
|
||||
status,
|
||||
page,
|
||||
data,
|
||||
totalCount,
|
||||
isSpin
|
||||
} = this.state;
|
||||
let is_current=this.props.is_current;
|
||||
|
||||
console.log(this.props.current_user&&this.props.current_user.user_identity==="学生")
|
||||
return(
|
||||
<div className="educontent">
|
||||
<Spin size="large" spinning={isSpin}>
|
||||
<div className="white-panel edu-back-white pt25 pb25 clearfix ">
|
||||
<li className={category ? "" : "active"}><a href="javascript:void(0)" onClick={()=>this.changeCategory()}>全部</a></li>
|
||||
<li className={category=="manage" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeCategory("manage")}>{is_current ? "我":"TA"}管理的</a></li>
|
||||
<li className={category=="study" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeCategory("study")}>{is_current ? "我":"TA"}参与的</a></li>
|
||||
</div>
|
||||
|
||||
<p className="pl25 pr25 clearfix font-12 mb20 mt20">
|
||||
<span className="fl color-grey-9">共{0}个</span>
|
||||
<span className="fr color-grey-9">发布时间</span>
|
||||
</p>
|
||||
|
||||
</Spin>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
export default InfosPackage;
|
Loading…
Reference in new issue