Show message in questionbox that users need to log in

This commit is contained in:
Andreas Nedbal 2022-11-13 14:27:33 +01:00
parent 32d270113d
commit 16c6e7c096
2 changed files with 8 additions and 1 deletions

View File

@ -14,6 +14,9 @@
- elsif user_signed_in? && user.blocking?(current_user)
.text-center
%strong= t(".status.blocked")
- 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))
- else
- if user_signed_in? || user.privacy_allow_anonymous_questions?
#question-box{ data: { controller: "character-count", "character-count-max-value": 512 }}
@ -51,4 +54,5 @@
.col-xs-12.col-sm-10.offset-sm-1.text-center
%small= t(".promote.join", app_title: APP_CONFIG["site_name"])
- else
%p= raw t(".required", signup: link_to(t("voc.register"), new_user_registration_path))
.text-center
%strong= t(".status.non_anonymous_html", sign_in: link_to(t("voc.login"), new_user_session_path), sign_up: link_to(t("voc.register"), new_user_registration_path))

View File

@ -51,6 +51,9 @@ module Errors
class Blocked < Forbidden
end
class LoginRequired < Forbidden
end
class OtherBlockedSelf < Blocked
end