From c318d7c5d8f24ca0551cf32115999dfdf1c0f1c7 Mon Sep 17 00:00:00 2001 From: jfederico Date: Fri, 14 Oct 2016 11:59:21 -0400 Subject: [PATCH 1/3] Added controller/view for landing page --- app/assets/javascripts/landing.coffee | 3 +++ app/assets/stylesheets/landing.scss | 3 +++ app/controllers/landing_controller.rb | 4 ++++ app/helpers/landing_helper.rb | 2 ++ app/views/landing/index.html.erb | 2 ++ config/routes.rb | 3 +++ test/controllers/landing_controller_test.rb | 9 +++++++++ 7 files changed, 26 insertions(+) create mode 100644 app/assets/javascripts/landing.coffee create mode 100644 app/assets/stylesheets/landing.scss create mode 100644 app/controllers/landing_controller.rb create mode 100644 app/helpers/landing_helper.rb create mode 100644 app/views/landing/index.html.erb create mode 100644 test/controllers/landing_controller_test.rb diff --git a/app/assets/javascripts/landing.coffee b/app/assets/javascripts/landing.coffee new file mode 100644 index 00000000..24f83d18 --- /dev/null +++ b/app/assets/javascripts/landing.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/stylesheets/landing.scss b/app/assets/stylesheets/landing.scss new file mode 100644 index 00000000..f33d6f8d --- /dev/null +++ b/app/assets/stylesheets/landing.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the landing controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/controllers/landing_controller.rb b/app/controllers/landing_controller.rb new file mode 100644 index 00000000..a5c04b4f --- /dev/null +++ b/app/controllers/landing_controller.rb @@ -0,0 +1,4 @@ +class LandingController < ApplicationController + def index + end +end diff --git a/app/helpers/landing_helper.rb b/app/helpers/landing_helper.rb new file mode 100644 index 00000000..6aa3ee92 --- /dev/null +++ b/app/helpers/landing_helper.rb @@ -0,0 +1,2 @@ +module LandingHelper +end diff --git a/app/views/landing/index.html.erb b/app/views/landing/index.html.erb new file mode 100644 index 00000000..ea27d33b --- /dev/null +++ b/app/views/landing/index.html.erb @@ -0,0 +1,2 @@ +

Landing#index

+

Find me in app/views/landing/index.html.erb

diff --git a/config/routes.rb b/config/routes.rb index 787824f8..57c3044e 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,3 +1,6 @@ Rails.application.routes.draw do + get 'meeting(/:id)', to: 'landing#index' + + root to: 'landing#index' # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html end diff --git a/test/controllers/landing_controller_test.rb b/test/controllers/landing_controller_test.rb new file mode 100644 index 00000000..ee1801da --- /dev/null +++ b/test/controllers/landing_controller_test.rb @@ -0,0 +1,9 @@ +require 'test_helper' + +class LandingControllerTest < ActionDispatch::IntegrationTest + test "should get index" do + get landing_index_url + assert_response :success + end + +end From fb5afb7d9b3ec86b511b9585d98d20c34c4ea76a Mon Sep 17 00:00:00 2001 From: jfederico Date: Mon, 17 Oct 2016 10:20:08 -0400 Subject: [PATCH 2/3] Aded bigbluebutton-api gem --- Gemfile | 3 +++ Gemfile.lock | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/Gemfile b/Gemfile index 4aa8f6b2..00c79238 100644 --- a/Gemfile +++ b/Gemfile @@ -46,3 +46,6 @@ end # Windows does not include zoneinfo files, so bundle the tzinfo-data gem gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] + +gem 'bigbluebutton-api-ruby' + diff --git a/Gemfile.lock b/Gemfile.lock index 8015104a..3aa0a317 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -39,6 +39,8 @@ GEM minitest (~> 5.1) tzinfo (~> 1.1) arel (7.1.4) + bigbluebutton-api-ruby (1.6.0) + xml-simple (~> 1.1) builder (3.2.2) byebug (9.0.6) coffee-rails (4.2.1) @@ -149,11 +151,13 @@ GEM websocket-driver (0.6.4) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.2) + xml-simple (1.1.5) PLATFORMS ruby DEPENDENCIES + bigbluebutton-api-ruby byebug coffee-rails (~> 4.2) jbuilder (~> 2.5) From 3376a929f573d70b630b4db6bd7c285f2e41e99d Mon Sep 17 00:00:00 2001 From: jfederico Date: Mon, 17 Oct 2016 10:21:18 -0400 Subject: [PATCH 3/3] Statics landing page, first approach --- app/controllers/landing_controller.rb | 11 +++++++++ app/views/landing/index.html.erb | 35 ++++++++++++++++++++++++++- 2 files changed, 45 insertions(+), 1 deletion(-) diff --git a/app/controllers/landing_controller.rb b/app/controllers/landing_controller.rb index a5c04b4f..135fd099 100644 --- a/app/controllers/landing_controller.rb +++ b/app/controllers/landing_controller.rb @@ -1,4 +1,15 @@ class LandingController < ApplicationController def index + @meeting_token = params[:id] || @meeting_token = rand.to_s[2..10] + @meeting_url = meeting_url(@meeting_token) + end + + private + def meeting_url(meeting_token) + _meeting_url = "#{request.original_url}" + _meeting_url += "meeting" if ( request.original_url == "#{request.base_url}/" ) + _meeting_url += "/" unless _meeting_url.end_with?('/') + _meeting_url += "#{meeting_token}" if !params.has_key?(:id) + _meeting_url end end diff --git a/app/views/landing/index.html.erb b/app/views/landing/index.html.erb index ea27d33b..fed5c740 100644 --- a/app/views/landing/index.html.erb +++ b/app/views/landing/index.html.erb @@ -1,2 +1,35 @@

Landing#index

-

Find me in app/views/landing/index.html.erb

+
+

<%= @meeting_url %>

+
+ +
+
+ + +
+
+ +
+ + + + +
+

Hi Everyone

+
+

The meeting will be at this URL

+
+

<%= @meeting_url %>

+
+

Please join!

+
+
+ + + +