From f0171d336fe0187b8bb809f991d2bf9ae27a078f Mon Sep 17 00:00:00 2001 From: Nicolas Bally Date: Fri, 23 Oct 2015 22:58:32 +0200 Subject: [PATCH 1/2] events --- app/assets/stylesheets/public.scss | 30 +++++++++++++++++----- app/helpers/events_helper.rb | 12 ++++----- app/views/layouts/public.html.haml | 6 ++--- app/views/public/events/_event.html.haml | 7 ++--- app/views/public/events/index.html.haml | 3 ++- app/views/public/events/show.html.haml | 11 +++++--- app/views/public/menu_items/show.html.haml | 4 +-- 7 files changed, 48 insertions(+), 25 deletions(-) diff --git a/app/assets/stylesheets/public.scss b/app/assets/stylesheets/public.scss index f1ba022..94e3420 100644 --- a/app/assets/stylesheets/public.scss +++ b/app/assets/stylesheets/public.scss @@ -547,7 +547,10 @@ article{ .image{ width:15%; float:left; - background:#757575; + background: #757575 center center no-repeat; + background-size:100%; + background-size:cover; + height:80px; overflow:hidden; margin-bottom:5px; @@ -586,13 +589,28 @@ h1{ .event{ + margin-bottom:2em; + %strong{ + + color:#E5383A; + } + .date{ + font-weight: 400; + font-family:$header_font, Arial, sans-serif; + + } .image{ - max-width:150px; - max-height:100px; - height:500px; - width:100%; + width:200px; + img{ + max-width:200px; + max-height:300px; + + width:100%; + float:left; - background:#757575; + background:#757575; + } + } diff --git a/app/helpers/events_helper.rb b/app/helpers/events_helper.rb index f6846f5..d3edeeb 100644 --- a/app/helpers/events_helper.rb +++ b/app/helpers/events_helper.rb @@ -4,22 +4,22 @@ module EventsHelper if event.entire_day? if event.stop_date? if event.start_at.strftime('%d/%m/%Y') == event.stop_at.strftime('%d/%m/%Y') - "le #{l(event.start_at, :format => date_format)}" + "le #{l(event.start_at, :format => date_format)}" else - "du #{l(event.start_at, :format => date_format)} au #{l(event.stop_at, :format => date_format)}" + "du #{l(event.start_at, :format => date_format)} au #{l(event.stop_at, :format => date_format)}" end else - "le #{l(event.start_at, :format => date_format)}" + "le #{l(event.start_at, :format => date_format)}" end else if event.stop_date? if event.start_at.strftime('%d/%m/%Y') == event.stop_at.strftime('%d/%m/%Y') - "le #{l(event.start_at, :format => date_format)} de #{l(event.start_at, :format => time_format)} à #{l(event.stop_at, :format => time_format)} " + "le #{l(event.start_at, :format => date_format)} de #{l(event.start_at, :format => time_format)} à #{l(event.stop_at, :format => time_format)} " else - "du #{l(event.start_at, :format => date_format)} à #{l(event.start_at, :format => time_format)} au #{l(event.stop_at, :format => date_format)} à #{l(event.stop_at, :format => time_format)} " + "du #{l(event.start_at, :format => date_format)} à #{l(event.start_at, :format => time_format)} au #{l(event.stop_at, :format => date_format)} à #{l(event.stop_at, :format => time_format)} " end else - "le #{l(event.start_at, :format => date_format)} à #{l(event.start_at, :format => time_format)}" + "le #{l(event.start_at, :format => date_format)} à #{l(event.start_at, :format => time_format)}" end end diff --git a/app/views/layouts/public.html.haml b/app/views/layouts/public.html.haml index a3ef510..f08c864 100644 --- a/app/views/layouts/public.html.haml +++ b/app/views/layouts/public.html.haml @@ -66,7 +66,7 @@ -if @menu_item and @menu_item.slug and @menu_item.slug == "index" .main_section_title - =link_to "Actualités +", "/blog.html" + =link_to "Actualités +", "/actualites.html" -article = Article.before(Date.today).recents.first @@ -87,7 +87,7 @@ -articles.each do |article| %a{:href => public_article_path(:id => article.slug)} .article - .image=image_tag article.image_file.file.large.medium.url if article.image_file + .image{:style => "background-image:url('"+(article.image_file.file.large.medium.url if article.image_file).to_s+"');"} .description @@ -102,7 +102,7 @@ #sidebar -if @menu_item and @menu_item.slug and @menu_item.slug == "index" .main_section_title - Prochainement + + =link_to "Prochainement +", "/agenda.html" =#render Event.recents.limit(2) diff --git a/app/views/public/events/_event.html.haml b/app/views/public/events/_event.html.haml index df65165..fc1809c 100644 --- a/app/views/public/events/_event.html.haml +++ b/app/views/public/events/_event.html.haml @@ -1,9 +1,9 @@ -= event_human_date(event) + .event .image=image_tag event.image_file.file.large.medium.url if event.image_file - - %strong=event.title + %h2.date=raw event_human_date(event) + %h1=event.title -if event.description and event.description != "" @@ -13,3 +13,4 @@ %br=link_to "En savoir plus", public_event_path(event) +.clear \ No newline at end of file diff --git a/app/views/public/events/index.html.haml b/app/views/public/events/index.html.haml index c751a9d..5b4605c 100644 --- a/app/views/public/events/index.html.haml +++ b/app/views/public/events/index.html.haml @@ -8,7 +8,8 @@ -while the_month <= last_month %h2{:class => "month_title"}=l(the_month.to_date, :format => :month_and_year) .month_content - =render :partial => "public/events/event", :collection =>Event.where('start_at < ? AND stop_at > ?',the_month.next_month, the_month.beginning_of_month).order(:start_at) + =render :partial => "public/events/event", :collection =>Event.where('(start_at < ? AND start_at > ?) OR (stop_at < ? AND stop_at > ?)',the_month.end_of_month, the_month.beginning_of_month,the_month.end_of_month, the_month.beginning_of_month).order(:start_at) + -the_month = the_month.next_month diff --git a/app/views/public/events/show.html.haml b/app/views/public/events/show.html.haml index de97d4c..12b9276 100644 --- a/app/views/public/events/show.html.haml +++ b/app/views/public/events/show.html.haml @@ -3,9 +3,14 @@ -@event = Event.find(params[:id]) -%h2=@event.title -= event_human_date(@event) - +%h1=@event.title +=raw event_human_date(@event) +%br +%br +.image=image_tag @event.image_file.file.large.medium.url if @event.image_file + +%br +%br .agenda_description =simple_format @event.description diff --git a/app/views/public/menu_items/show.html.haml b/app/views/public/menu_items/show.html.haml index 9c3f344..c4aae10 100644 --- a/app/views/public/menu_items/show.html.haml +++ b/app/views/public/menu_items/show.html.haml @@ -20,9 +20,7 @@ %ul -menu_item.children.where(:enabled => true, :visible => true).order(:position).each do |menu_item| %li=menu_item_link(menu_item) - -if first_level_menu.slug == "livres-eft" - %li=link_to "Ebook Maigrir Durablement avec l'EFT", "http://www.maigrir-durablement-avec-eft.com/", :target => "_blank" - %li=link_to "Ebook Arrêter de Fumer avec l'EFT", "http://www.arreter-de-fumer-avec-eft.com/", :target => "_blank" + .breadcrumb -if @menu_item.ancestors From df01f33887f6047f795bc4f3e3c34657743fed5b Mon Sep 17 00:00:00 2001 From: Nicolas Bally Date: Fri, 23 Oct 2015 23:36:55 +0200 Subject: [PATCH 2/2] actus --- app/assets/stylesheets/public.scss | 43 +++++++++++++++++++++- app/views/public/articles/_index.html.haml | 9 +++-- 2 files changed, 46 insertions(+), 6 deletions(-) diff --git a/app/assets/stylesheets/public.scss b/app/assets/stylesheets/public.scss index 94e3420..5372a0e 100644 --- a/app/assets/stylesheets/public.scss +++ b/app/assets/stylesheets/public.scss @@ -29,14 +29,14 @@ a{ } body{ - font-family:Lato; + font-family:"Museo sans"; font-weight:300; line-height:1.4em; text-align:justify; padding:0; margin:0; - font-size:14px; + font-size:15px; color:#333333; @@ -572,6 +572,8 @@ article{ } + + h1{ color:#69952f; @@ -614,4 +616,41 @@ h1{ } +} +.articles_index{ + + a{ + color:inherit; + &:hover{ + + color:inherit; + text-decoration:none; + } + + + } +} + + +.article_list{ + + .image{ + width:200px; + float:left; + background: #757575 center center no-repeat; + background-size:100%; + background-size:cover; + + overflow:hidden; + margin-bottom:5px; + } + .description{ + + + margin-left:210px; + margin-bottom:5px; + + } + + } \ No newline at end of file diff --git a/app/views/public/articles/_index.html.haml b/app/views/public/articles/_index.html.haml index 99e96e9..5ebc14a 100644 --- a/app/views/public/articles/_index.html.haml +++ b/app/views/public/articles/_index.html.haml @@ -3,17 +3,18 @@ -articles = @articles -if articles - .articles + .articles_index -articles.each do |article| %a{:href => public_article_path(:id => article.slug)} - .article + .article_list .image=image_tag article.image_file.file.large.medium.url if article.image_file .description - %h2=article.title + %h1=article.title + =simple_format article.description - .clear + .clear #articles_pagination= paginate @articles -else %p