Sha256: 65fe23ebe5786d3b5e272179a1c8c5c28da664617c284a159b4f97384b58946c

Contents?: true

Size: 1.67 KB

Versions: 7

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

7 entries across 7 versions & 1 rubygems

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