summaryrefslogtreecommitdiff
path: root/lib/chef_server/views/nodes/_resource.html.haml
blob: 7b9776b816d59a36a7ae5478e2e7bff3f760bf87 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
.resource
  %h3= "#{h resource.to_s} (#{resource.class})"
  %table
    - resource.instance_variables.sort.each do |v|
      - attr_name = v.gsub(/\@/, "")
      - unless attr_name == "collection"
        %tr.attr_group
          %td.attr_name
            = "#{h attr_name}"
          %td.attr_value
            - value = resource.instance_variable_get(v)
            - if value.kind_of?(String)
              = "#{h value}"
            - elsif value.kind_of?(Array)
              = "#{h value.join(", ")}"
            - elsif value.kind_of?(Symbol)
              = "#{h value.to_s}"
            - elsif attr_name == "actions"
              = partial(:action, :actions => value)
            - else
              = "#{h value.inspect}"