Sha256: 87aa53e9bb67cea3cfb6da6dbb8cc34f4b0a95d4d1bd71535a96131795a51e76

Contents?: true

Size: 1.73 KB

Versions: 7

Compression:

Stored size: 1.73 KB

Contents

- data_source ||= field.link ? field.link.get_objects : field.reflection.klass.all 
- fk = field.db_name
= reflection_node f, field do
  .quick_edit_block
    %ul.relation.quick_edit_inject
      - data_source.each do |obj|
        %li.quick_edit_entry
          = f.radio_button fk, obj.id, id: "belongs_to_#{fk}_#{obj.id}"
          - if field.link && ! field.link.hide_edit
            = link_to obj.to_bhf_s, edit_entry_path(field.link.name, obj), class: 'js_edit_field qe_button quick_edit'
          - else
            = label_tag "belongs_to_#{fk}_#{obj.id}", obj.to_bhf_s
          - if field.link && ! field.link.hide_delete
            = link_to '×'.html_safe, entry_path(field.link.name, obj), method: :delete, class: 'qe_delete js_delete', remote: true, data: {confirm: t('bhf.helpers.promts.confirm', platform_title: field.link.title_singular)}
    
    .quick_edit_template{type: 'text/template'}
      %li
        = f.radio_button fk, '{object_id}', id: "belongs_to_#{fk}_{object_id}", class: 'js_remove_disabled', disabled: true
        - if field.link && ! field.link.hide_edit
          = link_to '{to_bhf_s}', edit_entry_path(field.link.name, '{object_id}'), class: 'js_edit_field qe_button quick_edit'
        - else
          = label_tag "belongs_to_#{fk}_#{obj.id}", obj.to_bhf_s
        - if field.link && ! field.link.hide_delete
          = link_to '×'.html_safe, entry_path(field.link.name, '{object_id}'), 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/_radio.html.haml
bhf-0.10.11 app/views/bhf/form/belongs_to/_radio.html.haml
bhf-0.10.10 app/views/bhf/form/belongs_to/_radio.html.haml
bhf-0.10.9 app/views/bhf/form/belongs_to/_radio.html.haml
bhf-0.9.9 app/views/bhf/form/belongs_to/_radio.html.haml
bhf-0.9.8 app/views/bhf/form/belongs_to/_radio.haml
bhf-0.9.7 app/views/bhf/form/belongs_to/_radio.haml