summaryrefslogtreecommitdiff
path: root/chef-server/lib/views/nodes/_resource.html.haml
diff options
context:
space:
mode:
Diffstat (limited to 'chef-server/lib/views/nodes/_resource.html.haml')
-rw-r--r--chef-server/lib/views/nodes/_resource.html.haml22
1 files changed, 22 insertions, 0 deletions
diff --git a/chef-server/lib/views/nodes/_resource.html.haml b/chef-server/lib/views/nodes/_resource.html.haml
new file mode 100644
index 0000000000..7b9776b816
--- /dev/null
+++ b/chef-server/lib/views/nodes/_resource.html.haml
@@ -0,0 +1,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}"
+