From 624d235992bbf8db1f6736b1a8e8dbe82f41e0a5 Mon Sep 17 00:00:00 2001 From: Rafael Martins Date: Tue, 21 Feb 2012 21:25:33 -0200 Subject: [PATCH] Fix for solidarity economy percentage on product search view --- app/models/product.rb | 1 - app/views/search/_product.rhtml | 8 ++++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/app/models/product.rb b/app/models/product.rb index 583203f..e8affa7 100644 --- a/app/models/product.rb +++ b/app/models/product.rb @@ -125,7 +125,6 @@ class Product < ActiveRecord::Base end end - # Note: will probably be completely overhauled for AI1413 def inputs_prices? return false if self.inputs.count <= 0 self.inputs.each do |input| diff --git a/app/views/search/_product.rhtml b/app/views/search/_product.rhtml index 591ffa2..2c18d3e 100644 --- a/app/views/search/_product.rhtml +++ b/app/views/search/_product.rhtml @@ -23,10 +23,10 @@ <% product.inputs.each{ |i| t_i += 1; se_i += 1 if i.is_from_solidarity_economy } %> <% p = case (se_i.to_f/t_i)*100 when 0..24.999 then ["0", _("")]; - when 25..49.999 then ["0", _("25%")]; - when 50..74.999 then ["25", _("50%")]; - when 75..99.999 then ["50", _("75%")]; - when 100 then ["75", _("100%")]; + when 25..49.999 then ["25", _("25%")]; + when 50..74.999 then ["50", _("50%")]; + when 75..99.999 then ["75", _("75%")]; + when 100 then ["100", _("100%")]; end %>
<%= p[1] %> -- libgit2 0.21.2