File: _form_nested_one.html.haml

package info (click to toggle)
ruby-rails-admin 0.8.1%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 2,492 kB
  • ctags: 1,292
  • sloc: ruby: 5,341; makefile: 3
file content (17 lines) | stat: -rw-r--r-- 1,118 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
.controls.col-sm-10{data: { nestedone: true }}
  %ul.nav{style: 'margin-bottom:0px; display:none'}
  .btn-group
    %a.btn.btn-info.toggler{:'data-toggle' => "button", :'data-target' => "#{form.jquery_namespace(field)} > .tab-content", class: (field.active? ? 'active' : '') }
      %i.icon-white
    - unless field.nested_form[:update_only] || !field.inline_add
      = form.link_to_add "<i class=\"icon-plus icon-white\"></i> #{wording_for(:link, :new, field.associated_model_config.abstract_model)}".html_safe,
        field.name,
        { class: 'btn btn-info', :'data-add-label' => "<i class=\"icon-plus icon-white\"></i> #{wording_for(:link, :new, field.associated_model_config.abstract_model)}".gsub("\n", "") }
  = form.errors_for(field)
  = form.help_for(field)

.tab-content
  = form.fields_for field.name do |nested_form|
    - if field.nested_form[:allow_destroy]
      = nested_form.link_to_remove '<span class="btn btn-small btn-danger"><i class="icon-trash icon-white"></i></span>'.html_safe
    = nested_form.generate({action: :nested, model_config: field.associated_model_config, nested_in: field })