From: Tomas Sedovic <[email protected]>

---
 src/app/controllers/pool_controller.rb |    4 ++
 src/app/views/pool/list.html.erb       |   38 +++++++++++++++++++++++
 src/app/views/pool/show.html.erb       |   51 ++++++++-----------------------
 src/public/stylesheets/dcloud.css      |    9 ++++-
 4 files changed, 62 insertions(+), 40 deletions(-)
 create mode 100644 src/app/views/pool/list.html.erb

diff --git a/src/app/controllers/pool_controller.rb 
b/src/app/controllers/pool_controller.rb
index d557d57..f04c0e4 100644
--- a/src/app/controllers/pool_controller.rb
+++ b/src/app/controllers/pool_controller.rb
@@ -29,6 +29,10 @@ class PoolController < ApplicationController
   end
 
   def show
+    @pool = Pool.find(params[:id])
+  end
+
+  def list
     #FIXME: clean this up, many error cases here
     @pool = Pool.find(params[:id])
     require_privilege(Privilege::INSTANCE_VIEW,@pool)
diff --git a/src/app/views/pool/list.html.erb b/src/app/views/pool/list.html.erb
new file mode 100644
index 0000000..38e46e7
--- /dev/null
+++ b/src/app/views/pool/list.html.erb
@@ -0,0 +1,38 @@
+<script type="text/javascript">
+  function clickRow(ev) {
+    var box = $('input[name="image_id[]"]', ev.target.parentNode);
+    if ($(ev.target).attr('name') != "image_id[]")
+      box.attr('checked', !box.attr('checked'));
+  }
+
+  function checkAll(ev) {
+    $('input[name="image_id[]"]', dataTable_instances_table).attr('checked', 
$(ev.target).attr('checked'))
+  }
+</script>
+
+<%= datatable(
+  Instance::COLUMNS.map {|c| c[:opts]},
+  {
+    :table_dom_id => 'instances_table',
+    :per_page => Instance::per_page,
+    :sort_by => "[3, 'asc']",
+    :serverside => true,
+    :ajax_source => url_for(:controller => 'pool', :action => 
'instances_paginate') + "/#[email protected]}",
+    :append => ".fnSetFilteringDelay()",
+    :persist_state => false,
+    :click_callback => "function(ev) {clickRow(ev);}",
+  }
+) %>
+
+<table class="datatable display" id="instances_table">
+  <thead>
+    <tr>
+        <% Instance::COLUMNS.each do |c| %>
+          <%= "<th>#{c[:header]}</th>" %>
+        <% end %>
+    </tr>
+  </thead>
+  <tbody>
+  </tbody>
+</table>
+<%= link_to "Add a new instance", {:controller => "instance", :action => 
"new", "instance[pool_id]" => @pool}, :class=>"actionlink"%>
diff --git a/src/app/views/pool/show.html.erb b/src/app/views/pool/show.html.erb
index 8fb8fb6..12e5bad 100644
--- a/src/app/views/pool/show.html.erb
+++ b/src/app/views/pool/show.html.erb
@@ -1,42 +1,17 @@
 <script type="text/javascript">
-  function clickRow(ev) {
-    var box = $('input[name="image_id[]"]', ev.target.parentNode);
-    if ($(ev.target).attr('name') != "image_id[]")
-      box.attr('checked', !box.attr('checked'));
-  }
-
-  function checkAll(ev) {
-    $('input[name="image_id[]"]', dataTable_instances_table).attr('checked', 
$(ev.target).attr('checked'))
-  }
+  $(document).ready(function() {
+    $("#pool-tabs").tabs();
+  });
 </script>
 
-<%= datatable(
-  Instance::COLUMNS.map {|c| c[:opts]},
-  {
-    :table_dom_id => 'instances_table',
-    :per_page => Instance::per_page,
-    :sort_by => "[3, 'asc']",
-    :serverside => true,
-    :ajax_source => url_for(:controller => 'pool', :action => 
'instances_paginate') + "/#[email protected]}",
-    :append => ".fnSetFilteringDelay()",
-    :persist_state => false,
-    :click_callback => "function(ev) {clickRow(ev);}",
-  }
-) %>
-
-<table class="datatable display" id="instances_table">
-  <thead>
-    <tr>
-        <% Instance::COLUMNS.each do |c| %>
-          <%= "<th>#{c[:header]}</th>" %>
+<div id="pool-tabs">
+    <ul>
+        <li><%= link_to "Instances", {:action => "list", :id => @pool.id, 
:ajax => true} %></li>
+        <% if has_view_perms? %>
+          <li><%= link_to "User access",  {:controller => "permissions", 
:action => "list", :pool_id => @pool.id, :ajax => true} %></li>
         <% end %>
-    </tr>
-  </thead>
-  <tbody>
-  </tbody>
-</table>
-<%= link_to "Add a new instance", {:controller => "instance", :action => 
"new", "instance[pool_id]" => @pool}, :class=>"actionlink"%>
-<%= link_to "User access",  {:controller => "permissions", :action => "list", 
:pool_id => @pool.id}, :class=>"actionlink" if has_view_perms? %>
-<%= link_to "Hardware Profiles",  {:action => "hardware_profiles", :id => 
@pool.id}, :class=>"actionlink"%>
-<%= link_to "Realms",  {:action => "realms", :id => @pool.id}, 
:class=>"actionlink"%>
-<%= link_to "Quota",  {:controller => "quota", :action => "show", :id => 
@pool, :parent_type => "pool"}, :class=>"actionlink"%>
+        <li><%= link_to "Hardware Profiles",  {:action => "hardware_profiles", 
:id => @pool.id, :ajax => true} %></li>
+        <li><%= link_to "Realms",  {:action => "realms", :id => @pool.id, 
:ajax => true} %></li>
+        <li><%= link_to "Quota",  {:controller => "quota", :action => "show", 
:id => @pool, :parent_type => "pool", :ajax => true} %></li>
+    </ul>
+</div>
diff --git a/src/public/stylesheets/dcloud.css 
b/src/public/stylesheets/dcloud.css
index c75c234..0183a55 100644
--- a/src/public/stylesheets/dcloud.css
+++ b/src/public/stylesheets/dcloud.css
@@ -276,6 +276,11 @@ ul#pools li a:hover {
   border-left: none;
 }
 
+#instances_table_wrapper {
+  min-height: 0;
+  margin-bottom: 1em;
+}
+
 /* Style for button links */
 a.button_link {
   border: 1px solid black;
@@ -289,10 +294,10 @@ a.button_link {
   -webkit-border-radius: 5px;
 }
 
-#dashboard-tabs, #provider-tabs {
+#dashboard-tabs, #provider-tabs, #pool-tabs{
   border: none;
 }
 
-#dashboard-tabs ul, #provider-tabs ul {
+#dashboard-tabs ul, #provider-tabs ul, #pool-tabs ul{
   float: none;
 }
-- 
1.6.6.1

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

Reply via email to