From 1e267c80313a650b5bb715975a629e5f62649d39 Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Sat, 10 Aug 2024 01:44:53 +0200 Subject: [PATCH] Add no sign-up locale variant for "require user" option --- app/views/application/_questionbox.html.haml | 10 +++++++--- config/locales/views.en.yml | 3 +++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/app/views/application/_questionbox.html.haml b/app/views/application/_questionbox.html.haml index 447c123c2..a5a9089b2 100644 --- a/app/views/application/_questionbox.html.haml +++ b/app/views/application/_questionbox.html.haml @@ -19,9 +19,13 @@ %strong= t(".status.locked") - elsif !user_signed_in? && user.privacy_require_user? .text-center - %strong= t(".status.require_user_html", - sign_in: link_to(t("voc.login"), new_user_session_path), - sign_up: link_to(t("voc.register"), new_user_registration_path)) + - if Retrospring::Config.registrations_enabled? + %strong= t(".status.require_user_html", + sign_in: link_to(t("voc.login"), new_user_session_path), + sign_up: link_to(t("voc.register"), new_user_registration_path)) + - else + %strong= t(".status.require_user_no_registration_html", + sign_in: link_to(t("voc.login"), new_user_session_path)) - else - if user_signed_in? || user.privacy_allow_anonymous_questions? #question-box{ diff --git a/config/locales/views.en.yml b/config/locales/views.en.yml index c938bf06e..ecdf11aad 100644 --- a/config/locales/views.en.yml +++ b/config/locales/views.en.yml @@ -143,6 +143,9 @@ en: require_user_html: | This user requires others to be logged in to ask questions.
(%{sign_in} or %{sign_up}) + require_user_no_registration_html: | + This user requires others to be logged in to ask questions.
+ (%{sign_in}) non_anonymous_html: | This user does not want to receive anonymous questions.
(%{sign_in} or %{sign_up})