Sha256: 5684cd26113f3195df070fe0456713bba2efcb4362a1abde584ffd9d4375bd98

Contents?: true

Size: 1.08 KB

Versions: 16

Compression:

Stored size: 1.08 KB

Contents

%table{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

16 entries across 16 versions & 1 rubygems

Version Path
effective_datatables-3.6.3 app/views/effective/datatables/_datatable.html.haml
effective_datatables-3.6.1 app/views/effective/datatables/_datatable.html.haml
effective_datatables-3.6.0 app/views/effective/datatables/_datatable.html.haml
effective_datatables-3.5.4 app/views/effective/datatables/_datatable.html.haml
effective_datatables-3.5.3 app/views/effective/datatables/_datatable.html.haml
effective_datatables-3.5.2 app/views/effective/datatables/_datatable.html.haml
effective_datatables-3.5.0 app/views/effective/datatables/_datatable.html.haml
effective_datatables-3.4.8 app/views/effective/datatables/_datatable.html.haml
effective_datatables-3.4.7 app/views/effective/datatables/_datatable.html.haml
effective_datatables-3.4.6 app/views/effective/datatables/_datatable.html.haml
effective_datatables-3.4.5 app/views/effective/datatables/_datatable.html.haml
effective_datatables-3.4.4 app/views/effective/datatables/_datatable.html.haml
effective_datatables-3.4.3 app/views/effective/datatables/_datatable.html.haml
effective_datatables-3.4.2 app/views/effective/datatables/_datatable.html.haml
effective_datatables-3.4.1 app/views/effective/datatables/_datatable.html.haml
effective_datatables-3.4.0 app/views/effective/datatables/_datatable.html.haml