Skip to content

Commit

Permalink
Move package edit action close to the target
Browse files Browse the repository at this point in the history
Following the conventions used for editing the details of a kiwi image, we're
moving the "Edit Package" button close to the edited details.
  • Loading branch information
danidoni committed Mar 15, 2021
1 parent ac32cef commit e1732dc
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 deletions.
6 changes: 6 additions & 0 deletions src/api/app/views/webui/package/_basic_info.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,9 @@
%i No description set
- else
= render partial: 'webui/shared/collapsible_text', locals: { text: package.description }

- if policy(package).update? && feature_enabled?(:responsive_ux)
.pt-4
= link_to(edit_package_path(project, package), class: 'nav-link', remote: true, title: 'Edit Package') do
%i.fas.fa-edit
%span.nav-item-name Edit Package
1 change: 0 additions & 1 deletion src/api/app/views/webui/package/_show_actions.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
= render partial: 'webui/package/show_actions/submit_package', locals: { package: package, project: project,
revision: revision }
- if User.possibly_nobody.can_modify?(package)
= render partial: 'webui/package/actions/edit_package', locals: { project: project, package: package }
= render partial: 'webui/package/show_actions/delete_package'

- if package.kiwi_image? && policy(package).update?
Expand Down

This file was deleted.

2 changes: 1 addition & 1 deletion src/api/app/views/webui/package/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
.card-body
.row
.col-md-8
= render partial: 'basic_info', locals: { package: @package }
= render partial: 'basic_info', locals: { package: @package, project: @project }
.col-md-4
= render partial: 'side_links', locals: { devel_package: @package.develpackage,
failures: @failures,
Expand Down
3 changes: 2 additions & 1 deletion src/api/app/views/webui/package/update.js.haml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ resetFormValidation();
opacity: 0.25
}, 400, function() {
scrollToInPlace();
$('.in-place-editing').html("#{escape_javascript(render(partial: 'webui/package/basic_info', locals: { package: @package }))}");
$('.in-place-editing').html("#{escape_javascript(render(partial: 'webui/package/basic_info',
locals: { package: @package, project: @project }))}");
setCollapsible();
$('.in-place-editing').animate({ opacity: 1 }, 400, function() {
$('#flash').html("#{escape_javascript(render(layout: false, partial: 'layouts/webui/flash', object: flash))}");
Expand Down

0 comments on commit e1732dc

Please sign in to comment.