--- src/app/controllers/portal_pool_controller.rb | 6 ++++++ src/app/controllers/provider_controller.rb | 6 ++++++ src/app/views/portal_pool/realms.html.erb | 1 + src/app/views/portal_pool/show.html.erb | 1 + src/app/views/provider/realms.html.erb | 1 + src/app/views/provider/show.html.erb | 1 + src/app/views/realms/_list.html.erb | 18 ++++++++++++++++++ 7 files changed, 34 insertions(+), 0 deletions(-) create mode 100644 src/app/views/portal_pool/realms.html.erb create mode 100644 src/app/views/provider/realms.html.erb create mode 100644 src/app/views/realms/_list.html.erb
diff --git a/src/app/controllers/portal_pool_controller.rb b/src/app/controllers/portal_pool_controller.rb index 5e42d55..8ef046d 100644 --- a/src/app/controllers/portal_pool_controller.rb +++ b/src/app/controllers/portal_pool_controller.rb @@ -44,6 +44,12 @@ class PortalPoolController < ApplicationController require_privilege(Privilege::POOL_VIEW, @pool) end
+ def realms + @pool = PortalPool.find(params[:id]) + @realms = @pool.realms + require_privilege(Privilege::POOL_VIEW,@pool) + end + def new require_privilege(Privilege::POOL_MODIFY) @portal_pool = PortalPool.new diff --git a/src/app/controllers/provider_controller.rb b/src/app/controllers/provider_controller.rb index b676fa7..0436aee 100644 --- a/src/app/controllers/provider_controller.rb +++ b/src/app/controllers/provider_controller.rb @@ -32,6 +32,12 @@ class ProviderController < ApplicationController require_privilege(Privilege::PROVIDER_VIEW, @provider) end
+ def realms + @provider = Provider.find(params[:id]) + @realms = @provider.realms + require_privilege(Privilege::PROVIDER_VIEW, @provider) + end + def new require_privilege(Privilege::PROVIDER_MODIFY) @provider = Provider.new(params[:provider]) diff --git a/src/app/views/portal_pool/realms.html.erb b/src/app/views/portal_pool/realms.html.erb new file mode 100644 index 0000000..3aca533 --- /dev/null +++ b/src/app/views/portal_pool/realms.html.erb @@ -0,0 +1 @@ +<%= render :partial => 'realms/list' %> diff --git a/src/app/views/portal_pool/show.html.erb b/src/app/views/portal_pool/show.html.erb index 5a29875..cdd9e5d 100644 --- a/src/app/views/portal_pool/show.html.erb +++ b/src/app/views/portal_pool/show.html.erb @@ -37,3 +37,4 @@ <% end %> <%= link_to "Add a new instance", {:controller => "instance", :action => "new", :id => @pool}, :class=>"actionlink"%> <%= link_to "Hardware Profiles", {:action => "hardware_profiles", :id => @pool.id}, :class=>"actionlink"%> +<%= link_to "Realms", {:action => "realms", :id => @pool.id}, :class=>"actionlink"%> diff --git a/src/app/views/provider/realms.html.erb b/src/app/views/provider/realms.html.erb new file mode 100644 index 0000000..3aca533 --- /dev/null +++ b/src/app/views/provider/realms.html.erb @@ -0,0 +1 @@ +<%= render :partial => 'realms/list' %> diff --git a/src/app/views/provider/show.html.erb b/src/app/views/provider/show.html.erb index 299346f..884ce81 100644 --- a/src/app/views/provider/show.html.erb +++ b/src/app/views/provider/show.html.erb @@ -19,6 +19,7 @@ </table> <% end %> <%= link_to "Add a pool", {:controller => "portal_pool", :action => "new", :provider => @provider}, :class => "actionlink" %> +<%= link_to "Realms", {:action => "realms", :id => @provider.id}, :class=>"actionlink"%> <% form_tag :action => 'destroy' do %> <%=hidden_field :provider, :id %> <%= submit_tag "Delete Provider", :class => "submit_link" %> diff --git a/src/app/views/realms/_list.html.erb b/src/app/views/realms/_list.html.erb new file mode 100644 index 0000000..49fcd36 --- /dev/null +++ b/src/app/views/realms/_list.html.erb @@ -0,0 +1,18 @@ +<% if @realms.size == 0 %> +<h1>There are no realms to display</h1> +<% else %> + <table> + <thead> + <tr> + <th scope="col">Name</th> + </tr> + </thead> + <tbody> + <%@realms.each {|realm| %> + <tr> + <td><%= realm.name %></td> + </tr> + <% } %> + </tbody> + </table> +<% end %>
deltacloud-devel@lists.fedorahosted.org