Skip to content

Commit

Permalink
notice when trying to upload to Youtube with Twitter auth
Browse files Browse the repository at this point in the history
  • Loading branch information
joshua-arts committed Jul 11, 2017
1 parent 042622c commit 29ca709
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 5 deletions.
8 changes: 7 additions & 1 deletion app/assets/javascripts/recordings.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,10 @@ class @Recordings
options.selector = '.disabled-tooltip'
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()
Expand Down Expand Up @@ -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')

Expand Down
10 changes: 6 additions & 4 deletions app/controllers/bbb_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -201,10 +201,12 @@ def youtube_publish

# 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

Expand Down
10 changes: 10 additions & 0 deletions app/views/landing/rooms.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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') %>
Expand Down
1 change: 1 addition & 0 deletions config/locales/en-us.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 29ca709

Please sign in to comment.