Skip to content

Instantly share code, notes, and snippets.

@angelsystem
Created December 2, 2013 21:36
Show Gist options
  • Save angelsystem/7759506 to your computer and use it in GitHub Desktop.
Save angelsystem/7759506 to your computer and use it in GitHub Desktop.
= simple_form_for(@couple, url: save_family_clients_url, html: { multipart: true, id: 'form_modal_family', novalidate: true}, remote: true) do |f|
.head-modal
%p Asignacion de pareja
.body-modal.scroll-wrapp
= hidden_field_tag "parent", @parent.id
- if @parent.marital_status == 'M'
%fieldset
%legend Régimen de Propiedad
= f.input :married_regimen do
= f.select :married_regimen, [['Bienes Mancomunados', Client::REGIMENS[:community_property]], ['Bienes Separados', Client::REGIMENS[:separate_property]]]
%fieldset
%legend Asignar Cónyugue
= f.input :token_client, collection: Client.not_have_couple.not_client(@parent.id).order(:lname), label_method: :full_name, value_method: :id, input_html: {data: {"placeholder" => "Seleccione un cliente"}}, label: "Esposo(a)"
- if false
%fieldset
%legend Crear pareja
= f.input :fname
= f.input :lname
= f.input :gender do
= f.select :gender, [['masculino', 'm'], ['femenino', 'f']], include_blank: "- #{t("frontend.client.select_gender")} -"
= f.input :age
= f.input :domicile
= f.input :denomination do
= f.select :denomination, ['Sr', 'Sra', 'Dr'], include_blank: "- #{t("frontend.client.select_denomination")} -"
= f.input :document_type do
= f.select :document_type, [['DNI', Client::DNI], ['Carnet de Extranjería', Client::INMIGRATION_CARD]]
.document-inline
= f.input :document, hint: t("frontend.client.hint.document"), input_html: { size: 20 }
= link_to "Generar", '#', class: 'btn boton-mini generate-button', id: 'client_generate_document'
= f.input :email, hint: t("frontend.client.hint.email")
= f.input :main_telephone, hint: t("frontend.client.hint.main_telephone"), input_html: { size: 17 }
= f.association :source, collection: Source.all.map{ |p| [p.name.titleize, p.id] }, prompt: "- #{t("frontend.client.select_source")} -", selected: @parent.source_id, wrapper_html: { class: 'hidden' }
= f.association :input_channel, collection: InputChannel.all.map{ |p| [p.name.titleize, p.id] }, prompt: "- #{t("frontend.client.select_input_channel")} -", selected: @parent.input_channel_id, wrapper_html: { class: 'hidden' }
= f.association :interest_type, collection: InterestType.all.map{ |p| [p.name.titleize, p.id] }, prompt: "- #{t("frontend.client.select_interest_type")} -", selected: @parent.interest_type_id, wrapper_html: { class: 'hidden' }
= f.association :funding_type, collection: FundingType.all.map{ |p| [p.name.titleize, p.id] }, prompt: "- #{t("frontend.client.select_funding_type")} -", selected: @parent.funding_type_id, wrapper_html: { class: 'hidden' }
= f.input :is_fit, as: :radio_buttons, wrapper_html: { class: 'hidden' }
= f.input :photo_cache, as: :hidden
= f.input :photo
.inline
= image_tag(@couple.photo_url(:thumb)) if @couple.photo? && params[:action] == "edit"
.clear
.footer-modal
= f.button :submit, t("buttons.save"), class: "boton-blue right"
.clear
%a.close-modal{href: '#close-modal', rel: "modal:close"}close
:javascript
Remote.Tipsy()
Remote.Chosen('#client_token_client')
Client.GenerateDocument()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment