diff --git a/app/assets/javascripts/landing.js b/app/assets/javascripts/landing.js index fad81029..b9fb8843 100644 --- a/app/assets/javascripts/landing.js +++ b/app/assets/javascripts/landing.js @@ -132,7 +132,6 @@ }; var initIndex = function() { - $('.generate-link').click (function (e) { e.preventDefault(); var newId = Math.trunc(Math.random() * 1000000000); @@ -140,11 +139,11 @@ $('.meeting-url').val(Meeting.buildMeetingURL()); }); - if (meetingId = $(".page-wrapper.meetings").data('id')) { - $('.meeting-url').val(Meeting.getInstance().getURL()); - } else { - $('.generate-link').click(); - } + $('.generate-link').click(); + }; + + var initMeetings = function() { + $('.meeting-url').val(Meeting.getInstance().getURL()); }; var initRooms = function() { @@ -157,8 +156,10 @@ $(document).on("turbolinks:load", function() { if ($("body[data-controller=landing]").get(0)) { init(); - if ($("body[data-action=meetings]").get(0)) { + if ($("body[data-action=index]").get(0)) { initIndex(); + } else if ($("body[data-action=meetings]").get(0)) { + initMeetings(); } else if ($("body[data-action=rooms]").get(0)) { initRooms(); } diff --git a/app/assets/javascripts/recordings.coffee b/app/assets/javascripts/recordings.coffee index 1e4938c6..03b09085 100644 --- a/app/assets/javascripts/recordings.coffee +++ b/app/assets/javascripts/recordings.coffee @@ -63,12 +63,14 @@ class @Recordings if type == 'display' roomName = Meeting.getInstance().getId() published = row.published - icon = getPublishClass(published) publishText = if published then 'unpublish' else 'publish' recordingActions = $('.hidden-elements').find('.recording-actions') - recordingActions.find('.recording-update > i') - .removeClass() - .addClass('fa '+icon) + recordingActions.find('.recording-update > i.default') + .removeClass(PUBLISHED_CLASSES.join(' ')) + .addClass(getPublishClass(published)) + recordingActions.find('.recording-update > i.hover') + .removeClass(PUBLISHED_CLASSES.join(' ')) + .addClass(getPublishClass(!published)) recordingActions.find('.recording-update') .attr('data-published', published) .attr('title', I18n[publishText+'_recording']) diff --git a/app/assets/stylesheets/landing.scss b/app/assets/stylesheets/landing.scss index f93d71b8..793855de 100644 --- a/app/assets/stylesheets/landing.scss +++ b/app/assets/stylesheets/landing.scss @@ -16,6 +16,17 @@ .dataTables_empty { text-align: center; } + .recording-update:hover > { + .default { + display: none; + } + .hover { + display: inline-block; + } + } + .fa.hover { + display: none; + } } } diff --git a/app/assets/stylesheets/shared.scss b/app/assets/stylesheets/shared.scss index a243f9c9..1a123b12 100644 --- a/app/assets/stylesheets/shared.scss +++ b/app/assets/stylesheets/shared.scss @@ -31,7 +31,7 @@ html, body { .header { padding: 20px 40px; - + margin-bottom: 160px; .logo { max-width: 150px; max-height: 50px; @@ -42,11 +42,6 @@ html, body { padding: 20px; } -.page-header { - margin-top: 100px; - border: 0; -} - .center-panel { .center-block { float: none; diff --git a/app/controllers/landing_controller.rb b/app/controllers/landing_controller.rb index ca336cdc..3f14be1b 100644 --- a/app/controllers/landing_controller.rb +++ b/app/controllers/landing_controller.rb @@ -2,6 +2,9 @@ class LandingController < ApplicationController include BbbApi def index + end + + def resource if params[:resource] == 'meetings' render_meeting elsif params[:resource] == 'rooms' diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb index 54a0f3b5..d5c6bd50 100644 --- a/app/controllers/sessions_controller.rb +++ b/app/controllers/sessions_controller.rb @@ -2,7 +2,7 @@ class SessionsController < ApplicationController def create @user = User.from_omniauth(request.env['omniauth.auth']) session[:user_id] = @user.id - redirect_to controller: 'landing', action: 'index', id: @user.encrypted_id, resource: 'rooms' + redirect_to @user.room_url rescue => e logger.error "Error authenticating via omniauth: #{e}" redirect_to root_path diff --git a/app/views/landing/index.html.erb b/app/views/landing/index.html.erb new file mode 100644 index 00000000..0e9615e6 --- /dev/null +++ b/app/views/landing/index.html.erb @@ -0,0 +1,20 @@ +<% content_for :title do %> +
+

<%= t('create_session') %>

+
+<% end %> + +
+
+ +
+ <%= render layout: 'shared/center_panel' do %> +
+ <%= render 'shared/meeting_url', hidden: false %> + <%= render 'shared/join_form' %> +
+ <% end %> +
+ +
+
diff --git a/app/views/landing/meetings.html.erb b/app/views/landing/meetings.html.erb index 7f157f22..14785810 100644 --- a/app/views/landing/meetings.html.erb +++ b/app/views/landing/meetings.html.erb @@ -1,31 +1,28 @@ <% content_for :title do %>
- <%= t('hi_all') %> +

<%= t('join_session_id', id: @meeting_id) %>

- - <%= t('session_url_explanation') %> - <% end %> -<% if !@meeting_id %> - <% content_for :footer do %> -