|
|
@@ -1,4 +1,4 @@
|
|
|
-<%= form_for( setup_customer(@customer), :html => {:class=>"form-horizontal"}) do |f| %>
|
|
|
+<%= form_for( setup_customer(@customer), html: { class: "form-horizontal" }) do |f| %>
|
|
|
<div class="portlet-body form">
|
|
|
<% if @customer.errors.any? %>
|
|
|
<div class="alert alert-danger">
|
|
|
@@ -9,110 +9,102 @@
|
|
|
<h4 class="form-section">Información general</h4>
|
|
|
<div class="row">
|
|
|
<div class="form-group ">
|
|
|
- <%= f.label :nick_name, {:class=>"col-md-3 control-label"} do %>Cliente <span class="required">*</span>
|
|
|
- <% end %>
|
|
|
+ <%= f.label :nick_name, { class: "col-md-3 control-label" } do %>Cliente <span class="required">*</span>
|
|
|
+ <% end %>
|
|
|
<div class="col-md-9">
|
|
|
- <%= f.text_field :nick_name, {:class=>"form-control input-xlarge" } %>
|
|
|
+ <%= f.text_field :nick_name, { class: "form-control input-xlarge" } %>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="form-group">
|
|
|
- <%= f.label :phone, "Teléfono", {:class=>"col-md-3 control-label"} do %> Teléfono <span class="required">*</span>
|
|
|
- <% end %>
|
|
|
+ <%= f.label :phone, "Teléfono", { class: "col-md-3 control-label" } do %> Teléfono
|
|
|
+ <% end %>
|
|
|
<div class="col-md-9">
|
|
|
<div class="input-icon">
|
|
|
<i class="fa fa-phone"></i>
|
|
|
- <%= f.text_field :phone, {:class=>"form-control input-small mask_phone" } %>
|
|
|
+ <%= f.text_field :phone, { class: "form-control input-small mask_phone" } %>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="form-group">
|
|
|
- <%= f.label :email, "Correo", {:class=>"col-md-3 control-label"} do %> Correo electrónico
|
|
|
- <% end %>
|
|
|
+ <%= f.label :email, "Correo", { class: "col-md-3 control-label" } do %> Correo electrónico
|
|
|
+ <% end %>
|
|
|
<div class="col-md-9">
|
|
|
<div class="input-icon">
|
|
|
<i class="fa fa-envelope"></i>
|
|
|
- <%= f.text_field :email, {:class=>"form-control input-xlarge", :placeholder=>"ejemplo@correo.com" } %>
|
|
|
+ <%= f.text_field :email, { class: "form-control input-xlarge", placeholder: "ejemplo@correo.com" } %>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="form-group">
|
|
|
- <%= f.label :notes, "Observaciones", {:class=>"col-md-3 control-label"} %>
|
|
|
+ <%= f.label :notes, "Observaciones", { class: "col-md-3 control-label" } %>
|
|
|
<div class="col-md-9">
|
|
|
- <%= f.text_area :notes, {:class=>"form-control", :rows=>5 } %>
|
|
|
+ <%= f.text_area :notes, { class: "form-control", rows: 5 } %>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="form-group ">
|
|
|
- <%= f.label :credit, "¿Se le otorgó crédito?", {:class=>"col-md-3 control-label"} %>
|
|
|
+ <%= f.label :credit, "¿Se le otorgó crédito?", { class: "col-md-3 control-label" } %>
|
|
|
<div class="col-md-9">
|
|
|
- <%= f.check_box(:credit,
|
|
|
- {
|
|
|
+ <%= f.check_box(:credit,
|
|
|
+ {
|
|
|
class: "make-switch",
|
|
|
data: {
|
|
|
on_color: "success",
|
|
|
off_color: "danger",
|
|
|
- on_text: "Si",
|
|
|
+ on_text: "Si",
|
|
|
off_text: "No"
|
|
|
}
|
|
|
}, "true","false"
|
|
|
) %>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="form-group credit_limits" <% if !@customer.credit? %> style="display:none;" <% end %> >
|
|
|
- <%= f.label :credit_limit, {:class=>"col-md-3 control-label"} do %> Limite de crédito <span class="required">*</span> <% end %>
|
|
|
+ <div class="form-group credit_limits" <% if !@customer.credit? %> style="display:none;" <% end %> >
|
|
|
+ <%= f.label :credit_limit, { class: "col-md-3 control-label" } do %> Limite de crédito <span class="required">*</span> <% end %>
|
|
|
<div class="col-md-9">
|
|
|
<div class="input-group">
|
|
|
<span class="input-group-addon"> $ </span>
|
|
|
- <%= f.text_field :credit_limit, {:class=>"form-control input-small mask_decimal"} %>
|
|
|
+ <%= f.text_field :credit_limit, { class: "form-control input-small mask_decimal" } %>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="form-group credit_limits" <% if !@customer.credit? %> style="display:none;" <% end %> >
|
|
|
- <%= f.label :time_limit, {:class=>"col-md-3 control-label"} do %> Días límite de crédito <span class="required">*</span>
|
|
|
- <% end %>
|
|
|
+ <div class="form-group credit_limits" <% if !@customer.credit? %> style="display:none;" <% end %> >
|
|
|
+ <%= f.label :time_limit, { class: "col-md-3 control-label" } do %> Días límite de crédito <span class="required">*</span>
|
|
|
+ <% end %>
|
|
|
<div class="col-md-9">
|
|
|
- <%= f.text_field :time_limit, {:class=>"form-control input-small mask_number"} %>
|
|
|
+ <%= f.text_field :time_limit, { class: "form-control input-small mask_number" } %>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
- <% if @customer.persisted? %>
|
|
|
+ <!-- < % if @customer.persisted? %> -->
|
|
|
<!-- <div class="form-group last">
|
|
|
- <%= f.label :status, "Status", {:class=>"col-md-3 control-label"} %>
|
|
|
+ < %= f.label :status, "Status", { class: "col-md-3 control-label" } %>
|
|
|
<div class="col-md-9">
|
|
|
- <%= f.check_box(:status,
|
|
|
+ < %= f.check_box(:status,
|
|
|
{
|
|
|
class: "make-switch",
|
|
|
data: {
|
|
|
on_color: "success",
|
|
|
off_color: "danger",
|
|
|
- on_text: "Activo",
|
|
|
+ on_text: "Activo",
|
|
|
off_text: "Inactivo"
|
|
|
}
|
|
|
},"active", "inactive"
|
|
|
) %>
|
|
|
</div>
|
|
|
</div> -->
|
|
|
- <% end %>
|
|
|
+ <!-- < % end %> -->
|
|
|
</div>
|
|
|
-
|
|
|
-
|
|
|
<%= f.fields_for :billing_information, @customer.billing_information do |b| %>
|
|
|
- <%= render partial: "billing_information/form", locals: { info: @customer, b: b } %>
|
|
|
-
|
|
|
+ <%= render partial: "billing_information/form", locals: { info: @customer, b: b } %>
|
|
|
<% end %>
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
<%= f.fields_for :contact, @customer.contact do |b| %>
|
|
|
- <%= render partial: "contacts/form", locals: { info: @customer, c: b } %>
|
|
|
-
|
|
|
+ <%= render partial: "contacts/form", locals: { info: @customer, c: b } %>
|
|
|
<% end %>
|
|
|
-
|
|
|
</div>
|
|
|
<div class="form-actions">
|
|
|
<div class="row">
|
|
|
<div class="col-md-offset-3 col-md-9">
|
|
|
- <%= f.submit 'Guardar', {:class=>"btn green"} %>
|
|
|
- <%= link_to 'Cancelar', customers_path(:filter => @filter, :current_page => @current_page), {:class=>"btn default"} %>
|
|
|
+ <%= f.submit 'Guardar', { class: "btn green" } %>
|
|
|
+ <%= link_to 'Cancelar', customers_path(filter: @filter, current_page: @current_page), { class: "btn default" } %>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -129,6 +121,5 @@
|
|
|
$(".credit_limits").hide();
|
|
|
}
|
|
|
});
|
|
|
-
|
|
|
});
|
|
|
</script>
|