Sha256: 07c3503e54056f94b10f6b762284a08d472380f1fa6b739ca4d40f5d8a0814b5

Contents?: true

Size: 1.69 KB

Versions: 13

Compression:

Stored size: 1.69 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)}
    
    %template.quick_edit_template{type: 'text/template'}
      %li
        = f.radio_button fk, '{object_id}', id: "belongs_to_#{fk}_{object_id}"
        - 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

13 entries across 13 versions & 1 rubygems

Version Path
bhf-0.9.6 app/views/bhf/form/belongs_to/_radio.haml
bhf-0.9.5 app/views/bhf/form/belongs_to/_radio.haml
bhf-0.9.4 app/views/bhf/form/belongs_to/_radio.haml
bhf-0.9.3 app/views/bhf/form/belongs_to/_radio.haml
bhf-0.9.2 app/views/bhf/form/belongs_to/_radio.haml
bhf-0.9.1 app/views/bhf/form/belongs_to/_radio.haml
bhf-0.9.0 app/views/bhf/form/belongs_to/_radio.haml
bhf-0.8.7 app/views/bhf/form/belongs_to/_radio.haml
bhf-0.8.6 app/views/bhf/form/belongs_to/_radio.haml
bhf-0.8.5 app/views/bhf/form/belongs_to/_radio.haml
bhf-0.8.4 app/views/bhf/form/belongs_to/_radio.haml
bhf-0.8.3 app/views/bhf/form/belongs_to/_radio.haml
bhf-0.8.2 app/views/bhf/form/belongs_to/_radio.haml