Sha256: 7406d8650eb76993146c4680f90c6635d6ea9236cffaf985cdc9a3ed667ad43e

Contents?: true

Size: 1.07 KB

Versions: 173

Compression:

Stored size: 1.07 KB

Contents

%table{effective_datatable_params}
  %thead
    - if datatable.columns.any? { |_, opts| opts[:th].present? } == false
      %tr
        - datatable.columns.each do |name, opts|
          %th{title: opts[:label].presence}= opts[:label]
    - 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].presence)}= opts[:label]
            - (opts[:th_append] || []).each do |faux_col|
              %th{(faux_col[:th] || {}).merge(title: faux_col[:label].presence)}= 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

173 entries across 173 versions & 1 rubygems

Version Path
effective_datatables-4.31.3 app/views/effective/datatables/_datatable.html.haml
effective_datatables-4.31.2 app/views/effective/datatables/_datatable.html.haml
effective_datatables-4.31.1 app/views/effective/datatables/_datatable.html.haml
effective_datatables-4.31.0 app/views/effective/datatables/_datatable.html.haml
effective_datatables-4.30.2 app/views/effective/datatables/_datatable.html.haml
effective_datatables-4.30.1 app/views/effective/datatables/_datatable.html.haml
effective_datatables-4.30.0 app/views/effective/datatables/_datatable.html.haml
effective_datatables-4.29.0 app/views/effective/datatables/_datatable.html.haml
effective_datatables-4.26.0 app/views/effective/datatables/_datatable.html.haml
effective_datatables-4.25.3 app/views/effective/datatables/_datatable.html.haml
effective_datatables-4.25.2 app/views/effective/datatables/_datatable.html.haml
effective_datatables-4.25.1 app/views/effective/datatables/_datatable.html.haml
effective_datatables-4.25.0 app/views/effective/datatables/_datatable.html.haml
effective_datatables-4.24.2 app/views/effective/datatables/_datatable.html.haml
effective_datatables-4.24.1 app/views/effective/datatables/_datatable.html.haml
effective_datatables-4.24.0 app/views/effective/datatables/_datatable.html.haml
effective_datatables-4.23.0 app/views/effective/datatables/_datatable.html.haml
effective_datatables-4.22.3 app/views/effective/datatables/_datatable.html.haml
effective_datatables-4.22.2 app/views/effective/datatables/_datatable.html.haml
effective_datatables-4.22.1 app/views/effective/datatables/_datatable.html.haml