Apply review suggestions
Co-authored-by: Andreas Nedbal <git@pixelde.su> Co-authored-by: Georg Gadinger <nilsding@nilsding.org>
This commit is contained in:
parent
92a5095c00
commit
2d01d9b365
|
@ -6,7 +6,7 @@ class Ajax::AnonymousBlockController < AjaxController
|
||||||
|
|
||||||
question = Question.find(params[:question])
|
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!(
|
AnonymousBlock.create!(
|
||||||
user: params[:global] ? nil : current_user,
|
user: params[:global] ? nil : current_user,
|
||||||
|
|
|
@ -18,8 +18,8 @@
|
||||||
%a.dropdown-item{ href: "#", tabindex: -1, data: { action: "ab-question-report", q_id: a.question.id } }
|
%a.dropdown-item{ href: "#", tabindex: -1, data: { action: "ab-question-report", q_id: a.question.id } }
|
||||||
%i.fa.fa-exclamation-triangle
|
%i.fa.fa-exclamation-triangle
|
||||||
= t("voc.report")
|
= t("voc.report")
|
||||||
- if current_user.has_role?(:moderator) && a.question.anonymous? && !a.question.generated?
|
- if current_user.mod? && a.question.anonymous? && !a.question.generated?
|
||||||
%a.dropdown-item{ name: "mod-block-anon", data: { q_id: a.question.id } }
|
%a.dropdown-item{ href: "#", name: "mod-block-anon", data: { q_id: a.question.id } }
|
||||||
%i.fa.fa-volume-off
|
%i.fa.fa-volume-off
|
||||||
= t("voc.block_site_wide")
|
= t("voc.block_site_wide")
|
||||||
- if current_user.has_role? :administrator
|
- if current_user.has_role? :administrator
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
%a.dropdown-item{ name: "ib-report", data: { q_id: i.question.id } }
|
%a.dropdown-item{ name: "ib-report", data: { q_id: i.question.id } }
|
||||||
%i.fa.fa-fw.fa-warning
|
%i.fa.fa-fw.fa-warning
|
||||||
= t("voc.report")
|
= 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 } }
|
%a.dropdown-item{ name: "mod-block-anon", data: { q_id: i.question.id } }
|
||||||
%i.fa.fa-fw.fa-volume-off
|
%i.fa.fa-fw.fa-volume-off
|
||||||
= t("voc.block_site_wide")
|
= t("voc.block_site_wide")
|
||||||
|
|
|
@ -48,7 +48,7 @@ en:
|
||||||
mod_mute:
|
mod_mute:
|
||||||
confirm:
|
confirm:
|
||||||
title: "Are you sure?"
|
title: "Are you sure?"
|
||||||
text: "This will block this user for everyone."
|
text: "This will mute this user for everyone."
|
||||||
report:
|
report:
|
||||||
confirm:
|
confirm:
|
||||||
title: "Are you sure you want to report this %{type}?"
|
title: "Are you sure you want to report this %{type}?"
|
||||||
|
|
Loading…
Reference in New Issue