On 12/06/2011 01:23 PM, jprovazn(a)redhat.com wrote:
From: Jan Provaznik<jprovazn(a)redhat.com>
---
src/app/controllers/deployables_controller.rb | 2 +-
src/app/views/deployables/show.html.haml | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/app/controllers/deployables_controller.rb
b/src/app/controllers/deployables_controller.rb
index 0072533..f5a894d 100644
--- a/src/app/controllers/deployables_controller.rb
+++ b/src/app/controllers/deployables_controller.rb
@@ -54,7 +54,7 @@ class DeployablesController< ApplicationController
require_privilege(Privilege::VIEW, @deployable)
save_breadcrumb(catalog_deployable_path(@catalog, @deployable), @deployable.name)
@providers = Provider.all
- @catalogs_options = Catalog.all.map {|c| [c.name, c.id] unless c ==
@catalog}.compact
+ @catalogs_options = Catalog.list_for_user(current_user, Privilege::VIEW).select {|c|
!(a)deployable.catalogs.include?(c)}
add_permissions_inline(@deployable)
@image_details = @deployable.get_image_details
@image_details.each do |assembly|
diff --git a/src/app/views/deployables/show.html.haml
b/src/app/views/deployables/show.html.haml
index 9917a82..06964b2 100644
--- a/src/app/views/deployables/show.html.haml
+++ b/src/app/views/deployables/show.html.haml
@@ -85,7 +85,7 @@
.section-controls
= form_for(:catalog_entry, :url => catalog_entries_path) do |f|
= f.label :catalog_id, t('catalog_entries.show.choose_catalog')
- = f.select :catalog_id, options_for_select(@catalogs_options)
+ = f.select :catalog_id, options_for_select((a)catalogs_options.map {|c| [c.name,
c.id]})
= f.hidden_field(:deployable_id, :value => @deployable.id)
= f.submit t('catalog_entries.show.add_catalog'), :id =>
:add_catalog, :class => 'button pill'
.content
self ACK & pushed