suite
This commit is contained in:
parent
a6aa1f6074
commit
ff95aa77ae
@ -44,6 +44,16 @@ $(document).ready ->
|
|||||||
language: 'fr'
|
language: 'fr'
|
||||||
).focus();
|
).focus();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$(document).on 'click', 'input.year_date_picker', ->
|
||||||
|
$(this).datetimepicker(
|
||||||
|
language: 'fr'
|
||||||
|
pickTime: false
|
||||||
|
minDate: (new Date(new Date().getFullYear(), 0, 1))
|
||||||
|
maxDate: (new Date(new Date().getFullYear(), 11, 31))
|
||||||
|
).focus();
|
||||||
|
|
||||||
|
|
||||||
$(document).on 'click', 'input.timepicker', ->
|
$(document).on 'click', 'input.timepicker', ->
|
||||||
$(this).datetimepicker(
|
$(this).datetimepicker(
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
@import "fontawesome/v4-shims";
|
@import "fontawesome/v4-shims";
|
||||||
@import "fontawesome/regular";
|
@import "fontawesome/regular";
|
||||||
|
@import "fontawesome/brands";
|
||||||
|
|
||||||
@import "fontawesome/solid";
|
@import "fontawesome/solid";
|
||||||
|
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
@import "fontawesome/v4-shims";
|
@import "fontawesome/v4-shims";
|
||||||
@import "fontawesome/regular";
|
@import "fontawesome/regular";
|
||||||
@import "fontawesome/solid";
|
@import "fontawesome/solid";
|
||||||
|
@import "fontawesome/brands";
|
||||||
|
|
||||||
@import "qi_grids";
|
@import "qi_grids";
|
||||||
|
|
||||||
@ -1897,9 +1898,10 @@ body {
|
|||||||
opacity: 0.6;
|
opacity: 0.6;
|
||||||
padding: 0px 10px;
|
padding: 0px 10px;
|
||||||
font-size: 15px;
|
font-size: 15px;
|
||||||
|
padding-right:0px;
|
||||||
}
|
}
|
||||||
a {
|
a {
|
||||||
color: #fff;
|
color: rgba(255, 255, 255, 0.7);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.header-topbarbox-1 {
|
.header-topbarbox-1 {
|
||||||
@ -3374,12 +3376,16 @@ select {
|
|||||||
border-bottom: 1px solid #000;
|
border-bottom: 1px solid #000;
|
||||||
font-family: "Roboto Condensed", sans-serif;
|
font-family: "Roboto Condensed", sans-serif;
|
||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
&:hover {
|
&:hover, &.active {
|
||||||
border-bottom: 1px solid #fd0;
|
border-bottom: 1px solid #fd0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.social-links{
|
||||||
|
font-family: "Roboto Condensed", sans-serif;
|
||||||
|
}
|
||||||
.menu-sub {
|
.menu-sub {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 49px;
|
top: 49px;
|
||||||
@ -3434,9 +3440,7 @@ select {
|
|||||||
#contenu {
|
#contenu {
|
||||||
padding: 0px;
|
padding: 0px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
h2 {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
#ariane {
|
#ariane {
|
||||||
display: none;
|
display: none;
|
||||||
@ -7149,10 +7153,7 @@ div.modeles_similaires {
|
|||||||
border-color: #5e605f;
|
border-color: #5e605f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.green {
|
|
||||||
font-size: 24px;
|
|
||||||
color: #CC4B14;
|
|
||||||
}
|
|
||||||
.inline_check {
|
.inline_check {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
width: 22%;
|
width: 22%;
|
||||||
@ -10013,14 +10014,11 @@ a.sp-video {
|
|||||||
text-transform:uppercase;
|
text-transform:uppercase;
|
||||||
color:black;
|
color:black;
|
||||||
}
|
}
|
||||||
.img{
|
img{
|
||||||
position:absolute;
|
|
||||||
top:0;
|
|
||||||
left:0;
|
|
||||||
bottom:0;
|
|
||||||
width:160px;
|
width:160px;
|
||||||
background:white no-repeat center;
|
margin:5px;
|
||||||
background-size:contain;
|
float:left;
|
||||||
}
|
}
|
||||||
h3{
|
h3{
|
||||||
font-weight:bold;
|
font-weight:bold;
|
||||||
@ -10174,8 +10172,8 @@ a.sp-video {
|
|||||||
.new_btn{
|
.new_btn{
|
||||||
color: #fff !important;
|
color: #fff !important;
|
||||||
background-color: #000000;
|
background-color: #000000;
|
||||||
font-size: 20px !important;
|
font-size: 16px !important;
|
||||||
padding: 7px 50px;
|
padding: 5px 20px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
border: none;
|
border: none;
|
||||||
font-weight: normal !important;
|
font-weight: normal !important;
|
||||||
@ -10183,11 +10181,20 @@ a.sp-video {
|
|||||||
-webkit-transition: 0.5s all ease;
|
-webkit-transition: 0.5s all ease;
|
||||||
font-family: 'Fugaz One', cursive;
|
font-family: 'Fugaz One', cursive;
|
||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
|
|
||||||
|
&:hover{
|
||||||
|
background-color:#ffe500;
|
||||||
|
color:black !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.yellow{
|
||||||
|
background-color:#ffe500;
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
h1{
|
h1{
|
||||||
font-family: 'Montserrat' !important;
|
font-size: 30px;
|
||||||
font-size: 30px;
|
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
color: #111111;
|
color: #111111;
|
||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
@ -10375,3 +10382,70 @@ a.sp-video {
|
|||||||
margin-bottom:30px;
|
margin-bottom:30px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.green{
|
||||||
|
color:green;
|
||||||
|
}
|
||||||
|
|
||||||
|
.orange{
|
||||||
|
color:orange;
|
||||||
|
}
|
||||||
|
|
||||||
|
.red{
|
||||||
|
color:red;
|
||||||
|
}
|
||||||
|
|
||||||
|
td.state{
|
||||||
|
text-align:right;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
h1{
|
||||||
|
font-weight: normal !important;
|
||||||
|
|
||||||
|
text-align:center;
|
||||||
|
font-family: 'Fugaz One', cursive;
|
||||||
|
text-transform: uppercase;
|
||||||
|
margin:20px 0px;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
h3{
|
||||||
|
font-weight: normal !important;
|
||||||
|
|
||||||
|
|
||||||
|
font-family: 'Fugaz One', cursive;
|
||||||
|
text-transform: uppercase;
|
||||||
|
margin:20px 0px;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.marg_top{
|
||||||
|
margin-top:20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.doc_pannel{
|
||||||
|
background:rgba(0,0,0,0.05);
|
||||||
|
|
||||||
|
border-top:4px solid #fd0;
|
||||||
|
padding:20px;
|
||||||
|
padding-bottom:30px;
|
||||||
|
.empty{
|
||||||
|
color:rgba(0,0,0,0.5);
|
||||||
|
text-align:center;
|
||||||
|
padding-bottom:20px;
|
||||||
|
}
|
||||||
|
margin:30px 0;
|
||||||
|
h3{
|
||||||
|
margin-top:0;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.align_center{
|
||||||
|
text-align:center;
|
||||||
|
}
|
||||||
|
|
@ -7,7 +7,7 @@ class Admin::ImportCsvsController < ApplicationController
|
|||||||
before_action :admin_space
|
before_action :admin_space
|
||||||
|
|
||||||
def admin_space
|
def admin_space
|
||||||
@admin_space = "default"
|
@admin_space = "preferences"
|
||||||
end
|
end
|
||||||
|
|
||||||
def index
|
def index
|
||||||
|
76
app/controllers/admin/mail_type_cats_controller.rb
Normal file
76
app/controllers/admin/mail_type_cats_controller.rb
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
# -*- encoding : utf-8 -*-
|
||||||
|
|
||||||
|
class Admin::MailTypeCatsController < ApplicationController
|
||||||
|
layout "admin"
|
||||||
|
before_action :auth_admin
|
||||||
|
|
||||||
|
before_action :admin_space
|
||||||
|
|
||||||
|
def admin_space
|
||||||
|
@admin_space = "default"
|
||||||
|
end
|
||||||
|
|
||||||
|
def index
|
||||||
|
@mail_type_cats = MailTypeCat.all
|
||||||
|
|
||||||
|
@mail_type_cats = sort_by_sorting(@mail_type_cats, "id DESC")
|
||||||
|
respond_to do |format|
|
||||||
|
format.html{
|
||||||
|
|
||||||
|
params[:search][:per_page] = params[:search][:per_page] || 100
|
||||||
|
per_page = params[:search][:per_page]
|
||||||
|
page = (params[:page] and params[:page] != "") ? params[:page] : 1
|
||||||
|
@mail_type_cats = @mail_type_cats.page(page).per(per_page)
|
||||||
|
|
||||||
|
}
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def show
|
||||||
|
@mail_type_cat = MailTypeCat.find(params[:id])
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
def new
|
||||||
|
@mail_type_cat = MailTypeCat.new
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
def edit
|
||||||
|
@mail_type_cat = MailTypeCat.find(params[:id])
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
def create
|
||||||
|
@mail_type_cat = MailTypeCat.new(params.require(:mail_type_cat).permit!)
|
||||||
|
|
||||||
|
if @mail_type_cat.save
|
||||||
|
|
||||||
|
else
|
||||||
|
render action: "new"
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
def update
|
||||||
|
@mail_type_cat = MailTypeCat.find(params[:id])
|
||||||
|
|
||||||
|
|
||||||
|
if @mail_type_cat.update_attributes(params.require(:mail_type_cat).permit!)
|
||||||
|
|
||||||
|
else
|
||||||
|
render action: "edit"
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
def destroy
|
||||||
|
@mail_type_cat = MailTypeCat.find(params[:id])
|
||||||
|
@mail_type_cat.destroy
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
@ -7,7 +7,7 @@ class Admin::MailTypesController < ApplicationController
|
|||||||
before_action :admin_space
|
before_action :admin_space
|
||||||
|
|
||||||
def admin_space
|
def admin_space
|
||||||
@admin_space = "stocks"
|
@admin_space = "preferences"
|
||||||
end
|
end
|
||||||
|
|
||||||
def index
|
def index
|
||||||
|
@ -5,13 +5,13 @@ class Public::CircuitsController < ApplicationController
|
|||||||
|
|
||||||
def index
|
def index
|
||||||
@circuits = Circuit.all
|
@circuits = Circuit.all
|
||||||
|
@circuits_active = true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
def show
|
def show
|
||||||
@circuit = Circuit.find(params[:id])
|
@circuit = Circuit.find(params[:id])
|
||||||
|
@circuits_active = true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
@ -5,13 +5,13 @@ class Public::OrganisateursController < ApplicationController
|
|||||||
|
|
||||||
def index
|
def index
|
||||||
@organisateurs = Organisateur.all
|
@organisateurs = Organisateur.all
|
||||||
|
@organisateurs_active = true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
def show
|
def show
|
||||||
@organisateur = Organisateur.find(params[:id])
|
@organisateur = Organisateur.find(params[:id])
|
||||||
|
@organisateurs_active = true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
@ -4,6 +4,23 @@ class Public::PCustomerAuthsController < ApplicationController
|
|||||||
|
|
||||||
before_action :auth_p_customer, :only => [:index, :edit_password]
|
before_action :auth_p_customer, :only => [:index, :edit_password]
|
||||||
|
|
||||||
|
|
||||||
|
def valid_account
|
||||||
|
@p_customer = PCustomer.find_by_mlm_token(params[:token])
|
||||||
|
|
||||||
|
if !@p_customer.enabled
|
||||||
|
@p_customer.enabled = true
|
||||||
|
|
||||||
|
@p_customer.save
|
||||||
|
|
||||||
|
mail_hist = MailHist.auto_generate_mail(:fr, "confirmation-inscription", @p_customer.email, {:arguments => {:nbr_inscrits => PCustomer.count}, :p_customer => @p_customer})
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
redirect_to public_my_account_path(), :notice => "Votre email a été validé, merci !"
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
def index
|
def index
|
||||||
|
|
||||||
#current_p_customer.consolide_operations
|
#current_p_customer.consolide_operations
|
||||||
|
@ -18,6 +18,9 @@ class Public::PCustomersController < ApplicationController
|
|||||||
#@p_customer.particulars << Particular.new(:pro => true, :skip_validation => true)
|
#@p_customer.particulars << Particular.new(:pro => true, :skip_validation => true)
|
||||||
@p_customer.valid_public = true
|
@p_customer.valid_public = true
|
||||||
@p_customer.require_cgv = true
|
@p_customer.require_cgv = true
|
||||||
|
|
||||||
|
@p_customer.enabled = false
|
||||||
|
|
||||||
if @p_customer.save
|
if @p_customer.save
|
||||||
|
|
||||||
@p_customer.last_sign_in_at = Time.now
|
@p_customer.last_sign_in_at = Time.now
|
||||||
@ -26,7 +29,10 @@ class Public::PCustomersController < ApplicationController
|
|||||||
|
|
||||||
cookies[:p_customer_auth_token] = @p_customer.auth_token
|
cookies[:p_customer_auth_token] = @p_customer.auth_token
|
||||||
|
|
||||||
mail_hist = MailHist.generate_mail(:fr, MailType.find_or_create("new_account"), @p_customer.email, {:arguments => {:email => @p_customer.email}, :p_customer => @p_customer, :element => @p_customer})
|
|
||||||
|
mail_hist = MailHist.auto_generate_mail(:fr, "confirmer-inscription", @p_customer.email, {:arguments => {:lien => valid_account_public_p_customer_auths_url(:token => @p_customer.mlm_token) }, :p_customer => @p_customer})
|
||||||
|
|
||||||
|
#mail_hist = MailHist.generate_mail(:fr, MailType.find_or_create("new_account"), @p_customer.email, {:arguments => {:email => @p_customer.email}, :p_customer => @p_customer, :element => @p_customer})
|
||||||
|
|
||||||
|
|
||||||
redirect_to public_my_account_path
|
redirect_to public_my_account_path
|
||||||
|
@ -36,12 +36,8 @@ class Public::ParticularsController < ApplicationController
|
|||||||
|
|
||||||
|
|
||||||
if @particular.save
|
if @particular.save
|
||||||
if params[:for_order]
|
redirect_to public_my_account_path
|
||||||
redirect_to particulars_public_p_orders_path()
|
|
||||||
elsif
|
|
||||||
redirect_to public_particulars_path
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
else
|
else
|
||||||
render action: "new"
|
render action: "new"
|
||||||
@ -57,11 +53,7 @@ class Public::ParticularsController < ApplicationController
|
|||||||
|
|
||||||
if @particular.update_attributes(params.require(:particular).permit!)
|
if @particular.update_attributes(params.require(:particular).permit!)
|
||||||
|
|
||||||
if params[:for_order]
|
redirect_to public_my_account_path
|
||||||
redirect_to particulars_public_p_orders_path()
|
|
||||||
elsif
|
|
||||||
redirect_to public_particulars_path
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ module TranslationHelper
|
|||||||
|
|
||||||
def state_helper(value)
|
def state_helper(value)
|
||||||
value = value.to_s
|
value = value.to_s
|
||||||
if ["brouillon","Reçue","A traiter"].include?(value)
|
if ["brouillon","Reçue","A traiter", "En cours de vérification", "Manque RIB"].include?(value)
|
||||||
r = '<span class="badge badge-pill badge-warning">'+value+'</span>'
|
r = '<span class="badge badge-pill badge-warning">'+value+'</span>'
|
||||||
elsif ["Virement envoyé", "Validé"].include?(value)
|
elsif ["Virement envoyé", "Validé"].include?(value)
|
||||||
r = '<span class="badge badge-success">'+value+'</span>'
|
r = '<span class="badge badge-success">'+value+'</span>'
|
||||||
|
@ -26,5 +26,18 @@ class MEvent < ApplicationRecord
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
acts_as_csv_import :fields => [:m_event_type_title, :start_at, :end_at, :title, :description, :link, :encadrant, :imp_circuit_name, :imp_circuit_organisateur ]
|
||||||
|
|
||||||
|
|
||||||
|
before_validation do
|
||||||
|
if self.imp_circuit_organisateur? and !self.organisateur
|
||||||
|
self.organisateur = Organisateur.where(:name => self.imp_circuit_organisateur).first
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
if self.imp_circuit_name? and !self.circuit
|
||||||
|
self.circuit = Circuit.where(:name => self.imp_circuit_name).first
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
@ -39,7 +39,7 @@ class MOdrFile < ApplicationRecord
|
|||||||
elsif self.m_odr_file_type_id == 2
|
elsif self.m_odr_file_type_id == 2
|
||||||
nbr_pneus = 0
|
nbr_pneus = 0
|
||||||
self.m_odr_file_products.each do |mofp|
|
self.m_odr_file_products.each do |mofp|
|
||||||
nbr_pneus += mofp.qte
|
nbr_pneus += mofp.qte.to_i
|
||||||
end
|
end
|
||||||
|
|
||||||
self.nbr_pneus = nbr_pneus
|
self.nbr_pneus = nbr_pneus
|
||||||
|
@ -3,6 +3,7 @@ class MOdrFileProduct < ApplicationRecord
|
|||||||
belongs_to :m_odr_product
|
belongs_to :m_odr_product
|
||||||
belongs_to :m_odr_product_size
|
belongs_to :m_odr_product_size
|
||||||
|
|
||||||
|
validates :qte, :presence => true
|
||||||
before_save do
|
before_save do
|
||||||
if self.m_odr_product_size
|
if self.m_odr_product_size
|
||||||
self.m_odr_product = self.m_odr_product_size.m_odr_product
|
self.m_odr_product = self.m_odr_product_size.m_odr_product
|
||||||
|
@ -54,7 +54,14 @@ class MailHist < ApplicationRecord
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
arguments = @arguments
|
arguments = @arguments || {}
|
||||||
|
|
||||||
|
if @p_customer and @p_customer.particular
|
||||||
|
arguments[:civilite] = @p_customer.particular.civilite
|
||||||
|
arguments[:nom] = @p_customer.particular.name
|
||||||
|
arguments[:prenom] = @p_customer.particular.firstname
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
s = @mail_content.subject.to_s
|
s = @mail_content.subject.to_s
|
||||||
|
@ -5,7 +5,9 @@ class MailType < ApplicationRecord
|
|||||||
|
|
||||||
accepts_nested_attributes_for :mail_contents
|
accepts_nested_attributes_for :mail_contents
|
||||||
|
|
||||||
|
belongs_to :mail_type_cat
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
acts_as_sorting :fields => {
|
acts_as_sorting :fields => {
|
||||||
|
|
||||||
@ -31,4 +33,18 @@ class MailType < ApplicationRecord
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
def lang(slug)
|
||||||
|
self.mail_contents.where(:lang_site => LangSite.where(:slug => slug.to_s).first).first
|
||||||
|
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
def default_title
|
||||||
|
self.lang(:fr).subject
|
||||||
|
end
|
||||||
|
|
||||||
|
def default_message
|
||||||
|
self.lang(:fr).message.to_s.truncate(100)
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
2
app/models/mail_type_cat.rb
Normal file
2
app/models/mail_type_cat.rb
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
class MailTypeCat < ApplicationRecord
|
||||||
|
end
|
@ -1,5 +1,7 @@
|
|||||||
class PCustomer < ApplicationRecord
|
class PCustomer < ApplicationRecord
|
||||||
|
|
||||||
|
acts_as_tree
|
||||||
|
|
||||||
has_many :price_documents
|
has_many :price_documents
|
||||||
|
|
||||||
has_many :particulars, :as => :owner, :dependent => :destroy
|
has_many :particulars, :as => :owner, :dependent => :destroy
|
||||||
@ -68,10 +70,22 @@ class PCustomer < ApplicationRecord
|
|||||||
|
|
||||||
validates :cgv, :presence => true, :if => :require_cgv
|
validates :cgv, :presence => true, :if => :require_cgv
|
||||||
validates :rgpd, :presence => true, :if => :require_cgv
|
validates :rgpd, :presence => true, :if => :require_cgv
|
||||||
|
|
||||||
|
|
||||||
attr_accessor :actual_password, :valid_last_password, :valid_public, :generate_mdp, :valid_pswd_confirmation, :require_cgv
|
attr_accessor :actual_password, :valid_last_password, :valid_public, :generate_mdp, :valid_pswd_confirmation, :require_cgv
|
||||||
|
|
||||||
NBR_ROULAGES = ["Entre 1 et 2", "Entre 3 et 5", "Entre 6 et 8", "Entre 9 et 10", "> 10", "Pas pour l'instant"]
|
NBR_ROULAGES = ["Entre 1 et 2", "Entre 3 et 5", "Entre 6 et 8", "Entre 9 et 10", "> 10", "Pas pour l'instant"]
|
||||||
|
|
||||||
|
def particular_ok?
|
||||||
|
|
||||||
|
if self.particular and self.particular.address_2? and self.particular.cp? and self.particular.city? and self.particular.country?
|
||||||
|
true
|
||||||
|
else
|
||||||
|
false
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
def valid_m_odr_rep_rib
|
def valid_m_odr_rep_rib
|
||||||
self.m_odr_rep_ribs.where(:admin_ok => true).order("id DESC").first
|
self.m_odr_rep_ribs.where(:admin_ok => true).order("id DESC").first
|
||||||
end
|
end
|
||||||
@ -149,15 +163,14 @@ class PCustomer < ApplicationRecord
|
|||||||
|
|
||||||
def self.qi_table_order
|
def self.qi_table_order
|
||||||
{
|
{
|
||||||
:show_name => "RNom",
|
:show_name => "Nom",
|
||||||
:code => {:name => "Code", :reorder => true},
|
:mlm_token => {:name => "Code ambassadeur", :reorder => true},
|
||||||
#:created_at => {:name => "Date création", :reorder => true},
|
#:created_at => {:name => "Date création", :reorder => true},
|
||||||
:enabled => "Etat",
|
:enabled => "Actif ?",
|
||||||
:p_commercial => "Commercial",
|
:parent => "Ambassadeur",
|
||||||
:p_customer_cat => "Catégorie",
|
|
||||||
:particular => "Ville",
|
:particular => "Ville",
|
||||||
:market_discount => "Remise marché"
|
:actions => "Actions"
|
||||||
|
|
||||||
}
|
}
|
||||||
#, :sort_name => "code"
|
#, :sort_name => "code"
|
||||||
end
|
end
|
||||||
@ -192,7 +205,15 @@ class PCustomer < ApplicationRecord
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
def self.find_parrain(token)
|
||||||
|
|
||||||
|
|
||||||
|
if token != ""
|
||||||
|
self.find_by_mlm_token(token.upcase)
|
||||||
|
else
|
||||||
|
nil
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
before_validation do
|
before_validation do
|
||||||
@ -201,6 +222,21 @@ class PCustomer < ApplicationRecord
|
|||||||
|
|
||||||
generate_mlm_token
|
generate_mlm_token
|
||||||
|
|
||||||
|
|
||||||
|
if !self.id
|
||||||
|
if self.parent_code?
|
||||||
|
|
||||||
|
if mlm_parent = PCustomer.find_parrain(self.parent_code)
|
||||||
|
self.parent_id = mlm_parent.id
|
||||||
|
self.parent_at_create = true
|
||||||
|
else
|
||||||
|
errors.add(:parent_code, "Ce code ambassadeur n'est pas valide, merci de vérifier son exactitude. ")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if self.comptant
|
if self.comptant
|
||||||
|
|
||||||
if self.acompte
|
if self.acompte
|
||||||
@ -348,24 +384,14 @@ class PCustomer < ApplicationRecord
|
|||||||
self.show_name
|
self.show_name
|
||||||
end
|
end
|
||||||
|
|
||||||
def show_name
|
|
||||||
if self.particular
|
|
||||||
n = ""
|
|
||||||
n += self.mlm_token+" "
|
|
||||||
n += self.particular.organisation+" " if self.particular.organisation?
|
|
||||||
n += self.particular.name+" " if self.particular.name?
|
|
||||||
n += self.particular.firstname+" " if self.particular.firstname?
|
|
||||||
return n
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
def show_name
|
def show_name
|
||||||
if self.particular
|
if self.particular
|
||||||
n = ""
|
n = ""
|
||||||
n += self.particular.organisation+" " if self.particular.organisation?
|
n += self.particular.organisation+" " if self.particular.organisation?
|
||||||
n += self.particular.name+" " if self.particular.name?
|
|
||||||
n += self.particular.firstname+" " if self.particular.firstname?
|
n += self.particular.firstname+" " if self.particular.firstname?
|
||||||
|
n += self.particular.name+" " if self.particular.name?
|
||||||
return n
|
return n
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
|
|
||||||
%li= link_to "Gestion des permissions", admin_admin_permissions_path
|
%li= link_to "Gestion des permissions", admin_admin_permissions_path
|
||||||
|
|
||||||
|
%li= link_to "Gestion des mails types", admin_mail_types_path
|
||||||
|
|
||||||
-if false
|
-if false
|
||||||
%li= link_to "Zones de vente", admin_accounting_zones_path
|
%li= link_to "Zones de vente", admin_accounting_zones_path
|
||||||
|
|
||||||
|
@ -1,5 +1,10 @@
|
|||||||
%tr.m_odr_product_remise_form.field
|
%tr.m_odr_product_remise_form.field
|
||||||
%td{:style => "width:200px;"}= form.input :champ, :label => false, :as => :select, :collection => @import_csv.table_name.classify.constantize.import_csv_fields.map{|a| a.to_s}
|
%td{:style => "width:200px;"}= form.input :champ, :label => false, :as => :select, :collection => @import_csv.table_name.classify.constantize.import_csv_fields.map{|a| a.to_s}
|
||||||
|
|
||||||
|
|
||||||
|
-if !form.object.header? and @import_csv.import_csv_headers.all.map{|a| a.name}.include?(form.object.champ)
|
||||||
|
-form.object.header = form.object.champ
|
||||||
|
|
||||||
%td{:style => "width:200px;"}= form.input :header, :label => false, :as => :select, :collection => @import_csv.import_csv_headers.all.map{|a| a.name}
|
%td{:style => "width:200px;"}= form.input :header, :label => false, :as => :select, :collection => @import_csv.import_csv_headers.all.map{|a| a.name}
|
||||||
%td{:style => "width:200px;"}= form.input :value, :label => false, :placeholder => "Valeure fixe"
|
%td{:style => "width:200px;"}= form.input :value, :label => false, :placeholder => "Valeure fixe"
|
||||||
|
|
||||||
|
@ -1,16 +0,0 @@
|
|||||||
%tr#import_csv_champ_row{:id => import_csv_champ.id}
|
|
||||||
-tr = {}
|
|
||||||
|
|
||||||
-tr[:actions] = capture do
|
|
||||||
%td.actions
|
|
||||||
= link_to i(:"trash-o"), [:admin, import_csv_champ], method: :delete, data: { confirm: 'Voulez-vous vraiment supprimer cet enregistrement ? ' } , :remote => true
|
|
||||||
= link_to i(:pencil), edit_admin_import_csv_champ_path(import_csv_champ), :remote => true
|
|
||||||
= link_to i(:eye), admin_import_csv_champ_path(import_csv_champ), :remote => true
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
=render :partial => "qi/qi_ordered_table_object", :locals => {:tr => tr, :object => import_csv_champ}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
|||||||
$('#import_csv_champs_rows').prepend("<%= escape_javascript(render(@import_csv_champ))%>");
|
|
||||||
close_pane_hover();
|
|
@ -1 +0,0 @@
|
|||||||
$('#import_csv_champ_row_<%= @import_csv_champ.id %>').remove();
|
|
@ -1,2 +0,0 @@
|
|||||||
$('#import_csv_champ_row_<%= @import_csv_champ.id %>').replaceWith("<%= escape_javascript(render(@import_csv_champ))%>");
|
|
||||||
close_pane_hover();
|
|
@ -6,7 +6,7 @@
|
|||||||
= f.input :name, :label => "Nom de l'import :"
|
= f.input :name, :label => "Nom de l'import :"
|
||||||
= f.input :file, :label => "file :"
|
= f.input :file, :label => "file :"
|
||||||
|
|
||||||
= f.input :table_name, :label => "Table :" , :as => :select, :collection => ["circuits", "organisateurs", "m_odr_product_sizes", "m_odr_places", "circuit_regions"]
|
= f.input :table_name, :label => "Table :" , :as => :select, :collection => ["circuits", "organisateurs", "m_odr_product_sizes", "m_odr_places", "circuit_regions", "m_events"]
|
||||||
|
|
||||||
-if f.object.id
|
-if f.object.id
|
||||||
%table.import_csv_champs_form
|
%table.import_csv_champs_form
|
||||||
|
@ -10,6 +10,3 @@
|
|||||||
|
|
||||||
|
|
||||||
=render :partial => "qi/qi_ordered_table", :locals => {:qi_ordered_table_collection => @import_csvs}
|
=render :partial => "qi/qi_ordered_table", :locals => {:qi_ordered_table_collection => @import_csvs}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
12
app/views/admin/mail_type_cats/_form.html.haml
Normal file
12
app/views/admin/mail_type_cats/_form.html.haml
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
=semantic_form_for [:admin, @mail_type_cat], :remote => true do |f|
|
||||||
|
|
||||||
|
.content
|
||||||
|
=f.inputs do
|
||||||
|
= f.input :name, :label => "name :"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.actions=f.submit "sauvegarder", :class => "btn btn-primary"
|
||||||
|
|
16
app/views/admin/mail_type_cats/_mail_type_cat.html.haml
Normal file
16
app/views/admin/mail_type_cats/_mail_type_cat.html.haml
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
%tr#mail_type_cat_row{:id => mail_type_cat.id}
|
||||||
|
-tr = {}
|
||||||
|
|
||||||
|
-tr[:actions] = capture do
|
||||||
|
%td.actions
|
||||||
|
= link_to i(:"trash-o"), [:admin, mail_type_cat], method: :delete, data: { confirm: 'Voulez-vous vraiment supprimer cet enregistrement ? ' } , :remote => true
|
||||||
|
= link_to i(:pencil), edit_admin_mail_type_cat_path(mail_type_cat), :remote => true
|
||||||
|
= link_to i(:eye), admin_mail_type_cat_path(mail_type_cat), :remote => true
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
=render :partial => "qi/qi_ordered_table_object", :locals => {:tr => tr, :object => mail_type_cat}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
2
app/views/admin/mail_type_cats/create.js.erb
Normal file
2
app/views/admin/mail_type_cats/create.js.erb
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
$('#mail_type_cats_rows').prepend("<%= escape_javascript(render(@mail_type_cat))%>");
|
||||||
|
close_pane_hover();
|
1
app/views/admin/mail_type_cats/destroy.js.erb
Normal file
1
app/views/admin/mail_type_cats/destroy.js.erb
Normal file
@ -0,0 +1 @@
|
|||||||
|
$('#mail_type_cat_row_<%= @mail_type_cat.id %>').remove();
|
@ -1,15 +1,15 @@
|
|||||||
.qi_header
|
.qi_header
|
||||||
.right= link_to ic(:plus)+' Ajouter', new_admin_import_csv_champ_path(), :class => "btn btn-primary btn-ap-add", :remote => true
|
.right= link_to ic(:plus)+' Ajouter', new_admin_mail_type_cat_path(), :class => "btn btn-primary btn-ap-add", :remote => true
|
||||||
%h1
|
%h1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.qi_search_row
|
.qi_search_row
|
||||||
=form_tag "", :method => "get", :onsubmit => "" do
|
=form_tag "", :method => "get", :onsubmit => "" do
|
||||||
=render :partial => "qi/qi_ordered_table_search_footer", :locals => {:collection_object => @import_csv_champs}
|
=render :partial => "qi/qi_ordered_table_search_footer", :locals => {:collection_object => @mail_type_cats}
|
||||||
|
|
||||||
|
|
||||||
=render :partial => "qi/qi_ordered_table", :locals => {:qi_ordered_table_collection => @import_csv_champs}
|
=render :partial => "qi/qi_ordered_table", :locals => {:qi_ordered_table_collection => @mail_type_cats}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -7,4 +7,4 @@
|
|||||||
|
|
||||||
.qi_row
|
.qi_row
|
||||||
.qi_pannel.qi_plain.padding
|
.qi_pannel.qi_plain.padding
|
||||||
=debug @import_csv_champ
|
=debug @mail_type_cat
|
2
app/views/admin/mail_type_cats/update.js.erb
Normal file
2
app/views/admin/mail_type_cats/update.js.erb
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
$('#mail_type_cat_row_<%= @mail_type_cat.id %>').replaceWith("<%= escape_javascript(render(@mail_type_cat))%>");
|
||||||
|
close_pane_hover();
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
.content
|
.content
|
||||||
|
|
||||||
|
= form.input :mail_type_cat, :label => "Catégorie mail type :"
|
||||||
=form.input :slug, :label => "Référence mail :"
|
=form.input :slug, :label => "Référence mail :"
|
||||||
|
|
||||||
|
|
||||||
@ -12,6 +12,8 @@
|
|||||||
-form.object.mail_contents.build(:lang_site_id => ls.id, :content_type => "text")
|
-form.object.mail_contents.build(:lang_site_id => ls.id, :content_type => "text")
|
||||||
|
|
||||||
=form.semantic_fields_for :mail_contents do |form|
|
=form.semantic_fields_for :mail_contents do |form|
|
||||||
|
|
||||||
|
|
||||||
= form.input :subject
|
= form.input :subject
|
||||||
= form.input :message
|
= form.input :message
|
||||||
= form.hidden_field :lang_site_id
|
= form.hidden_field :lang_site_id
|
||||||
|
@ -4,12 +4,15 @@
|
|||||||
-tr[:enabled] = capture do
|
-tr[:enabled] = capture do
|
||||||
%td
|
%td
|
||||||
-if p_customer.enabled
|
-if p_customer.enabled
|
||||||
Actif
|
Oui
|
||||||
-else
|
|
||||||
%span.red
|
-tr[:parent] = capture do
|
||||||
=ic :lock
|
%td
|
||||||
|
-if p_customer.parent
|
||||||
=p_customer.disabled_raison
|
=p_customer.parent.mlm_token
|
||||||
|
="-"
|
||||||
|
=p_customer.show_name
|
||||||
|
|
||||||
|
|
||||||
-tr[:p_commercial] = capture do
|
-tr[:p_commercial] = capture do
|
||||||
%td
|
%td
|
||||||
@ -25,43 +28,26 @@
|
|||||||
= p_customer.particular.city
|
= p_customer.particular.city
|
||||||
= p_customer.particular.country
|
= p_customer.particular.country
|
||||||
|
|
||||||
-tr[:market_discount] = capture do
|
-tr[:actions] = capture do
|
||||||
%td
|
%td.actions
|
||||||
-if p_customer.market_discount
|
-if params[:offre].to_s == "true"
|
||||||
=p_customer.market_discount.percent
|
-if p_customer.enabled
|
||||||
="%"
|
=link_to ic(:"arrow-right")+" Demande de commande", new_admin_p_customer_sheet_path(:p_customer_id => p_customer.id), :class => "btn btn-primary btn-ap-add"
|
||||||
|
-else
|
||||||
|
.badge.badge-danger
|
||||||
-if !@qi_table_orders
|
=ic :lock
|
||||||
=render :partial => "qi/qi_ordered_table_head", :locals => {:qi_ordered_table_name => p_product.class.to_s.tableize, :qi_ordered_table_model => p_product.class}
|
=p_customer.disabled_raison
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-@qi_table_orders[:p_customers].each do |key,value|
|
|
||||||
-if tr[:"#{key}"]
|
|
||||||
=raw tr[:"#{key}"]
|
|
||||||
-elsif (p_customer.respond_to?(key))
|
|
||||||
%td
|
|
||||||
=p_customer.send(key.to_s)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
%td.actions
|
|
||||||
-if params[:offre].to_s == "true"
|
|
||||||
-if p_customer.enabled
|
|
||||||
=link_to ic(:"arrow-right")+" Demande de commande", new_admin_p_customer_sheet_path(:p_customer_id => p_customer.id), :class => "btn btn-primary btn-ap-add"
|
|
||||||
-else
|
|
||||||
.badge.badge-danger
|
|
||||||
=ic :lock
|
|
||||||
=p_customer.disabled_raison
|
|
||||||
|
|
||||||
-else
|
-else
|
||||||
-if current_admin.has_permission?("customers-d")
|
-if current_admin.has_permission?("customers-d")
|
||||||
= link_to i(:"trash-o"), [:admin, p_customer], method: :delete, data: { confirm: 'Voulez-vous vraiment supprimer ce client ? ' } , :remote => true if p_customer.can_destroy?
|
= link_to i(:"trash-o"), [:admin, p_customer], method: :delete, data: { confirm: 'Voulez-vous vraiment supprimer ce client ? ' } , :remote => true if p_customer.can_destroy?
|
||||||
-if current_admin.has_permission?("customers-d")
|
-if current_admin.has_permission?("customers-d")
|
||||||
= link_to i(:pencil), edit_admin_p_customer_path(p_customer), :remote => false
|
= link_to i(:pencil), edit_admin_p_customer_path(p_customer), :remote => false
|
||||||
-if current_admin.has_permission?("customers-s")
|
-if current_admin.has_permission?("customers-s")
|
||||||
= link_to i(:eye), admin_p_customer_path(p_customer)
|
= link_to i(:eye), admin_p_customer_path(p_customer)
|
||||||
|
|
||||||
|
=render :partial => "qi/qi_ordered_table_object", :locals => {:tr => tr, :object => p_customer}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -108,6 +108,23 @@
|
|||||||
.header-topbarbox-1
|
.header-topbarbox-1
|
||||||
.header-topbarbox-2
|
.header-topbarbox-2
|
||||||
%ul.social-links
|
%ul.social-links
|
||||||
|
|
||||||
|
-if current_p_customer
|
||||||
|
=link_to ic(:"power-off")+" Déconnexion", logout_public_p_customer_auths_path()
|
||||||
|
|
||||||
|
|
||||||
|
%li
|
||||||
|
-if current_p_customer
|
||||||
|
=link_to public_my_account_path do
|
||||||
|
=ic(:user)
|
||||||
|
Mon compte :
|
||||||
|
=current_p_customer.particular.firstname
|
||||||
|
=current_p_customer.particular.name
|
||||||
|
|
||||||
|
-else
|
||||||
|
=link_to ic(:user)+" Mon compte", public_my_account_path
|
||||||
|
|
||||||
|
|
||||||
%li
|
%li
|
||||||
%a{:href => "https://www.facebook.com/mamotosurcircuit/", :target => "_blank"}
|
%a{:href => "https://www.facebook.com/mamotosurcircuit/", :target => "_blank"}
|
||||||
=ic :"facebook-f"
|
=ic :"facebook-f"
|
||||||
@ -121,24 +138,7 @@
|
|||||||
#position-menu
|
#position-menu
|
||||||
#menu_haut.WithCarousel
|
#menu_haut.WithCarousel
|
||||||
%ul
|
%ul
|
||||||
-if false
|
|
||||||
%li.PGS_PRIMES.sousmenu
|
|
||||||
%a{:href => "https://www.mamotosurcircuit.com/136-primes.html", :title => "Primes"}
|
|
||||||
%span Primes
|
|
||||||
/ [if gt IE 6]><!
|
|
||||||
%a.extend{:href => "#"}
|
|
||||||
%i.fa.fa-chevron-down
|
|
||||||
/ <![endif]
|
|
||||||
%ul.menu-sub
|
|
||||||
%li
|
|
||||||
%a{:href => "https://www.mamotosurcircuit.com/135-dunlop.html", :title => "Dunlop"}
|
|
||||||
%span Dunlop
|
|
||||||
%li
|
|
||||||
%a{:href => "https://www.mamotosurcircuit.com/137-stickers.html", :title => "Stickers"}
|
|
||||||
%span Stickers
|
|
||||||
/[if lte IE 6] </a>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-MenuItem.where(:parent_id => nil, :menu_id => 1).order(:position).each do |menu_item|
|
-MenuItem.where(:parent_id => nil, :menu_id => 1).order(:position).each do |menu_item|
|
||||||
-if menu_item_link(menu_item) and menu_item_link(menu_item) != ""
|
-if menu_item_link(menu_item) and menu_item_link(menu_item) != ""
|
||||||
@ -146,21 +146,21 @@
|
|||||||
=menu_item_link(menu_item)
|
=menu_item_link(menu_item)
|
||||||
|
|
||||||
|
|
||||||
%li.PGS_ROULAGE
|
-if false
|
||||||
=link_to "Trouvez votre journée", public_m_events_path
|
%li.PGS_ROULAGE
|
||||||
|
=link_to "Trouvez votre journée", public_m_events_path
|
||||||
|
|
||||||
|
|
||||||
%li.PGS_ANNUAIRE_CIRCUIT
|
%li.PGS_ANNUAIRE_CIRCUIT
|
||||||
=link_to "Circuits", public_circuits_path
|
=link_to "Circuits", public_circuits_path, :class => ("active" if @circuits_active)
|
||||||
%li.PGS_ANNUAIRE_ORGA
|
%li.PGS_ANNUAIRE_ORGA
|
||||||
=link_to "Organisateurs", public_organisateurs_path
|
=link_to "Organisateurs", public_organisateurs_path, :class => ("active" if @organisateurs_active)
|
||||||
|
|
||||||
%li.PGS_DISTRIBUTEUR
|
%li.PGS_DISTRIBUTEUR
|
||||||
%a{:href => "https://www.dunlop.eu/fr_fr/motorcycle/dealers/find-a-dealer.html", :target => "_blank", :title => "Distributeurs"}
|
%a{:href => "https://www.dunlop.eu/fr_fr/motorcycle/dealers/find-a-dealer.html", :target => "_blank", :title => "Distributeurs"}
|
||||||
%span Distributeurs
|
%span Distributeurs
|
||||||
|
|
||||||
%li.PGS_COMPTE
|
|
||||||
=link_to "Mon compte", public_my_account_path
|
|
||||||
|
|
||||||
|
|
||||||
%button.navbar-toggle.collapsed.btn-menu{"aria-controls" => "navbar", "aria-expanded" => "false", "data-target" => "#navbar", "data-toggle" => "collapse", :type => "button"}
|
%button.navbar-toggle.collapsed.btn-menu{"aria-controls" => "navbar", "aria-expanded" => "false", "data-target" => "#navbar", "data-toggle" => "collapse", :type => "button"}
|
||||||
@ -204,7 +204,7 @@
|
|||||||
%a{:accesskey => "8", :href => "https://www.mamotosurcircuit.com/123-conditions-generales-utilisation.html", :title => "Conditions générales d'utilisation"} Conditions générales d'utilisation
|
%a{:accesskey => "8", :href => "https://www.mamotosurcircuit.com/123-conditions-generales-utilisation.html", :title => "Conditions générales d'utilisation"} Conditions générales d'utilisation
|
||||||
.col-md-4
|
.col-md-4
|
||||||
%section.footer-section
|
%section.footer-section
|
||||||
%h3.footer-section__title.ui-title-inner Nous situer
|
%h3.footer-section__title.ui-title-inner Nous contacter
|
||||||
.footer-contact
|
.footer-contact
|
||||||
%i.icon.icon-xs.fa.fa-envelope-o
|
%i.icon.icon-xs.fa.fa-envelope-o
|
||||||
%a{:href => "mailto:contact@mamotosurcircuit.com"} contact@mamotosurcircuit.com
|
%a{:href => "mailto:contact@mamotosurcircuit.com"} contact@mamotosurcircuit.com
|
||||||
|
@ -2,11 +2,15 @@
|
|||||||
.m_event
|
.m_event
|
||||||
-img = ""
|
-img = ""
|
||||||
-img = m_event.organisateur.logo.file.large.medium.url if m_event.organisateur and m_event.organisateur.logo
|
-img = m_event.organisateur.logo.file.large.medium.url if m_event.organisateur and m_event.organisateur.logo
|
||||||
.img{:style => ("background-image:url('#{img}');" if img)}
|
|
||||||
|
=image_tag img
|
||||||
.desc
|
.desc
|
||||||
.head
|
.head
|
||||||
%h3
|
%h3
|
||||||
=m_event.title
|
=link_to m_event.m_event_type_title, public_m_events_path(:search => {:m_event_type_title => [m_event.m_event_type_title]})
|
||||||
|
="-"
|
||||||
|
=link_to m_event.circuit.name, public_m_events_path(:search => {:circuit_id => m_event.circuit.id})
|
||||||
|
|
||||||
%span.date
|
%span.date
|
||||||
-if m_event.start_at.to_date == m_event.end_at.to_date
|
-if m_event.start_at.to_date == m_event.end_at.to_date
|
||||||
le
|
le
|
||||||
@ -16,22 +20,22 @@
|
|||||||
=l m_event.start_at, :format => :date
|
=l m_event.start_at, :format => :date
|
||||||
au
|
au
|
||||||
=l m_event.end_at, :format => :date
|
=l m_event.end_at, :format => :date
|
||||||
.circuit_name
|
|
||||||
%strong Circuit :
|
|
||||||
=link_to m_event.circuit.name, public_m_events_path(:search => {:circuit_id => m_event.circuit.id})
|
|
||||||
|
|
||||||
.details=simple_format m_event.description
|
|
||||||
|
|
||||||
.right_roulage.right
|
|
||||||
=link_to "Détail", m_event.link.to_s, :target => "_blank"
|
|
||||||
.type
|
|
||||||
%strong Type :
|
|
||||||
=link_to m_event.m_event_type_title, public_m_events_path(:search => {:m_event_type_title => [m_event.m_event_type_title]})
|
|
||||||
|
|
||||||
.organisateur_name
|
.organisateur_name
|
||||||
%strong Organisateur :
|
Organisé par
|
||||||
=link_to m_event.organisateur.name, public_organisateur_path(m_event.organisateur), :target => "_blank" if m_event.organisateur
|
%strong=link_to m_event.organisateur.name, public_organisateur_path(m_event.organisateur), :target => "_blank" if m_event.organisateur
|
||||||
|
|
||||||
|
-if m_event.description?
|
||||||
|
%br
|
||||||
|
=link_to "+ d'infos", "#", :onclick => "$(this).next('.details').toggle();return false;"
|
||||||
|
.details{:style => "display:none;"}=simple_format m_event.description
|
||||||
|
|
||||||
|
%br
|
||||||
|
%br
|
||||||
|
.right_roulage.right
|
||||||
|
=link_to "Réserver (site officiel)", m_event.link.to_s, :target => "_blank"
|
||||||
|
|
||||||
|
|
||||||
.clear
|
.clear
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
%tr.m_odr_file_roulage_form.field
|
%tr.m_odr_file_roulage_form.field
|
||||||
%td= form.input :date, :label => "date :" , :as => :date
|
%td= form.input :date, :label => "Date :" , :as => :string , :input_html => {:autocomplete => "off", :class => "year_date_picker"}
|
||||||
%td= form.input :m_event_id, :label => "Journée de roulage :", :as => :date, :collection => MEvent.all, :member_label => :member_label, :as => :select
|
=#%td=# form.input :m_event_id, :label => "Journée de roulage :", :as => :date, :collection => MEvent.all, :member_label => :member_label, :as => :select
|
||||||
|
|
||||||
|
|
||||||
%td.actions=link_to_remove_fields ic(:"trash-o"), form
|
%td.actions=link_to_remove_fields ic(:"trash-o"), form
|
@ -7,18 +7,17 @@
|
|||||||
|
|
||||||
= f.input :file, :label => "Fichier :"
|
= f.input :file, :label => "Fichier :"
|
||||||
|
|
||||||
= f.input :buy_at, :label => "Date de la facture :", :as => :date
|
|
||||||
|
|
||||||
= f.hidden_field :m_odr_file_type_id
|
= f.hidden_field :m_odr_file_type_id
|
||||||
|
|
||||||
|
|
||||||
-if f.object.m_odr_file_type_id == 2
|
-if f.object.m_odr_file_type_id == 2
|
||||||
%table.m_odr_file_products_form.form-table
|
%table.m_odr_file_products_form.form-table
|
||||||
= f.input :buy_at, :label => "Date de l'achat", :as => :date
|
= f.input :buy_at, :label => "Date de l'achat",:as => :string, :input_html => {:autocomplete => "off", :class => "year_date_picker"}
|
||||||
= f.input :m_odr_place, :label => "Revendeur :", :as => :date, :collection => MOdrPlace.all, :member_label => :member_label, :as => :select
|
|
||||||
|
|
||||||
-if true
|
-if true
|
||||||
%p= public_link_to_add_fields ic(:plus)+" Ajouter un produit", f, :m_odr_file_products
|
%p= public_link_to_add_fields ic(:plus)+" Ajouter un ou plusieurs pneus", f, :m_odr_file_products
|
||||||
|
|
||||||
=f.semantic_fields_for :m_odr_file_products do |form|
|
=f.semantic_fields_for :m_odr_file_products do |form|
|
||||||
=render :partial => "public/m_odr_file_products/form", :locals => {:form => form}
|
=render :partial => "public/m_odr_file_products/form", :locals => {:form => form}
|
||||||
@ -30,12 +29,14 @@
|
|||||||
=f.semantic_fields_for :m_odr_file_roulages do |form|
|
=f.semantic_fields_for :m_odr_file_roulages do |form|
|
||||||
=render :partial => "public/m_odr_file_roulages/form", :locals => {:form => form}
|
=render :partial => "public/m_odr_file_roulages/form", :locals => {:form => form}
|
||||||
|
|
||||||
-if false
|
-if true
|
||||||
%p= link_to_add_fields ic(:plus)+" Ajouter une date de roulage", f, :m_odr_file_roulages
|
%p= public_link_to_add_fields ic(:plus)+" Ajouter une journée de roulage", f, :m_odr_file_roulages
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.large_actions
|
.large_actions
|
||||||
.actions=f.submit "sauvegarder", :class => "btn btn-primary"
|
.actions=f.submit "sauvegarder", :class => "btn btn-primary"
|
||||||
|
%br
|
||||||
|
%br
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
=link_to ic(:download)+" Télécharger le document", download_admin_m_odr_file_path(m_odr_file, :disposition => "attachment")
|
=link_to ic(:download)+" Télécharger le document", download_admin_m_odr_file_path(m_odr_file, :disposition => "attachment")
|
||||||
|
|
||||||
|
|
||||||
%td
|
%td.state
|
||||||
-if m_odr_file.admin_ok
|
-if m_odr_file.admin_ok
|
||||||
=state_helper("Validé")
|
=state_helper("Validé")
|
||||||
-elsif m_odr_file.admin_ok == false
|
-elsif m_odr_file.admin_ok == false
|
||||||
|
@ -3,6 +3,6 @@
|
|||||||
=l m_odr_prime.created_at, :format => :date
|
=l m_odr_prime.created_at, :format => :date
|
||||||
%td
|
%td
|
||||||
=number_to_currency m_odr_prime.amount
|
=number_to_currency m_odr_prime.amount
|
||||||
%td
|
%td.state
|
||||||
=state_helper(m_odr_prime.state)
|
=state_helper(m_odr_prime.state)
|
||||||
|
|
||||||
|
@ -29,15 +29,15 @@
|
|||||||
.block_avantage
|
.block_avantage
|
||||||
%a{:href => "/fr/primes.html"}
|
%a{:href => "/fr/primes.html"}
|
||||||
.container_picto
|
.container_picto
|
||||||
%img.img_av{:src => "https://www.mamotosurcircuit.com/images/interface/pneu_left_2.png"}/
|
%img.img_av{:src => "https://www.mamotosurcircuit.com/images/interface/bonus_left.png"}/
|
||||||
%img.img_av_hover{:src => "https://www.mamotosurcircuit.com/images/interface/pneu_left_2_white.png"}/
|
%img.img_av_hover{:src => "https://www.mamotosurcircuit.com/images/interface/bonus_left_white.png"}/
|
||||||
%h5 Prime de roulage pneus Dunlop
|
%h5 Prime de roulage pneus Dunlop
|
||||||
%p Achetez, roulez et soyez remboursé
|
%p Achetez, roulez et soyez remboursé
|
||||||
.block_avantage
|
.block_avantage
|
||||||
%a{:href => public_my_account_path()}
|
%a{:href => public_my_account_path()}
|
||||||
.container_picto
|
.container_picto
|
||||||
%img.img_av{:src => "https://www.mamotosurcircuit.com/images/interface/bonus_left.png"}/
|
%img.img_av{:src => "https://www.mamotosurcircuit.com/images/interface/pneu_left_2.png"}/
|
||||||
%img.img_av_hover{:src => "https://www.mamotosurcircuit.com/images/interface/bonus_left_white.png"}/
|
%img.img_av_hover{:src => "https://www.mamotosurcircuit.com/images/interface/pneu_left_2_white.png"}/
|
||||||
%h5 Des stickers
|
%h5 Des stickers
|
||||||
%p Inscrivez-vous et recevez gratuitement vos stickers
|
%p Inscrivez-vous et recevez gratuitement vos stickers
|
||||||
.block_avantage
|
.block_avantage
|
||||||
|
@ -1,64 +1,146 @@
|
|||||||
|
|
||||||
.center_content
|
.center_content
|
||||||
%a{:accesskey => "s", :href => "#contenu", :name => "contenu"}
|
|
||||||
#contenu_scroller
|
|
||||||
#paragraphe292.paragraphe
|
|
||||||
%a{:name => "paragraphe292"}
|
|
||||||
.panel_user
|
|
||||||
.nav_user
|
|
||||||
%h3 Mon compte
|
|
||||||
.link_nav
|
|
||||||
=link_to ic(:"user")+" me déconnecter", logout_public_p_customer_auths_path(), :class => "disconnect"
|
|
||||||
.new_compte
|
|
||||||
%h4
|
|
||||||
Bonjour
|
|
||||||
%span{:style => "font-weight:300;"}=current_p_customer.show_name
|
|
||||||
.nav_user_full
|
|
||||||
%div
|
|
||||||
%a{:href => "https://www.mamotosurcircuit.com/104--195-mon-compte.html"}
|
|
||||||
%span Mes demandes de prime
|
|
||||||
= link_to 'Envoyer une facture de roulage', new_public_m_odr_file_path(:m_odr_file_type_id => 1)
|
|
||||||
= link_to 'Envoyer une facture d\'achat', new_public_m_odr_file_path(:m_odr_file_type_id => 2)
|
|
||||||
= link_to "Suivre mes demandes de prime", public_m_odr_files_path
|
|
||||||
-if current_p_customer.m_odr_rep_ribs.count > 0
|
|
||||||
= link_to "Modifier mon rib", edit_public_m_odr_rep_rib_path(current_p_customer.m_odr_rep_ribs.first)
|
|
||||||
-else
|
|
||||||
= link_to "Ajouter mon rib", new_public_m_odr_rep_rib_path()
|
|
||||||
|
|
||||||
|
#contenu_scroller
|
||||||
|
|
||||||
%div
|
%h1 Mon compte
|
||||||
|
|
||||||
|
.right
|
||||||
|
=link_to ic(:lock)+" Modifier mon mot de passe", edit_password_public_p_customer_auths_path()
|
||||||
|
|
||||||
|
.clear
|
||||||
|
.row
|
||||||
|
.col-md-6
|
||||||
|
%h3 Mes informations personnelles
|
||||||
|
.particular_div
|
||||||
|
%p
|
||||||
|
-if current_p_customer.particular_ok?
|
||||||
|
%span.green
|
||||||
|
=ic :flag
|
||||||
|
Adresse remplie
|
||||||
|
-else
|
||||||
|
%span.orange
|
||||||
|
=ic :flag
|
||||||
|
Remplissez votre adresse pour recevoir vos stickers
|
||||||
|
|
||||||
%span Mes informations personnelles
|
|
||||||
=link_to "Modifier mes coordonnées, indiquer mes préférences, ...", edit_public_particular_path(current_p_customer.particular)
|
-particular = current_p_customer.particular
|
||||||
=link_to "Modifier mon mot de passe", edit_password_public_p_customer_auths_path()
|
-if particular
|
||||||
|
=particular.firstname
|
||||||
|
=particular.name
|
||||||
|
%br
|
||||||
|
-if particular.address_2?
|
||||||
|
|
||||||
|
=particular.address_2
|
||||||
|
%br
|
||||||
|
-if particular.address_3?
|
||||||
|
|
||||||
|
=particular.address_3
|
||||||
|
%br
|
||||||
|
-if particular.cp? or particular.city? or particular.country?
|
||||||
|
|
||||||
|
=particular.cp
|
||||||
|
|
||||||
%div
|
=particular.city
|
||||||
%a{:href => "/fr/primes.html"}
|
|
||||||
%span Dunlop Sponsor Program
|
=particular.country
|
||||||
%span Découvrir mes avantages
|
%br
|
||||||
%h4 Contacter l'équipe de mamotosurcircuit.com
|
%p
|
||||||
.info_contact
|
=link_to "Modifier mes coordonnées", edit_public_particular_path(current_p_customer.particular)
|
||||||
%div
|
|
||||||
%span.picto_cmpt.arobase @
|
|
||||||
%a{:href => "mailto:contact@mamotosurcircuit.com", :target => "_blank"} contact@mamotosurcircuit.com
|
|
||||||
%div
|
|
||||||
%span.picto_cmpt
|
|
||||||
=ic :"facebook-f"
|
|
||||||
%a{:href => "https://www.facebook.com/mamotosurcircuit/", :target => "_blank"} @mamotosurcircuit
|
.col-md-6
|
||||||
%div
|
%h3 Mon rib
|
||||||
%span.picto_cmpt
|
.rib
|
||||||
%i.fa.fa-phone{"aria-hidden" => "true"}
|
-if current_p_customer.valid_m_odr_rep_rib
|
||||||
%a{:href => "tel:0476313838", :target => "_blank"} 04 76 31 38 38
|
%p
|
||||||
%div
|
%span.green
|
||||||
%span.picto_cmpt.adresse_cpt
|
=ic :flag
|
||||||
%i.fa.fa-envelope-o{"aria-hidden" => "true"}
|
RIB validé
|
||||||
%span.inlince_adresse
|
-rib = current_p_customer.valid_m_odr_rep_rib
|
||||||
Market-Inn
|
|
||||||
%br/
|
.rib
|
||||||
Service relation client Mamotosurcircuit.com
|
IBAN :
|
||||||
%br/
|
=rib.iban
|
||||||
8 route des Bois Bat A
|
%br
|
||||||
%br/
|
BIC :
|
||||||
38500 Voiron
|
=rib.bic
|
||||||
%br.clr/
|
%br
|
||||||
|
= link_to "Modifier mon rib", edit_public_m_odr_rep_rib_path(current_p_customer.m_odr_rep_ribs.first)
|
||||||
|
|
||||||
|
-elsif current_p_customer.m_odr_rep_ribs.count > 0
|
||||||
|
%p
|
||||||
|
%span.orange
|
||||||
|
=ic :flag
|
||||||
|
RIB en cours de validation
|
||||||
|
|
||||||
|
-rib = current_p_customer.m_odr_rep_ribs.first
|
||||||
|
|
||||||
|
.rib
|
||||||
|
IBAN :
|
||||||
|
=rib.iban
|
||||||
|
%br
|
||||||
|
BIC :
|
||||||
|
=rib.bic
|
||||||
|
|
||||||
|
|
||||||
|
-else
|
||||||
|
%p
|
||||||
|
%span.red
|
||||||
|
=ic :flag
|
||||||
|
RIB non renseigné
|
||||||
|
.rib= link_to "Ajouter mon rib", new_public_m_odr_rep_rib_path()
|
||||||
|
|
||||||
|
|
||||||
|
.doc_pannel
|
||||||
|
%h3 Mes primes
|
||||||
|
-if current_p_customer.m_odr_primes.count > 0
|
||||||
|
%table.table
|
||||||
|
=render current_p_customer.m_odr_primes
|
||||||
|
|
||||||
|
-else
|
||||||
|
.empty
|
||||||
|
Pour obtenir des primes déposez vos factures d'achat et de roulage
|
||||||
|
|
||||||
|
|
||||||
|
.doc_pannel
|
||||||
|
|
||||||
|
%h3 Mes factures d'achat
|
||||||
|
-if m_odr_files = current_p_customer.m_odr_files.where(:m_odr_file_type_id => 2) and m_odr_files.count > 0
|
||||||
|
%table.table
|
||||||
|
=render m_odr_files
|
||||||
|
|
||||||
|
-else
|
||||||
|
.empty
|
||||||
|
Vous n'avez pas encore déposé de facture d'achat
|
||||||
|
|
||||||
|
.align_center
|
||||||
|
= link_to 'Envoyer une facture d\'achat', new_public_m_odr_file_path(:m_odr_file_type_id => 2), :class => "new_btn"
|
||||||
|
.doc_pannel
|
||||||
|
%h3 Mes factures de roulage
|
||||||
|
-if m_odr_files = current_p_customer.m_odr_files.where(:m_odr_file_type_id => 1) and m_odr_files.count > 0
|
||||||
|
%table.table
|
||||||
|
=render m_odr_files
|
||||||
|
-else
|
||||||
|
.empty
|
||||||
|
Vous n'avez pas encore déposé de facture de roulage
|
||||||
|
|
||||||
|
.align_center
|
||||||
|
= link_to 'Envoyer une facture de roulage', new_public_m_odr_file_path(:m_odr_file_type_id => 1), :class => "new_btn"
|
||||||
|
|
||||||
|
=link_to "Découvrir les avantages du Dunlop Sponsor Program", "/fr/primes.html"
|
||||||
|
|
||||||
|
%br
|
||||||
|
%br
|
||||||
|
%br
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
%br.clr/
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
|
|
||||||
.connexion_form
|
.connexion_form
|
||||||
%h2 Déjà inscrit ?
|
%h3 Déjà inscrit ?
|
||||||
|
|
||||||
= form_tag public_p_customer_auths_path, {:class => "formtastic"} do
|
= form_tag public_p_customer_auths_path, {:class => "formtastic"} do
|
||||||
=hidden_field_tag :for_order, params[:for_order]
|
=hidden_field_tag :for_order, params[:for_order]
|
||||||
@ -35,7 +35,13 @@
|
|||||||
%p{:style => "text-align:center"}
|
%p{:style => "text-align:center"}
|
||||||
=link_to qit("lost-password","Mot de passe perdu ?"), password_reset_public_p_customer_auths_path(:for_order => params[:for_order]), :class => "shop"
|
=link_to qit("lost-password","Mot de passe perdu ?"), password_reset_public_p_customer_auths_path(:for_order => params[:for_order]), :class => "shop"
|
||||||
|
|
||||||
|
%br
|
||||||
.col-md-6
|
.col-md-6
|
||||||
=link_to "Créer mon compte", new_public_p_customer_path ,:class => "new_btn"
|
%h3 Pas encore de compte ?
|
||||||
|
|
||||||
|
%br
|
||||||
|
%br
|
||||||
|
%br
|
||||||
|
%center
|
||||||
|
=link_to "Créer mon compte", new_public_p_customer_path ,:class => "new_btn"
|
||||||
=#render :partial => "public/p_customers/new_form"
|
=#render :partial => "public/p_customers/new_form"
|
||||||
|
@ -1,11 +1,12 @@
|
|||||||
|
|
||||||
%h2 Pas encore client ?
|
|
||||||
=#debug @p_customer.errors.messages
|
=#debug @p_customer.errors.messages
|
||||||
= semantic_form_for [:public, @p_customer] do |f|
|
= semantic_form_for [:public, @p_customer] do |f|
|
||||||
=hidden_field_tag :for_order, params[:for_order]
|
=hidden_field_tag :for_order, params[:for_order]
|
||||||
=f.inputs do
|
=f.inputs do
|
||||||
=f.hidden_field :valid_public
|
=f.hidden_field :valid_public
|
||||||
|
|
||||||
|
=f.input :parent_code, :label => "Code ambassadeur :"
|
||||||
|
|
||||||
=f.input :email, :label => "Email :"
|
=f.input :email, :label => "Email :"
|
||||||
=f.input :password, :label => "Mot de passe :", :as => :password
|
=f.input :password, :label => "Mot de passe :", :as => :password
|
||||||
|
|
||||||
|
@ -1,5 +1,16 @@
|
|||||||
Rails.application.routes.draw do
|
Rails.application.routes.draw do
|
||||||
|
|
||||||
|
namespace :admin do
|
||||||
|
resources :mail_type_cats do
|
||||||
|
member do
|
||||||
|
|
||||||
|
end
|
||||||
|
collection do
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
namespace :admin do
|
namespace :admin do
|
||||||
resources :circuit_regions do
|
resources :circuit_regions do
|
||||||
member do
|
member do
|
||||||
@ -610,6 +621,8 @@ Rails.application.routes.draw do
|
|||||||
resources :p_customer_auths do
|
resources :p_customer_auths do
|
||||||
collection do
|
collection do
|
||||||
|
|
||||||
|
get :valid_account
|
||||||
|
|
||||||
get :password_reset
|
get :password_reset
|
||||||
post :save_password_reset
|
post :save_password_reset
|
||||||
|
|
||||||
|
7
db/migrate/20200602223325_add_imports_to_m_events.rb
Normal file
7
db/migrate/20200602223325_add_imports_to_m_events.rb
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
class AddImportsToMEvents < ActiveRecord::Migration[6.0]
|
||||||
|
def change
|
||||||
|
add_column :m_events, :encadrant, :string
|
||||||
|
add_column :m_events, :imp_circuit_name, :string
|
||||||
|
add_column :m_events, :imp_circuit_organisateur, :string
|
||||||
|
end
|
||||||
|
end
|
9
db/migrate/20200602230532_create_mail_type_cats.rb
Normal file
9
db/migrate/20200602230532_create_mail_type_cats.rb
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
class CreateMailTypeCats < ActiveRecord::Migration[6.0]
|
||||||
|
def change
|
||||||
|
create_table :mail_type_cats do |t|
|
||||||
|
t.string :name
|
||||||
|
|
||||||
|
t.timestamps
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,5 @@
|
|||||||
|
class AddMailTypeCatToMailTypes < ActiveRecord::Migration[6.0]
|
||||||
|
def change
|
||||||
|
add_column :mail_types, :mail_type_cat_id, :integer
|
||||||
|
end
|
||||||
|
end
|
12
db/schema.rb
12
db/schema.rb
@ -10,7 +10,7 @@
|
|||||||
#
|
#
|
||||||
# It's strongly recommended that you check this file into your version control system.
|
# It's strongly recommended that you check this file into your version control system.
|
||||||
|
|
||||||
ActiveRecord::Schema.define(version: 2020_05_25_085510) do
|
ActiveRecord::Schema.define(version: 2020_06_02_230712) do
|
||||||
|
|
||||||
create_table "accounting_zones", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4", force: :cascade do |t|
|
create_table "accounting_zones", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4", force: :cascade do |t|
|
||||||
t.string "name"
|
t.string "name"
|
||||||
@ -676,6 +676,9 @@ ActiveRecord::Schema.define(version: 2020_05_25_085510) do
|
|||||||
t.integer "image_file_id"
|
t.integer "image_file_id"
|
||||||
t.datetime "created_at", precision: 6, null: false
|
t.datetime "created_at", precision: 6, null: false
|
||||||
t.datetime "updated_at", precision: 6, null: false
|
t.datetime "updated_at", precision: 6, null: false
|
||||||
|
t.string "encadrant"
|
||||||
|
t.string "imp_circuit_name"
|
||||||
|
t.string "imp_circuit_organisateur"
|
||||||
t.index ["circuit_id"], name: "index_m_events_on_circuit_id"
|
t.index ["circuit_id"], name: "index_m_events_on_circuit_id"
|
||||||
t.index ["organisateur_id"], name: "index_m_events_on_organisateur_id"
|
t.index ["organisateur_id"], name: "index_m_events_on_organisateur_id"
|
||||||
end
|
end
|
||||||
@ -1149,6 +1152,12 @@ ActiveRecord::Schema.define(version: 2020_05_25_085510) do
|
|||||||
t.datetime "updated_at", precision: 6, null: false
|
t.datetime "updated_at", precision: 6, null: false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
create_table "mail_type_cats", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4", force: :cascade do |t|
|
||||||
|
t.string "name"
|
||||||
|
t.datetime "created_at", precision: 6, null: false
|
||||||
|
t.datetime "updated_at", precision: 6, null: false
|
||||||
|
end
|
||||||
|
|
||||||
create_table "mail_types", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4", force: :cascade do |t|
|
create_table "mail_types", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4", force: :cascade do |t|
|
||||||
t.string "slug"
|
t.string "slug"
|
||||||
t.string "default_title"
|
t.string "default_title"
|
||||||
@ -1159,6 +1168,7 @@ ActiveRecord::Schema.define(version: 2020_05_25_085510) do
|
|||||||
t.bigint "m_odr_id"
|
t.bigint "m_odr_id"
|
||||||
t.text "tags"
|
t.text "tags"
|
||||||
t.bigint "file_tunel_id"
|
t.bigint "file_tunel_id"
|
||||||
|
t.integer "mail_type_cat_id"
|
||||||
t.index ["file_tunel_id"], name: "index_mail_types_on_file_tunel_id"
|
t.index ["file_tunel_id"], name: "index_mail_types_on_file_tunel_id"
|
||||||
t.index ["m_odr_id"], name: "index_mail_types_on_m_odr_id"
|
t.index ["m_odr_id"], name: "index_mail_types_on_m_odr_id"
|
||||||
t.index ["mail_type_reference_id"], name: "index_mail_types_on_mail_type_reference_id"
|
t.index ["mail_type_reference_id"], name: "index_mail_types_on_mail_type_reference_id"
|
||||||
|
@ -7,3 +7,4 @@ module ActsAsCaching
|
|||||||
#autoload :InstanceMethods, File.join(File.dirname(__FILE__), "acts_as_caching/instance_methods")
|
#autoload :InstanceMethods, File.join(File.dirname(__FILE__), "acts_as_caching/instance_methods")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# V 0.1
|
@ -29,6 +29,9 @@ module ActsAsCaching::Hook
|
|||||||
|
|
||||||
define_method("qi_dynamics_cache"){
|
define_method("qi_dynamics_cache"){
|
||||||
puts "qi_dynamics_cache"
|
puts "qi_dynamics_cache"
|
||||||
|
puts "hook"
|
||||||
|
puts self.class
|
||||||
|
|
||||||
|
|
||||||
if self.methods.include?(:to_no_archive)
|
if self.methods.include?(:to_no_archive)
|
||||||
self.to_no_archive.each do |noc|
|
self.to_no_archive.each do |noc|
|
||||||
|
@ -7,3 +7,4 @@ module ActsAsCsvImport
|
|||||||
#autoload :InstanceMethods, File.join(File.dirname(__FILE__), "acts_as_csv_import/instance_methods")
|
#autoload :InstanceMethods, File.join(File.dirname(__FILE__), "acts_as_csv_import/instance_methods")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# V 0.1
|
@ -24,15 +24,17 @@ module ActsAsCsvImport::Hook
|
|||||||
n = self.new
|
n = self.new
|
||||||
|
|
||||||
row.each do |key, value|
|
row.each do |key, value|
|
||||||
eval "n.#{key} = value"
|
|
||||||
|
if self.type_for_attribute(key) and self.type_for_attribute(key).type == :decimal
|
||||||
|
eval "n.#{key} = value.to_s.gsub(' ', '').gsub(',', '.')"
|
||||||
|
else
|
||||||
|
eval "n.#{key} = value"
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
puts "ENREGISTREMENT"
|
|
||||||
puts n.save
|
n.save
|
||||||
puts "ERREURS"
|
|
||||||
puts n.errors.messages
|
|
||||||
puts "FIN"
|
|
||||||
|
|
||||||
import_csv.import_csv_elements << ImportCsvElement.new(:element => n)
|
import_csv.import_csv_elements << ImportCsvElement.new(:element => n)
|
||||||
|
|
||||||
|
@ -7,3 +7,4 @@ module ActsAsSorting
|
|||||||
#autoload :InstanceMethods, File.join(File.dirname(__FILE__), "acts_as_sorting/instance_methods")
|
#autoload :InstanceMethods, File.join(File.dirname(__FILE__), "acts_as_sorting/instance_methods")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# V 0.1
|
@ -53,3 +53,5 @@ end
|
|||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# V 0.1
|
Binary file not shown.
After Width: | Height: | Size: 230 KiB |
7
test/fixtures/mail_type_cats.yml
vendored
Normal file
7
test/fixtures/mail_type_cats.yml
vendored
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
|
||||||
|
|
||||||
|
one:
|
||||||
|
name: MyString
|
||||||
|
|
||||||
|
two:
|
||||||
|
name: MyString
|
7
test/models/mail_type_cat_test.rb
Normal file
7
test/models/mail_type_cat_test.rb
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
require 'test_helper'
|
||||||
|
|
||||||
|
class MailTypeCatTest < ActiveSupport::TestCase
|
||||||
|
# test "the truth" do
|
||||||
|
# assert true
|
||||||
|
# end
|
||||||
|
end
|
Loading…
x
Reference in New Issue
Block a user