Apply review suggestions

Co-authored-by: Andreas Nedbal <git@pixelde.su>
Co-authored-by: Georg Gadinger <nilsding@nilsding.org>
This commit is contained in:
Karina Kwiatek 2022-08-17 22:25:34 +02:00
parent 92a5095c00
commit 2d01d9b365
4 changed files with 5 additions and 5 deletions

View File

@ -6,7 +6,7 @@ class Ajax::AnonymousBlockController < AjaxController
question = Question.find(params[:question])
raise Errors::Forbidden if params[:global] && !current_user.has_role?(:moderator)
raise Errors::Forbidden if params[:global] && !current_user.mod?
AnonymousBlock.create!(
user: params[:global] ? nil : current_user,

View File

@ -18,8 +18,8 @@
%a.dropdown-item{ href: "#", tabindex: -1, data: { action: "ab-question-report", q_id: a.question.id } }
%i.fa.fa-exclamation-triangle
= t("voc.report")
- if current_user.has_role?(:moderator) && a.question.anonymous? && !a.question.generated?
%a.dropdown-item{ name: "mod-block-anon", data: { q_id: a.question.id } }
- if current_user.mod? && a.question.anonymous? && !a.question.generated?
%a.dropdown-item{ href: "#", name: "mod-block-anon", data: { q_id: a.question.id } }
%i.fa.fa-volume-off
= t("voc.block_site_wide")
- if current_user.has_role? :administrator

View File

@ -24,7 +24,7 @@
%a.dropdown-item{ name: "ib-report", data: { q_id: i.question.id } }
%i.fa.fa-fw.fa-warning
= t("voc.report")
- if current_user.has_role?(:moderator) && i.question.anonymous? && !i.question.generated?
- if current_user.mod? && i.question.anonymous? && !i.question.generated?
%a.dropdown-item{ name: "mod-block-anon", data: { q_id: i.question.id } }
%i.fa.fa-fw.fa-volume-off
= t("voc.block_site_wide")

View File

@ -48,7 +48,7 @@ en:
mod_mute:
confirm:
title: "Are you sure?"
text: "This will block this user for everyone."
text: "This will mute this user for everyone."
report:
confirm:
title: "Are you sure you want to report this %{type}?"