From fe0ce271d0a5c08b70e94dd47916568f886c9b28 Mon Sep 17 00:00:00 2001 From: Zachary Chai Date: Thu, 24 Nov 2016 10:42:13 -0500 Subject: [PATCH 1/6] remove page header --- app/assets/stylesheets/shared.scss | 7 +------ app/views/landing/meetings.html.erb | 2 -- app/views/landing/rooms.html.erb | 2 -- app/views/shared/_title.html.erb | 7 ------- 4 files changed, 1 insertion(+), 17 deletions(-) delete mode 100644 app/views/shared/_title.html.erb 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/views/landing/meetings.html.erb b/app/views/landing/meetings.html.erb index 7f157f22..37cfdf13 100644 --- a/app/views/landing/meetings.html.erb +++ b/app/views/landing/meetings.html.erb @@ -20,8 +20,6 @@
- <%= render 'shared/title', title: t('start_new_session') %> -
<%= render layout: 'shared/center_panel' do %>
diff --git a/app/views/landing/rooms.html.erb b/app/views/landing/rooms.html.erb index 6c82ba3a..497eb4c3 100644 --- a/app/views/landing/rooms.html.erb +++ b/app/views/landing/rooms.html.erb @@ -7,8 +7,6 @@
- <%= render 'shared/title', title: page_title %> -
<%= render 'rooms_center_panel' %>
diff --git a/app/views/shared/_title.html.erb b/app/views/shared/_title.html.erb deleted file mode 100644 index 21e3ea50..00000000 --- a/app/views/shared/_title.html.erb +++ /dev/null @@ -1,7 +0,0 @@ -
- -
From 269ce7915ee65a494b00e2361de2e8b0d9b3b09b Mon Sep 17 00:00:00 2001 From: Zachary Chai Date: Thu, 24 Nov 2016 11:16:56 -0500 Subject: [PATCH 2/6] separate root page and meetings page --- app/assets/javascripts/landing.js | 8 ++++--- app/controllers/landing_controller.rb | 3 +++ app/controllers/sessions_controller.rb | 2 +- app/views/landing/index.html.erb | 33 ++++++++++++++++++++++++++ app/views/landing/meetings.html.erb | 8 +++++++ config/locales/en-us.yml | 1 + config/routes.rb | 2 +- 7 files changed, 52 insertions(+), 5 deletions(-) create mode 100644 app/views/landing/index.html.erb diff --git a/app/assets/javascripts/landing.js b/app/assets/javascripts/landing.js index fad81029..cd4097e2 100644 --- a/app/assets/javascripts/landing.js +++ b/app/assets/javascripts/landing.js @@ -131,7 +131,7 @@ } }; - var initIndex = function() { + var initMeetings = function() { $('.generate-link').click (function (e) { e.preventDefault(); @@ -157,8 +157,10 @@ $(document).on("turbolinks:load", function() { if ($("body[data-controller=landing]").get(0)) { init(); - if ($("body[data-action=meetings]").get(0)) { - initIndex(); + if ($("body[data-action=index]").get(0)) { + initMeetings(); + } else if ($("body[data-action=meetings]").get(0)) { + initMeetings(); } else if ($("body[data-action=rooms]").get(0)) { initRooms(); } 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..37cfdf13 --- /dev/null +++ b/app/views/landing/index.html.erb @@ -0,0 +1,33 @@ +<% content_for :title do %> +
+ <%= t('hi_all') %> +
+ + <%= t('session_url_explanation') %> + +<% end %> + +<% if !@meeting_id %> + <% content_for :footer do %> + + <% end %> +<% 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 37cfdf13..6763a45c 100644 --- a/app/views/landing/meetings.html.erb +++ b/app/views/landing/meetings.html.erb @@ -17,6 +17,14 @@ <% end %> <% end %> +<% content_for :footer do %> + +<% end %> +
diff --git a/config/locales/en-us.yml b/config/locales/en-us.yml index bed580f8..38c106bb 100644 --- a/config/locales/en-us.yml +++ b/config/locales/en-us.yml @@ -35,6 +35,7 @@ en-US: unpublish_recording: Hide recording copied: Copied copy_error: Use Ctrl-c to copy + create_your_session: Create your own session date_recorded: Date duration: Duration end: End diff --git a/config/routes.rb b/config/routes.rb index 16bef9a8..9da269c9 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -11,7 +11,7 @@ Rails.application.routes.draw do # There are two resources [meetings|rooms] # 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 - get '/:resource/:id', to: 'landing#index', as: :resource + get '/:resource/:id', to: 'landing#resource', as: :resource get '/:resource/:id/join', to: 'bbb#join', as: :bbb_join, defaults: {format: 'json'} get '/:resource/:id/wait', to: 'landing#wait_for_moderator' get '/:resource/:id/session_status_refresh', to: 'landing#session_status_refresh' From ded0f9b056404773d71c188e11588efccf39864d Mon Sep 17 00:00:00 2001 From: Zachary Chai Date: Thu, 24 Nov 2016 11:30:12 -0500 Subject: [PATCH 3/6] meetings page changes --- app/views/landing/index.html.erb | 2 +- app/views/landing/meetings.html.erb | 23 +++++++---------------- config/locales/en-us.yml | 2 ++ 3 files changed, 10 insertions(+), 17 deletions(-) diff --git a/app/views/landing/index.html.erb b/app/views/landing/index.html.erb index 37cfdf13..f6e19d38 100644 --- a/app/views/landing/index.html.erb +++ b/app/views/landing/index.html.erb @@ -17,7 +17,7 @@ <% end %> <% end %> -
+
diff --git a/app/views/landing/meetings.html.erb b/app/views/landing/meetings.html.erb index 6763a45c..14785810 100644 --- a/app/views/landing/meetings.html.erb +++ b/app/views/landing/meetings.html.erb @@ -1,26 +1,17 @@ <% 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 %> - - <% end %> <% end %> <% content_for :footer do %> <% end %> @@ -31,7 +22,7 @@
<%= render layout: 'shared/center_panel' do %>
- <%= render 'shared/meeting_url', hidden: false %> + <%= render 'shared/meeting_url', hidden: true %> <%= render 'shared/join_form' %>
<% end %> diff --git a/config/locales/en-us.yml b/config/locales/en-us.yml index 38c106bb..465f63b5 100644 --- a/config/locales/en-us.yml +++ b/config/locales/en-us.yml @@ -45,6 +45,7 @@ en-US: hi_all: Hi Everyone join: Join join_session: Join the current session + join_session_id: Join %{id} join_session_user: Join %{name} session login: login logout: logout @@ -55,6 +56,7 @@ en-US: powered_bigbluebutton: Powered by BigBlueButton presentation: Presentation refresh_html: Click refresh to generate a new meeting URL + return_to_room: Return to your personal room session_url_explanation: The session will be taking place using the following URL start: Start start_new_session: Start a new session From 08ecae0ef6e5ca3eaa2fb0bf1622ea5c202c8dfd Mon Sep 17 00:00:00 2001 From: Zachary Chai Date: Thu, 24 Nov 2016 13:57:06 -0500 Subject: [PATCH 4/6] move meeting refresh to the url input field --- app/assets/javascripts/landing.js | 15 +++++++-------- app/views/landing/index.html.erb | 15 +-------------- app/views/shared/_meeting_url.html.erb | 7 +++++++ config/locales/en-us.yml | 3 ++- 4 files changed, 17 insertions(+), 23 deletions(-) diff --git a/app/assets/javascripts/landing.js b/app/assets/javascripts/landing.js index cd4097e2..b9fb8843 100644 --- a/app/assets/javascripts/landing.js +++ b/app/assets/javascripts/landing.js @@ -131,8 +131,7 @@ } }; - var initMeetings = function() { - + 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() { @@ -158,7 +157,7 @@ if ($("body[data-controller=landing]").get(0)) { init(); if ($("body[data-action=index]").get(0)) { - initMeetings(); + initIndex(); } else if ($("body[data-action=meetings]").get(0)) { initMeetings(); } else if ($("body[data-action=rooms]").get(0)) { diff --git a/app/views/landing/index.html.erb b/app/views/landing/index.html.erb index f6e19d38..0e9615e6 100644 --- a/app/views/landing/index.html.erb +++ b/app/views/landing/index.html.erb @@ -1,20 +1,7 @@ <% content_for :title do %>
- <%= t('hi_all') %> +

<%= t('create_session') %>

- - <%= t('session_url_explanation') %> - -<% end %> - -<% if !@meeting_id %> - <% content_for :footer do %> - - <% end %> <% end %>
diff --git a/app/views/shared/_meeting_url.html.erb b/app/views/shared/_meeting_url.html.erb index ff15f091..122b1417 100644 --- a/app/views/shared/_meeting_url.html.erb +++ b/app/views/shared/_meeting_url.html.erb @@ -2,6 +2,13 @@
+ <% if params[:action] == 'index' %> + + <% end %>