Skip to content

Commit

Permalink
[webui] Add Kiwi Image breadcrumb
Browse files Browse the repository at this point in the history
To make easy to navigate in the kiwi images pages. Speacially important now
that we plan to introduce kiwi images packages.
  • Loading branch information
DavidKang authored and Ana06 committed Jul 18, 2017
1 parent a1e0e1c commit 40962d4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/api/app/helpers/webui/kiwi/image_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module Webui::Kiwi::ImageHelper
include Webui::ProjectHelper

def kiwi_image_breadcrumb(kiwi_image, *args)
@project = kiwi_image.package.try(:project)
return unless @project

args.insert(0, link_to_if(params['action'] != 'show', 'Image',
kiwi_image_path(id: kiwi_image)))
project_bread_crumb( *args )
end
end
2 changes: 2 additions & 0 deletions src/api/app/views/webui/kiwi/_tabs.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
});
<% end %>
<% kiwi_image_breadcrumb(@image, @image.name) %>

<div class="box-header header-tabs" id="package_tabs">
<ul>
<%= tab 'kiwi', 'Kiwi', controller: 'kiwi/images', action: 'show', selected: true %>
Expand Down

0 comments on commit 40962d4

Please sign in to comment.