Sha256: 5ac5def12e833a177767256755b58dcacd85fe405af366cbb4f66df164acb3ab

Contents?: true

Size: 1.16 KB

Versions: 26

Compression:

Stored size: 1.16 KB

Contents

- if !f.object.new_record? && field.ui_enabled?

  - target_content_type       = Locomotive::ContentType.class_name_to_content_type(field.class_name, current_site)
  - new_target_content_entry  = target_content_type.entries.build(field.inverse_of => f.object)

  = f.input     name.to_sym,
    label:      field.label,
    hint:       field.hint,
    as:         :'locomotive/empty',
    wrapper_html: { id: "content_entry_#{name}_input", class: 'empty relationship input' }

  - content_for :head do

    %script{ type: 'text/html', id: "#{name}_list" }

      %p.empty{ style: 'display: none' }!= t('.empty')

      %ul

      %hr

      %p.actions
        = link_to t('.new_entry'), '#', class: 'add'

    %script{ type: 'text/html', id: "#{name}_entry" }
      %li
        .handle.col
          %i.icon-reorder

        .label.col
          {{label}}

        %span.actions
          = link_to_icon :pencil, '#', class: 'edit'
          = link_to_icon :trash, '#', class: 'remove', data: { confirm: t('locomotive.messages.confirm') }


  - content_for :backbone_view_data do
    :plain
      , #{name}_new_entry: #{to_json(new_target_content_entry)}

  - push_has_many_form field

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
locomotive_cms-2.5.7 app/views/locomotive/custom_fields/types/_has_many.html.haml
locomotive_cms-2.5.6 app/views/locomotive/custom_fields/types/_has_many.html.haml
locomotive_cms-2.5.6.rc2 app/views/locomotive/custom_fields/types/_has_many.html.haml
locomotive_cms-2.5.6.rc1 app/views/locomotive/custom_fields/types/_has_many.html.haml
locomotive_cms-2.5.5 app/views/locomotive/custom_fields/types/_has_many.html.haml
locomotive_cms-2.5.4 app/views/locomotive/custom_fields/types/_has_many.html.haml
locomotive_cms-2.5.3 app/views/locomotive/custom_fields/types/_has_many.html.haml
locomotive_cms-2.5.2 app/views/locomotive/custom_fields/types/_has_many.html.haml
locomotive_cms-2.5.1 app/views/locomotive/custom_fields/types/_has_many.html.haml
locomotive_cms-2.5.0 app/views/locomotive/custom_fields/types/_has_many.html.haml
locomotive_cms-2.5.0.rc3 app/views/locomotive/custom_fields/types/_has_many.html.haml
locomotive_cms-2.5.0.rc2 app/views/locomotive/custom_fields/types/_has_many.html.haml
locomotive_cms-2.5.0.rc1 app/views/locomotive/custom_fields/types/_has_many.html.haml
locomotive_cms-2.4.1 app/views/locomotive/custom_fields/types/_has_many.html.haml
locomotive_cms-2.4.0 app/views/locomotive/custom_fields/types/_has_many.html.haml
locomotive_cms-2.3.1 app/views/locomotive/custom_fields/types/_has_many.html.haml
locomotive_cms-2.3.0 app/views/locomotive/custom_fields/types/_has_many.html.haml
locomotive_cms-2.2.3 app/views/locomotive/custom_fields/types/_has_many.html.haml
locomotive_cms-2.2.2 app/views/locomotive/custom_fields/types/_has_many.html.haml
locomotive_cms-2.2.1 app/views/locomotive/custom_fields/types/_has_many.html.haml