mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Convert reports index and sales_total views from erb to haml
This commit is contained in:
@@ -1,21 +0,0 @@
|
||||
<% content_for :page_title do %>
|
||||
<%= t(:listing_reports) %>
|
||||
<% end %>
|
||||
|
||||
<table class="index">
|
||||
<thead>
|
||||
<tr data-hook="reports_header">
|
||||
<th><%= t(:name) %></th>
|
||||
<th><%= t(:description) %></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @reports.each do |key, value| %>
|
||||
<tr data-hook="reports_row">
|
||||
<td><%= link_to value[:name], value[:url] %></td>
|
||||
<td><%= value[:description] %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
13
app/views/spree/admin/reports/index.html.haml
Normal file
13
app/views/spree/admin/reports/index.html.haml
Normal file
@@ -0,0 +1,13 @@
|
||||
- content_for :page_title do
|
||||
= t(:listing_reports)
|
||||
|
||||
%table.index
|
||||
%thead
|
||||
%tr
|
||||
%th= t(:name)
|
||||
%th= t(:description)
|
||||
%tbody
|
||||
- @reports.each do |key, value|
|
||||
%tr
|
||||
%td= link_to value[:name], value[:url]
|
||||
%td= value[:description]
|
||||
@@ -1,37 +0,0 @@
|
||||
<% content_for :page_title do %>
|
||||
<%= Spree.t(:sales_totals) %>
|
||||
<% end %>
|
||||
|
||||
<% content_for :page_actions do %>
|
||||
<li><%= link_to_with_icon 'icon-arrow-left', Spree.t(:back_to_reports_list), spree.admin_reports_url, :class => 'button' %></li>
|
||||
<% end %>
|
||||
|
||||
|
||||
<% content_for :table_filter_title do %>
|
||||
<%= Spree.t(:date_range) %>
|
||||
<% end %>
|
||||
|
||||
<% content_for :table_filter do %>
|
||||
<%= render :partial => 'spree/admin/shared/report_criteria', :locals => {} %>
|
||||
<% end %>
|
||||
|
||||
<table class="admin-report" data-hook="sales_total">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><%= Spree.t(:currency) %></th>
|
||||
<th><%= Spree.t(:item_total) %></th>
|
||||
<th><%= Spree.t(:adjustment_total) %></th>
|
||||
<th><%= Spree.t(:sales_total) %></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @totals.each do |key, row| %>
|
||||
<tr class="align-center">
|
||||
<td><%= key %></td>
|
||||
<td><%= row[:item_total].format %></td>
|
||||
<td><%= row[:adjustment_total].format %></td>
|
||||
<td><%= row[:sales_total].format %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
26
app/views/spree/admin/reports/sales_total.html.haml
Normal file
26
app/views/spree/admin/reports/sales_total.html.haml
Normal file
@@ -0,0 +1,26 @@
|
||||
- content_for :page_title do
|
||||
= Spree.t(:sales_totals)
|
||||
|
||||
- content_for :page_actions do
|
||||
%li= link_to_with_icon 'icon-arrow-left', Spree.t(:back_to_reports_list), spree.admin_reports_url, class: 'button'
|
||||
|
||||
- content_for :table_filter_title do
|
||||
= Spree.t(:date_range)
|
||||
|
||||
- content_for :table_filter do
|
||||
= render partial: 'spree/admin/shared/report_criteria', locals: {}
|
||||
|
||||
%table.admin-report
|
||||
%thead
|
||||
%tr
|
||||
%th= Spree.t(:currency)
|
||||
%th= Spree.t(:item_total)
|
||||
%th= Spree.t(:adjustment_total)
|
||||
%th= Spree.t(:sales_total)
|
||||
%tbody
|
||||
- @totals.each do |key, row|
|
||||
%tr.align-center
|
||||
%td= key
|
||||
%td= row[:item_total].format
|
||||
%td= row[:adjustment_total].format
|
||||
%td= row[:sales_total].format
|
||||
Reference in New Issue
Block a user