Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #24276 - add resource switcher to facts page #6127

Merged
merged 1 commit into from Oct 31, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 17 additions & 0 deletions app/helpers/fact_values_helper.rb
Expand Up @@ -49,4 +49,21 @@ def fact_origin_icon(origin)
return origin if origin == 'N/A'
image_tag(origin + ".png", :title => origin)
end

def fact_breadcrumbs
breadcrumbs(
items: [
{
caption: _("Facts Values"),
url: (url_for(fact_values_path) if authorized_for(hash_for_fact_values_path))
},
{
caption: params[:host_id]
}
],
resource_url: api_hosts_path(thin: true),
switcher_item_url: host_facts_path(':name'),
switchable: true
)
end
end
16 changes: 1 addition & 15 deletions app/views/fact_values/index.html.erb
@@ -1,20 +1,6 @@
<%
if params[:host_id].present?
breadcrumbs(
items: [
{
caption: _("Facts"),
url: (url_for(fact_values_path) if authorized_for(hash_for_fact_values_path))
},
{
caption: params[:host_id],
url: (host_path(params[:host_id]) if authorized_for(hash_for_host_path(params[:host_id])))
},
{
caption: _('values')
}
]
)
fact_breadcrumbs
else
title(_("Fact Values"))
end
Expand Down