Skip to content

Commit

Permalink
Refactor bottom_actions Package view: Add partials:
Browse files Browse the repository at this point in the history
- bottom_actions/bugzilla_owner
- bottom_actions/branch_package
- bottom_actions/submit_package
- bottom_actions/edit_description
- bottom_actions/delete_package
- bottom_actions/cloud_upload
- bottom_actions/trigger_services
- bottom_actions/view_kiwi
- bottom_actions/request_deletion
- bottom_action/request_devel_project_change
- bottom_action/request_role_adiction
  • Loading branch information
vpereira committed Sep 18, 2018
1 parent b4d2a7a commit a7f7e49
Show file tree
Hide file tree
Showing 12 changed files with 63 additions and 45 deletions.
64 changes: 19 additions & 45 deletions src/api/app/views/webui2/webui/package/_bottom_actions.html.haml
Original file line number Diff line number Diff line change
@@ -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 }
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit a7f7e49

Please sign in to comment.