diff --git a/app/controllers/public/customers_auths_controller.rb b/app/controllers/public/customers_auths_controller.rb index 13d98c1..7a5c88e 100755 --- a/app/controllers/public/customers_auths_controller.rb +++ b/app/controllers/public/customers_auths_controller.rb @@ -22,11 +22,17 @@ 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]) diff --git a/app/views/layouts/public.html.haml b/app/views/layouts/public.html.haml index b2fc178..a2edbc8 100755 --- a/app/views/layouts/public.html.haml +++ b/app/views/layouts/public.html.haml @@ -57,10 +57,36 @@ #flashs= bootstrap_flash + + -if @video_must_read + :javascript + $(document).ready(function() { + $.magnificPopup.open({ + items: { + src: 'http://www.youtube.com/watch?v=0uf7X-fcu1o' + }, + type:'iframe', + iframe: { + markup: '
'+'
'+''+'
', + patterns: { + youtube: { + index: 'youtube.com/', + id: 'v=', + src: '//www.youtube.com/embed/%id%?autoplay=1' + } + }, + srcAction: 'iframe_src', + } + }); + }); + + + + :javascript $(document).ready(function() { - $('#negos-video').magnificPopup({ + $('.negos-video').magnificPopup({ items: { src: 'http://www.youtube.com/watch?v=0uf7X-fcu1o' }, diff --git a/app/views/public/shared/_menu.html.haml b/app/views/public/shared/_menu.html.haml index e71d78e..0653d5d 100755 --- a/app/views/public/shared/_menu.html.haml +++ b/app/views/public/shared/_menu.html.haml @@ -3,8 +3,8 @@ -if current_customer %ul - -if current_customer.account_validated? - %li=link_to ic(:"youtube-play")+" Négos, comment ça marche ?","", :class => "btn", id:"negos-video" + + %li=link_to ic(:"youtube-play")+" Négos, comment ça marche ?","", :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,5 +15,6 @@ -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"