deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dko...@apache.org
Subject [8/9] git commit: CIMI: changed CEP hrefs to use client's paths
Date Tue, 09 Jul 2013 06:25:14 GMT
CIMI: changed CEP hrefs to use client's paths


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

Branch: refs/heads/master
Commit: 3306c61be723d58a0df0584f89d36c5cca06cd96
Parents: 58d1f36
Author: Dies Koper <diesk@fast.au.fujitsu.com>
Authored: Fri Jul 5 21:40:24 2013 +1000
Committer: Dies Koper <diesk@fast.au.fujitsu.com>
Committed: Fri Jul 5 21:42:43 2013 +1000

----------------------------------------------------------------------
 clients/cimi/lib/cimi_frontend_helper.rb        | 5 +++++
 clients/cimi/views/cloud_entry_point/index.haml | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/3306c61b/clients/cimi/lib/cimi_frontend_helper.rb
----------------------------------------------------------------------
diff --git a/clients/cimi/lib/cimi_frontend_helper.rb b/clients/cimi/lib/cimi_frontend_helper.rb
index 314ec91..14c9ea3 100644
--- a/clients/cimi/lib/cimi_frontend_helper.rb
+++ b/clients/cimi/lib/cimi_frontend_helper.rb
@@ -35,6 +35,11 @@ module CIMI
         href.split('/').last.strip
       end
 
+      def id_to_href(id)
+        return '' unless id
+        id.gsub(/([A-Z])/, '_\1').sub('Configs', 'Configurations').downcase
+      end
+
       def collection_name(obj)
         obj.class.name.split('::').last
       end

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/3306c61b/clients/cimi/views/cloud_entry_point/index.haml
----------------------------------------------------------------------
diff --git a/clients/cimi/views/cloud_entry_point/index.haml b/clients/cimi/views/cloud_entry_point/index.haml
index 866adb7..0779687 100644
--- a/clients/cimi/views/cloud_entry_point/index.haml
+++ b/clients/cimi/views/cloud_entry_point/index.haml
@@ -13,4 +13,4 @@
 %ul
   - entry_point.select { |k, v| !v.kind_of?(String) and v.first['href'] }.each do |k, v|
     %li
-      %a{ :href => '/cimi/'+href_to_id(v.first['href']) }=k
+      %a{ :href => '/cimi/'+id_to_href(k) }=k


Mime
View raw message