Mohammed Morsi wrote:
> ---
> 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
>
>
Conditional ACK with one change below.
> diff --git a/src/app/controllers/portal_pool_controller.rb
> b/src/app/controllers/portal_pool_controller.rb
> index 7a99d90..2a18e1b 100644
> --- a/src/app/controllers/portal_pool_controller.rb
> +++ b/src/app/controllers/portal_pool_controller.rb
> @@ -49,6 +49,12 @@ class PortalPoolController < ApplicationController
> require_privilege(Privilege::ACCOUNT_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..09815d9 100644
> --- a/src/app/controllers/provider_controller.rb
> +++ b/src/app/controllers/provider_controller.rb
> @@ -61,6 +61,12 @@ class ProviderController < ApplicationController
> require_privilege(Privilege::ACCOUNT_VIEW, @provider)
> end
>
> + def realms
> + @provider = Provider.find(params[:id])
> + @realms = @provider.realms
> + require_privilege(Privilege::PROVIDER_VIEW, @provider)
> + end
> +
> def new_account
> @provider = Provider.find(params[:id])
> require_privilege(Privilege::ACCOUNT_MODIFY, @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 9901897..128d74c 100644
> --- a/src/app/views/portal_pool/show.html.erb
> +++ b/src/app/views/portal_pool/show.html.erb
> @@ -39,3 +39,4 @@
> <%= link_to "Accounts", {:action => "accounts", :id => @pool.id},
> :class=>"actionlink"%>
> <%= link_to "Hardware Profiles", {:action => "hardware_profiles", :id =>
> @pool.id}, :class=>"actionlink"%>
> <%=link_to "View Images", {:controller => "portal_pool", :action =>
> "images", :portal_pool => @pool}, :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>
> + <%[email protected] {|realm| %>
> + <tr>
> + <td><%= realm.name %></td>
>
Drop the ".name" and push it.
Scott
> + </tr>
> + <% } %>
> + </tbody>
> + </table>
> +<% end %>
>
_______________________________________________
deltacloud-devel mailing list
[email protected]
https://fedorahosted.org/mailman/listinfo/deltacloud-devel