diff --git a/app/controllers/live_links_controller.rb b/app/controllers/live_links_controller.rb index 085a8178b..b1ff0c187 100644 --- a/app/controllers/live_links_controller.rb +++ b/app/controllers/live_links_controller.rb @@ -1,8 +1,7 @@ class LiveLinksController < ApplicationController before_action :require_login before_action :find_course, only: [:index, :create] - before_action :user_course_identity - before_action :teacher_allowed, only: [:create] + before_action :user_course_identity, :teacher_allowed, only: [:create] def index lives = @course.live_links.order("id desc") diff --git a/app/views/live_links/index.json.jbuilder b/app/views/live_links/index.json.jbuilder index 7e0347618..02eb7be53 100644 --- a/app/views/live_links/index.json.jbuilder +++ b/app/views/live_links/index.json.jbuilder @@ -1,5 +1,6 @@ json.lives @lives do |live| - json.(live, :id, :url, :description, :on_status) + json.(live, :id, :description, :on_status) + json.url live.on_status ? live.url : "" json.author_name live.user.show_real_name json.author_login live.user.login json.author_img url_to_avatar(live.user) diff --git a/public/react/src/modules/courses/Video/Live.js b/public/react/src/modules/courses/Video/Live.js index 8de2628e8..71dced679 100644 --- a/public/react/src/modules/courses/Video/Live.js +++ b/public/react/src/modules/courses/Video/Live.js @@ -7,11 +7,9 @@ import './video.css'; class Live extends Component{ render(){ - const { liveData , lives , successFunc , pageSize , changePage } = this.props; + const { liveData , lives , successFunc , pageSize , changePage } = this.props; - const { admin , business , is_teacher } = this.props.user; - const operation = admin || business || (is_teacher && this.props.checkIfProfessionalCertification()) - return( + return(