From: Tomas Sedovic <[email protected]>

Only for Documentation at the moment.
---
 deltacloud.org/content/_navigation.erb    |   23 +++++++++++++++++++++++
 deltacloud.org/content/api.erb            |    1 +
 deltacloud.org/content/client-ruby.erb    |    1 +
 deltacloud.org/content/drivers.erb        |    1 +
 deltacloud.org/content/framework.erb      |    1 +
 deltacloud.org/layouts/documentation.haml |   24 ++----------------------
 6 files changed, 29 insertions(+), 22 deletions(-)
 create mode 100644 deltacloud.org/content/_navigation.erb

diff --git a/deltacloud.org/content/_navigation.erb 
b/deltacloud.org/content/_navigation.erb
new file mode 100644
index 0000000..fa96408
--- /dev/null
+++ b/deltacloud.org/content/_navigation.erb
@@ -0,0 +1,23 @@
+---
+filter:
+  - erb
+  - haml
+---
+<% menu = [
+    { :href => "index.html", :title => "Deltacloud Home", :text => "Home" },
+    { :href => "tools.html", :title => "Tools", :text => "Tools" },
+    { :href => "download.html", :title => "Get the latest releases", :text => 
"Download" },
+    { :href => "contribute.html", :title => "Information about 
design/development process", :text => "Contribute" },
+    { :href => "documentation.html", :title => "Project documentation", :text 
=> "Documentation" },
+    { :href => "page", :title => "Project wiki", :text => "Wiki" } ] %>
+
+#navigation
+  #menu.container
+    %ul.l0
+      <% menu.each do |link| %>
+      %li
+        <% current_page = "#{area}.html" unless area.nil? or area.empty? or 
(link[:href].index(area) != 0) %>
+        <% state = (link[:href] == current_page) ? 'active' : 'inactive' %>
+        %a.<%= state %>{ :href => "./<%= link[:href] %>", :title => "<%= 
link[:title] %>" }
+          <%= link[:text] %>
+      <% end %>
diff --git a/deltacloud.org/content/api.erb b/deltacloud.org/content/api.erb
index 5f18a0d..28f3c9d 100644
--- a/deltacloud.org/content/api.erb
+++ b/deltacloud.org/content/api.erb
@@ -1,5 +1,6 @@
 ---
 title: Deltacloud - Documentation
+area: documentation
 extension: html
 layout: documentation.haml
 filter:
diff --git a/deltacloud.org/content/client-ruby.erb 
b/deltacloud.org/content/client-ruby.erb
index 9b2cf26..798d656 100644
--- a/deltacloud.org/content/client-ruby.erb
+++ b/deltacloud.org/content/client-ruby.erb
@@ -1,5 +1,6 @@
 ---
 title: Deltacloud - Documentation
+area: documentation
 extension: html
 layout: documentation.haml
 filter:
diff --git a/deltacloud.org/content/drivers.erb 
b/deltacloud.org/content/drivers.erb
index bf5554c..10f720d 100644
--- a/deltacloud.org/content/drivers.erb
+++ b/deltacloud.org/content/drivers.erb
@@ -1,5 +1,6 @@
 ---
 title: Deltacloud - Documentation
+area: documentation
 extension: html
 layout: documentation.haml
 filter:
diff --git a/deltacloud.org/content/framework.erb 
b/deltacloud.org/content/framework.erb
index 6f9a1b3..bab39c2 100644
--- a/deltacloud.org/content/framework.erb
+++ b/deltacloud.org/content/framework.erb
@@ -1,5 +1,6 @@
 ---
 title: Deltacloud - Documentation
+area: documentation
 extension: html
 layout: documentation.haml
 filter:
diff --git a/deltacloud.org/layouts/documentation.haml 
b/deltacloud.org/layouts/documentation.haml
index 7b5200e..0157d6e 100644
--- a/deltacloud.org/layouts/documentation.haml
+++ b/deltacloud.org/layouts/documentation.haml
@@ -21,28 +21,8 @@ filter:
         #headerLogo{ :onclick => "location.href='index.html';", :style => 
"cursor: pointer;" }
           %h1
             Deltacloud - Many clouds. One API. No problem.
-    #navigation
-      #menu.container
-        %ul.l0
-          %li
-            %a.inactive{ :href => "./index.html", :title => "Deltacloud Home" }
-              Home
-          %li
-            %a.inactive{ :href => "./tools.html", :title => "Tools" }
-              Tools
-          %li
-            %a.inactive{ :href => "./download.html", :title => "Get the latest 
releases" }
-              Download
-          %li
-            %a.inactive{ :href => "./contribute.html", :title => "Information 
about design/development process" }
-              Contribute
-          %li
-            %a.active{ :href => "./documentation.html", :title => "Project 
documentation" }
-              Documentation
-          %li
-            %a.inactive{ :href => "./page", :title => "Project wiki" }
-              Wiki
-    <%= render(:partial => "submenu-documentation", :locals => {:current_page 
=> "#[email protected]}.#{@page.extension}"} ) %>
+    <%= render(:partial => "navigation", :locals => {:current_page => 
"#[email protected]}.#{@page.extension}", :area => @page.area } ) %>
+    <%= render(:partial => "submenu-documentation", :locals => {:current_page 
=> "#[email protected]}.#{@page.extension}" } ) %>
     #main
       #content-deltacloud.container
         <%= @content %>
-- 
1.6.6.1

_______________________________________________
deltacloud-devel mailing list
[email protected]
https://fedorahosted.org/mailman/listinfo/deltacloud-devel

Reply via email to