madetech/solidus_wms

View on GitHub
app/views/spree/admin/reports/unexported_orders.html.erb

Summary

Maintainability
Test Coverage
<% content_for :page_title do %>
  <%= Spree.t(:unexported_orders) %>
<% end %>

<% content_for :page_actions do %>
  <li><%= link_to_with_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/reports/unexported_order_criteria' %>
<% end %>

<% if @orders.any? %>
  <table class="admin-report" data-hook>
    <thead>
      <tr>
        <th><%= I18n.t(:completed_at, scope: 'activerecord.attributes.spree/order') %></th>
        <th><%= I18n.t(:number, scope: 'activerecord.attributes.spree/order') %></th>
        <th><%= I18n.t(:email, scope: 'activerecord.attributes.spree/order') %></th>
        <th><%= I18n.t(:total, scope: 'activerecord.attributes.spree/order') %></th>
        <th class="actions"></th>
      </tr>
    </thead>
    <tbody>
    <% @orders.each do |order| %>
      <tr class="<%= order.completed_at < 3.days.ago ? 'state-canceled' : '' %>
                 <%= cycle('odd', 'even') %>">
        <td class="align-center">
          <%= l(order.completed_at).to_date %></td>
        <td class="align-center">
          <%= link_to order.number, edit_admin_order_path(order) %></td>
        <td>
          <% if order.user %>
            <%= link_to order.email, edit_admin_user_path(order.user) %>
          <% else %>
            <%= mail_to order.email %>
          <% end %>
        </td>
        <td class="align-center">
          <%= order.display_total.to_html %>
        </td>
        <td class='actions align-center'>
          <%= link_to_edit_url edit_admin_order_path(order), title: "admin_edit_#{dom_id(order)}", no_text: true %>
        </td>
      </tr>
    <% end %>
    </tbody>
  </table>
<% end %>