spree-contrib/spree_legacy_return_authorizations

View on GitHub
app/views/spree/admin/legacy_return_authorizations/index.html.erb

Summary

Maintainability
Test Coverage
<%= render :partial => 'spree/admin/shared/order_tabs', :locals => { :current => 'Legacy Return Authorizations' } %>

<% content_for :page_actions do %>
  <li><%= button_link_to Spree.t(:back_to_orders_list), spree.admin_orders_path, :icon => 'arrow-left' %></li>
<% end %>

<% content_for :page_title do %>
  <i class="fa fa-arrow-right"></i> <%= Spree.t(:legacy_return_authorizations) %>
<% end %>

<% if @order.shipments.any?(&:shipped?) || @order.legacy_return_authorizations.any? %>
  <table class="index">
    <thead data-hook="legacy_rma_header">
      <tr>
        <th><%= Spree.t(:legacy_rma_number) %></th>
        <th><%= Spree.t(:status) %></th>
        <th><%= Spree.t(:amount) %></th>
        <th><%= "#{Spree.t('date')}/#{Spree.t('time')}" %></th>
        <th class="actions"></th>
      </tr>
    </thead>
    <tbody>
      <% @legacy_return_authorizations.each do |legacy_return_authorization| %>
        <tr id="<%= spree_dom_id(legacy_return_authorization) %>" data-hook="legacy_rma_row" class="<%= cycle('odd', 'even')%>">
          <td><%= legacy_return_authorization.number %></td>
          <td><%= Spree.t(legacy_return_authorization.state.downcase) %></td>
          <td><%= legacy_return_authorization.display_amount.to_html %></td>
          <td><%= pretty_time(legacy_return_authorization.created_at) %></td>
          <td class="actions">
            <%= link_to_edit legacy_return_authorization, :no_text => true, :class => 'edit' %>
            <% unless legacy_return_authorization.received? %>
              &nbsp;
              <%= link_to_delete legacy_return_authorization, :no_text => true %>
            <% end %>
          </td>

        </tr>
      <% end %>
    </tbody>
  </table>
<% else %>
  <div data-hook="legacy_rma_cannont_create" class="no-objects-found">
    <%= Spree.t(:cannot_create_returns) %>
  </div>
<% end %>