From eaccba7bea6228d40dd385f42fd426dbc49f24b8 Mon Sep 17 00:00:00 2001
From: caicai8 <1149225589@qq.com>
Date: Mon, 9 Mar 2020 10:52:39 +0800
Subject: [PATCH 1/4] =?UTF-8?q?=E8=A7=86=E9=A2=91=E5=A2=9E=E5=8A=A0?=
=?UTF-8?q?=E4=BA=8C=E7=BA=A7=E7=9B=AE=E5=BD=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../react/src/modules/courses/coursesDetail/CoursesLeftNav.js | 2 ++
1 file changed, 2 insertions(+)
diff --git a/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js b/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js
index 999ae4e15..f4ccccdba 100644
--- a/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js
+++ b/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js
@@ -838,6 +838,8 @@ class Coursesleftnav extends Component{
{item.type==="shixun_homework"?
this.Navmodalnames(e,1,"shixun_homework",item.id)}>新建目录
:""}
{/*资源*/}
{item.type==="attachment"?this.Navmodalnames(e,1,"attachment",item.id)}>新建目录
:""}
+ {/* 视频 */}
+ {item.type==="video"?this.Navmodalnames(e,1,"video",item.id)}>新建目录
:""}
{/*毕业设计*/}
{/*{item.type==="graduation"?this.Navmodalnames(1,"attachment",item.id)}>添加目录
:""}*/}
{/*讨论区*/}
From 63f1cfc935411fcfa90ca277405773787775d0ae Mon Sep 17 00:00:00 2001
From: caicai8 <1149225589@qq.com>
Date: Mon, 9 Mar 2020 14:32:53 +0800
Subject: [PATCH 2/4] =?UTF-8?q?=E8=A7=86=E9=A2=91?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
public/react/src/modules/courses/Index.js | 8 ++-
.../src/modules/courses/Video/VideoIndex.js | 25 +++++++++-
.../courses/coursesDetail/CoursesLeftNav.js | 49 +++++++++----------
3 files changed, 53 insertions(+), 29 deletions(-)
diff --git a/public/react/src/modules/courses/Index.js b/public/react/src/modules/courses/Index.js
index dc935ab1c..fff564146 100644
--- a/public/react/src/modules/courses/Index.js
+++ b/public/react/src/modules/courses/Index.js
@@ -508,12 +508,16 @@ class CoursesIndex extends Component{
}
>
{/*视频列表*/}
-
+ ()
+ }
+ >
()
}
- >
+ >
{/* 资源列表页 */}
{
- const CourseId=this.props.match.params.coursesId;
- const fetchUrl = `/courses/${CourseId}/course_videos.json`;
+ const { coursesId , videoId }=this.props.match.params;
+ const fetchUrl = `/courses/${coursesId}/course_videos.json`;
axios.get(fetchUrl, {
params: {
page,
limit: PAGE_SIZE,
+ category_id:videoId
}
})
.then((response) => {
@@ -200,9 +201,18 @@ class VideoIndex extends Component{
})
this.setliveVisibel(true);
}
+
+ addDir=()=>{
+
+ }
+ editDir=()=>{
+
+ }
render(){
const { videos , upload , videoData , type , liveData , lives , page , liveVisible , isSpining , liveId } = this.state;
const { admin , is_teacher , business } = this.props.user;
+ const { coursesId , videoId }=this.props.match.params;
+
// console.log("p",this.props);
return(
@@ -247,6 +257,17 @@ class VideoIndex extends Component{
{
type === "video" ?
+ {
+ this.props.isAdmin() &&
+
+ {
+ videoId ?
+ this.editDir()} className={"mr30 font-16"}>目录重命名
+ :
+ 新建目录
+ }
+
+ }
{
upload ?
this.uploadVideo(false)}>取消
diff --git a/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js b/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js
index f4ccccdba..c6e72fee5 100644
--- a/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js
+++ b/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js
@@ -658,32 +658,28 @@ class Coursesleftnav extends Component{
updatadeleteSecondary=(url)=>{
this.props.updataleftNavfun();
- // this.setState({
- // ModalsType:true,
- // Modalstopval:"删除成功",
- // loadtype:true,
- // })
- // notification.open({
- // message: "删除成功",
- // });
-
- // this.props.history.replace(url);
- window.location.href = url;
+ this.setState({
+ ModalsType:false,
+ Modalstopval:"",
+ loadtype:false,
+ })
+ notification.open({
+ message: "删除成功",
+ });
+
+ this.props.history.replace(url);
+
+ // window.location.href = url;
}
deletenavchilds=(url,mainurl)=>{
- this.setState({
- antIcon:true
- })
+ console.log(this.props);
+ this.setState({
+ antIcon:true
+ })
axios.delete(url).then((result)=>{
if(result.data.status===0){
-
- if(mainurl===undefined){
- this.updatadeleteSecondary(result.data.right_url)
- }else{
- this.updatadeleteSecondary(mainurl)
- }
-
+ this.updatadeleteSecondary(mainurl || result.data.right_url);
}
}).catch((error)=>{
console.log(error)
@@ -698,8 +694,8 @@ class Coursesleftnav extends Component{
ModalsType:true,
Modalstopval:"该目录下的内容将被移动到父目录,",
ModalsBottomval:"是否确认删除?",
- ModalSave:()=>this.deletenavchilds(url),
-
+ ModalSave:()=>this.deletenavchilds(url,mainurl),
+ loadtype:false
})
}else if(type===2){
@@ -709,7 +705,7 @@ class Coursesleftnav extends Component{
Modalstopval:"该分班的学生将被移动到“未分班”,",
ModalsBottomval:"是否确认删除?",
ModalSave:()=>this.deletenavchilds(url),
-
+ loadtype:false
})
}else if(type===3){
let url="/boards/"+id+".json"
@@ -718,7 +714,7 @@ class Coursesleftnav extends Component{
Modalstopval:"该目录下的内容将被移动到父目录,",
ModalsBottomval:"是否确认删除?",
ModalSave:()=>this.deletenavchilds(url,mainurl),
-
+ loadtype:false
})
}
@@ -874,6 +870,9 @@ class Coursesleftnav extends Component{
{/*讨论区*/}
{item.type==="board"?this.Navmodalnames(e,7,"editSecondname",iem.category_id,iem.category_name)}>重命名
:""}
{item.type==="board"?this.deleteSecondary(e,3,iem.category_id,item.category_url)}>删除
:""}
+ {/*视频*/}
+ {item.type==="video"?this.Navmodalnames(e,4,"editSecondname",iem.category_id,iem.category_name)}>重命名
:""}
+ {item.type==="video"?this.deleteSecondary(e,1,iem.category_id,item.category_url)}>删除
:""}
)
};
From e59665ccb1aecf02fe4a07372b7e68f06152d127 Mon Sep 17 00:00:00 2001
From: daiao <358551898@qq.com>
Date: Mon, 9 Mar 2020 21:11:05 +0800
Subject: [PATCH 3/4] =?UTF-8?q?=E5=88=A0=E9=99=A4=E8=A7=86=E9=A2=91?=
=?UTF-8?q?=E6=8E=A5=E5=8F=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/users/videos_controller.rb | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/app/controllers/users/videos_controller.rb b/app/controllers/users/videos_controller.rb
index 0ae240dd7..645c25362 100644
--- a/app/controllers/users/videos_controller.rb
+++ b/app/controllers/users/videos_controller.rb
@@ -1,6 +1,6 @@
class Users::VideosController < Users::BaseController
before_action :private_user_resources!, :check_account
- before_action :require_teacher!
+ before_action :require_teacher!, except: [:destroy]
before_action :require_auth_teacher!, except: [:index, :review]
helper_method :current_video
@@ -53,6 +53,19 @@ class Users::VideosController < Users::BaseController
render_error(ex.message)
end
+ def destroy
+ video = observed_user.videos.find_by(id: params[:video_id])
+ render_forbidden unless video.user_id != observed_user.id || !current_user.admin_or_business?
+ return render_not_found if video.blank?
+ return render_error('该状态下不能删除视频') unless video.pending?
+
+ video.destroy!
+
+ AliyunVod::Service.delete_video([video.uuid]) rescue nil
+
+ render_ok
+ end
+
private
def current_video
From ce1293ab9b440921401c543fc88739d61137acb3 Mon Sep 17 00:00:00 2001
From: caicai8 <1149225589@qq.com>
Date: Mon, 9 Mar 2020 21:14:38 +0800
Subject: [PATCH 4/4] =?UTF-8?q?=E8=A7=86=E9=A2=91=E4=BA=8C=E7=BA=A7?=
=?UTF-8?q?=E7=9B=AE=E5=BD=95=E5=92=8C=E5=A4=96=E9=93=BE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
public/react/public/css/demo_index.html | 184 ++++++++++++++++++
public/react/public/css/iconfont.css | 44 ++++-
public/react/public/css/iconfont.eot | Bin 87360 -> 88664 bytes
public/react/public/css/iconfont.js | 2 +-
public/react/public/css/iconfont.json | 56 ++++++
public/react/public/css/iconfont.svg | 24 +++
public/react/public/css/iconfont.ttf | Bin 87192 -> 88496 bytes
public/react/public/css/iconfont.woff | Bin 55256 -> 55920 bytes
public/react/public/css/iconfont.woff2 | Bin 46304 -> 46852 bytes
public/react/src/modules/courses/Index.js | 2 +-
.../src/modules/courses/ListPageIndex.js | 6 +-
.../src/modules/courses/Video/MoveBox.js | 128 ++++++++++++
.../react/src/modules/courses/Video/Video.js | 41 +++-
.../src/modules/courses/Video/VideoIndex.js | 116 +++++++----
.../src/modules/courses/Video/VideoLink.js | 86 ++++++++
.../courses/coursesDetail/CoursesLeftNav.js | 65 ++++---
.../user/usersInfo/video/EditVideoModal.js | 43 +++-
.../user/usersInfo/video/InfosVideo.css | 22 +++
.../user/usersInfo/video/VideoInReviewItem.js | 31 ++-
.../user/usersInfo/video/images/default.png | Bin 0 -> 69294 bytes
20 files changed, 753 insertions(+), 97 deletions(-)
create mode 100644 public/react/src/modules/courses/Video/MoveBox.js
create mode 100644 public/react/src/modules/courses/Video/VideoLink.js
create mode 100644 public/react/src/modules/user/usersInfo/video/images/default.png
diff --git a/public/react/public/css/demo_index.html b/public/react/public/css/demo_index.html
index 281ac40d0..7b0854698 100644
--- a/public/react/public/css/demo_index.html
+++ b/public/react/public/css/demo_index.html
@@ -30,6 +30,54 @@
+ -
+
+
移动
+ 
+
+
+ -
+
+
下移2
+ 
+
+
+ -
+
+
上移2
+ 
+
+
+ -
+
+
下移
+ 
+
+
+ -
+
+
上移
+ 
+
+
+ -
+
+
编辑
+ 
+
+
+ -
+
+
删除
+ 
+
+
+ -
+
+
选择
+ 
+
+
-
编辑
@@ -2012,6 +2060,78 @@
+ -
+
+
+ 移动
+
+ .icon-yidong
+
+
+
+ -
+
+
+ 下移2
+
+ .icon-xiayi1
+
+
+
+ -
+
+
+ 上移2
+
+ .icon-shangyi1
+
+
+
+ -
+
+
+ 下移
+
+ .icon-xiayi
+
+
+
+ -
+
+
+ 上移
+
+ .icon-shangyi
+
+
+
+ -
+
+
+ 编辑
+
+ .icon-bianji5
+
+
+
+ -
+
+
+ 删除
+
+ .icon-shanchu3
+
+
+
+ -
+
+
+ 选择
+
+ .icon-xuanze
+
+
+
-
@@ -4939,6 +5059,70 @@
+ -
+
+
移动
+ #icon-yidong
+
+
+ -
+
+
下移2
+ #icon-xiayi1
+
+
+ -
+
+
上移2
+ #icon-shangyi1
+
+
+ -
+
+
下移
+ #icon-xiayi
+
+
+ -
+
+
上移
+ #icon-shangyi
+
+
+ -
+
+
编辑
+ #icon-bianji5
+
+
+ -
+
+
删除
+ #icon-shanchu3
+
+
+ -
+
+
选择
+ #icon-xuanze
+
+
-