Skip to content

Commit

Permalink
Add ability to report users
Browse files Browse the repository at this point in the history
  • Loading branch information
rubhanazeem committed Sep 14, 2023
1 parent c666514 commit 13e1286
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/api/app/views/webui/user/_basic_info.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@

.basic-info
.d-flex.flex-row-reverse
- if policy(Report.new(reportable: user)).create?
= link_to('#', id: "js-user-#{user.id}", class: 'ps-2',
data: { 'bs-toggle': 'modal',
'bs-target': '#report-user-modal',
'modal-title': "Report #{user.login}",
'reportable-type': user.class.name,
'reportable-id': user.id }) do
%i.fas.fa-regular.fa-flag
%span.nav-item-name Report
- if User.possibly_nobody.is_admin?
= link_to('#', title: 'Delete user', class: 'ms-2', data: { 'bs-toggle': 'modal', 'bs-target': '#delete-user-modal' }) do
%i.fas.fa-times-circle.text-danger
Expand Down Expand Up @@ -39,6 +48,7 @@
%i.fas.fa-envelope.me-1
= user.email

= render ReportComponent.new(modal_id: 'report-user-modal', options: { object_type: 'User', user: User.session })

:javascript
$('#toggle-in-place-editing').on('click', function () {
Expand Down

0 comments on commit 13e1286

Please sign in to comment.