diff --git a/app/constraints/authenticated_constraint.rb b/app/constraints/authenticated_constraint.rb index 5c59d059..9bd45ece 100644 --- a/app/constraints/authenticated_constraint.rb +++ b/app/constraints/authenticated_constraint.rb @@ -2,4 +2,4 @@ class AuthenticatedConstraint def matches?(request) request.session[:user_id].present? end -end \ No newline at end of file +end diff --git a/app/constraints/unauthenticated_constraint.rb b/app/constraints/unauthenticated_constraint.rb index 87f9aca4..7c8b3116 100644 --- a/app/constraints/unauthenticated_constraint.rb +++ b/app/constraints/unauthenticated_constraint.rb @@ -2,4 +2,4 @@ class UnauthenticatedConstraint def matches?(request) request.session[:user_id].nil? end -end \ No newline at end of file +end diff --git a/app/controllers/concerns/authentication.rb b/app/controllers/concerns/authentication.rb index e784cdb5..da010ffa 100644 --- a/app/controllers/concerns/authentication.rb +++ b/app/controllers/concerns/authentication.rb @@ -27,7 +27,7 @@ def authenticate_user! authenticate_user if !user_signed_in? - flash[:notice] = "You need to sign in or sign up before continuing." + flash[:notice] = I18n.t("authentication.unauthenticated") redirect_to new_user_session_path end end diff --git a/app/helpers/navigation_helper.rb b/app/helpers/navigation_helper.rb index 58922915..93aad8fa 100644 --- a/app/helpers/navigation_helper.rb +++ b/app/helpers/navigation_helper.rb @@ -24,12 +24,12 @@ def show_header? def show_bottom_navbar? current_page?(sessions_path) || (user_signed_in? || !current_page?(unauthenticated_root_path)) && - !current_page?(new_registration_path) && - !current_page?(new_user_session_path) && - !current_page?(new_password_reset_path) && - !current_page?(edit_password_reset_path) && - !current_page?(post_submit_password_reset_path) && - !current_page?(coming_soon_path) + !current_page?(new_registration_path) && + !current_page?(new_user_session_path) && + !current_page?(new_password_reset_path) && + !current_page?(edit_password_reset_path) && + !current_page?(post_submit_password_reset_path) && + !current_page?(coming_soon_path) end def title(title) diff --git a/app/views/layouts/_bottom_navbar.html.erb b/app/views/layouts/_bottom_navbar.html.erb index ac026ce4..aa43236a 100644 --- a/app/views/layouts/_bottom_navbar.html.erb +++ b/app/views/layouts/_bottom_navbar.html.erb @@ -59,7 +59,6 @@ <% end %> <% end %> - <%= link_to( notifications_path, class: [ diff --git a/config/locales/en.yml b/config/locales/en.yml index 13af4ee5..0c49b7ab 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -44,6 +44,8 @@ en: live: "Live" starting_soon: "Starting soon" submit: "Apply" + authentication: + unauthenticated: "You need to sign in or sign up before continuing." authorization: unauthorized: "You are not authorized to access this page." session_mailer: diff --git a/config/routes.rb b/config/routes.rb index 1f110f05..bb5debdb 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,5 +1,4 @@ Rails.application.routes.draw do - constraints AuthenticatedConstraint.new do root "sessions#index" end