Négos video after Login and registration

This commit is contained in:
Nicolas VARROT 2016-03-22 11:25:18 +01:00
parent e173d7ced7
commit 735ffde7c3
4 changed files with 17 additions and 10 deletions

View File

@ -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"

View File

@ -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"

View File

@ -58,7 +58,7 @@
#flashs= bootstrap_flash
-if @video_must_read
-if flash[:read_video]
:javascript
$(document).ready(function() {
$.magnificPopup.open({

View File

@ -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"