From 1f9a37ad60ec32499660a74fe06fc1d5f84eb93f Mon Sep 17 00:00:00 2001 From: Nicolas Bally Date: Fri, 14 Sep 2012 12:15:04 +0200 Subject: [PATCH] promotions --- app/views/public/home/show.html.haml | 15 +++------------ app/views/public/promotions/_promotion.html.haml | 2 +- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/app/views/public/home/show.html.haml b/app/views/public/home/show.html.haml index daf619e..3071c8e 100644 --- a/app/views/public/home/show.html.haml +++ b/app/views/public/home/show.html.haml @@ -44,10 +44,7 @@ -promotion = @home.promotion_1 - -if promotion.month.beginning_of_month == Date.today.beginning_of_month - .label=link_to image_tag('front/en-cours.png'), "/pages/promotions.html" - -elsif promotion.month.beginning_of_month == Date.today.next_month.beginning_of_month - .label=link_to image_tag('front/a-venir.png'), "/pages/promotions.html" + .img =link_to image_tag(promotion.image_file.file.large.medium.small.thumb.url), "/pages/promotions.html" if promotion.image_file .title @@ -61,10 +58,7 @@ -promotion = @home.promotion_2 - -if promotion.month.beginning_of_month == Date.today.beginning_of_month - .label=link_to image_tag('front/en-cours.png'), "/pages/promotions.html" - -elsif promotion.month.beginning_of_month == Date.today.next_month.beginning_of_month - .label=link_to image_tag('front/a-venir.png'), "/pages/promotions.html" + .img =link_to image_tag(promotion.image_file.file.large.medium.small.thumb.url), "/pages/promotions.html" if promotion.image_file .title @@ -78,10 +72,7 @@ -promotion = @home.promotion_3 - -if promotion.month.beginning_of_month == Date.today.beginning_of_month - .label=link_to image_tag('front/en-cours.png'), "/pages/promotions.html" - -elsif promotion.month.beginning_of_month == Date.today.next_month.beginning_of_month - .label=link_to image_tag('front/a-venir.png'), "/pages/promotions.html" + .img =link_to image_tag(promotion.image_file.file.large.medium.small.thumb.url), "/pages/promotions.html" if promotion.image_file .title diff --git a/app/views/public/promotions/_promotion.html.haml b/app/views/public/promotions/_promotion.html.haml index 9252717..f7d9ba2 100644 --- a/app/views/public/promotions/_promotion.html.haml +++ b/app/views/public/promotions/_promotion.html.haml @@ -2,7 +2,7 @@ .img - =image_tag promotion.image_file.file.square.url if promotion.image_file + =image_tag promotion.image_file.file.large.medium.small.thumb.url if promotion.image_file .title %h3=promotion.title