diff --git a/app/views/application/_questionbox.html.haml b/app/views/application/_questionbox.html.haml index fd9ceb36..09183122 100644 --- a/app/views/application/_questionbox.html.haml +++ b/app/views/application/_questionbox.html.haml @@ -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)) diff --git a/lib/errors.rb b/lib/errors.rb index 5414f7f8..1a887285 100644 --- a/lib/errors.rb +++ b/lib/errors.rb @@ -51,6 +51,9 @@ module Errors class Blocked < Forbidden end + class LoginRequired < Forbidden + end + class OtherBlockedSelf < Blocked end