From 9ecbd7f29d3ee29c2ec64eab57cca4dfd55566a2 Mon Sep 17 00:00:00 2001 From: Zachary Chai Date: Tue, 7 Feb 2017 15:54:26 -0500 Subject: [PATCH 1/5] fix some assets not loading with relative root URLs --- app/assets/stylesheets/shared.scss | 1 - app/views/layouts/application.html.erb | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/assets/stylesheets/shared.scss b/app/assets/stylesheets/shared.scss index 92d30c85..a0987b93 100644 --- a/app/assets/stylesheets/shared.scss +++ b/app/assets/stylesheets/shared.scss @@ -33,7 +33,6 @@ html, body { .background { height: 350px; width: 100%; - background: asset-url('greenlight_background'); background-position: center; background-size: cover; background-repeat: no-repeat; diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index c670ddb5..fb6dfd07 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -26,7 +26,8 @@ with BigBlueButton; if not, see . - +
From abe532afcf0ed25f06801616eba0e783792803e8 Mon Sep 17 00:00:00 2001 From: Zachary Chai Date: Thu, 9 Feb 2017 10:17:19 -0500 Subject: [PATCH 2/5] use official font awesome gem --- Gemfile | 2 +- Gemfile.lock | 6 +++--- app/assets/stylesheets/shared.scss | 2 ++ app/views/landing/rooms.html.erb | 4 ++-- app/views/shared/_meeting_url.html.erb | 8 ++++---- 5 files changed, 12 insertions(+), 10 deletions(-) diff --git a/Gemfile b/Gemfile index 5717fb2e..d257db5f 100644 --- a/Gemfile +++ b/Gemfile @@ -60,7 +60,7 @@ gem 'bigbluebutton-api-ruby' gem 'bootstrap-sass', '3.3.0.0' gem 'bootstrap-social-rails', '~> 4.12' -gem 'font-awesome-rails' +gem 'font-awesome-sass' gem 'jquery-ui-rails' gem 'jquery-datatables-rails', '~> 3.4.0' gem 'rails-timeago', '~> 2.0' diff --git a/Gemfile.lock b/Gemfile.lock index ccd8f2c1..e1a12cb5 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -65,8 +65,8 @@ GEM faraday (0.9.2) multipart-post (>= 1.2, < 3) ffi (1.9.14) - font-awesome-rails (4.6.3.1) - railties (>= 3.2, < 5.1) + font-awesome-sass (4.7.0) + sass (>= 3.2) globalid (0.3.7) activesupport (>= 4.1.0) hashie (3.4.4) @@ -216,7 +216,7 @@ DEPENDENCIES byebug coffee-rails (~> 4.2) dotenv-rails - font-awesome-rails + font-awesome-sass http_accept_language jbuilder (~> 2.5) jquery-datatables-rails (~> 3.4.0) diff --git a/app/assets/stylesheets/shared.scss b/app/assets/stylesheets/shared.scss index a0987b93..b79a5f5e 100644 --- a/app/assets/stylesheets/shared.scss +++ b/app/assets/stylesheets/shared.scss @@ -17,6 +17,8 @@ @import "bootstrap-sprockets"; @import "bootstrap"; @import "bootstrap-social"; + +@import "font-awesome-sprockets"; @import "font-awesome"; diff --git a/app/views/landing/rooms.html.erb b/app/views/landing/rooms.html.erb index c9551996..d0ed1226 100644 --- a/app/views/landing/rooms.html.erb +++ b/app/views/landing/rooms.html.erb @@ -77,12 +77,12 @@ - + <%= icon('trash-o') %> diff --git a/app/views/shared/_meeting_url.html.erb b/app/views/shared/_meeting_url.html.erb index a487afae..d2dd0e4c 100644 --- a/app/views/shared/_meeting_url.html.erb +++ b/app/views/shared/_meeting_url.html.erb @@ -35,7 +35,7 @@ data-copy-error="<%= t('copy_error') %>" data-copy-hint="<%= t('url_copy_explanation') %>" > - + <%= icon('clipboard') %> <% else %> @@ -55,7 +55,7 @@ data-copy-error="<%= t('copy_error') %>" data-copy-hint="<%= t('url_copy_explanation') %>" > - + <%= icon('clipboard') %> From 6c374bd0c049a4ab1626148e1280669d8ed31458 Mon Sep 17 00:00:00 2001 From: Zachary Chai Date: Thu, 9 Feb 2017 11:26:49 -0500 Subject: [PATCH 3/5] reorganize stylesheet directory structure --- app/assets/stylesheets/application.css | 2 +- app/assets/stylesheets/fa/gl-fa.scss | 2 ++ app/assets/stylesheets/{ => main}/bbb.scss | 0 app/assets/stylesheets/{ => main}/landing.scss | 0 app/assets/stylesheets/{ => main}/sessions.scss | 0 app/assets/stylesheets/{ => main}/shared.scss | 3 --- config/initializers/assets.rb | 2 +- 7 files changed, 4 insertions(+), 5 deletions(-) create mode 100644 app/assets/stylesheets/fa/gl-fa.scss rename app/assets/stylesheets/{ => main}/bbb.scss (100%) rename app/assets/stylesheets/{ => main}/landing.scss (100%) rename app/assets/stylesheets/{ => main}/sessions.scss (100%) rename app/assets/stylesheets/{ => main}/shared.scss (98%) diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index c1787826..cfe51396 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -29,6 +29,6 @@ * *= require jquery-ui *= require dataTables/bootstrap/3/jquery.dataTables.bootstrap - *= require_tree . + *= require_tree ./main *= require_self */ diff --git a/app/assets/stylesheets/fa/gl-fa.scss b/app/assets/stylesheets/fa/gl-fa.scss new file mode 100644 index 00000000..001bc336 --- /dev/null +++ b/app/assets/stylesheets/fa/gl-fa.scss @@ -0,0 +1,2 @@ +@import "font-awesome-sprockets"; +@import "font-awesome"; diff --git a/app/assets/stylesheets/bbb.scss b/app/assets/stylesheets/main/bbb.scss similarity index 100% rename from app/assets/stylesheets/bbb.scss rename to app/assets/stylesheets/main/bbb.scss diff --git a/app/assets/stylesheets/landing.scss b/app/assets/stylesheets/main/landing.scss similarity index 100% rename from app/assets/stylesheets/landing.scss rename to app/assets/stylesheets/main/landing.scss diff --git a/app/assets/stylesheets/sessions.scss b/app/assets/stylesheets/main/sessions.scss similarity index 100% rename from app/assets/stylesheets/sessions.scss rename to app/assets/stylesheets/main/sessions.scss diff --git a/app/assets/stylesheets/shared.scss b/app/assets/stylesheets/main/shared.scss similarity index 98% rename from app/assets/stylesheets/shared.scss rename to app/assets/stylesheets/main/shared.scss index b79a5f5e..0febf358 100644 --- a/app/assets/stylesheets/shared.scss +++ b/app/assets/stylesheets/main/shared.scss @@ -18,9 +18,6 @@ @import "bootstrap"; @import "bootstrap-social"; -@import "font-awesome-sprockets"; -@import "font-awesome"; - html, body { width: 100%; diff --git a/config/initializers/assets.rb b/config/initializers/assets.rb index 01ef3e66..e56f0bfe 100644 --- a/config/initializers/assets.rb +++ b/config/initializers/assets.rb @@ -8,4 +8,4 @@ Rails.application.config.assets.version = '1.0' # Precompile additional assets. # application.js, application.css, and all non-JS/CSS in app/assets folder are already added. -# Rails.application.config.assets.precompile += %w( search.js ) +Rails.application.config.assets.precompile += %w( fa/gl-fa.css ) From 3dd3f43b24af4f72b1b8aa64cac441b92b9e2ea4 Mon Sep 17 00:00:00 2001 From: Zachary Chai Date: Thu, 9 Feb 2017 11:28:11 -0500 Subject: [PATCH 4/5] serve fa assets from relative root --- app/views/layouts/application.html.erb | 5 +++++ config/environments/production.rb | 2 ++ 2 files changed, 7 insertions(+) diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index fb6dfd07..58ff0dca 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -21,6 +21,11 @@ with BigBlueButton; if not, see . + <% if relative_root != '/b' %> + + <% else %> + <%= stylesheet_link_tag 'fa/gl-fa', media: 'all', 'data-turbolinks-track': 'reload' %> + <% end %> <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %> <%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %> diff --git a/config/environments/production.rb b/config/environments/production.rb index 7ccf92cc..cd23b595 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -87,4 +87,6 @@ Rails.application.configure do # Do not dump schema after migrations. config.active_record.dump_schema_after_migration = false + + config.relative_url_root = ENV['RAILS_RELATIVE_URL_ROOT'] || '/b' end From eacde6bde55c6dd5332f6d6d8c8e9e9843477e7c Mon Sep 17 00:00:00 2001 From: Zachary Chai Date: Thu, 9 Feb 2017 11:34:18 -0500 Subject: [PATCH 5/5] update env doc --- env | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/env b/env index 2c49bf57..b330ddab 100644 --- a/env +++ b/env @@ -1,9 +1,9 @@ # Step 1 - Create a secret key for rails # -# You can generate a secure one through the Greenlight docker image +# You can generate a secure one through the Greenlight docker image # with with the command # -# docker run --rm greenlight rake secret +# docker run --rm bigbluebutton/greenlight rake secret # SECRET_KEY_BASE= @@ -18,6 +18,7 @@ SECRET_KEY_BASE= #BIGBLUEBUTTON_ENDPOINT= #BIGBLUEBUTTON_SECRET= + # If "true", GreenLight will register a webhook callback for each meeting # created. This callback is called for all events that happen in the meeting, # including the processing of its recording. These events are used to update @@ -62,3 +63,10 @@ TWITTER_SECRET= # GOOGLE_OAUTH2_ID= GOOGLE_OAUTH2_SECRET= + +# Prefix for the application's root URL +# Useful for deploying the application to a subdirectory +# +# default: '/b' (recommended) +# +#RAILS_RELATIVE_URL_ROOT=/b