From d55cc5c33b70e3ca53e8ad7d9938de6132fb423f Mon Sep 17 00:00:00 2001 From: Nicolas Bally Date: Sun, 29 Apr 2018 16:30:21 +0200 Subject: [PATCH] suite --- app/assets/stylesheets/public.scss | 41 +++++++++++++++++++ app/controllers/public/products_controller.rb | 1 + app/views/layouts/public.html.haml | 8 +++- app/views/public/shared/_sub_menu.html.haml | 10 +++++ 4 files changed, 58 insertions(+), 2 deletions(-) create mode 100644 app/views/public/shared/_sub_menu.html.haml diff --git a/app/assets/stylesheets/public.scss b/app/assets/stylesheets/public.scss index cd931e4..a29ec2c 100755 --- a/app/assets/stylesheets/public.scss +++ b/app/assets/stylesheets/public.scss @@ -1,3 +1,5 @@ +$blue:#428bca; + @import "bootstrap"; @import "fontawesome/font-awesome"; @@ -16,6 +18,45 @@ @import "vendor/flipclock"; + +.sub_menu_boutique{ + + padding:5px 5px; + a{ + color:white; + display:inline-block; + padding:4px 10px; + margin:0 3px; + border-radius:30px; + background:#a39f9f; + + &:hover, &.active{ + text-decoration:none; + color:white; + background:$blue !important; + + } + + + } + + ul{ + margin:0; + padding:2px 10px; + + li{ + padding:0; + margin:0; + display:inline; + + + + } + + } + +} + .footer{ position:absolute; bottom:10px; diff --git a/app/controllers/public/products_controller.rb b/app/controllers/public/products_controller.rb index bf64da0..153668b 100755 --- a/app/controllers/public/products_controller.rb +++ b/app/controllers/public/products_controller.rb @@ -19,6 +19,7 @@ class Public::ProductsController < ApplicationController def index + @products = true @reseaux = current_customer.reseauxes.find(params[:reseaux_id]) @reseaux_layout = true session[:reseaux_id] =@reseaux.id diff --git a/app/views/layouts/public.html.haml b/app/views/layouts/public.html.haml index 111dd7e..e09269b 100755 --- a/app/views/layouts/public.html.haml +++ b/app/views/layouts/public.html.haml @@ -56,9 +56,13 @@ -else =link_to image_tag("/logo.png", :id => "logo"), "/" .clear{:style => "height:1px;"} - - + =render :partial => "public/shared/sub_menu" + + #main + + + =yield -if !@my_reseauxes .footer diff --git a/app/views/public/shared/_sub_menu.html.haml b/app/views/public/shared/_sub_menu.html.haml new file mode 100644 index 0000000..b76c145 --- /dev/null +++ b/app/views/public/shared/_sub_menu.html.haml @@ -0,0 +1,10 @@ +-if @needs or @products or @product + .sub_menu_boutique + .center + %ul + -if current_customer.account_validated? + %li=link_to "Besoins", public_needs_path, :class => ("active" if @needs) + + -if session[:reseaux_id].to_i > 0 + %li=link_to "Offres", public_reseaux_products_path(:reseaux_id => session[:reseaux_id].to_i), :class => ("active" if @products or @product) +