From aeb445e4f236392bba4d384368e1abadb3ee220f Mon Sep 17 00:00:00 2001 From: Nicolas Bally Date: Tue, 12 Mar 2019 15:50:19 +0100 Subject: [PATCH] suite --- .../public/p_products/_p_product.html.haml | 19 ++++---- app/views/public/p_products/show.html.haml | 45 ++++++++++--------- 2 files changed, 33 insertions(+), 31 deletions(-) diff --git a/app/views/public/p_products/_p_product.html.haml b/app/views/public/p_products/_p_product.html.haml index 69fc5a4..844bb76 100644 --- a/app/views/public/p_products/_p_product.html.haml +++ b/app/views/public/p_products/_p_product.html.haml @@ -10,13 +10,14 @@ .img.with_ratio{:style => ("background: grey url('"+(p_product.image_file.file.large.medium.small.thumb.url if p_product.image_file).to_s+"?u="+(p_product.image_file.updated_at if p_product.image_file).to_s+"') no-repeat center center;background-size:contain;" ), :data => {:ratio => "1.10"}} - -if p_product.get_prices(current_p_customer).first - %p.price - -if p_product.get_prices(current_p_customer).count > 1 - Prix de - =number_to_currency p_product.get_prices(current_p_customer).last.price - à - = number_to_currency p_product.get_prices(current_p_customer).first.price + -if current_p_customer.account_validated + -if p_product.get_prices(current_p_customer).first + %p.price + -if p_product.get_prices(current_p_customer).count > 1 + Prix de + =number_to_currency p_product.get_prices(current_p_customer).last.price + à + = number_to_currency p_product.get_prices(current_p_customer).first.price - -elsif p_product.get_prices(current_p_customer).count == 1 - =number_to_currency p_product.get_prices(current_p_customer).last.price \ No newline at end of file + -elsif p_product.get_prices(current_p_customer).count == 1 + =number_to_currency p_product.get_prices(current_p_customer).last.price \ No newline at end of file diff --git a/app/views/public/p_products/show.html.haml b/app/views/public/p_products/show.html.haml index 01bf033..0150a17 100644 --- a/app/views/public/p_products/show.html.haml +++ b/app/views/public/p_products/show.html.haml @@ -26,34 +26,35 @@ -if @p_product.get_prices(current_p_customer).count > 0 and @p_product.get_prices(current_p_customer).first.price > 0.0 .sub_header - .right + -if current_p_customer.account_validated + .right - -if @p_product.get_prices(current_p_customer).count > 1 - %p - Prix de - =number_to_currency @p_product.get_prices(current_p_customer).last.price - à - = number_to_currency @p_product.get_prices(current_p_customer).first.price - %table.table.price_table - %tr + -if @p_product.get_prices(current_p_customer).count > 1 + %p + Prix de + =number_to_currency @p_product.get_prices(current_p_customer).last.price + à + = number_to_currency @p_product.get_prices(current_p_customer).first.price + %table.table.price_table + %tr - -@p_product.get_prices(current_p_customer).each do |price| + -@p_product.get_prices(current_p_customer).each do |price| - %td - A partir de - =price.nbr.to_i - ex - %tr + %td + A partir de + =price.nbr.to_i + ex + %tr - -@p_product.get_prices(current_p_customer).each do |price| + -@p_product.get_prices(current_p_customer).each do |price| - %td - =number_to_currency price.price + %td + =number_to_currency price.price - -elsif @p_product.get_prices(current_p_customer).count == 1 - %p - %strong Votre prix : - =number_to_currency @p_product.get_prices(current_p_customer).last.price + -elsif @p_product.get_prices(current_p_customer).count == 1 + %p + %strong Votre prix : + =number_to_currency @p_product.get_prices(current_p_customer).last.price -if !current_p_customer.account_validated %p