diff --git a/app/helpers/service_helper.rb b/app/helpers/service_helper.rb index 2825b9aede9..15d3a39698a 100644 --- a/app/helpers/service_helper.rb +++ b/app/helpers/service_helper.rb @@ -1,3 +1,19 @@ module ServiceHelper include TextualSummary + + def child_service_summary(child_services) + rows = [] + data = {:title => _("Child Services"), :mode => "miq_child_services"} + child_services.sort_by { |o| o.name.downcase }.each do |service| + rows.push( + { + :cells => [{:icon => 'pficon pficon-service', :value => service.name}], + :title => _("View this Service"), + :onclick => {:url => "/service/show/#{service.id}"}, + } + ) + end + data[:rows] = rows + miq_structured_list(data) + end end diff --git a/app/views/service/_svcs_show.html.haml b/app/views/service/_svcs_show.html.haml index 8777189fa72..860ca86bfb6 100644 --- a/app/views/service/_svcs_show.html.haml +++ b/app/views/service/_svcs_show.html.haml @@ -22,16 +22,7 @@ - unless child_services.blank? .row .col-md-12.col-lg-6 - %h3 - = _('Child Services') - %table.table.table-striped.table-bordered.table-hover - %tbody - - child_services.sort_by { |o| o.name.downcase }.each do |s| - %tr{:onclick => "miqTreeSelect('s-#{s.id}');", :title => _("View this Service")} - %td.table-view-pf-select - %i.pficon.pficon-service - %td - = h(s.name) + = child_service_summary(child_services) .row .col-md-12 %h3