deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@apache.org
Subject [49/50] [abbrv] git commit: Core: Updated entrypoint views to list collections from Deltacloud module
Date Tue, 22 May 2012 20:19:38 GMT
Core: Updated entrypoint views to list collections from Deltacloud module


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

Branch: refs/heads/master
Commit: 1f5a3f1715a28604e19c53e48e725935aaa3d39c
Parents: 8319969
Author: Michal Fojtik <mfojtik@redhat.com>
Authored: Tue Apr 17 15:22:34 2012 +0200
Committer: Michal fojtik <mfojtik@redhat.com>
Committed: Tue May 22 22:17:34 2012 +0200

----------------------------------------------------------------------
 server/views/api/show.html.haml |    7 +++----
 server/views/api/show.xml.haml  |   13 ++++++-------
 2 files changed, 9 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/1f5a3f17/server/views/api/show.html.haml
----------------------------------------------------------------------
diff --git a/server/views/api/show.html.haml b/server/views/api/show.html.haml
index 9a40860..4630a87 100644
--- a/server/views/api/show.html.haml
+++ b/server/views/api/show.html.haml
@@ -3,20 +3,19 @@
 
 %div{ :'data-role' => :content, :'data-theme' => 'c'}
   %ul{ :'data-role' => :listview, :'data-inset' => 'true'}
-
     - Deltacloud.collections.each do |c|
       - next unless c.operation(:index).has_capability?
       %li
         %a{ :href => api_url_for(c.collection_name),  :'data-icon' => "arrow-r"}=c.collection_name.to_s.gsub('_',
' ').titlecase
 
-- if @providers.size > 1
+- unless driver.configured_providers.empty?
   %div{ :'data-role' => :footer, :'data-theme' => 'a'}
     %form{ :action => settings.root_url, :method => :post, :'data-ajax' => 'false'}
       - if @driver_name
-        %input{ :name => :driver, :type => :hidden, :value => @driver_name }/
+        %input{ :name => :driver, :type => :hidden, :value => driver.name }/
       %fieldset{ :'data-type' => "horizontal", :'data-role' => "controlgroup", :id
=> "providers" }
         %select{:name => 'provider', :'data-inline' => 'true', :'data-native-menu'
=> 'false'}
           %option{ :value => 'default'} default
-          - @providers.each do |provider|
+          - driver.configured_providers.each do |provider|
             %option{ :value => provider } #{provider}
         %button{ :type => :submit, :'data-inline' => "true"} Change Provider

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/1f5a3f17/server/views/api/show.xml.haml
----------------------------------------------------------------------
diff --git a/server/views/api/show.xml.haml b/server/views/api/show.xml.haml
index 2b9f653..ad2df09 100644
--- a/server/views/api/show.xml.haml
+++ b/server/views/api/show.xml.haml
@@ -1,7 +1,6 @@
-%api{ :version => settings.version, :driver => driver_symbol }
-  - for entry_point in entry_points
-    %link{ :rel=>entry_point[0], :href=>entry_point[1] }
-      - for feature in driver.features(entry_point[0])
-        %feature{ :name=>feature.name }
-          - for name,value in feature.constraints
-            %constraint{ :name=>name, :value=>value }
+%api{ :version => settings.version, :driver => driver_symbol, :provider => Thread.current[:provider]
|| ENV['API_PROVIDER'] }
+  - Deltacloud.collections.each do |c|
+    - next unless c.operation(:index).has_capability?
+    %link{ :rel => c.collection_name, :href => self.send(:"#{c.collection_name}_url")}
+      - c.features.select { |f| driver.class.has_feature?(c.collection_name, f.name) }.each
do |f|
+        %feature{ :name => f.name }


Mime
View raw message