Sha256: 4151c6ac93e3e8921da8db0d0320d8d8adc23efcec97c8a33c1b05a1c92293b2

Contents?: true

Size: 1.75 KB

Versions: 13

Compression:

Stored size: 1.75 KB

Contents

- data_source ||= field.link ? field.link.get_objects : field.reflection.klass.all 
= reflection_node f, field do
  .quick_edit_block
    %ul.relation.quick_edit_inject
      - data_source.each do |ref_object|
        %li.quick_edit_entry
          = f.many_to_many_check_box(ref_object, field.reflection.name, params, field.link && ! field.link.hide_edit)
          - 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'
          - 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)}

    %template.quick_edit_template{type: 'text/template'}
      %li.quick_edit_entry
        = f.many_to_many_check_box(OpenStruct.new(to_bhf_s: '{to_bhf_s}'), field.reflection.name, params, field.link && ! field.link.hide_edit, true, "{object_id}").gsub('_object_id_', '{object_id}').html_safe # fix for id attr
        - 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'
        - 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 default_form_align'

Version data entries

13 entries across 13 versions & 1 rubygems

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