You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@deltacloud.apache.org by mf...@apache.org on 2012/11/08 15:02:59 UTC

[1/4] git commit: Core: Simplify the way how we create XML for images

Updated Branches:
  refs/heads/master aecefd4da -> 5423bb553


Core: Simplify the way how we create XML for images


Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/5423bb55
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/5423bb55
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/5423bb55

Branch: refs/heads/master
Commit: 5423bb5532a58621c211e3df0a76b52ee01525df
Parents: c9c0c9e
Author: Michal Fojtik <mf...@redhat.com>
Authored: Thu Oct 25 14:36:47 2012 +0200
Committer: Michal fojtik <mf...@redhat.com>
Committed: Thu Nov 8 15:02:36 2012 +0100

----------------------------------------------------------------------
 server/views/images/show.html.haml |    4 ++++
 server/views/images/show.xml.haml  |   11 ++++++++---
 2 files changed, 12 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/5423bb55/server/views/images/show.html.haml
----------------------------------------------------------------------
diff --git a/server/views/images/show.html.haml b/server/views/images/show.html.haml
index 181d43e..f12ecb4 100644
--- a/server/views/images/show.html.haml
+++ b/server/views/images/show.html.haml
@@ -17,6 +17,10 @@
     %li{ :'data-role' => 'list-divider'} State
     %li
       %p{ :'data-role' => 'fieldcontain'}=@image.state
+    - if @image.creation_time
+      %li{ :'data-role' => 'list-divider'} Creation Time
+      %li
+        %p{ :'data-role' => 'fieldcontain'}=@image.creation_time
     %li{ :'data-role' => 'list-divider'} Architecture
     %li
       %p{ :'data-role' => 'fieldcontain'}=@image.architecture

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/5423bb55/server/views/images/show.xml.haml
----------------------------------------------------------------------
diff --git a/server/views/images/show.xml.haml b/server/views/images/show.xml.haml
index ffbe3a0..66b4f9a 100644
--- a/server/views/images/show.xml.haml
+++ b/server/views/images/show.xml.haml
@@ -1,9 +1,14 @@
 - unless defined?(partial)
   !!! XML
 %image{:href => image_url(@image.id), :id => @image.id}
-  - @image.attributes.select{ |attr| ![:id, :hardware_profiles].include?(attr) }.each do |attribute|
-    - haml_tag(attribute, :<) do
-      - haml_concat @image.send(attribute)
+  %name=@image.name
+  %description=@image.description
+  %owner_id=@image.owner_id
+  %architecture=@image.architecture
+  - if @image.state
+    %state=@image.state
+  - if @image.creation_time
+    %creation_time=@image.creation_time
   - if @image.hardware_profiles
     %hardware_profiles
       - @image.hardware_profiles.each do |profile|