diff --git a/app/helpers/persistent_volume_helper/textual_summary.rb b/app/helpers/persistent_volume_helper/textual_summary.rb index 1e042b2c019..c0400768df2 100644 --- a/app/helpers/persistent_volume_helper/textual_summary.rb +++ b/app/helpers/persistent_volume_helper/textual_summary.rb @@ -23,7 +23,7 @@ def textual_group_claim_properties end def textual_group_relationships - TextualGroup.new(_("Relationships"), %i(parent)) + TextualGroup.new(_("Relationships"), %i(parent pods_using_persistent_volume)) end def textual_group_smart_management @@ -40,6 +40,11 @@ def textual_group_capacity # # Items # + def textual_pods_using_persistent_volume + link = url_for_only_path(:id => @record.id, :action => "show", :display => "container_groups") + textual_link(@record.container_groups, :as => ContainerGroup, :link => link) + end + def textual_resource_version @record.resource_version end diff --git a/app/views/layouts/listnav/_persistent_volume.html.haml b/app/views/layouts/listnav/_persistent_volume.html.haml index 74a8b603344..b7c7af1c13a 100644 --- a/app/views/layouts/listnav/_persistent_volume.html.haml +++ b/app/views/layouts/listnav/_persistent_volume.html.haml @@ -15,3 +15,11 @@ = link_to("#{ui_lookup(:table => "ems_container")}: #{@record.parent.name}", polymorphic_path(@record.parent), :title => _("Show this persistent volume's parent Containers Provider")) + - if @record.number_of(:container_groups).zero? + %li.disabled + = link_to(_("%{container_groups} (0)") % {:container_groups => ui_lookup(:tables => "container_groups")}, "#") + - else + %li + = link_to(_("%{container_groups} (%{count})") % {:container_groups => ui_lookup(:table => "container_groups"), + :count => @record.number_of(:container_groups)}, + url_for_only_path(:id => @record.id, :action => "show", :display => "container_groups")) diff --git a/app/views/persistent_volume/show.html.haml b/app/views/persistent_volume/show.html.haml index 4300d07738d..7b4746338b1 100644 --- a/app/views/persistent_volume/show.html.haml +++ b/app/views/persistent_volume/show.html.haml @@ -1,4 +1,4 @@ -- if @display == 'containers' +- if %w(containers container_groups).include?(@display) = render :partial => "layouts/gtl", :locals => {:action_url => "show/#{@record.id}"} - elsif @showtype == 'main' = render :partial => "layouts/textual_groups_generic"