diff --git a/src/api/app/views/webui2/webui/package/_bottom_actions.html.haml b/src/api/app/views/webui2/webui/package/_bottom_actions.html.haml index 7a2dab3c12f..8b3f2acd209 100644 --- a/src/api/app/views/webui2/webui/package/_bottom_actions.html.haml +++ b/src/api/app/views/webui2/webui/package/_bottom_actions.html.haml @@ -1,58 +1,32 @@ -# FIXME: Refactor this file %ul.list-inline.mb-0 - if bugowners_mail.present? && configuration['bugzilla_url'] - %li.list-inline-item - = link_to(bugzilla_url(bugowners_mail, "#{project.name}/#{package.name}: Bug"), class: 'nav-link') do - %i.fas.fa-bug.text-danger - Report Bug + = render partial: 'webui2/webui/package/bottom_actions/bugzilla_owner', locals: { bugowners_mail: bugowners_mail, + package_name: package.name, project_name: project.name } - unless User.current.is_nobody? - if current_rev - %li.list-inline-item - = link_to('#', class: 'nav-link', data: { toggle: 'modal', target: '#branch-modal' }) do - %i.fas.fa-code-branch.text-primary - Branch package - %li.list-inline-item - = link_to(package_submit_request_dialog_path(project: project, package: package, revision: revision), remote: true, class: 'nav-link') do - %i.fas.fa-share-square.text-obs-yellow - Submit package + = render partial: 'webui2/webui/package/bottom_actions/branch_package' + = render partial: 'webui2/webui/package/bottom_actions/submit_package', locals: { package: package, project: project, + revision: revision } - if User.current.can_modify?(package) - %li.list-inline-item - = link_to(package_edit_path(project: project, package: package, spec_count: spec_count), class: 'nav-link') do - %i.fas.fa-edit.text-info - Edit description - %li.list-inline-item - = link_to('#', class: 'nav-link', data: { toggle: 'modal', target: '#delete-modal' }) do - %i.fas.fa-times-circle.text-danger - Delete package + = render partial: 'webui2/webui/package/bottom_actions/edit_description', locals: { project: project, package: package, spec_count: spec_count } + = render partial: 'webui2/webui/package/bottom_actions/delete_package' + - Feature.with(:kiwi_image_editor) do - if package.kiwi_image? && policy(package).update? - %li.list-inline-item - = link_to(import_kiwi_image_path(package.id), id: 'edit-kiwi', class: 'nav-link') do - %i.fas.fa-compact-disc.text-primary - View Image - - if Feature.active?(:cloud_upload) && !User.current.is_nobody? + = render partial: 'webui2/webui/package/bottom_actions/view_kiwi', locals: { package_id: package.id } + + - if Feature.active?(:cloud_upload) - if package.kiwi_image? - %li.list-inline-item - = link_to(cloud_upload_index_path, id: 'cloud-upload', class: 'nav-link') do - %i.fas.fa-cloud-upload-alt.text-info - Cloud Upload + = render partial: 'webui2/webui/package/bottom_actions/cloud_upload', locals: { cloud_upload_index_path: cloud_upload_index_path } + - if services.present? - %li.list-inline-item - = link_to(package_trigger_services_path(package: package, project: project), method: :post, class: 'nav-link') do - %i.fas.fa-project-diagram.text-obs-yellow - Trigger services + = render partial: 'webui2/webui/package/bottom_actions/trigger_services', locals: { package: package, project: project } + - else - %li.list-inline-item - = link_to('#', class: 'nav-link', data: { toggle: 'modal', target: '#add-role-modal' }) do - %i.fas.fa-user-plus.text-primary - Request role addition - %li.list-inline-item - = link_to('#', class: 'nav-link', data: { toggle: 'modal', target: '#delete-request-modal' }) do - %i.fas.fa-list-alt.text-danger - Request deletion + = render partial: 'webui2/webui/package/bottom_actions/request_role_addition' + = render partial: 'webui2/webui/package/bottom_actions/request_deletion' + //TODO: only users w/o rights should see this, maintainers should get a different dialog: - if package.develpackage - %li.list-inline-item - = link_to(request_change_devel_dialog_path(project: project, package: package), remote: true, class: 'nav-link') do - %i.fas.fa-exchange-alt.text-primary - Request devel project change + = render partial: 'webui2/webui/package/bottom_actions/request_devel_project_change', locals: { package: package, project: project } diff --git a/src/api/app/views/webui2/webui/package/bottom_actions/_branch_package.html.haml b/src/api/app/views/webui2/webui/package/bottom_actions/_branch_package.html.haml new file mode 100644 index 00000000000..5a6d69c14e4 --- /dev/null +++ b/src/api/app/views/webui2/webui/package/bottom_actions/_branch_package.html.haml @@ -0,0 +1,4 @@ +%li.list-inline-item + = link_to('#', class: 'nav-link', data: { toggle: 'modal', target: '#branch-modal' }) do + %i.fas.fa-code-branch.text-primary + Branch package diff --git a/src/api/app/views/webui2/webui/package/bottom_actions/_bugzilla_owner.html.haml b/src/api/app/views/webui2/webui/package/bottom_actions/_bugzilla_owner.html.haml new file mode 100644 index 00000000000..af64e521dfb --- /dev/null +++ b/src/api/app/views/webui2/webui/package/bottom_actions/_bugzilla_owner.html.haml @@ -0,0 +1,4 @@ +%li.list-inline-item + = link_to(bugzilla_url(bugowners_mail, "#{project_name}/#{package_name}: Bug"), class: 'nav-link') do + %i.fas.fa-bug.text-danger + Report Bug diff --git a/src/api/app/views/webui2/webui/package/bottom_actions/_cloud_upload.html.haml b/src/api/app/views/webui2/webui/package/bottom_actions/_cloud_upload.html.haml new file mode 100644 index 00000000000..66bebd6284e --- /dev/null +++ b/src/api/app/views/webui2/webui/package/bottom_actions/_cloud_upload.html.haml @@ -0,0 +1,4 @@ +%li.list-inline-item + = link_to(cloud_upload_index_path, id: 'cloud-upload', class: 'nav-link') do + %i.fas.fa-cloud-upload-alt.text-info + Cloud Upload diff --git a/src/api/app/views/webui2/webui/package/bottom_actions/_delete_package.html.haml b/src/api/app/views/webui2/webui/package/bottom_actions/_delete_package.html.haml new file mode 100644 index 00000000000..4b5219bd988 --- /dev/null +++ b/src/api/app/views/webui2/webui/package/bottom_actions/_delete_package.html.haml @@ -0,0 +1,4 @@ +%li.list-inline-item + = link_to('#', class: 'nav-link', data: { toggle: 'modal', target: '#delete-modal' }) do + %i.fas.fa-times-circle.text-danger + Delete package diff --git a/src/api/app/views/webui2/webui/package/bottom_actions/_edit_description.html.haml b/src/api/app/views/webui2/webui/package/bottom_actions/_edit_description.html.haml new file mode 100644 index 00000000000..c712115fa5b --- /dev/null +++ b/src/api/app/views/webui2/webui/package/bottom_actions/_edit_description.html.haml @@ -0,0 +1,4 @@ +%li.list-inline-item + = link_to(package_edit_path(project: project, package: package, spec_count: spec_count), class: 'nav-link') do + %i.fas.fa-edit.text-info + Edit description diff --git a/src/api/app/views/webui2/webui/package/bottom_actions/_request_deletion.html.haml b/src/api/app/views/webui2/webui/package/bottom_actions/_request_deletion.html.haml new file mode 100644 index 00000000000..04d4b082867 --- /dev/null +++ b/src/api/app/views/webui2/webui/package/bottom_actions/_request_deletion.html.haml @@ -0,0 +1,4 @@ +%li.list-inline-item + = link_to('#', class: 'nav-link', data: { toggle: 'modal', target: '#delete-request-modal' }) do + %i.fas.fa-list-alt.text-danger + Request deletion diff --git a/src/api/app/views/webui2/webui/package/bottom_actions/_request_devel_project_change.html.haml b/src/api/app/views/webui2/webui/package/bottom_actions/_request_devel_project_change.html.haml new file mode 100644 index 00000000000..f791245b687 --- /dev/null +++ b/src/api/app/views/webui2/webui/package/bottom_actions/_request_devel_project_change.html.haml @@ -0,0 +1,4 @@ +%li.list-inline-item + = link_to(request_change_devel_dialog_path(project: project, package: package), remote: true, class: 'nav-link') do + %i.fas.fa-exchange-alt.text-primary + Request devel project change diff --git a/src/api/app/views/webui2/webui/package/bottom_actions/_request_role_addition.html.haml b/src/api/app/views/webui2/webui/package/bottom_actions/_request_role_addition.html.haml new file mode 100644 index 00000000000..af5a8ba2b62 --- /dev/null +++ b/src/api/app/views/webui2/webui/package/bottom_actions/_request_role_addition.html.haml @@ -0,0 +1,4 @@ +%li.list-inline-item + = link_to('#', class: 'nav-link', data: { toggle: 'modal', target: '#add-role-modal' }) do + %i.fas.fa-user-plus.text-primary + Request role addition diff --git a/src/api/app/views/webui2/webui/package/bottom_actions/_submit_package.html.haml b/src/api/app/views/webui2/webui/package/bottom_actions/_submit_package.html.haml new file mode 100644 index 00000000000..c6cfe43894c --- /dev/null +++ b/src/api/app/views/webui2/webui/package/bottom_actions/_submit_package.html.haml @@ -0,0 +1,4 @@ +%li.list-inline-item + = link_to(package_submit_request_dialog_path(project: project, package: package, revision: revision), remote: true, class: 'nav-link') do + %i.fas.fa-share-square.text-obs-yellow + Submit package diff --git a/src/api/app/views/webui2/webui/package/bottom_actions/_trigger_services.html.haml b/src/api/app/views/webui2/webui/package/bottom_actions/_trigger_services.html.haml new file mode 100644 index 00000000000..02dd2558b31 --- /dev/null +++ b/src/api/app/views/webui2/webui/package/bottom_actions/_trigger_services.html.haml @@ -0,0 +1,4 @@ +%li.list-inline-item + = link_to(package_trigger_services_path(package: package, project: project), method: :post, class: 'nav-link') do + %i.fas.fa-project-diagram.text-obs-yellow + Trigger services diff --git a/src/api/app/views/webui2/webui/package/bottom_actions/_view_kiwi.html.haml b/src/api/app/views/webui2/webui/package/bottom_actions/_view_kiwi.html.haml new file mode 100644 index 00000000000..2dafc5da1d6 --- /dev/null +++ b/src/api/app/views/webui2/webui/package/bottom_actions/_view_kiwi.html.haml @@ -0,0 +1,4 @@ +%li.list-inline-item + = link_to(import_kiwi_image_path(package_id), id: 'edit-kiwi', class: 'nav-link') do + %i.fas.fa-compact-disc.text-primary + View Image