Sha256: 09cb11428a4506cfbebe13b1eaa353cf4172f430d34977150250cc8a5ef45cd4

Contents?: true

Size: 1.44 KB

Versions: 6

Compression:

Stored size: 1.44 KB

Contents

- switch_id = "#{form.builder.object_name}_#{field.method_name}_show_one"
- active_nested_form = field.value && field.value.new_record?

.control-group
  .accordion{id: switch_id}
    .accordion-group
      .accordion-heading
        %a.accordion-toggle{data: {toggle: 'collapse', parent: "##{switch_id}", removeoncollapse: true}, href: "##{switch_id}_filtering_select"}
          %i.icon-chevron-right
          #{field.label} - vybrat existujícího
      .accordion-body.collapse{id: "#{switch_id}_filtering_select", class: active_nested_form ? nil : "in"}
        .accordion-inner
          = render 'forms/edit/form_filtering_select', form: form, field: field.copy(nested_form: false)
    .accordion-group
      .accordion-heading
        %a.accordion-toggle{data: {toggle: 'collapse', parent: "##{switch_id}", removeoncollapse: true}, href: "##{switch_id}_nested_form"}
          %i.icon-chevron-right
          #{field.label} - zadat nový
      .accordion-body.collapse{id: "#{switch_id}_nested_form", class: !active_nested_form ? nil : "in"}
        .accordion-inner
          = form.render_nested_form field do |nform|
            - if active_nested_form
              .nested_fields.well.well-small
                = nform.render_fields
            - else
              - nform.with_resource(nform.resource_class.new) do
                - nform.builder.object = nform.resource
                .nested_fields.well.well-small
                  = nform.render_fields

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
basepack-1.0.1 app/views/forms/edit/_select_or_nested.html.haml
basepack-1.0.0 app/views/forms/edit/_select_or_nested.html.haml
basepack-1.0.0.pre.0 app/views/forms/edit/_select_or_nested.html.haml
basepack-0.2.0 app/views/forms/edit/_select_or_nested.html.haml
basepack-0.1.0 app/views/forms/edit/_select_or_nested.html.haml
basepack-0.0.2 app/views/forms/edit/_select_or_nested.html.haml