From 1290e608898ca0b2a956023fe8f97c0853107ead Mon Sep 17 00:00:00 2001 From: Jeremy Friesen Date: Tue, 16 Apr 2024 10:28:07 -0400 Subject: [PATCH] Fixing docker build --- Gemfile.lock | 2 +- app/assets/javascripts/application.js | 2 - .../themes/cultural_repository.scss | 6 +-- .../themes/neutral_repository.scss | 4 +- app/controllers/application_controller.rb | 37 ++++++++++--------- 5 files changed, 25 insertions(+), 26 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index ba48f5e8db..8b14e016b9 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -481,7 +481,7 @@ GEM railties (>= 4.1.0) responders warden (~> 1.2.3) - devise-guests (0.8.1) + devise-guests (0.8.2) devise devise-i18n (1.12.0) devise (>= 4.9.0) diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index cc77aba01a..48040d1593 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -20,8 +20,6 @@ //= require dataTables.bootstrap4 //= require cropper.min -//= require dataTables/jquery.dataTables -//= require dataTables/bootstrap/3/jquery.dataTables.bootstrap //= require stat_slider //= require turbolinks //= require cocoon diff --git a/app/assets/stylesheets/themes/cultural_repository.scss b/app/assets/stylesheets/themes/cultural_repository.scss index fc451c0c74..200da8559b 100644 --- a/app/assets/stylesheets/themes/cultural_repository.scss +++ b/app/assets/stylesheets/themes/cultural_repository.scss @@ -14,7 +14,7 @@ body.dashboard { padding-top: 100px !important; - @media (max-width: $screen-md-min) { + @media (max-width: 992px) { padding-top: 0 !important; } @@ -162,7 +162,7 @@ .facet-panel-background-color { background-color: #ffffff; - @media (max-width: $screen-md-min) { + @media (max-width: 992px) { background-color: transparent; } @@ -255,7 +255,7 @@ } } - @media screen and (max-width: $screen-md-min) { + @media screen and (max-width: 992px) { div.recently-uploaded:nth-of-type(2n+3), div.featured-works-6-column-layout:nth-of-type(2n+3), div.featured-works-4-column-layout:nth-of-type(2n+3) { diff --git a/app/assets/stylesheets/themes/neutral_repository.scss b/app/assets/stylesheets/themes/neutral_repository.scss index ec037fa896..26639ca41a 100644 --- a/app/assets/stylesheets/themes/neutral_repository.scss +++ b/app/assets/stylesheets/themes/neutral_repository.scss @@ -152,13 +152,13 @@ ////// Media Queries ////// - @media (max-width: $screen-md-min) { + @media (max-width: 992px) { div.neutral-repository-collections:nth-of-type(2n+3) { clear: left; } } - @media (min-width: $screen-md-min) { + @media (min-width: 992px) { div.neutral-repository-collections:nth-of-type(3n+4) { clear: left; } diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 127d1137e2..7264610533 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -34,24 +34,6 @@ def hidden? current_account.persisted? && !current_account.is_public? end - # Override method from devise-guests v0.7.0 to prevent the application - # from attempting to create duplicate guest users - def guest_user - return @guest_user if @guest_user - if session[:guest_user_id] - # Override - added #unscoped to include guest users who are filtered out of User queries by default - @guest_user = User.unscoped.find_by(User.authentication_keys.first => session[:guest_user_id]) rescue nil - @guest_user = nil if @guest_user.respond_to? :guest and !@guest_user.guest - end - @guest_user ||= begin - u = create_guest_user(session[:guest_user_id]) - session[:guest_user_id] = u.send(User.authentication_keys.first) - u - end - @guest_user - end - - def api_or_pdf? request.format.to_s.match('json') || params[:print] || @@ -90,6 +72,25 @@ def super_and_current_users users end + # Override method from devise-guests v0.8.2 to prevent the application from + # attempting to create duplicate guest users; namely by adding the + # User.unscoped + def guest_user + return @guest_user if @guest_user + if session[:guest_user_id] + # Override - added #unscoped to include guest users who are filtered out of User queries by default + @guest_user = User.unscoped.find_by(User.authentication_keys.first => session[:guest_user_id]) rescue nil + @guest_user = nil if @guest_user.respond_to? :guest and !@guest_user.guest + end + @guest_user ||= begin + u = create_guest_user(session[:guest_user_id]) + session[:guest_user_id] = u.send(User.authentication_keys.first) + u + end + @guest_user + end + + private def require_active_account!