separate root page and meetings page

This commit is contained in:
Zachary Chai 2016-11-24 11:16:56 -05:00
parent fe0ce271d0
commit 269ce7915e
7 changed files with 52 additions and 5 deletions

View File

@ -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();
}

View File

@ -2,6 +2,9 @@ class LandingController < ApplicationController
include BbbApi
def index
end
def resource
if params[:resource] == 'meetings'
render_meeting
elsif params[:resource] == 'rooms'

View File

@ -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

View File

@ -0,0 +1,33 @@
<% content_for :title do %>
<div class="title">
<%= t('hi_all') %>
</div>
<small>
<%= t('session_url_explanation') %>
</small>
<% end %>
<% if !@meeting_id %>
<% content_for :footer do %>
<div class="panel-footer">
<div class="text-center">
<%= t('refresh_html') %>
</div>
</div>
<% end %>
<% end %>
<div class="page-wrapper meetings" data-id="<%= @meeting_id %>">
<div class="container-fluid">
<div class="center-panel-wrapper">
<%= render layout: 'shared/center_panel' do %>
<div class="center-block center-panel-conent-size col-xs-12">
<%= render 'shared/meeting_url', hidden: false %>
<%= render 'shared/join_form' %>
</div>
<% end %>
</div>
</div>
</div>

View File

@ -17,6 +17,14 @@
<% end %>
<% end %>
<% content_for :footer do %>
<div class="panel-footer">
<div class="text-center">
<%= link_to t('create_your_session'), root_path %>
</div>
</div>
<% end %>
<div class="page-wrapper meetings" data-id="<%= @meeting_id %>">
<div class="container-fluid">

View File

@ -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

View File

@ -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'