Sha256: c231f6c10a9c11916b9810bf7d8639048b59d1c81546b9aaf2bde13d8215d365

Contents?: true

Size: 1.35 KB

Versions: 1

Compression:

Stored size: 1.35 KB

Contents

- html = { id: (:main_form unless @quick_edit), multipart: (!@quick_edit && @platform.has_file_upload?), class: 'js_bhf_form' }
= form_for @object, url: @form_url, builder: Bhf::ActionView::FormBuilder, html: html do |f|

  - if f.object.errors.any?
    = render partial: 'bhf/entries/validation_errors', locals: {f: f}
    
  - @platform.fields.each do |field|
    - unless field.form_type == :hidden
      = render partial: "bhf/form/#{field.macro}/#{field.form_type}", locals: {f: f, field: field}

  - unless @quick_edit
    
    - if params[:return_to]
      = hidden_field :return, :to, name: :return_to, value: params[:return_to]
    
    .node
      .label
      .input
        - unless (f.object.new_record? && @platform.hide_create) || (!f.object.new_record? && @platform.hide_edit)
          = f.submit t('bhf.helpers.form.buttons.save', platform_title: @platform.title_singular)
          - unless @platform.hide_edit
            = f.submit t('bhf.helpers.form.buttons.and_edit'), name: :return_to_edit, class: 'alt_button'
          - unless @platform.hide_create
            = f.submit t('bhf.helpers.form.buttons.and_add'), name: :return_to_new, class: 'alt_button'
        
        = link_to t('bhf.helpers.entry.cancel'), params[:return_to] ? params[:return_to] : page_path(@platform.page_name), class: 'cancel', data: ( {no_turbolink: true} if params[:return_to])

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
bhf-0.9.9 app/views/bhf/entries/_form.html.haml