mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-30 06:31:16 +00:00
Unify sales tax report rendering with others
This commit is contained in:
1
app/views/spree/admin/reports/_link_order.html.haml
Normal file
1
app/views/spree/admin/reports/_link_order.html.haml
Normal file
@@ -0,0 +1 @@
|
||||
%a.edit-order{href: "/admin/orders/#{value}"}= value
|
||||
@@ -1,15 +1,21 @@
|
||||
- column_partials ||= {}
|
||||
%br
|
||||
%br
|
||||
%table{id: id}
|
||||
%thead
|
||||
%tr
|
||||
- @header.each do |heading|
|
||||
%th=heading
|
||||
%th= heading
|
||||
%tbody
|
||||
- @table.each do |row|
|
||||
%tr
|
||||
- row.each do |column|
|
||||
%td= column
|
||||
- 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 => "2"}= t(:none)
|
||||
%td{colspan: @header.count}= t(:none)
|
||||
|
||||
@@ -16,22 +16,4 @@
|
||||
%br
|
||||
= button t(:search)
|
||||
|
||||
%br
|
||||
%br
|
||||
%table#listing_orders.index
|
||||
%thead
|
||||
%tr{'data-hook' => "orders_header"}
|
||||
- @report.header.each do |heading|
|
||||
%th= heading
|
||||
%tbody
|
||||
- @report.table.each do |row|
|
||||
%tr
|
||||
- row.each_with_index do |column, i|
|
||||
- if i == 0
|
||||
%td
|
||||
%a.edit-order{'href' => "/admin/orders/#{column}"}= column
|
||||
- else
|
||||
%td= column
|
||||
- if @report.table.empty?
|
||||
%tr
|
||||
%td{:colspan => @report.header.count}= t(:none)
|
||||
= render "table", id: "listing_orders", column_partials: {0 => "link_order"}
|
||||
|
||||
Reference in New Issue
Block a user