= simple_form_for @etp do |f| = f.error_notification = f.error_notification message: f.object.errors[:base].to_sentence if f.object.errors[:base].present? .form-inputs .row .col-sm-3 = f.input :data_previsao_contratacao, as: :string, placeholder: '01/01/2024', label: "Previsão da Contratação *", input_html: { class: 'input-sm date-picker', autocomplete: "off", style: 'font-size: 12px;' } .col-sm-6 = f.input :unidade_orcamentaria_id, label: "Unidade Orçamentária Principal*", collection: (@unidades_orcamentarias || []).map { |u| [u.codigo_completo_e_nome, u.id] }.uniq, prompt: "Selecione", input_html: { class: "s2", id: "unidade_orcamentaria", multiple: false, style: 'font-size: 12px;' } .col-sm-3 = f.input :pode_convidar_unidades, as: :boolean, label: " Unidades Convidadas ?", input_html: { style: 'font-size: 12px; margin-top: 30px' } .row .col-sm-6 = f.input :acao_gerencial, as: :boolean, label: " Ação Gerencial ?", input_html: { style: "margin-top: 30px; margin-left: 5px;", id: "acao_gerencial", checked: true} .row .col-sm-6 = f.input :acao_ids, label: "Ação", collection: @acoes_pca.map { |a| [a.numero, a.id] }, input_html: { rows: 3, class: 's2', placeholder: 'Adicione uma ação', multiple: true, style: 'font-size: 12px;', id: 'pca_acoes' } .col-sm-6 = f.input :acao_fora_gerencial, label: "Ação Fora do Gerencial", as: :text, input_html: { rows: 2, class: 'form-control input-lg acao_fora_gerencial', style: 'font-size: 12px;' } .row .col-sm-6 = f.input :responsavel_id, collection: @agentes, label_method: :cpf_e_nome, include_blank: 'Selecione', input_html: { class: 'input-sm s2', style: 'font-size: 12px;' } .row .col-sm-12 = f.input :objeto, label: "Objeto", as: :text, input_html: { rows: 5, class: 'form-control input-lg', style: 'font-size: 12px;' } .row .col-sm-12 = f.input :necessidade_da_contratacao, label: "Necessidade da Contratação *", as: :text, input_html: { rows: 5, class: 'form-control input-lg', style: 'font-size: 12px;' } .row .col-sm-12 = f.submit "Salvar", class: "btn btn-primary" = link_to "Cancelar", licitacao_etps_path(@etp), class: "btn btn-default" javascript: $(document).ready(function(){ function acao_fields() { var isChecked = $('#acao_gerencial').is(':checked'); if (isChecked) { $('.acao_fora_gerencial').hide(); $('.acao_fora_gerencial').prev('label').hide(); $('#pca_acoes').show(); $('#pca_acoes').prev('label').show(); } else { $('.acao_fora_gerencial').show(); $('.acao_fora_gerencial').prev('label').show(); $('#pca_acoes').hide(); $('#pca_acoes').prev('label').hide(); } } acao_fields(); $('#acao_gerencial').change(function(){ acao_fields(); }); });