From d7698aae141f42ccf66b39e53776f119178028c5 Mon Sep 17 00:00:00 2001 From: Antonio Terceiro Date: Tue, 6 Jan 2009 13:53:59 -0300 Subject: [PATCH] ActionItem862: not displaying links for disabled enterprises --- app/helpers/catalog_helper.rb | 2 +- app/helpers/display_helper.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/helpers/catalog_helper.rb b/app/helpers/catalog_helper.rb index 984b5b4..f2329fd 100644 --- a/app/helpers/catalog_helper.rb +++ b/app/helpers/catalog_helper.rb @@ -11,7 +11,7 @@ include DisplayHelper content_tag('h3', link_to_product(product)) + content_tag('ul', (product.price ? content_tag('li', _('Price: %s') % ( "%.2f" % product.price), :class => 'product_price') : '') + - content_tag('li', link_to_category(product.product_category), :class => 'product_category') + content_tag('li', profile.enabled? ? link_to_category(product.product_category) : product.product_category, :class => 'product_category') ) + (product.description ? content_tag('div', txt2html(product.description), :class => 'description') : tag('br', :style => 'clear:both')), :class => 'product') diff --git a/app/helpers/display_helper.rb b/app/helpers/display_helper.rb index 09d82bf..4b96489 100644 --- a/app/helpers/display_helper.rb +++ b/app/helpers/display_helper.rb @@ -2,7 +2,7 @@ module DisplayHelper def link_to_product(product, opts={}) return _('No product') unless product - link_to content_tag( 'span', product.name ), + link_to_if product.enterprise.enabled?, content_tag( 'span', product.name ), product.enterprise.generate_url(:controller => 'catalog', :action => 'show', :id => product), opts end -- libgit2 0.21.2