Use full locale path for ban flash message

This commit is contained in:
Andreas Nedbal 2022-07-30 16:29:12 +02:00 committed by Andreas Nedbal
parent 27eaef45ef
commit 4c67a9b492
1 changed files with 3 additions and 3 deletions

View File

@ -23,14 +23,14 @@ class ApplicationController < ActionController::Base
if current_user.present? && current_user.banned?
name = current_user.screen_name
# obligatory '2001: A Space Odyssey' reference
flash[:notice] = t(".banned", name:)
flash[:notice] = t("user.sessions.create.banned", name:)
current_ban = current_user.bans.current.first
unless current_ban&.reason.nil?
flash[:notice] += "\n#{t('.reason', reason: current_ban.reason)}"
flash[:notice] += "\n#{t('user.sessions.create.reason', reason: current_ban.reason)}"
end
unless current_ban&.permanent?
# TODO format banned_until
flash[:notice] += "\n#{t('.until', time: current_ban.expires_at)}"
flash[:notice] += "\n#{t('user.sessions.create.until', time: current_ban.expires_at)}"
end
sign_out current_user
redirect_to new_user_session_path