From a76eff9f8186a514b22bca3602b0775daed783d7 Mon Sep 17 00:00:00 2001 From: Nicolas Bally Date: Tue, 20 Mar 2018 17:35:43 +0100 Subject: [PATCH] suite --- app/views/public/plumes/show.html.haml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/app/views/public/plumes/show.html.haml b/app/views/public/plumes/show.html.haml index 74d6705..f6bd9a1 100644 --- a/app/views/public/plumes/show.html.haml +++ b/app/views/public/plumes/show.html.haml @@ -6,7 +6,17 @@ =render :partial => "sommaire" .right_plume - -@plume.plume_articles.where(:id => [1,4]).each do |article| + -id = [] + -cat = @plume.plume_cats.where(:title => "édito").first + -if cat + -id << cat.plume_articles.first.id if cat.plume_articles.first + + -cat = @plume.plume_cats.where(:title => "Dossier").first + -if cat + -id << cat.plume_articles.first.id if cat.plume_articles.first + + + -@plume.plume_articles.where(:id => id).each do |article| .article .inner .image.with_ratio.fill_img{:style => "background-image:url('"+(article.image_file.file.large.medium.url if article.image_file).to_s+"');", :data => {:ratio => 0.6}} @@ -20,8 +30,12 @@ =article.description .clear + -id = [] + -cat = @plume.plume_cats.where(:title => "Grain de sable").first + -if cat + -id << cat.plume_articles.first.id if cat.plume_articles.first - -@plume.plume_articles.where(:id => [5]).each do |article| + -@plume.plume_articles.where(:id => id).each do |article| .article.article_large .inner .image.with_ratio.fill_img{:style => "background-image:url('"+(article.image_file.file.large.medium.url if article.image_file).to_s+"');", :data => {:ratio => 0.6}}