suite
This commit is contained in:
parent
52ba89cc94
commit
2e5b21a8a6
@ -9,7 +9,7 @@ class ApplicationController < ActionController::Base
|
||||
|
||||
|
||||
def get_reseaux
|
||||
if session[:reseaux_id]
|
||||
if session[:reseaux_id] and current_customer
|
||||
@reseaux = current_customer.reseauxes.find(session[:reseaux_id])
|
||||
@reseaux_layout = true
|
||||
end
|
||||
|
@ -1,7 +1,7 @@
|
||||
# -*- encoding : utf-8 -*-
|
||||
class Public::CustomersAuthsController < ApplicationController
|
||||
layout "public"
|
||||
|
||||
before_filter :get_reseaux
|
||||
def new
|
||||
@biglogo = true
|
||||
@no_search = true
|
||||
@ -12,6 +12,16 @@ class Public::CustomersAuthsController < ApplicationController
|
||||
else
|
||||
session[:for_annonce] = nil
|
||||
end
|
||||
|
||||
|
||||
if params[:p]
|
||||
@reseaux = Reseaux.where(:token => params[:p].to_s).first
|
||||
if @reseaux
|
||||
session[:reseaux_id] = @reseaux.id
|
||||
@reseaux_layout = true
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
@customer = Customer.new()
|
||||
if params[:p]
|
||||
@ -29,7 +39,12 @@ class Public::CustomersAuthsController < ApplicationController
|
||||
end
|
||||
|
||||
def create
|
||||
|
||||
if session[:reseaux_id]
|
||||
@reseaux = Reseaux.find(session[:reseaux_id])
|
||||
@reseaux_layout = true
|
||||
end
|
||||
|
||||
|
||||
@biglogo = true
|
||||
@customer = Customer.new()
|
||||
if cookies[:mlm_token] and @parent = Customer.find_parrain(cookies[:mlm_token])
|
||||
@ -70,7 +85,11 @@ class Public::CustomersAuthsController < ApplicationController
|
||||
end
|
||||
|
||||
else
|
||||
redirect_to public_my_reseauxes_path
|
||||
if @reseaux
|
||||
redirect_to public_reseaux_products_path(:reseaux_id => @reseaux.id)
|
||||
else
|
||||
redirect_to public_my_reseauxes_path
|
||||
end
|
||||
end
|
||||
|
||||
else
|
||||
|
@ -1,6 +1,6 @@
|
||||
class Public::ReseauxesController < ApplicationController
|
||||
layout "public"
|
||||
before_filter :auth_customer
|
||||
before_filter :auth_customer, :except => :find_sub_domain
|
||||
|
||||
def index
|
||||
@reseauxes = current_customer.own_reseauxes.order(:name)
|
||||
@ -24,5 +24,22 @@ class Public::ReseauxesController < ApplicationController
|
||||
|
||||
end
|
||||
|
||||
|
||||
def find_sub_domain
|
||||
if ["negos.pro", "localhost.qz"].include?(request.domain(1))
|
||||
|
||||
sub_domain = request.domain(2).split(".")[0]
|
||||
@reseaux = Reseaux.where(:sub_domain => sub_domain.to_s).first
|
||||
|
||||
if request.domain(1) == "localhost.qz"
|
||||
redirect_to "http://localhost:3000/public/customers_auths/new?p="+@reseaux.token.to_s
|
||||
|
||||
else
|
||||
render :inline => @reseaux.id.to_s
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
@ -122,7 +122,12 @@ class Customer < ActiveRecord::Base
|
||||
|
||||
end
|
||||
|
||||
|
||||
after_create do
|
||||
if reseaux = Reseaux.find_by_token(self.reseaux_token)
|
||||
self.reseauxes << reseaux
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
before_validation do
|
||||
|
||||
|
@ -28,7 +28,7 @@ class ProductOrderDocument < ActiveRecord::Base
|
||||
|
||||
self.d_year = self.product_order.created_at.year
|
||||
|
||||
|
||||
self.public = self.product_order_document_type.public
|
||||
self.d_prefix = self.product_order_document_type.prefix.to_s
|
||||
self.label = self.product_order_document_type.label.to_s
|
||||
self.header = self.product_order_document_type.header.to_s
|
||||
|
@ -1,6 +1,7 @@
|
||||
= semantic_form_for [:admin,@product_order_document_type], :remote => true do |form|
|
||||
|
||||
.content
|
||||
= form.input :public, :label => "Visible des clients ?"
|
||||
= form.input :label, :label => "Label :"
|
||||
= form.input :name, :label => "Nom :"
|
||||
= form.input :prefix, :label => "Prefix :"
|
||||
|
@ -74,10 +74,10 @@
|
||||
-if true
|
||||
%td
|
||||
|
||||
=number_to_currency sub_products[0].price_ht
|
||||
=number_to_currency sub_products[0].price_ht_with_qte
|
||||
|
||||
%td{:style => "text-align:right;"}
|
||||
=number_to_currency sub_products[0].price_ht * i
|
||||
=number_to_currency sub_products[0].price_ht_with_qte * i
|
||||
|
||||
%tr
|
||||
%td{:colspan => 4, :style => "text-align:right;"}
|
||||
|
@ -95,7 +95,11 @@
|
||||
|
||||
|
||||
%body
|
||||
-if @product_order.reseaux_id == 19 #distributeurs vouisstar
|
||||
-if @product_order.reseaux_id == 18 #distributeurs vouisstar
|
||||
|
||||
-if @product_order_document.product_order_document_type.fournisseur
|
||||
=render :partial => "admin/product_order_documents/vsg_fournisseurs"
|
||||
-elsif @product_order.reseaux_id == 19 #distributeurs vouisstar
|
||||
|
||||
-if @product_order_document.product_order_document_type.fournisseur
|
||||
=render :partial => "admin/product_order_documents/vsg_fournisseurs"
|
||||
|
@ -13,6 +13,7 @@
|
||||
=f.input :description, :label => "A propos : ", :input_html => {:class => "redactor_textarea"}
|
||||
-if !@reseaux.parent
|
||||
=f.input :chef_reseau, :label => "Chef réseau : ", :collection => Customer.where(:chef_reseau => true).pluck(Arel.sql("CONCAT(`firstname`, ' ', `name`)"), :id)
|
||||
=f.input :sub_domain, :label => "Sous domaine (pour l'url) :"
|
||||
|
||||
=f.input :logo_image_file_id, :label => "Logo :", :as => :qi_image_select
|
||||
=f.input :background_image_file_id, :label => "Image de fond :", :as => :qi_image_select
|
||||
|
@ -6,6 +6,8 @@
|
||||
= reseaux.chef_reseau.pseudo_admin if reseaux.chef_reseau
|
||||
%td
|
||||
= reseaux.token
|
||||
%td
|
||||
= reseaux.sub_domain
|
||||
%td
|
||||
= reseaux.customers.count
|
||||
|
||||
|
@ -71,7 +71,8 @@
|
||||
.error
|
||||
Votre mot de passe
|
||||
= error
|
||||
-if false
|
||||
-if @customer.reseaux_token
|
||||
Code réseau :
|
||||
.form-group{:class => ("has-error has-feedback" if @customer.errors[:reseaux_token].size > 0)}
|
||||
=f.text_field :reseaux_token, :class => "form-control", :placeholder => "Code réseau"
|
||||
-if @customer.errors[:reseaux_token].uniq
|
||||
|
@ -95,7 +95,11 @@
|
||||
|
||||
|
||||
%body
|
||||
-if @product_order.reseaux_id == 19 #distributeurs vouisstar
|
||||
-if @product_order.reseaux_id == 18
|
||||
-if @product_order_document.product_order_document_type.fournisseur
|
||||
=render :partial => "admin/product_order_documents/vsg_fournisseurs"
|
||||
|
||||
-elsif @product_order.reseaux_id == 19 #distributeurs vouisstar
|
||||
|
||||
-if @product_order_document.product_order_document_type.fournisseur
|
||||
=render :partial => "admin/product_order_documents/vsg_fournisseurs"
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
Téléchargez dès maintenant vos documents :
|
||||
%table.table
|
||||
-@product_order_ar.product_order_documents.each do |product_order_document|
|
||||
-@product_order_ar.product_order_documents.where(:public => true).each do |product_order_document|
|
||||
%tr
|
||||
%td{:style => "width:300px;"}
|
||||
=product_order_document.name
|
||||
|
955
config/routes.rb
955
config/routes.rb
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user