From 46bb456063cb5f13d8d067d673d6b54bc5db26ce Mon Sep 17 00:00:00 2001 From: Josh Date: Mon, 11 Jun 2018 17:32:08 -0400 Subject: [PATCH] error pages and rec row --- app/assets/stylesheets/application.scss | 14 +++++++++++++- app/controllers/rooms_controller.rb | 7 +++++++ app/controllers/users_controller.rb | 11 +++++++++-- app/helpers/application_helper.rb | 9 +++++++++ app/views/errors/internal_error.html.erb | 17 +++++++++++------ app/views/errors/not_found.html.erb | 18 +++++++++++------- app/views/errors/unprocessable.html.erb | 17 +++++++++++------ app/views/layouts/application.html.erb | 4 ++++ app/views/main/index.html.erb | 2 +- app/views/rooms/show.html.erb | 2 +- app/views/shared/_error_banner.html.erb | 6 ++++++ app/views/shared/_header.html.erb | 7 +++++-- .../shared/components/_recording_row.html.erb | 18 ++++++++++++------ app/views/shared/components/_subtitle.html.erb | 2 +- app/views/shared/modals/_login_modal.html.erb | 6 +++--- config/application.rb | 17 +++++++++++++---- 16 files changed, 117 insertions(+), 40 deletions(-) create mode 100644 app/views/shared/_error_banner.html.erb diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index 0c7451b0..3ab92069 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -56,12 +56,24 @@ a { flex-direction: column; } -.room-section { +.table-responsive { + overflow: visible; +} + +.landing-section { position: relative; height: 45%; background-color: $background-color; } +.room-section { + background-color: $background-color; +} + +.danger-section { + background-color: #efe6e6; +} + .start-block { background-color: white; border: 3px solid lightblue; diff --git a/app/controllers/rooms_controller.rb b/app/controllers/rooms_controller.rb index 10769815..e6dcadc3 100644 --- a/app/controllers/rooms_controller.rb +++ b/app/controllers/rooms_controller.rb @@ -90,6 +90,13 @@ class RoomsController < ApplicationController redirect_to @room end + # PATCH /r/:room_uid/:record_id + def update_recording + bbb.publish_recordings(params[:record_id], params[:publish]) + + + end + # DELETE /r/:room_uid/:record_id def delete_recording @room.delete_recording(params[:record_id]) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index a3c17818..aa6f6523 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -5,6 +5,9 @@ class UsersController < ApplicationController # POST /users def create + # Verify that GreenLight is configured to allow user signup. + return unless Rails.configuration.allow_user_signup + @user = User.new(user_params) @user.provider = "greenlight" @@ -17,8 +20,12 @@ class UsersController < ApplicationController end # GET /signup - def new - @user = User.new + def new + if Rails.configuration.allow_user_signup + @user = User.new + else + redirect_to root_path + end end # GET /users/:user_uid/edit diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 26747c06..09c9f44e 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -12,4 +12,13 @@ module ApplicationHelper def omniauth_login_url(provider) "/auth/#{provider}" end + + # Determine if Greenlight is configured to allow user signups. + def allow_user_signup? + Rails.configuration.allow_user_signup + end + + def bigbluebutton_endpoint_default? + Rails.configuration.bigbluebutton_endpoint_default == Rails.configuration.bigbluebutton_endpoint + end end diff --git a/app/views/errors/internal_error.html.erb b/app/views/errors/internal_error.html.erb index 01489b7a..cf0411aa 100644 --- a/app/views/errors/internal_error.html.erb +++ b/app/views/errors/internal_error.html.erb @@ -1,7 +1,12 @@ -
-

Oh no!

-

Looks like something went wrong on our end.

- <%= link_to root_url do %> -

Return to home page.

- <% end %> +
+
+
+
500
+

Oh no! Looks like something went wrong on our end.

+

The error has been logged, we'll take a look!

+ + Go back + +
+
diff --git a/app/views/errors/not_found.html.erb b/app/views/errors/not_found.html.erb index f4e15fa4..b20f70ac 100644 --- a/app/views/errors/not_found.html.erb +++ b/app/views/errors/not_found.html.erb @@ -1,8 +1,12 @@ -
-

Whoops!

-

Looks like we can't find that resource.

-

Is it possible its been removed?

- <%= link_to root_url do %> -

Return to home page.

- <% end %> +
+
+
+
404
+

Whoops! Looks like we can't find that.

+

Is it possible its been removed?

+ + Go back + +
+
diff --git a/app/views/errors/unprocessable.html.erb b/app/views/errors/unprocessable.html.erb index a2926872..41bb9ece 100644 --- a/app/views/errors/unprocessable.html.erb +++ b/app/views/errors/unprocessable.html.erb @@ -1,7 +1,12 @@ -
-

Oops!

-

Request is unprocessable.

- <%= link_to root_url do %> -

Return to home page.

- <% end %> +
+
+
+
422
+

Oops! Request is unprocessable.

+

Unforunately this isn't a valid request.

+ + Go back + +
+
diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index cc1f00d9..0d8649cc 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -27,6 +27,10 @@ <%= render "shared/header" %> + <% if bigbluebutton_endpoint_default? %> + <%= render "shared/error_banner" %> + <% end %> + <%= yield %> diff --git a/app/views/main/index.html.erb b/app/views/main/index.html.erb index b5992157..3a447db9 100644 --- a/app/views/main/index.html.erb +++ b/app/views/main/index.html.erb @@ -1,4 +1,4 @@ -
+

Welcome to BigBlueButton.

diff --git a/app/views/rooms/show.html.erb b/app/views/rooms/show.html.erb index a8a3197b..fa87f9b7 100644 --- a/app/views/rooms/show.html.erb +++ b/app/views/rooms/show.html.erb @@ -35,7 +35,7 @@
-
+
<% if current_user.rooms.length > 1 %> <% current_user.rooms.each do |room| %>
diff --git a/app/views/shared/_error_banner.html.erb b/app/views/shared/_error_banner.html.erb new file mode 100644 index 00000000..6d6f31eb --- /dev/null +++ b/app/views/shared/_error_banner.html.erb @@ -0,0 +1,6 @@ +
+ +

 This deployment is using a pre-configured testing server, + you should replace this with your own. + For details, see the <%= link_to "documentation", "http://docs.bigbluebutton.org/install/green-light.html#installing-greenlight", target: "_blank" %>.

+
diff --git a/app/views/shared/_header.html.erb b/app/views/shared/_header.html.erb index 9c12efa2..25032ec0 100644 --- a/app/views/shared/_header.html.erb +++ b/app/views/shared/_header.html.erb @@ -10,7 +10,7 @@ <%= image_tag("logo_with_text.png", class: "header-brand-img") %> <% end %> <% end %> - +
<% if current_user %> @@ -45,7 +45,10 @@
<% else %> <%= link_to "Login", "#loginModal", :class => "btn btn-pill btn-outline-primary mx-2", "data-toggle": "modal" %> - <%= link_to "Signup", signup_path, :class => "btn btn-pill btn-outline-primary mx-2" %> + + <% if allow_user_signup? %> + <%= link_to "Signup", signup_path, :class => "btn btn-pill btn-outline-primary mx-2" %> + <% end %> <%= render "shared/modals/login_modal" %> <% end %> diff --git a/app/views/shared/components/_recording_row.html.erb b/app/views/shared/components/_recording_row.html.erb index 6a0e122e..c1056e8f 100644 --- a/app/views/shared/components/_recording_row.html.erb +++ b/app/views/shared/components/_recording_row.html.erb @@ -26,21 +26,27 @@ <%= recording[:participants] %> -
- Visibility + - <%= recording[:state].capitalize %> <% recording[:playbacks].each do |p| %> - <%= link_to p[:type].capitalize, p[:url], class: "btn btn-secondary", target: "_blank" %> + <%= link_to p[:type].capitalize, p[:url], class: "btn btn-sm btn-primary", target: "_blank" %> <% end %>