From 735ffde7c335d18cf4d802b48200e9b3ba0ddc5e Mon Sep 17 00:00:00 2001 From: Nicolas VARROT Date: Tue, 22 Mar 2016 11:25:18 +0100 Subject: [PATCH] =?UTF-8?q?N=C3=A9gos=20video=20after=20Login=20and=20regi?= =?UTF-8?q?stration?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../public/customers_auths_controller.rb | 15 ++++++++------- app/controllers/public/customers_controller.rb | 7 +++++++ app/views/layouts/public.html.haml | 2 +- app/views/public/shared/_menu.html.haml | 3 +-- 4 files changed, 17 insertions(+), 10 deletions(-) diff --git a/app/controllers/public/customers_auths_controller.rb b/app/controllers/public/customers_auths_controller.rb index 7a5c88e..f767559 100755 --- a/app/controllers/public/customers_auths_controller.rb +++ b/app/controllers/public/customers_auths_controller.rb @@ -22,17 +22,11 @@ class Public::CustomersAuthsController < ApplicationController end - if cookies[:video_read] == "true" - @video_must_read = false - else - cookies.permanent[:video_read] = "true" - @video_must_read = true - end end def create - @video_must_read = false + @biglogo = true @customer = Customer.new() if cookies[:mlm_token] and @parent = Customer.find_parrain(cookies[:mlm_token]) @@ -58,6 +52,13 @@ class Public::CustomersAuthsController < ApplicationController user.last_sign_in_at = Time.now user.save(:validate => false) + if cookies[:video_read] == "true" + flash[:read_video] = false + else + cookies.permanent[:video_read] = "true" + flash[:read_video] = true + end + redirect_to :root else flash.now.alert = "Email ou mot de passe incorect" diff --git a/app/controllers/public/customers_controller.rb b/app/controllers/public/customers_controller.rb index 838aed7..a78c24f 100755 --- a/app/controllers/public/customers_controller.rb +++ b/app/controllers/public/customers_controller.rb @@ -78,6 +78,13 @@ class Public::CustomersController < ApplicationController redirect_to public_my_account_path(:ins => "ins_finish"), notice: "Vous êtes désormais inscrit." end + if cookies[:video_read] == "true" + flash[:read_video] = false + else + cookies.permanent[:video_read] = "true" + flash[:read_video] = true + end + else render :action => "new" diff --git a/app/views/layouts/public.html.haml b/app/views/layouts/public.html.haml index a2edbc8..27efb78 100755 --- a/app/views/layouts/public.html.haml +++ b/app/views/layouts/public.html.haml @@ -58,7 +58,7 @@ #flashs= bootstrap_flash - -if @video_must_read + -if flash[:read_video] :javascript $(document).ready(function() { $.magnificPopup.open({ diff --git a/app/views/public/shared/_menu.html.haml b/app/views/public/shared/_menu.html.haml index 0653d5d..b263b06 100755 --- a/app/views/public/shared/_menu.html.haml +++ b/app/views/public/shared/_menu.html.haml @@ -4,7 +4,7 @@ -if current_customer %ul - %li=link_to ic(:"youtube-play")+" Négos, comment ça marche ?","", :class => "btn negos-video" + %li=link_to ic(:"youtube-play")+" Présentation Négos","", :class => "btn negos-video" -if current_customer.account_validated? %li=link_to ic(:star)+" Besoins", public_needs_path, :class => "btn" - unread_message = ContactMessage.where(contact_id: current_customer.id, read_by_customer: false).count @@ -15,6 +15,5 @@ -else %ul - %li=link_to ic(:"youtube-play")+" Négos, comment ça marche ?","", :class => "btn negos-video" %li=link_to "S'inscrire", new_public_customer_path(:p => params[:p]), :class => "btn" %li=link_to "Se connecter", new_public_customers_auth_path(:p => params[:p]), :class => "btn"