Sha256: 66fb2b8fccb54696ee048408975d1e207f03f4baecad9cfddc80716442a8e7b8

Contents?: true

Size: 1.73 KB

Versions: 7

Compression:

Stored size: 1.73 KB

Contents

= reflection_node f, field do
  - ref_objects ||= f.object.send(field.reflection.name)
  - is_one = field.macro == :embeds_one
  .quick_edit_block
    %p.empty{class: ('hide' unless ref_objects.blank?)}= t 'bhf.helpers.entry.empty', count: (is_one ? 1 : 2)
    %ul.relation.quick_edit_inject{class: field.macro}
      - ref_objects.each do |ref_object|
        %li.quick_edit_entry
          - if field.link && ! field.link.hide_edit
            = link_to ref_object.to_bhf_s, edit_entry_embed_path(field.link.name, f.object, ref_object), class: 'js_edit_field qe_button quick_edit'
          - else
            = ref_object.to_bhf_s
          - if field.link && ! field.link.hide_delete
            = link_to '×'.html_safe, entry_embed_path(field.link.name, f.object, ref_object), 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.quick_edit_entry
        - if field.link && ! field.link.hide_edit
          = link_to '{to_bhf_s}', edit_entry_embed_path(field.link.name, f.object, '{object_id}'), class: 'js_edit_field qe_button quick_edit'
        - else
          = '{to_bhf_s}'
        - if field.link && ! field.link.hide_delete
          = link_to '×'.html_safe, entry_embed_path(field.link.name, f.object, '{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 ! is_one && field.link && ! field.link.hide_create
      = link_to '+', new_entry_embed_path(field.link.name, f.object), class: 'js_add_field plus_button qe_button quick_edit default_form_align'

Version data entries

7 entries across 7 versions & 1 rubygems

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