Skip to content

Commit

Permalink
Merge pull request #682 from nimrodshn/add_pvc_relationship
Browse files Browse the repository at this point in the history
Add UI support for Pod to PV relationship
(cherry picked from commit 5630694)

https://bugzilla.redhat.com/show_bug.cgi?id=1447049
  • Loading branch information
Martin Povolny authored and simaishi committed May 1, 2017
1 parent c54b613 commit 99a0258
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
7 changes: 6 additions & 1 deletion app/helpers/persistent_volume_helper/textual_summary.rb
Expand Up @@ -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
Expand All @@ -38,6 +38,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
Expand Down
8 changes: 8 additions & 0 deletions app/views/layouts/listnav/_persistent_volume.html.haml
Expand Up @@ -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"))
2 changes: 1 addition & 1 deletion 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"

0 comments on commit 99a0258

Please sign in to comment.