Sha256: 7c5af3e099eb469800a45d5f39ea02e394f472e4abc3d51f6dc00ad3262f97fd

Contents?: true

Size: 1.67 KB

Versions: 21

Compression:

Stored size: 1.67 KB

Contents

= reflection_node f, field do
  - ref_objects ||= f.object.send(field.reflection.name)
  - is_one = (field.macro == :has_one || field.macro == :belongs_to)
  .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_path(field.link.name, 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_path(field.link.name, 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_path(field.link.name, '{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_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 ! is_one && field.link && ! field.link.hide_create
      = link_to '+', new_entry_path(field.link.name), class: 'js_add_field plus_button qe_button quick_edit default_form_align'

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
bhf-1.0.0.beta16 app/views/bhf/form/has_many/_static.html.haml
bhf-1.0.0.beta15 app/views/bhf/form/has_many/_static.html.haml
bhf-1.0.0.beta14 app/views/bhf/form/has_many/_static.html.haml
bhf-1.0.0.beta13 app/views/bhf/form/has_many/_static.html.haml
bhf-1.0.0.beta12 app/views/bhf/form/has_many/_static.html.haml
bhf-1.0.0.beta11 app/views/bhf/form/has_many/_static.html.haml
bhf-1.0.0.beta10 app/views/bhf/form/has_many/_static.html.haml
bhf-1.0.0.beta9 app/views/bhf/form/has_many/_static.html.haml
bhf-1.0.0.beta8 app/views/bhf/form/has_many/_static.html.haml
bhf-1.0.0.beta7 app/views/bhf/form/has_many/_static.html.haml
bhf-1.0.0.beta6 app/views/bhf/form/has_many/_static.html.haml
bhf-1.0.0.beta5 app/views/bhf/form/has_many/_static.html.haml
bhf-1.0.0.beta4 app/views/bhf/form/has_many/_static.html.haml
bhf-1.0.0.beta3 app/views/bhf/form/has_many/_static.html.haml
bhf-1.0.0.beta2 app/views/bhf/form/has_many/_static.html.haml
bhf-1.0.0.beta1 app/views/bhf/form/has_many/_static.html.haml
bhf-0.10.17 app/views/bhf/form/has_many/_static.html.haml
bhf-0.10.16 app/views/bhf/form/has_many/_static.html.haml
bhf-0.10.15 app/views/bhf/form/has_many/_static.html.haml
bhf-0.10.14 app/views/bhf/form/has_many/_static.html.haml