Sha256: bcf007dd32a7f4e9455301bfc577cdf5741a532db82436b0c36e495334c4de52

Contents?: true

Size: 957 Bytes

Versions: 4

Compression:

Stored size: 957 Bytes

Contents

.repeater-field.mat{ repeater: { field: true } }
  %table
    %thead
      %tr
        - field.fields.keys.each do |name|
          %th= name.to_s.humanize
        %th  
    %tbody.rows
      - field.rows.each do |row|
        = f.fields_for "#{ field.name }[]", row do |r|
          %tr{ repeater: { row: true } }
            - row.fields.each do |name, sub_field|
              %td= render_field sub_field, r, id: nil
            %td.remove
              %a.alert{ ng: { click: 'removeRow()' } }= ficon(:x)

  .plus
    %a.button.success.tiny.radius{ ng: { click: 'addRow()' } }
      = ficon :plus, 'Add row'

  %script{:type => 'html/template', :class => 'template' }
    = f.fields_for "#{ field.name }[]", field.structure do |r|
      %tr{ repeater: { row: true } }
        - field.fields.each do |name, sub_field|
          %td= render_field sub_field, r, id: nil
        %td.remove
          %a.alert{ ng: { click: 'removeRow()' } }= ficon(:x)

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
push_type_admin-0.6.0 app/views/push_type/fields/_matrix.html.haml
push_type_admin-0.6.0.beta.4 app/views/push_type/fields/_matrix.html.haml
push_type_admin-0.6.0.beta.3 app/views/push_type/fields/_matrix.html.haml
push_type_admin-0.6.0.beta.2 app/views/push_type/fields/_matrix.html.haml