incubator-deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@apache.org
Subject svn commit: r980052 - /incubator/deltacloud/trunk/server/views/instances/show.xml.haml
Date Wed, 28 Jul 2010 13:48:15 GMT
Author: mfojtik
Date: Wed Jul 28 13:48:15 2010
New Revision: 980052

URL: http://svn.apache.org/viewvc?rev=980052&view=rev
Log:
Make the HAML show instances handle truncated instance objects.

Signed-off-by: Chris Lalancette <clalance@redhat.com>

Modified:
    incubator/deltacloud/trunk/server/views/instances/show.xml.haml

Modified: incubator/deltacloud/trunk/server/views/instances/show.xml.haml
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/views/instances/show.xml.haml?rev=980052&r1=980051&r2=980052&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/views/instances/show.xml.haml (original)
+++ incubator/deltacloud/trunk/server/views/instances/show.xml.haml Wed Jul 28 13:48:15 2010
@@ -1,30 +1,39 @@
 !!! XML
 %instance{:href => instance_url(@instance.id), :id => @instance.id}
-  %name<
-    =@instance.name
-  %owner_id<
-    =@instance.owner_id
-  %image{:href => image_url(@instance.image_id), :id => @instance.image_id }
-  %realm{:href => realm_url(@instance.realm_id), :id => @instance.realm_id }
-  %state<
-    =@instance.state
-  - haml_tag :"hardware_profile", {:id => @instance.instance_profile.id, :href => hardware_profile_url(@instance.instance_profile.id)}
do
-    - @instance.instance_profile.overrides.each do |p, v|
-      %property{:kind => 'fixed', :name => p, :value => v, :unit => Deltacloud::HardwareProfile::unit(p)}
-  %actions
-    - @instance.actions.compact.each do |instance_action|
-      %link{:rel => instance_action, :method => instance_action_method(instance_action),
:href => self.send("#{instance_action}_instance_url", @instance.id)}
+  - if @instance.name
+    %name<
+      =@instance.name
+  - if @instance.owner_id
+    %owner_id<
+      =@instance.owner_id
+  - if @instance.image_id
+    %image{:href => image_url(@instance.image_id), :id => @instance.image_id }
+  - if @instance.realm_id
+    %realm{:href => realm_url(@instance.realm_id), :id => @instance.realm_id }
+  - if @instance.state
+    %state<
+      =@instance.state
+  - if @instance.instance_profile
+    - haml_tag :"hardware_profile", {:id => @instance.instance_profile.id, :href =>
hardware_profile_url(@instance.instance_profile.id)} do
+      - @instance.instance_profile.overrides.each do |p, v|
+        %property{:kind => 'fixed', :name => p, :value => v, :unit => Deltacloud::HardwareProfile::unit(p)}
+  - if @instance.actions
+    %actions
+      - @instance.actions.compact.each do |instance_action|
+        %link{:rel => instance_action, :method => instance_action_method(instance_action),
:href => self.send("#{instance_action}_instance_url", @instance.id)}
   - if @instance.instance_variables.include?("@launch_time")
     %launch_time<
       =@instance.launch_time
-  %public_addresses
-    - @instance.public_addresses.each do |address|
-      %address<
-        =address
-  %private_addresses
-    - @instance.private_addresses.each do |address|
-      %address<
-        =address
+  - if @instance.public_addresses
+    %public_addresses
+      - @instance.public_addresses.each do |address|
+        %address<
+          =address
+  - if @instance.private_addresses
+    %private_addresses
+      - @instance.private_addresses.each do |address|
+        %address<
+          =address
   - if driver_has_auth_features?
     %authentication{ :type => driver_auth_feature_name }
       - if @instance.authn_feature_failed?



Mime
View raw message