Skip to content

Commit

Permalink
Add ability to report projects
Browse files Browse the repository at this point in the history
  • Loading branch information
danidoni committed Sep 14, 2023
1 parent d5c85cc commit ab89bbe
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/api/app/views/webui/project/_show_actions.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,6 @@
= link_to(image_templates_path, class: 'nav-link', title: 'New Image') do
%i.fas.fa-compact-disc.fa-lg.me-2
%span.nav-item-name New Image

- if policy(Report.new(reportable: project)).create?
= render partial: 'webui/project/show_actions/report_project', locals: { project: project }
3 changes: 3 additions & 0 deletions src/api/app/views/webui/project/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -86,5 +86,8 @@
confirmation_text: "Please confirm deletion of the project '#{@project}'",
action: project_destroy_path(project: @project) })

- if policy(Report.new(reportable: @project)).create?
= render ReportComponent.new(modal_id: 'report-project-modal', options: { object_type: 'Project', user: User.session })

- content_for :ready_function do
initializeDataTable('#inherited-packages-table');
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
%li.nav-item
= link_to('#', class: 'nav-link', id: "js-project-#{project.id}",
data: { 'bs-toggle': 'modal',
'bs-target': '#report-project-modal',
'modal-title': "Report #{project.name}",
'reportable-type': project.class.name,
'reportable-id': project.id }) do
%i.fas.fa-regular.fa-flag.fa-lg.me-2
%span.nav-item-name Report Project

0 comments on commit ab89bbe

Please sign in to comment.