Files
openfoodnetwork/app/views/spree/admin/reports/_table.html.haml
Sebastian Castro 09247b21cd Reports Refactor 1
Use code closer to the new packing report controller
Handle nil @report_subtypes
2022-05-12 16:54:12 +02:00

20 lines
492 B
Plaintext

- column_partials ||= {}
%table.report__table
%thead
%tr
- @header.each do |heading|
%th= heading
%tbody
- @table.each do |row|
%tr
- row.each_with_index do |cell_value, column_index|
%td
- partial = column_partials[column_index]
- if partial
= render partial, value: cell_value
- else
= cell_value
- if @table.empty?
%tr
%td{colspan: @header.count}= t(:none)