Sha256: 79472dd63018f22ca9c6f804db59cd5b12871663ce4a22dc2fb4d2373260769f

Contents?: true

Size: 1.1 KB

Versions: 44

Compression:

Stored size: 1.1 KB

Contents

%table.effective-datatable{effective_datatable_params}
  %thead
    - if datatable.columns.any? { |_, opts| opts[:th].present? } == false
      %tr
        - datatable.columns.each do |name, opts|
          %th= opts[:label] || name
    - else
      - max_depth = datatable.columns.map { |_, opts| opts[:th].try(:[], :depth) || 0 }.max
      - [*0..max_depth].each do |depth|
        %tr
          - columns = datatable.columns.select { |_, opts| (opts[:th].try(:[], :depth) || 0) == depth }
          - columns.each do |name, opts|
            %th{(opts[:th] || {}).merge(title: (opts[:label] || name))}
              = opts[:label] || name
            - (opts[:th_append] || []).each do |faux_col|
              %th{(faux_col[:th] || {}).merge(title: faux_col[:label])}
                = faux_col[:label]

  %tbody
    - datatable.to_json[:data].each do |row|
      %tr
        - row.each do |col|
          %td= col.to_s.html_safe

  - if datatable.to_json[:aggregates].present?
    %tfoot
      - datatable.to_json[:aggregates].each do |row|
        %tr
          - row.each do |col|
            %td= col.to_s.html_safe

Version data entries

44 entries across 44 versions & 1 rubygems

Version Path
effective_datatables-3.3.14 app/views/effective/datatables/_datatable.html.haml
effective_datatables-3.3.13 app/views/effective/datatables/_datatable.html.haml
effective_datatables-3.3.12 app/views/effective/datatables/_datatable.html.haml
effective_datatables-3.3.11 app/views/effective/datatables/_datatable.html.haml
effective_datatables-3.3.10 app/views/effective/datatables/_datatable.html.haml
effective_datatables-3.3.9 app/views/effective/datatables/_datatable.html.haml
effective_datatables-3.3.8 app/views/effective/datatables/_datatable.html.haml
effective_datatables-3.3.7 app/views/effective/datatables/_datatable.html.haml
effective_datatables-3.3.6 app/views/effective/datatables/_datatable.html.haml
effective_datatables-3.3.5 app/views/effective/datatables/_datatable.html.haml
effective_datatables-3.3.4 app/views/effective/datatables/_datatable.html.haml
effective_datatables-3.3.3 app/views/effective/datatables/_datatable.html.haml
effective_datatables-3.3.2 app/views/effective/datatables/_datatable.html.haml
effective_datatables-3.3.1 app/views/effective/datatables/_datatable.html.haml
effective_datatables-3.3.0 app/views/effective/datatables/_datatable.html.haml
effective_datatables-3.2.7 app/views/effective/datatables/_datatable.html.haml
effective_datatables-3.2.6 app/views/effective/datatables/_datatable.html.haml
effective_datatables-3.2.5 app/views/effective/datatables/_datatable.html.haml
effective_datatables-3.2.4 app/views/effective/datatables/_datatable.html.haml
effective_datatables-3.2.3 app/views/effective/datatables/_datatable.html.haml