= simple_form_for [:admin, @institucionalPerson],:url => @institucionalPersonPath do |f| = f.error_notification = f.hidden_field :id .container.form .row .col-md-2 = f.label t('activerecord.attributes.institucional_person.name').titleize %span * .col-md-10 = f.input :name, label: false, required: true .row .col-md-2 = f.label t('activerecord.attributes.institucional_person.photo').titleize %div.col-md-12{'data-crop-container' => true} - home_image_base64 = '' - if @institucionalPerson.photo.present? - home_image_base64 = "data:image/png;base64,#{Base64.encode64(@institucionalPerson.photo.read)}" = image_tag(@institucionalPerson.photo_url.to_s, class: "menu_icon image-preview", :width => 280, :crop => "pad") = f.text_field :photo, value: home_image_base64, class: 'base64CropedImage d-none' %input{type:'file', 'data-file'=>true} = render partial: '/layouts/site/crop_modal' %input.crop-config{type:'hidden', 'width'=>280, 'height'=>432} .row .col-md-2 = f.label t('activerecord.attributes.institucional_person.description').titleize %span * .col-md-10 = f.input :description, as: :text, label: false, required: true .row .col-md-2 = f.label t('activerecord.attributes.institucional_person.role').titleize .col-md-10 = f.input :role, label: false .row .col-md-2 = f.label t('activerecord.attributes.institucional_person.group').titleize %span * .col-md-10.text-left = f.select('institucional_persons_group_id', @institucionalPersonsGroups.collect {|r| [h(r.name), r.id] }, { :include_blank => false, label: false }) .row.submit_buttons.ml-auto .col-sm-8.offset-sm-4 = f.button :submit, value: t('simple_form.buttons.submit'), class: 'save_button' = f.button :cancel_button, cancel: admin_institucional_person_index_path