Skip to content

Commit

Permalink
Add UI support for Pod to PV relationship
Browse files Browse the repository at this point in the history
refactored small mistakes

refactored small mistakes

refactored small mistakes

refactored small mistakes

refactoring

refactoring

refactored navbar
  • Loading branch information
nimrodshn committed Apr 24, 2017
1 parent 03689c2 commit 09f55cd
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
7 changes: 6 additions & 1 deletion app/helpers/persistent_volume_helper/textual_summary.rb
Original file line number Diff line number Diff line change
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 @@ -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
Expand Down
7 changes: 7 additions & 0 deletions app/views/layouts/listnav/_persistent_volume.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,10 @@
= 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) == 0
%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
Original file line number Diff line number Diff line change
@@ -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 09f55cd

Please sign in to comment.