You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@deltacloud.apache.org by dk...@apache.org on 2013/07/09 08:25:14 UTC
[8/9] git commit: CIMI: changed CEP hrefs to use client's paths
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 <di...@fast.au.fujitsu.com>
Authored: Fri Jul 5 21:40:24 2013 +1000
Committer: Dies Koper <di...@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