mirror of
https://github.com/Retrospring/retrospring.git
synced 2025-03-31 05:02:14 +02:00
Fix unprivileged comment actions being visible
- Fixes an error when viewing answers containing comments while not logged in - Hides the report option while not logged in
This commit is contained in:
parent
3135f333e6
commit
6b771887ab
1 changed files with 2 additions and 2 deletions
|
@ -6,11 +6,11 @@
|
||||||
%a.dropdown-item.text-danger{ href: "#", data: { action: "ab-comment-destroy", c_id: comment.id } }
|
%a.dropdown-item.text-danger{ href: "#", data: { action: "ab-comment-destroy", c_id: comment.id } }
|
||||||
%i.fa.fa-fw.fa-trash-o
|
%i.fa.fa-fw.fa-trash-o
|
||||||
= t("voc.delete")
|
= t("voc.delete")
|
||||||
- unless comment.user == current_user
|
- if user_signed_in? && comment.user != current_user
|
||||||
%a.dropdown-item{ href: "#", data: { action: "ab-comment-report", c_id: comment.id } }
|
%a.dropdown-item{ href: "#", data: { action: "ab-comment-report", c_id: comment.id } }
|
||||||
%i.fa.fa-fw.fa-exclamation-triangle
|
%i.fa.fa-fw.fa-exclamation-triangle
|
||||||
= t("voc.report")
|
= t("voc.report")
|
||||||
- if current_user.admin?
|
- if user_signed_in? && current_user&.admin?
|
||||||
%a.dropdown-item{ href: rails_admin_path_for_resource(comment), target: "_blank" }
|
%a.dropdown-item{ href: rails_admin_path_for_resource(comment), target: "_blank" }
|
||||||
%i.fa.fa-fw.fa-gears
|
%i.fa.fa-fw.fa-gears
|
||||||
= t("voc.view_in_rails_admin")
|
= t("voc.view_in_rails_admin")
|
||||||
|
|
Loading…
Reference in a new issue