Also, add 'create and add new cloud account from portal pool view'. Added link on provider view to see existing accounts & add new accounts. The permissions checking in this patch is woefully inadequate, but should be easy to add in before end of sprint! With the functionality added by this patch, I'm able to start Mock instances. Handy for demos! --- src/app/controllers/cloud_accounts_controller.rb | 86 ++++++++++++++++++++ src/app/controllers/portal_pool_controller.rb | 10 +++ src/app/views/cloud_accounts/_form.erb | 13 +++ .../cloud_accounts/accounts_for_pool.html.erb | 36 ++++++++ src/app/views/cloud_accounts/new.html.erb | 14 +++ .../views/cloud_accounts/new_from_pool.html.erb | 11 +++ src/app/views/portal_pool/show.html.erb | 6 +- 7 files changed, 175 insertions(+), 1 deletions(-) create mode 100644 src/app/controllers/cloud_accounts_controller.rb create mode 100644 src/app/views/cloud_accounts/_form.erb create mode 100644 src/app/views/cloud_accounts/accounts_for_pool.html.erb create mode 100644 src/app/views/cloud_accounts/new.html.erb create mode 100644 src/app/views/cloud_accounts/new_from_pool.html.erb
diff --git a/src/app/controllers/cloud_accounts_controller.rb b/src/app/controllers/cloud_accounts_controller.rb new file mode 100644 index 0000000..96a0e0f --- /dev/null +++ b/src/app/controllers/cloud_accounts_controller.rb @@ -0,0 +1,86 @@ +# +# Copyright (C) 2010 Red Hat, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +# MA 02110-1301, USA. A copy of the GNU General Public License is +# also available at http://www.gnu.org/copyleft/gpl.html. + +# Filters added to this controller apply to all controllers in the application. +# Likewise, all the methods added will be available for all controllers. + +class CloudAccountsController < ApplicationController + before_filter :require_user + + def new + @cloud_account = CloudAccount.new + @providers = [] + all_providers = Provider.all + all_providers.each {|provider| + begin + require_privilege(Privilege::PROVIDER_VIEW,provider) + @providers << provider + rescue + end + } + end + + def new_from_pool + @pool = PortalPool.find(params[:id]) + @cloud_account = CloudAccount.new + @providers = [] + all_providers = Provider.all + all_providers.each {|provider| + begin + require_privilege(Privilege::PROVIDER_VIEW,provider) + @providers << provider + rescue + end + } + end + + + def create + @cloud_account = CloudAccount.new(params[:cloud_account]) + @provider = Provider.find(params[:provider][:id]) + @cloud_account.provider = @provider + @cloud_account.save! + end + + def create_from_pool + @pool = PortalPool.find(params[:pool][:id]) + @cloud_account = CloudAccount.new(params[:cloud_account]) + @provider = Provider.find(params[:provider][:id]) + @cloud_account.provider = @provider + @cloud_account.save! + @pool.cloud_accounts << @cloud_account unless @pool.cloud_accounts.map{|x| x.id}.include?(@cloud_account.id) + @pool.save! + redirect_to :controller => "portal_pool", :action => 'show', :id => @pool.id + end + + def accounts_for_pool + @pool = PortalPool.find(params[:id]) + @cloud_accounts = [] + all_accounts = CloudAccount.all + all_accounts.each {|account| + begin + require_privilege(Privilege::ACCOUNT_VIEW,account) + require_privilege(Privilege::ACCOUNT_ADD,account) + @cloud_accounts << account unless @pool.cloud_accounts.map{|x| x.id}.include?(account.id) + rescue + end + } + + end + +end diff --git a/src/app/controllers/portal_pool_controller.rb b/src/app/controllers/portal_pool_controller.rb index 90df8a5..be9d774 100644 --- a/src/app/controllers/portal_pool_controller.rb +++ b/src/app/controllers/portal_pool_controller.rb @@ -66,4 +66,14 @@ class PortalPoolController < ApplicationController
def delete end + + def add_account + @portal_pool = PortalPool.find(params[:portal_pool]) + @cloud_account = CloudAccount.find(params[:cloud_account]) + @portal_pool.cloud_accounts << @cloud_account unless @portal_pool.cloud_accounts.map{|x| x.id}.include?(@cloud_account.id) + @portal_pool.save! + @portal_pool.populate_realms_and_images([@cloud_account]) + redirect_to :action => 'show', :id => @portal_pool.id + end + end diff --git a/src/app/views/cloud_accounts/_form.erb b/src/app/views/cloud_accounts/_form.erb new file mode 100644 index 0000000..78b3510 --- /dev/null +++ b/src/app/views/cloud_accounts/_form.erb @@ -0,0 +1,13 @@ +<ul> + <li> + <%= form.label :username, "Choose a username" %> + <%= form.text_field :username %> + </li> + <li> + <%= form.label :password, form.object.new_record? ? "Choose a password" : "Change password" %> + <%= form.password_field :password %> + </li> +<li> + <%= select("provider", "id", @providers.map{|p| [p.name,p.id]} , { :include_blank => false }) %> +</li> +</ul> diff --git a/src/app/views/cloud_accounts/accounts_for_pool.html.erb b/src/app/views/cloud_accounts/accounts_for_pool.html.erb new file mode 100644 index 0000000..e273551 --- /dev/null +++ b/src/app/views/cloud_accounts/accounts_for_pool.html.erb @@ -0,0 +1,36 @@ +<% if @pool.cloud_accounts.size > 0 %> +<h1>These Cloud Accounts are already attached to this pool</h1> +<table> +<thead> +<tr> +<th scope="col">Provider Name</th> +<th scope="col">Cloud Account User Name</th> +</tr> +<% @pool.cloud_accounts.each {|a| %> +<tr> +<td><%= a.provider.name %></td> +<td><%= a.username %></td> +</tr> +<% } %> +</table> +<% end %> + +<% if @cloud_accounts.size == 0 %> +<h1>There are no existing Cloud Accounts available to add</h1> +<% else %> +<h1>These Cloud Accounts are available to add</h1> +<table> +<thead> +<tr> +<th scope="col">Provider Name</th> +<th scope="col">Cloud Account User Name</th> +</tr> +<% @cloud_accounts.each {|a| %> +<tr> +<td><%= a.provider.name %></td> +<td><%= a.username %> <%= link_to "Add this account", {:controller=> "portal_pool", + :action => "add_account", :portal_pool => @pool, :cloud_account => a}, :class => "actionlink" %></td> +</tr> +<% } %> +</table> +<% end %> diff --git a/src/app/views/cloud_accounts/new.html.erb b/src/app/views/cloud_accounts/new.html.erb new file mode 100644 index 0000000..40f32cb --- /dev/null +++ b/src/app/views/cloud_accounts/new.html.erb @@ -0,0 +1,14 @@ +<% if @providers.size == 0 %> +<h1>No Providers available to associate with a new cloud account</h1> +<% else %> +<h2 class="greeting">New Cloud Account</h2> + +<div class="dcloud_form"> + <% form_for @cloud_account, :url => { :action => "create" } do |f| %> + <%= f.error_messages %> + <%= render :partial => "form", :object => f %> + <%= f.submit "Create Cloud Account", :class => "submit" %> + <% end %> + <%= link_to "Cancel", root_path, :class => 'actionlink' %> +</div> +<% end %> diff --git a/src/app/views/cloud_accounts/new_from_pool.html.erb b/src/app/views/cloud_accounts/new_from_pool.html.erb new file mode 100644 index 0000000..747df03 --- /dev/null +++ b/src/app/views/cloud_accounts/new_from_pool.html.erb @@ -0,0 +1,11 @@ +<h2 class="greeting">New Cloud Account</h2> + +<div class="dcloud_form"> + <% form_for @cloud_account, :url => { :action => "create_from_pool" } do |f| %> + <%= f.error_messages %> + <%= render :partial => "form", :object => f %> + <%= hidden_field :pool, :id %> + <%= f.submit "Create Cloud Account", :class => "submit" %> + <% end %> + <%= link_to "Cancel", root_path, :class => 'actionlink' %> +</div> diff --git a/src/app/views/portal_pool/show.html.erb b/src/app/views/portal_pool/show.html.erb index d649199..9d4e36c 100644 --- a/src/app/views/portal_pool/show.html.erb +++ b/src/app/views/portal_pool/show.html.erb @@ -35,4 +35,8 @@ </tbody> </table> <% end %> -<%= link_to "Add a new instance", {:controller => "instance", :action => "new", :id => @pool}, :class=>"actionlink"%> +<%= link_to "Add a new instance", {:controller => "instance", :action => "new", :id => @pool}, :class=>"actionlink"%><br/> +<%= link_to "View/Add Existing Cloud Accounts", {:controller => "cloud_accounts",:action => "accounts_for_pool", :id => @pool}, :class=>"actionlink" %><br/> +<%= link_to "Add a New Cloud Account", {:controller => +"cloud_accounts",:action => "new_from_pool", :id => @pool}, +:class=>"actionlink" %>
Steve Linabery wrote:
Also, add 'create and add new cloud account from portal pool view'. Added link on provider view to see existing accounts & add new accounts. The permissions checking in this patch is woefully inadequate, but should be easy to add in before end of sprint! With the functionality added by this patch, I'm able to start Mock instances. Handy for demos!
src/app/controllers/cloud_accounts_controller.rb | 86 ++++++++++++++++++++ src/app/controllers/portal_pool_controller.rb | 10 +++ src/app/views/cloud_accounts/_form.erb | 13 +++ .../cloud_accounts/accounts_for_pool.html.erb | 36 ++++++++ src/app/views/cloud_accounts/new.html.erb | 14 +++ .../views/cloud_accounts/new_from_pool.html.erb | 11 +++ src/app/views/portal_pool/show.html.erb | 6 +- 7 files changed, 175 insertions(+), 1 deletions(-) create mode 100644 src/app/controllers/cloud_accounts_controller.rb create mode 100644 src/app/views/cloud_accounts/_form.erb create mode 100644 src/app/views/cloud_accounts/accounts_for_pool.html.erb create mode 100644 src/app/views/cloud_accounts/new.html.erb create mode 100644 src/app/views/cloud_accounts/new_from_pool.html.erb
diff --git a/src/app/controllers/cloud_accounts_controller.rb b/src/app/controllers/cloud_accounts_controller.rb new file mode 100644 index 0000000..96a0e0f --- /dev/null +++ b/src/app/controllers/cloud_accounts_controller.rb @@ -0,0 +1,86 @@ +# +# Copyright (C) 2010 Red Hat, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +# MA 02110-1301, USA. A copy of the GNU General Public License is +# also available at http://www.gnu.org/copyleft/gpl.html.
+# Filters added to this controller apply to all controllers in the application. +# Likewise, all the methods added will be available for all controllers.
+class CloudAccountsController < ApplicationController
- before_filter :require_user
- def new
- @cloud_account = CloudAccount.new
- @providers = []
- all_providers = Provider.all
- all_providers.each {|provider|
begin
require_privilege(Privilege::PROVIDER_VIEW,provider)
@providers << provider
rescue
end
- }
- end
I don't think you need the providers list here, as for the default 'new' operation you'll be getting a provider ID in the url You also need 'require_privilege(Privilege::ACCOUNT_MODIFY,@provider)' somewhere in this method
- def new_from_pool
- @pool = PortalPool.find(params[:id])
You might use pool_id here since raw 'id' in the cloud_accounts_controller would normally be an account ID You also need 'require_privilege(Privilege::ACCOUNT_ADD,@pool)'
- @cloud_account = CloudAccount.new
- @providers = []
- all_providers = Provider.all
- all_providers.each {|provider|
begin
require_privilege(Privilege::PROVIDER_VIEW,provider)
@providers << provider
rescue
end
- }
- end
Instead of calling require_privilege and swallowing the exception, you can just call authorized? -- require_privilege is the exception-throwing version of authorized? Even better would be to filter the query on permissions. oVirt does this in a few places, and I believe jayg is doing this already in his nav patch for providers.
- def create
- @cloud_account = CloudAccount.new(params[:cloud_account])
- @provider = Provider.find(params[:provider][:id])
- @cloud_account.provider = @provider
- @cloud_account.save!
- end
Hmm. If the select list is in the form as provider_id, then you shouldn't require any special handling of the association here You also need 'require_privilege(Privilege::ACCOUNT_MODIFY,@provider)' before saving anything
- def create_from_pool
- @pool = PortalPool.find(params[:pool][:id])
- @cloud_account = CloudAccount.new(params[:cloud_account])
- @provider = Provider.find(params[:provider][:id])
- @cloud_account.provider = @provider
Hmm. If the select list is in the form as provider_id, then you shouldn't require any special handling of the association here You also need 'require_privilege(Privilege::ACCOUNT_ADD,@pool)' before saving anything
- @cloud_account.save!
- @pool.cloud_accounts << @cloud_account unless @pool.cloud_accounts.map{|x| x.id}.include?(@cloud_account.id)
- @pool.save!
- redirect_to :controller => "portal_pool", :action => 'show', :id => @pool.id
- end
- def accounts_for_pool
- @pool = PortalPool.find(params[:id])
- @cloud_accounts = []
- all_accounts = CloudAccount.all
- all_accounts.each {|account|
begin
require_privilege(Privilege::ACCOUNT_VIEW,account)
require_privilege(Privilege::ACCOUNT_ADD,account)
@cloud_accounts << account unless @pool.cloud_accounts.map{|x| x.id}.include?(account.id)
rescue
end
- }
- end
I'm assuming this is to generate the form for adding an existing account to a pool. If so, where's the action that does the actual save operation? Also you need to make sur ethat the user has ACCOUNT_ADD on the pool. Same comment above on require_privilege and rescue. In addition is this something that can be done with a query as well? It might make less sense as a single query since we need to filter out currently-used accounts.
+end diff --git a/src/app/controllers/portal_pool_controller.rb b/src/app/controllers/portal_pool_controller.rb index 90df8a5..be9d774 100644 --- a/src/app/controllers/portal_pool_controller.rb +++ b/src/app/controllers/portal_pool_controller.rb @@ -66,4 +66,14 @@ class PortalPoolController < ApplicationController
def delete end
- def add_account
- @portal_pool = PortalPool.find(params[:portal_pool])
- @cloud_account = CloudAccount.find(params[:cloud_account])
- @portal_pool.cloud_accounts << @cloud_account unless @portal_pool.cloud_accounts.map{|x| x.id}.include?(@cloud_account.id)
- @portal_pool.save!
- @portal_pool.populate_realms_and_images([@cloud_account])
- redirect_to :action => 'show', :id => @portal_pool.id
- end
end
Hmm. it seems a little odd to have the form generation method in one controller and the save in another -- I think in this case both operations belong to the pool controller.
diff --git a/src/app/views/cloud_accounts/_form.erb b/src/app/views/cloud_accounts/_form.erb new file mode 100644 index 0000000..78b3510 --- /dev/null +++ b/src/app/views/cloud_accounts/_form.erb @@ -0,0 +1,13 @@ +<ul>
<li>
- <%= form.label :username, "Choose a username" %>
- <%= form.text_field :username %>
</li>
<li>
- <%= form.label :password, form.object.new_record? ? "Choose a password" : "Change password" %>
- <%= form.password_field :password %>
</li>
Hmm. the "choose a username/password" implies that the user is creating an account -- but what's really going on is that the user is entering credentials for an already-existing provider account. Perhaps replace 'choose a' with 'enter your' or something similar
+<li>
- <%= select("provider", "id", @providers.map{|p| [p.name,p.id]} , { :include_blank => false }) %>
+</li>
The provider part should only be shown for 'add to pool' -- otherwise we just need a hidden provider_id field with the provider_id from the URL vars. For the provider selection you should set the provider_id attribute of the cloud_account object so you won't need to handle the association separately in the submit handling
+</ul> diff --git a/src/app/views/cloud_accounts/accounts_for_pool.html.erb b/src/app/views/cloud_accounts/accounts_for_pool.html.erb new file mode 100644 index 0000000..e273551 --- /dev/null +++ b/src/app/views/cloud_accounts/accounts_for_pool.html.erb @@ -0,0 +1,36 @@ +<% if @pool.cloud_accounts.size > 0 %> +<h1>These Cloud Accounts are already attached to this pool</h1> +<table> +<thead> +<tr> +<th scope="col">Provider Name</th> +<th scope="col">Cloud Account User Name</th> +</tr> +<% @pool.cloud_accounts.each {|a| %> +<tr> +<td><%= a.provider.name %></td> +<td><%= a.username %></td> +</tr> +<% } %> +</table> +<% end %>
+<% if @cloud_accounts.size == 0 %> +<h1>There are no existing Cloud Accounts available to add</h1> +<% else %> +<h1>These Cloud Accounts are available to add</h1> +<table> +<thead> +<tr> +<th scope="col">Provider Name</th> +<th scope="col">Cloud Account User Name</th> +</tr> +<% @cloud_accounts.each {|a| %> +<tr> +<td><%= a.provider.name %></td> +<td><%= a.username %> <%= link_to "Add this account", {:controller=> "portal_pool",
- :action => "add_account", :portal_pool => @pool, :cloud_account => a}, :class => "actionlink" %></td>
+</tr> +<% } %> +</table> +<% end %> diff --git a/src/app/views/cloud_accounts/new.html.erb b/src/app/views/cloud_accounts/new.html.erb new file mode 100644 index 0000000..40f32cb --- /dev/null +++ b/src/app/views/cloud_accounts/new.html.erb @@ -0,0 +1,14 @@ +<% if @providers.size == 0 %> +<h1>No Providers available to associate with a new cloud account</h1> +<% else %> +<h2 class="greeting">New Cloud Account</h2>
For the 'new' action we should be getting provider_id via a URL var
+<div class="dcloud_form">
- <% form_for @cloud_account, :url => { :action => "create" } do |f| %>
- <%= f.error_messages %>
<%= render :partial => "form", :object => f %>
- <%= f.submit "Create Cloud Account", :class => "submit" %>
- <% end %>
- <%= link_to "Cancel", root_path, :class => 'actionlink' %>
+</div> +<% end %> diff --git a/src/app/views/cloud_accounts/new_from_pool.html.erb b/src/app/views/cloud_accounts/new_from_pool.html.erb new file mode 100644 index 0000000..747df03 --- /dev/null +++ b/src/app/views/cloud_accounts/new_from_pool.html.erb @@ -0,0 +1,11 @@ +<h2 class="greeting">New Cloud Account</h2>
+<div class="dcloud_form">
- <% form_for @cloud_account, :url => { :action => "create_from_pool" } do |f| %>
- <%= f.error_messages %>
<%= render :partial => "form", :object => f %>
- <%= hidden_field :pool, :id %>
- <%= f.submit "Create Cloud Account", :class => "submit" %>
- <% end %>
- <%= link_to "Cancel", root_path, :class => 'actionlink' %>
+</div> diff --git a/src/app/views/portal_pool/show.html.erb b/src/app/views/portal_pool/show.html.erb index d649199..9d4e36c 100644 --- a/src/app/views/portal_pool/show.html.erb +++ b/src/app/views/portal_pool/show.html.erb @@ -35,4 +35,8 @@ </tbody>
</table> <% end %> -<%= link_to "Add a new instance", {:controller => "instance", :action => "new", :id => @pool}, :class=>"actionlink"%> +<%= link_to "Add a new instance", {:controller => "instance", :action => "new", :id => @pool}, :class=>"actionlink"%><br/> +<%= link_to "View/Add Existing Cloud Accounts", {:controller => "cloud_accounts",:action => "accounts_for_pool", :id => @pool}, :class=>"actionlink" %><br/>
+<%= link_to "Add a New Cloud Account", {:controller => +"cloud_accounts",:action => "new_from_pool", :id => @pool},
You should probably use pool_id instead of id here -- as suggested above on the controller comments.
+:class=>"actionlink" %>
[PATCH portal] Make a temporary usable nav.
Thanks to sseago for a great idea that made this patch better.
Tried to do this in a way that the convenience method I add here will be useful in the new design as well. --- src/app/controllers/application_controller.rb | 5 ++- src/app/models/permissioned_object.rb | 19 ++++++++++++ src/app/views/layouts/_main_nav.html.erb | 38 ++++++++++++++---------- src/public/stylesheets/dcloud.css | 9 +++-- 4 files changed, 50 insertions(+), 21 deletions(-)
diff --git a/src/app/controllers/application_controller.rb b/src/app/controllers/application_controller.rb index 63d908f..214eb2b 100644 --- a/src/app/controllers/application_controller.rb +++ b/src/app/controllers/application_controller.rb @@ -48,7 +48,10 @@ class ApplicationController < ActionController::Base end
def get_nav_items - @providers = Provider.find(:all) + if !current_user.nil? + @providers = Provider.list_for_user(@current_user, Privilege::PROVIDER_VIEW) + @pools = PortalPool.list_for_user(@current_user, Privilege::POOL_VIEW) + end end
perm_helper_string = "" diff --git a/src/app/models/permissioned_object.rb b/src/app/models/permissioned_object.rb index e4efaad..a253410 100644 --- a/src/app/models/permissioned_object.rb +++ b/src/app/models/permissioned_object.rb @@ -80,4 +80,23 @@ module PermissionedObject { :user => user.id, :priv => privilege }]) end + + # Any methods here will be able to use the context of the + # ActiveRecord model the module is included in. + def self.included(base) + base.class_eval do + def self.list_for_user(user, privilege) + if BasePortalObject.general_permission_scope.has_privilege(user, privilege) + all + else + find(:all, :include => {:permissions => {:role => :privileges}}, + :conditions => ["permissions.user_id=:user and + privileges.name=:priv", + {:user => user.id, + :priv => privilege }]) + end + end + end + end + end diff --git a/src/app/views/layouts/_main_nav.html.erb b/src/app/views/layouts/_main_nav.html.erb index 18ee43a..1894cb4 100644 --- a/src/app/views/layouts/_main_nav.html.erb +++ b/src/app/views/layouts/_main_nav.html.erb @@ -1,8 +1,13 @@ +<%=link_to "Add a provider", {:controller => "provider", :action => "new"}, :class => "actionlink" %> + +<%=link_to "Add a pool", {:controller => "portal_pool", :action => "new"}, :class => "actionlink" %> +<h3>Providers</h3> <ul id="providers"> - <% curId = params[:id].to_i %> + <% cur_id = params[:id].to_i %> + <% if !@providers.nil? %> <% @providers.each { |provider| %> <%#Note that this is a temporary way to selected proper list item for demo, and is not expected to stay this way%> - <% if controller.controller_name == "provider" && provider.id == curId + <% if controller.controller_name == "provider" && provider.id == cur_id selected_provider = "selected" else selected_provider = "" @@ -10,20 +15,21 @@ <li><%= link_to provider.name, {:controller => "provider", :action => "show", :id => provider}, :class => "providername #{selected_provider}"%> - <% provider.portal_pools.each { |pool| %> - <ul id="portal_pool-<%=provider.id%>"> - <% if controller.controller_name == "portal_pool" && pool.id == curId - selected_pool = "selected" - else selected_pool = "" - end %> - <li><%= link_to pool.name, - {:controller => "portal_pool", :action => "show", :id => pool}, - :class => "poolname #{selected_pool}" %></li> - </ul> - <% } %> </li> <% } %> + <% end %> </ul> -<%=link_to "Add a provider", {:controller => "provider", :action => "new"}, :class => "actionlink" %> - -<%=link_to "Add a pool", {:controller => "portal_pool", :action => "new"}, :class => "actionlink" %> +<h3>Pools</h3> +<ul id="portal_pools"> + <% if !@pools.nil? %> + <% @pools.each { |pool| %> + <% if controller.controller_name == "portal_pool" && pool.id == cur_id + selected_pool = "selected" + else selected_pool = "" + end %> + <li><%= link_to pool.name, + {:controller => "portal_pool", :action => "show", :id => pool}, + :class => "poolname #{selected_pool}" %></li> + <% } %> + <% end %> +</ul> \ No newline at end of file diff --git a/src/public/stylesheets/dcloud.css b/src/public/stylesheets/dcloud.css index 96cb95c..5b68ab6 100644 --- a/src/public/stylesheets/dcloud.css +++ b/src/public/stylesheets/dcloud.css @@ -210,24 +210,25 @@ ul#providers li a:hover { background: #efefef; }
-ul#providers li ul { +ul#portal_pools { list-style-type: none; line-height: 36px; margin: 0; padding: 0 0 0 10px; }
-ul#providers li ul li { +ul#portal_pools li { border-bottom: none; }
-ul#providers li ul li a { +ul#portal_pools li a { + display: block; line-height: 36px; padding-left: 32px; border-bottom: none; }
-ul#providers li ul li a:hover { +ul#portal_pools li a:hover { background: #efefef url(../images/icon_vmpool.png) no-repeat 2px 50%; }
Jason Guiditta wrote:
Tried to do this in a way that the convenience method I add here will be useful in the new design as well.
src/app/controllers/application_controller.rb | 5 ++- src/app/models/permissioned_object.rb | 19 ++++++++++++ src/app/views/layouts/_main_nav.html.erb | 38 ++++++++++++++---------- src/public/stylesheets/dcloud.css | 9 +++-- 4 files changed, 50 insertions(+), 21 deletions(-)
ACK,
This works for me
deltacloud-devel@lists.fedorahosted.org