mmsc_app/app/views/admin/p_customers/_form.html.haml
2021-03-23 15:48:01 +01:00

97 lines
3.1 KiB
Plaintext
Executable File

:coffeescript
@update_p_customer_form = () ->
if $("#p_customer_enabled").is(':checked')
$(".disabled_raison").hide()
else
$(".disabled_raison").show()
=semantic_form_for [:admin, @p_customer], :remote => false, :html => {:onchange => "update_p_customer_form();"} do |form|
=debug @p_customer.errors.messages if current_admin.id == 1
.qi_row
.qi_pannel.qi_plain.padding
=form.inputs do
.row.qi_cancel_margins
.col-sm-2
= form.input :parent_id, :label => "Ambassadeur :", :include_blank => true, :collection => PCustomer.where(:ambassadeur => true).all, :as => :select, :member_label => :member_label
.col-sm-2
%br
= form.input :enabled, :label => "Utilisateur actif ?", :as => :boolean
.col-sm-2
%br
= form.input :ambassadeur, :label => "Ambassadeur ?", :as => :boolean
.col-sm-2
%br
= form.input :sticker, :label => "Stickers envoyés ?"
.col-sm-2
%br
= form.input :test_user, :label => "Client test ?", :as => :boolean
.row.qi_cancel_margins
.col-sm-4
%br
= form.input :unlimited, :label => "Nbr de primes déplafonné ?", :as => :boolean
.col-sm-4
= form.object.import_name
.col-sm-4
=l form.object.import_date if form.object.import_date
=# form.input :tel, :label => "Tel :"
= form.input :email, :label => "Email (login) :"
= form.input :generate_mdp, :label => "Forcer la génération d'un nouveau mot de passe ? (un mail sera envoyé au client)", :as => :boolean
= form.input :password, :label => "Mot de passe :", :input_html => { :autocomplete => "new-password"}, :as => :string
= form.input :mlm_token, :label => "Code ambassadeur :"
.qi_row
.qi_pannel.qi_plain.padding
Adresse :
.particulars_form
=form.semantic_fields_for :particulars do |form|
=render :partial => "admin/particulars/form", :locals => {:form => form}
.qi_row
.qi_pannel.qi_plain.padding
.row.qi_cancel_margins
.col-sm-2
= form.input :circuit_1_id, :label => "Circuit préféré 1 :", :include_blank => true, :collection => Circuit.all, :as => :select, :member_label => :member_label
.col-sm-2
= form.input :circuit_2_id, :label => "Circuit préféré 2 :", :include_blank => true, :collection => Circuit.all, :as => :select, :member_label => :member_label
.col-sm-2
= form.input :circuit_3_id, :label => "Circuit préféré 3 :", :include_blank => true, :collection => Circuit.all, :as => :select, :member_label => :member_label
.col-sm-2
= form.input :nbr_roulages, :label => "Nombre de roulage :", :include_blank => true, :collection => PCustomer::NBR_ROULAGES, :as => :select
.col-sm-2
.large_actions
.actions
=form.submit "sauvegarder", :class => "btn btn-primary btn-ap-add"