diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index a0347fcf..1bf2c6ce 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -57,6 +57,8 @@ a { } .room-section { + position: relative; + height: 45%; background-color: $background-color; } @@ -96,8 +98,9 @@ iframe{ } .feature-stamp { - width: 100px; - height: 100px; + width: 7vw; + height: 7vw; + font-size: 1vw; } html, body { @@ -106,12 +109,16 @@ html, body { background-color: white; } +.resp-header { + font-size: 3.3vw; +} + .font-weight-400 { font-weight: 400; } .wrapper { - min-height: calc(100% - #{$footer-height}); + height: calc(100% - #{$footer-height}); position: relative; } diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 44971d21..e9d6f23b 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -42,6 +42,12 @@ class ApplicationController < ActionController::Base @room.meeting.join_path(current_user.name, opts) end helper_method :owner_meeting_url + + # Determines if a form field needs the is-invalid class. + def form_is_invalid?(obj, key) + 'is-invalid' if !obj.errors.messages[key].empty? + end + helper_method :form_is_invalid? # Default, unconfigured meeting options. def default_meeting_options diff --git a/app/controllers/rooms_controller.rb b/app/controllers/rooms_controller.rb index 254e2783..6a22bfd0 100644 --- a/app/controllers/rooms_controller.rb +++ b/app/controllers/rooms_controller.rb @@ -1,9 +1,7 @@ class RoomsController < ApplicationController before_action :find_room, except: :create - - #before_action :verify_room_ownership - #skip_before_action :verify_room_ownership, only: [:create, :show, :join, :wait] + before_action :verify_room_ownership, only: [:start, :destroy, :home] # POST /r def create diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 95138c44..a3c17818 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -5,14 +5,14 @@ class UsersController < ApplicationController # POST /users def create - user = User.new(user_params) - user.provider = "greenlight" + @user = User.new(user_params) + @user.provider = "greenlight" - if user.save - login(user) + if @user.save + login(@user) else # Handle error on user creation. - + render :new end end diff --git a/app/models/user.rb b/app/models/user.rb index ac1af10b..1e6c24fd 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -12,10 +12,9 @@ class User < ApplicationRecord uniqueness: { case_sensitive: false }, format: {with: /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i } - validates :password, length: { minimum: 6 }, allow_nil: true + validates :password, length: { minimum: 6 }, presence: true, confirmation: true, if: :greenlight_account? - # We don't want to run the validations because they require a user - # to have a password. Users who authenticate via omniauth won't. + # We don't want to require password validations on all accounts. has_secure_password(validations: false) class << self @@ -90,6 +89,10 @@ class User < ApplicationRecord name.split(' ').first end + def greenlight_account? + provider == "greenlight" + end + private # Initializes a room for the user and assign a BigBlueButton user id. diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index c1209583..cc1f00d9 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -8,10 +8,7 @@ <%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %> -
- +