diff --git a/src/api/app/views/webui/project/_show_actions.html.haml b/src/api/app/views/webui/project/_show_actions.html.haml index ff750391c49..a5185420303 100644 --- a/src/api/app/views/webui/project/_show_actions.html.haml +++ b/src/api/app/views/webui/project/_show_actions.html.haml @@ -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 } diff --git a/src/api/app/views/webui/project/show.html.haml b/src/api/app/views/webui/project/show.html.haml index d7bee5ccd24..eac2fa56deb 100644 --- a/src/api/app/views/webui/project/show.html.haml +++ b/src/api/app/views/webui/project/show.html.haml @@ -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'); diff --git a/src/api/app/views/webui/project/show_actions/_report_project.html.haml b/src/api/app/views/webui/project/show_actions/_report_project.html.haml new file mode 100644 index 00000000000..878e03abe65 --- /dev/null +++ b/src/api/app/views/webui/project/show_actions/_report_project.html.haml @@ -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