clair_app/app/views/admin/p_customers/_form.html.haml
Nicolas Bally c2f8ec2efb initial
2020-10-10 00:28:38 +02:00

66 lines
1.8 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-4
= form.input :enabled, :label => "Client actif ?", :as => :boolean, :input_html => {:id => ""}
-if false
.col-sm-4
= form.input :parent_id, :label => "Ambassadeur :", :include_blank => true, :collection => PCustomer.where(:ambassadeur => true).all, :as => :select, :member_label => :member_label
.col-sm-4
%br
= form.input :ambassadeur, :label => "Ambassadeur ?", :as => :boolean, :input_html => {:id => ""}
-if false
= 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
.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
= form.input :tel, :label => "Tel :"
= form.input :email, :label => "Email :"
.large_actions
.actions
=form.submit "sauvegarder", :class => "btn btn-primary btn-ap-add"