You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltacloud.apache.org by mf...@redhat.com on 2010/12/09 15:40:30 UTC
[PATCH core 1/6] Added 'rel' attribute to linked resources (like image, realm, blob...)
From: Michal Fojtik <mf...@redhat.com>
---
server/views/blobs/show.xml.haml | 2 +-
server/views/buckets/index.xml.haml | 2 +-
server/views/buckets/show.xml.haml | 2 +-
server/views/instances/index.xml.haml | 6 +++---
server/views/instances/show.xml.haml | 6 +++---
server/views/load_balancers/show.xml.haml | 2 +-
6 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/server/views/blobs/show.xml.haml b/server/views/blobs/show.xml.haml
index bc499ca..8211f45 100644
--- a/server/views/blobs/show.xml.haml
+++ b/server/views/blobs/show.xml.haml
@@ -4,4 +4,4 @@
- unless attribute == :content
- haml_tag(attribute, :<) do
- haml_concat @blob.send(attribute)
- %content{:href => bucket_url(@blob.bucket) + '/' + @blob.id + '/content'}
+ %content{:href => bucket_url(@blob.bucket) + '/' + @blob.id + '/content', :rel => "content"}
diff --git a/server/views/buckets/index.xml.haml b/server/views/buckets/index.xml.haml
index a81432c..d3b113e 100644
--- a/server/views/buckets/index.xml.haml
+++ b/server/views/buckets/index.xml.haml
@@ -7,4 +7,4 @@
- haml_tag("#{attribute}".tr('-', '_'), :<) do
- haml_concat bucket.send(attribute)
- bucket.blob_list.each do |blb|
- %blob{ :id => blb, :href => bucket_url(bucket.id) +"/#{blb}"}
+ %blob{ :id => blb, :href => bucket_url(bucket.id) +"/#{blb}", :rel => "blob"}
diff --git a/server/views/buckets/show.xml.haml b/server/views/buckets/show.xml.haml
index 9b650e2..166fa60 100644
--- a/server/views/buckets/show.xml.haml
+++ b/server/views/buckets/show.xml.haml
@@ -5,4 +5,4 @@
-haml_tag(attribute, :<) do
- haml_concat @bucket.send(attribute)
- @bucket.blob_list.each do |blb|
- %blob{:id => blb, :href => bucket_url(@bucket.id) +"/#{blb}"}
\ No newline at end of file
+ %blob{:id => blb, :href => bucket_url(@bucket.id) +"/#{blb}", :rel => "blob"}
diff --git a/server/views/instances/index.xml.haml b/server/views/instances/index.xml.haml
index ab780eb..e8353ec 100644
--- a/server/views/instances/index.xml.haml
+++ b/server/views/instances/index.xml.haml
@@ -4,10 +4,10 @@
%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 }
+ %image{:href => image_url(instance.image_id), :id => instance.image_id, :rel => "image" }
+ %realm{:href => realm_url(instance.realm_id), :id => instance.realm_id, :rel => "realm" }
%state #{instance.state}
- - haml_tag :"hardware_profile", { :id => instance.instance_profile.id, :href => hardware_profile_url(instance.instance_profile.id)} do
+ - haml_tag :"hardware_profile", { :id => instance.instance_profile.id, :href => hardware_profile_url(instance.instance_profile.id), :rel => "hardware_profile"} do
- instance.instance_profile.overrides.each do |p, v|
%property{:kind => 'fixed', :name => p, :value => v, :unit => Deltacloud::HardwareProfile::unit(p)}
%actions
diff --git a/server/views/instances/show.xml.haml b/server/views/instances/show.xml.haml
index c31a215..866171a 100644
--- a/server/views/instances/show.xml.haml
+++ b/server/views/instances/show.xml.haml
@@ -7,14 +7,14 @@
%owner_id<
=@instance.owner_id
- if @instance.image_id
- %image{:href => image_url(@instance.image_id), :id => @instance.image_id }
+ %image{:href => image_url(@instance.image_id), :id => @instance.image_id, :rel => 'image' }
- if @instance.realm_id
- %realm{:href => realm_url(@instance.realm_id), :id => @instance.realm_id }
+ %realm{:href => realm_url(@instance.realm_id), :id => @instance.realm_id, :rel => 'realm' }
- 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
+ - haml_tag :"hardware_profile", {:id => @instance.instance_profile.id, :href => hardware_profile_url(@instance.instance_profile.id), :rel => "hardware_profile"} do
- @instance.instance_profile.overrides.each do |p, v|
%property{:kind => 'fixed', :name => p, :value => v, :unit => Deltacloud::HardwareProfile::unit(p)}
- if @instance.actions
diff --git a/server/views/load_balancers/show.xml.haml b/server/views/load_balancers/show.xml.haml
index e36f79f..985770d 100644
--- a/server/views/load_balancers/show.xml.haml
+++ b/server/views/load_balancers/show.xml.haml
@@ -16,6 +16,6 @@
%instance_port #{listener.instance_port}
%instances
- @load_balancer.instances.each do |instance|
- %instance{:href => instance_url(instance.id), :id => instance.id}
+ %instance{:href => instance_url(instance.id), :id => instance.id, :rel => "instance"}
%link{:rel => "unregister", :href => unregister_load_balancer_url(@load_balancer.id, { :instance_id => instance.id})}
--
1.7.3.2