notice when trying to upload to Youtube with Twitter auth

This commit is contained in:
Josh 2017-07-11 15:28:30 -04:00
parent 042622cb01
commit 29ca709c85
4 changed files with 24 additions and 5 deletions

View File

@ -170,6 +170,10 @@ class @Recordings
options.title = I18n.youtube_disabled
$('#recordings').tooltip(options)
options.selector = '.invalid-tooltip'
options.title = I18n.invalid_provider
$('#recordings').tooltip(options)
$(document).one "turbolinks:before-cache", =>
@getTable().api().clear().draw().destroy()
@ -371,8 +375,10 @@ class @Recordings
canUpload = res_data['uploadable']
)
if canUpload
if canUpload == 'true'
$(this).attr('data-popover-body', '.mail_youtube_popover')
else if canUpload == 'invalid_provider'
$(this).attr('data-popover-body', '.no_youtube_popover')
else
$(this).attr('data-popover-body', '.mail_popover')

View File

@ -201,10 +201,12 @@ class BbbController < ApplicationController
# POST /rooms/:room_id/recordings/can_upload
def can_upload
# The recording is uploadable if it contains webcam data and they are logged in thorugh Google.
uploadable = Faraday.head(get_webcams_url(params[:rec_id])).status == 200 &&
Rails.application.config.omniauth_google &&
current_user.provider == 'google'
# The recording is uploadable if it contains webcam data and they are logged in through Google.
if current_user.provider != 'google'
uploadable = 'invalid_provider'
else
uploadable = (Faraday.head(get_webcams_url(params[:rec_id])).status == 200 && current_user.provider == 'google').to_s
end
render json: {:uploadable => uploadable}
end

View File

@ -99,6 +99,16 @@
</button>
</div>
</div>
<div class='no_youtube_popover'>
<button type="button" class="btn btn-default mail-recording mail-tooltip fa-2x">
<%= icon('envelope-o') %>
</button>
<div class="tooltip-wrapper disabled invalid-tooltip">
<button type="button" class="btn btn-default" disabled>
<%= icon('youtube-play') %>
</button>
</div>
</div>
<div class="recording-visibility-popover">
<button type="button" class="btn btn-default btn-success recording-update" data-visibility="published">
<%= t('client.published') %>

View File

@ -51,6 +51,7 @@ en-US:
email_footer_1: This e-mail is auto-generated by your friendly neighbourhood BigBlueButton server. Do no reply to this e-mail.
email_footer_2: BigBlueButton is an open source web conferencing system. For more information on BigBlueButton and it's amazing capabilities, see https://bigbluebutton.org/ .
enter_name: Enter a name to join
invalid_provider: You must authenticate with Google to upload.
mail_recording: Mail
meeting_ended: Meeting was ended
meeting_started: Meeting was started