Commit 78432cf268a41968e8ce76c37b4d957f1eb97e79
Committed by
Joenio Costa
1 parent
f2ed752f
Exists in
master
and in
29 other branches
Fixes of 0.25
On a product's page, the button "Back to product" redirects to catalog/index Removed link of certifier if certifier doesn's have link
Showing
3 changed files
with
8 additions
and
3 deletions
Show diff stats
app/helpers/manage_products_helper.rb
@@ -195,7 +195,12 @@ module ManageProductsHelper | @@ -195,7 +195,12 @@ module ManageProductsHelper | ||
195 | def display_qualifiers(product) | 195 | def display_qualifiers(product) |
196 | data = '' | 196 | data = '' |
197 | product.product_qualifiers.each do |pq| | 197 | product.product_qualifiers.each do |pq| |
198 | - certified_by = pq.certifier ? _(' certified by %s') % link_to(pq.certifier.name, pq.certifier.link) : '' | 198 | + certified_by = '' |
199 | + certifier = pq.certifier | ||
200 | + if certifier | ||
201 | + certifier_name = certifier.link.blank? ? certifier.name : link_to(certifier.name, certifier.link) | ||
202 | + certified_by = _(' certified by %s') % certifier_name | ||
203 | + end | ||
199 | data << content_tag('li', '✔ ' + pq.qualifier.name + certified_by, :class => 'product-qualifiers-item') | 204 | data << content_tag('li', '✔ ' + pq.qualifier.name + certified_by, :class => 'product-qualifiers-item') |
200 | end | 205 | end |
201 | content_tag('ul', data, :id => 'product-qualifiers') | 206 | content_tag('ul', data, :id => 'product-qualifiers') |
app/views/manage_products/show.rhtml
@@ -25,6 +25,6 @@ | @@ -25,6 +25,6 @@ | ||
25 | </div> | 25 | </div> |
26 | 26 | ||
27 | <% button_bar do %> | 27 | <% button_bar do %> |
28 | - <%= button :back, _('Back to the product listing'), :action => 'index' %> | 28 | + <%= button :back, _('Back to the product listing'), :controller => 'catalog', :action => 'index' %> |
29 | <%= button :delete, _('Remove product or service'), {:action => 'destroy', :id => @product}, :class => 'requires-permission-manage_products', :style => 'display:none;' %> | 29 | <%= button :delete, _('Remove product or service'), {:action => 'destroy', :id => @product}, :class => 'requires-permission-manage_products', :style => 'display:none;' %> |
30 | <% end %> | 30 | <% end %> |
test/functional/manage_products_controller_test.rb
@@ -257,7 +257,7 @@ class ManageProductsControllerTest < Test::Unit::TestCase | @@ -257,7 +257,7 @@ class ManageProductsControllerTest < Test::Unit::TestCase | ||
257 | :descendant => { | 257 | :descendant => { |
258 | :tag => 'a', | 258 | :tag => 'a', |
259 | :attributes => { | 259 | :attributes => { |
260 | - :href => "/myprofile/#{enterprise.identifier}/manage_products", | 260 | + :href => "/catalog/#{enterprise.identifier}", |
261 | }, | 261 | }, |
262 | :content => /Back to the product listing/ | 262 | :content => /Back to the product listing/ |
263 | } | 263 | } |