From 788384de83061ed936df8b170dd2e0ed1fb766fa Mon Sep 17 00:00:00 2001 From: Nicolas Bally Date: Wed, 13 Sep 2017 23:04:39 +0200 Subject: [PATCH] suite --- app/assets/stylesheets/public.scss | 2 + app/views/layouts/public.html.haml | 3 +- app/views/public/articles/_article.html.haml | 59 +++++++++++++------ app/views/public/shared/_first_menu.html.haml | 2 + 4 files changed, 48 insertions(+), 18 deletions(-) diff --git a/app/assets/stylesheets/public.scss b/app/assets/stylesheets/public.scss index 53b88b9..18e2b0f 100644 --- a/app/assets/stylesheets/public.scss +++ b/app/assets/stylesheets/public.scss @@ -143,6 +143,7 @@ h3{ #body{ margin:0 20px; margin-top:30px; + min-height:400px; } @@ -496,6 +497,7 @@ cursor:pointer background:#f2f2f2; max-width:1000px; margin-top:30px; + img{ position:relative; top:-30px; diff --git a/app/views/layouts/public.html.haml b/app/views/layouts/public.html.haml index 6f94adf..5a05466 100644 --- a/app/views/layouts/public.html.haml +++ b/app/views/layouts/public.html.haml @@ -67,6 +67,7 @@ #menu-top #menu =link_to image_tag( "/logo.png", :class => "logo", :alt => ""), "/" + =render(:partial => "public/shared/first_menu") .clear @@ -154,7 +155,7 @@ $("#big_menu_"+$(this).data("big-menu")).show() - %h2{:style => "text-align:center"} Actualités + %h2{:style => "text-align:center;font-size:34px;margin-top:50px"} Actualités =render :collection => Article.recents, :partial => "public/articles/article" #newsletter diff --git a/app/views/public/articles/_article.html.haml b/app/views/public/articles/_article.html.haml index c5c2401..e69d270 100644 --- a/app/views/public/articles/_article.html.haml +++ b/app/views/public/articles/_article.html.haml @@ -4,24 +4,49 @@ -article_counter = article_counter || 1 --if !(article_counter+1).odd? - .article.left - .row-fluid - .span5 - - =image_tag article.image_file.file.url if article.image_file - .span7{:style => "padding-right:1em;"} - %h2=link_to article.lang("fr").title, public_article_path(:id => article.lang("fr").slug) - =simple_format article.lang("fr").description --else - .article.right - .row-fluid - .span7{:style => "padding-left:1em;"} - %h2=link_to article.lang("fr").title, public_article_path(:id => article.lang("fr").slug) - =simple_format article.lang("fr").description - .span5 + +.article.left + .row-fluid + .span3 + + =image_tag article.image_file.file.url if article.image_file + + .span9{:style => "padding-left:2em;"} + %h2=link_to article.lang("fr").title, public_article_path(:id => article.lang("fr").slug) + =simple_format article.lang("fr").description + %br + %br + + =link_to "Lire la suite", public_article_path(:id => article.lang("fr").slug), :class => "plus" if article.blocks.where(:lang_site_id => 1).first.portlets.count > 0 + + +-if false + -if !(article_counter+1).odd? + .article.left + .row-fluid + .span4 - =image_tag article.image_file.file.url if article.image_file + =image_tag article.image_file.file.url if article.image_file + + .span8{:style => "padding-left:2em;"} + %h2=link_to article.lang("fr").title, public_article_path(:id => article.lang("fr").slug) + =simple_format article.lang("fr").description + %br + %br + + =link_to "Lire la suite", public_article_path(:id => article.lang("fr").slug), :class => "plus" if article.blocks.where(:lang_site_id => 1).first.portlets.count > 0 + -else + .article.right + .row-fluid + .span8{:style => "padding-right:2em;"} + %h2=link_to article.lang("fr").title, public_article_path(:id => article.lang("fr").slug) + =simple_format article.lang("fr").description + %br + %br + =link_to "Lire la suite", public_article_path(:id => article.lang("fr").slug), :class => "plus" if article.blocks.where(:lang_site_id => 1).first.portlets.count > 0 + .span4 + + =image_tag article.image_file.file.url if article.image_file \ No newline at end of file diff --git a/app/views/public/shared/_first_menu.html.haml b/app/views/public/shared/_first_menu.html.haml index 2719297..35b6bf7 100644 --- a/app/views/public/shared/_first_menu.html.haml +++ b/app/views/public/shared/_first_menu.html.haml @@ -1,5 +1,7 @@ .links =link_to ic(:home), "/", :class => "link" + =link_to "La ferme","/la-ferme.html" + =link_to "Les activités", "/les-activites.html" =link_to "Actualités", public_articles_path(), :class => "link" -MenuItem.where(:parent_id => nil, :menu_id => Menu.first.id).order(:position).each do |menu_item| =menu_item_link(menu_item)