= simple_form_for [:admin, @content], as: :content do |f| = contains_errors(@content) = f.hidden_field :id .container.form .row .col-md-2 = f.label t('activerecord.attributes.project.image').titleize %div{'data-crop'=>true} - content_image_base64 = '' - if @content.image.present? - content_image_base64 = "data:image/png;base64,#{Base64.encode64(@content.image.read)}" = image_tag(@content.image_url.to_s, class: "menu_icon image-preview") -# = f.input :image, as: :string, label: false, required: true, wrapper_html: { class: 'd-none' }, input_html: { class: 'base64CropedImage d-none' } = f.text_field :image, value: content_image_base64, class: 'base64CropedImage d-none' %input{type:'file', 'data-file'=>true} = render partial: '/layouts/site/crop_modal' %input.crop-config{type:'hidden', 'width'=>@croped_image_size[:width], 'height'=>@croped_image_size[:height]} .row .col-md-2 = f.label t('activerecord.attributes.project.title').titleize .col-md-10 = f.input :title, label: false, required: true .row .col-md-2 = f.label t('activerecord.attributes.project.title_summary').titleize .col-md-10 = f.input :title_summary, label: false, required: true - if @content.id.present? .row .col-md-2 = f.label t('activerecord.attributes.project.slug').titleize .col-md-10 = f.input :slug, label: false, required: true .row .col-md-2 = f.label t('activerecord.attributes.project.content').titleize .col-md-10 = f.cktext_area :content, label: false, required: true .row#select_section .col-md-2 = f.label t('activerecord.attributes.project.section').titleize .col-md-10.text-left = f.association :sections, as: :check_boxes, label: false .row .col-md-2 = f.label t('activerecord.attributes.project.publish_date').titleize .col-md-10 = f.input :publish_date, as: :datetime, label: false, required: true .row = render "#{content_type.pluralize}/#{content_type}_info", content_form: f, content: @content .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: url_for("/#{:admin}/"+@content.type.tableize)