From 380c24055a998ea6fb92b827282798923e3b3fea Mon Sep 17 00:00:00 2001 From: Nicolas Bally Date: Sat, 14 May 2011 15:25:41 +0200 Subject: [PATCH] Ajout des horaires d'ouvertures + prettyphoto pour messages --- .../public/menu_items_controller.rb | 2 +- app/views/public/home/show.html.haml | 15 +++++++++ app/views/public/menu_items/show.html.haml | 16 ++++++++-- .../public/shared/_contact_block.html.haml | 32 ++++++++++++++++--- app/views/public/shared/_even.html.haml | 4 +++ app/views/public/shared/_odd.html.haml | 4 +++ 6 files changed, 65 insertions(+), 8 deletions(-) create mode 100644 app/views/public/shared/_even.html.haml create mode 100644 app/views/public/shared/_odd.html.haml diff --git a/app/controllers/public/menu_items_controller.rb b/app/controllers/public/menu_items_controller.rb index 1f6047f..65e5a00 100644 --- a/app/controllers/public/menu_items_controller.rb +++ b/app/controllers/public/menu_items_controller.rb @@ -27,7 +27,7 @@ class Public::MenuItemsController < ApplicationController end else - redirect_to "/404.html" + redirect_to "/", :notice => "La page que vous demandez n'a pas pu être trouvée.

Vous avez donc été redirigé sur notre page d'accueil" end end diff --git a/app/views/public/home/show.html.haml b/app/views/public/home/show.html.haml index 2c2b74a..75fdc7c 100644 --- a/app/views/public/home/show.html.haml +++ b/app/views/public/home/show.html.haml @@ -1,3 +1,18 @@ +-if flash[:notice] + #flash_notice{:style => "display:none"}=raw(flash[:notice]) + + + #slider{:style => "width:979px;height:309px;"} diff --git a/app/views/public/menu_items/show.html.haml b/app/views/public/menu_items/show.html.haml index 4f0fa70..cc1b247 100644 --- a/app/views/public/menu_items/show.html.haml +++ b/app/views/public/menu_items/show.html.haml @@ -37,9 +37,21 @@ =menu_item_link(menu_item) > =@menu_item.name - + -if flash[:notice] - #flash_notice= raw flash[:notice] + #flash_notice=raw(flash[:notice]) + + =render @menu_item.menu_content.blocks[0] .clear diff --git a/app/views/public/shared/_contact_block.html.haml b/app/views/public/shared/_contact_block.html.haml index 710e9ce..446b487 100644 --- a/app/views/public/shared/_contact_block.html.haml +++ b/app/views/public/shared/_contact_block.html.haml @@ -1,12 +1,34 @@ #contact_block #horaires.content - Nous vous accueillons : + Horaire d'ouverture pour cette semaine : %br - ="- Le matin de 8h30 à 12h15 et L'après midi de 14h15 à 19h" + -if (Date.today.cweek).to_i%2 == 0 + =render :partial => "/public/shared/even" + -else + =render :partial => "/public/shared/odd" %br - ="Alternance une semaine sur deux : " - %br - ="- La pharmacie est fermée le samedi à partir de 12h15 ainsi que le lundi suivant." + + + + =link_to "Horaires pour la semaine prochaine", "#next_week", :rel => "prettyPhoto", :title => "" + + #next_week{:style => "display:none"} + %div{:style => "padding:1px"} + %h2 Horaires d'ouverture pour la semaine prochaine + %p + du lundi + =l Date.today.next_week, :format => :long + au dimanche + =l Date.today.next_week.end_of_week, :format => :long + =":" + + %p + -if (Date.today.cweek).to_i%2 == 0 + =render :partial => "/public/shared/odd" + -else + =render :partial => "/public/shared/even" + + #garde.content Pour connaître la pharmacie de garde : %br diff --git a/app/views/public/shared/_even.html.haml b/app/views/public/shared/_even.html.haml new file mode 100644 index 0000000..cc560f7 --- /dev/null +++ b/app/views/public/shared/_even.html.haml @@ -0,0 +1,4 @@ +=raw"- du mardi au vendredi : 8h30 à 12h15 et 14h15 à 19h" +%br +=raw"- le samedi : 8h30 à 12h15 et 14h15 à 18h" +%br diff --git a/app/views/public/shared/_odd.html.haml b/app/views/public/shared/_odd.html.haml new file mode 100644 index 0000000..05f7d54 --- /dev/null +++ b/app/views/public/shared/_odd.html.haml @@ -0,0 +1,4 @@ +="- du lundi au vendredi : 8h30 à 12h15 et 14h15 à 19h" +%br +="- le samedi : 8h30 à 12h15" +%br