Skip to content

Commit 8adaffa

Browse files
Merge pull request #9207 from jeffbonson/fix-child-services-link
Fix child services link
2 parents b63e5bb + 5e32298 commit 8adaffa

File tree

2 files changed

+17
-10
lines changed

2 files changed

+17
-10
lines changed

app/helpers/service_helper.rb

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
11
module ServiceHelper
22
include TextualSummary
3+
4+
def child_service_summary(child_services)
5+
rows = []
6+
data = {:title => _("Child Services"), :mode => "miq_child_services"}
7+
child_services.sort_by { |o| o.name.downcase }.each do |service|
8+
rows.push(
9+
{
10+
:cells => [{:icon => 'pficon pficon-service', :value => service.name}],
11+
:title => _("View this Service"),
12+
:onclick => {:url => "/service/show/#{service.id}"},
13+
}
14+
)
15+
end
16+
data[:rows] = rows
17+
miq_structured_list(data)
18+
end
319
end

app/views/service/_svcs_show.html.haml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,7 @@
2222
- unless child_services.blank?
2323
.row
2424
.col-md-12.col-lg-6
25-
%h3
26-
= _('Child Services')
27-
%table.table.table-striped.table-bordered.table-hover
28-
%tbody
29-
- child_services.sort_by { |o| o.name.downcase }.each do |s|
30-
%tr{:onclick => "miqTreeSelect('s-#{s.id}');", :title => _("View this Service")}
31-
%td.table-view-pf-select
32-
%i.pficon.pficon-service
33-
%td
34-
= h(s.name)
25+
= child_service_summary(child_services)
3526
.row
3627
.col-md-12
3728
%h3

0 commit comments

Comments
 (0)