forked from External/greenlight
		
	main room recordings
This commit is contained in:
		@@ -157,7 +157,7 @@ class @Recordings
 | 
				
			|||||||
  # refresh the recordings from the server
 | 
					  # refresh the recordings from the server
 | 
				
			||||||
  refresh: ->
 | 
					  refresh: ->
 | 
				
			||||||
    table_api = this.table.api()
 | 
					    table_api = this.table.api()
 | 
				
			||||||
    $.get "/rooms/"+Meeting.getInstance().getAdminId()+"/recordings", (data) =>
 | 
					    $.get @getRecordingsURL(), (data) =>
 | 
				
			||||||
      @setOwner(data.is_owner)
 | 
					      @setOwner(data.is_owner)
 | 
				
			||||||
      if !@owner
 | 
					      if !@owner
 | 
				
			||||||
        table_api.column(-1).visible(false)
 | 
					        table_api.column(-1).visible(false)
 | 
				
			||||||
@@ -172,11 +172,12 @@ class @Recordings
 | 
				
			|||||||
  # setup click handlers for the action buttons
 | 
					  # setup click handlers for the action buttons
 | 
				
			||||||
  setupActionHandlers: ->
 | 
					  setupActionHandlers: ->
 | 
				
			||||||
    table_api = this.table.api()
 | 
					    table_api = this.table.api()
 | 
				
			||||||
 | 
					    recordingsObject = this
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @getTable().on 'click', '.recording-update', (event) ->
 | 
					    @getTable().on 'click', '.recording-update', (event) ->
 | 
				
			||||||
      btn = $(this)
 | 
					      btn = $(this)
 | 
				
			||||||
      row = table_api.row($(this).closest('tr')).data()
 | 
					      row = table_api.row($(this).closest('tr')).data()
 | 
				
			||||||
      url = $('.meeting-url').val()
 | 
					      url = recordingsObject.getRecordingsURL()
 | 
				
			||||||
      id = row.id
 | 
					      id = row.id
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      published = btn.data('visibility') == "unlisted" ||
 | 
					      published = btn.data('visibility') == "unlisted" ||
 | 
				
			||||||
@@ -189,7 +190,7 @@ class @Recordings
 | 
				
			|||||||
      data["meta_" + GreenLight.META_LISTED] = listed.toString();
 | 
					      data["meta_" + GreenLight.META_LISTED] = listed.toString();
 | 
				
			||||||
      $.ajax({
 | 
					      $.ajax({
 | 
				
			||||||
        method: 'PATCH',
 | 
					        method: 'PATCH',
 | 
				
			||||||
        url: url+'/recordings/'+id,
 | 
					        url: url+'/'+id,
 | 
				
			||||||
        data: data
 | 
					        data: data
 | 
				
			||||||
      }).done((data) ->
 | 
					      }).done((data) ->
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -200,12 +201,12 @@ class @Recordings
 | 
				
			|||||||
    @getTable().on 'click', '.recording-delete', (event) ->
 | 
					    @getTable().on 'click', '.recording-delete', (event) ->
 | 
				
			||||||
      btn = $(this)
 | 
					      btn = $(this)
 | 
				
			||||||
      row = table_api.row($(this).closest('tr')).data()
 | 
					      row = table_api.row($(this).closest('tr')).data()
 | 
				
			||||||
      url = $('.meeting-url').val()
 | 
					      url = recordingsObject.getRecordingsURL()
 | 
				
			||||||
      id = row.id
 | 
					      id = row.id
 | 
				
			||||||
      btn.prop('disabled', true)
 | 
					      btn.prop('disabled', true)
 | 
				
			||||||
      $.ajax({
 | 
					      $.ajax({
 | 
				
			||||||
        method: 'DELETE',
 | 
					        method: 'DELETE',
 | 
				
			||||||
        url: url+'/recordings/'+id
 | 
					        url: url+'/'+id
 | 
				
			||||||
      }).done((data) ->
 | 
					      }).done((data) ->
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      ).fail((data) ->
 | 
					      ).fail((data) ->
 | 
				
			||||||
@@ -218,6 +219,13 @@ class @Recordings
 | 
				
			|||||||
  getTable: ->
 | 
					  getTable: ->
 | 
				
			||||||
    @table
 | 
					    @table
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  getRecordingsURL: ->
 | 
				
			||||||
 | 
					    if $(".page-wrapper.rooms").data('main-room')
 | 
				
			||||||
 | 
					      base_url = '/rooms/'+Meeting.getInstance().getAdminId()
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					      base_url = $('.meeting-url').val()
 | 
				
			||||||
 | 
					    base_url+'/recordings'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  isOwner: ->
 | 
					  isOwner: ->
 | 
				
			||||||
    @owner
 | 
					    @owner
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -29,11 +29,12 @@ Rails.application.routes.draw do
 | 
				
			|||||||
  # meetings offer a landing page for NON authenticated users to create and join session in BigBlueButton
 | 
					  # meetings offer a landing page for NON authenticated users to create and join session in BigBlueButton
 | 
				
			||||||
  # rooms offer a customized landing page for authenticated users to create and join session in BigBlueButton
 | 
					  # rooms offer a customized landing page for authenticated users to create and join session in BigBlueButton
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  get '/rooms/:room_id/recordings', to: 'bbb#recordings', defaults: {format: 'json'}
 | 
					  patch '/rooms/:room_id/recordings/:record_id', to: 'bbb#update_recordings', defaults: {format: 'json'}
 | 
				
			||||||
  patch '/rooms/:id/recordings/:record_id', to: 'bbb#update_recordings', defaults: {format: 'json'}
 | 
					  delete '/rooms/:room_id/recordings/:record_id', to: 'bbb#delete_recordings', defaults: {format: 'json'}
 | 
				
			||||||
  delete '/rooms/:id/recordings/:record_id', to: 'bbb#delete_recordings', defaults: {format: 'json'}
 | 
					
 | 
				
			||||||
  get '/rooms/:room_id/:id', to: 'landing#resource', resource: 'rooms'
 | 
					 | 
				
			||||||
  get '/rooms/:room_id',  to: 'landing#resource', resource: 'rooms'
 | 
					  get '/rooms/:room_id',  to: 'landing#resource', resource: 'rooms'
 | 
				
			||||||
 | 
					  get '/rooms/:room_id/recordings', to: 'bbb#recordings', defaults: {format: 'json'}
 | 
				
			||||||
 | 
					  get '/rooms/:room_id/:id', to: 'landing#resource', resource: 'rooms'
 | 
				
			||||||
  delete '/rooms/:room_id/:id/end', to: 'bbb#end', defaults: {format: 'json'}
 | 
					  delete '/rooms/:room_id/:id/end', to: 'bbb#end', defaults: {format: 'json'}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  get '/:resource/:id', to: 'landing#resource', as: :resource
 | 
					  get '/:resource/:id', to: 'landing#resource', as: :resource
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user