Sha256: 6ff5caf8b3deaf829197154cf2cd22b8ff22f28afb6215d439e7e3516e55f5f9

Contents?: true

Size: 1.51 KB

Versions: 7

Compression:

Stored size: 1.51 KB

Contents

- data_source ||= field.link ? field.link.get_objects : field.reflection.klass.all 
- fk = field.db_name
.node
  .label= f.label fk, reflection_title(f, field, 1)
  .input.select_input.quick_edit_block
    - if field.link
      .quick_edit_template{type: 'text/template'}
        = options_for_select([['{to_bhf_s}', '{object_id}', {data: {edit: edit_entry_path(field.link.name, '{object_id}'), delete: entry_path(field.link.name, '{object_id}')}}]])
      - select_options ||= options_from_collection_for_select_with_html_attrs(data_source, :id, :to_bhf_s, f.object.send(fk), Proc.new {|obj| {data: {edit: edit_entry_path(field.link.name, obj), delete: entry_path(field.link.name, obj)}}})
    - else
      - select_options ||= options_from_collection_for_select(data_source, :id, :to_bhf_s, f.object.send(fk))
    
    = f.select fk, select_options, {include_blank: true}, {class: ('quick_edit_inject quick_edit_select' if field.link)}
    = render partial: 'bhf/helper/field_errors', locals: {f: f, field: fk}
    
    - if field.link && ! field.link.hide_edit
      = link_to edit_t(field.link), '', class: 'js_edit_field icon edit quick_edit'
    - if field.link && ! field.link.hide_delete
      = link_to '×'.html_safe, '', method: :delete, class: 'qe_delete js_delete', remote: true, data: {confirm: t('bhf.helpers.promts.confirm', platform_title: field.link.title_singular)}
    - if field.link && ! field.link.hide_create
      = link_to '+', new_entry_path(field.link.name), class: 'js_add_field plus_button qe_button quick_edit'

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
bhf-0.10.12 app/views/bhf/form/belongs_to/_select.html.haml
bhf-0.10.11 app/views/bhf/form/belongs_to/_select.html.haml
bhf-0.10.10 app/views/bhf/form/belongs_to/_select.html.haml
bhf-0.10.9 app/views/bhf/form/belongs_to/_select.html.haml
bhf-0.9.9 app/views/bhf/form/belongs_to/_select.html.haml
bhf-0.9.8 app/views/bhf/form/belongs_to/_select.haml
bhf-0.9.7 app/views/bhf/form/belongs_to/_select.haml