<commit_before><%= render partial: 'spree/admin/shared/order_tabs', locals: { current: :return_authorizations } %>

<% content_for :page_actions do %>
  <% if @order.shipments.any?(&:shipped?) && can?(:create, Spree::ReturnAuthorization) %>
    <%= button_link_to Spree.t(:new_return_authorization), new_admin_order_return_authorization_url(@order), class: "btn-success", icon: 'add' %>
  <% end %>
<% end %>

<% content_for :page_title do %>
  / <%= Spree.t(:return_authorizations) %>
<% end %>

<% if @order.shipments.any?(&:shipped?) && @order.return_authorizations.any? %>
  <table class="table">
    <thead data-hook="rma_header">
      <tr>
        <th><%= Spree.t(:rma_number) %></th>
        <th><%= Spree.t(:status) %></th>
        <th><%= Spree.t(:pre_tax_total) %></th>
        <th><%= "#{Spree.t('date')}/#{Spree.t('time')}" %></th>
        <th></th>
      </tr>
    </thead>
    <tbody>
      <% @return_authorizations.each do |return_authorization| %>
        <tr id="<%= spree_dom_id(return_authorization) %>" data-hook="rma_row">
          <td><%= return_authorization.number %></td>
          <td><%= Spree.t(return_authorization.state.downcase) %></td>
          <td><%= return_authorization.display_pre_tax_total.to_html %></td>
          <td><%= pretty_time(return_authorization.created_at) %></td>
          <td class="actions actions-2">
            <%= link_to_edit(return_authorization, no_text: true, class: 'edit') if can?(:edit, return_authorization) %>
            <% if can?(:delete, return_authorization) && !return_authorization.customer_returned_items? %>
              <%= link_to_delete return_authorization, no_text: true %>
            <% end %>
          </td>
        </tr>
      <% end %>
    </tbody>
  </table>
<% elsif @order.shipments.any?(&:shipped?) %>
  <div class="alert alert-info no-objects-found">
    <%= Spree.t(:no_resource_found, resource: plural_resource_name(Spree::ReturnAuthorization)) %>
  </div>
<% else %>
  <div data-hook="rma_cannont_create" class="alert alert-info no-objects-found">
    <%= Spree.t(:cannot_create_returns) %>
  </div>
<% end %><commit_msg>Typo fix: Change cannont to cannot<commit_after><%= render partial: 'spree/admin/shared/order_tabs', locals: { current: :return_authorizations } %>

<% content_for :page_actions do %>
  <% if @order.shipments.any?(&:shipped?) && can?(:create, Spree::ReturnAuthorization) %>
    <%= button_link_to Spree.t(:new_return_authorization), new_admin_order_return_authorization_url(@order), class: "btn-success", icon: 'add' %>
  <% end %>
<% end %>

<% content_for :page_title do %>
  / <%= Spree.t(:return_authorizations) %>
<% end %>

<% if @order.shipments.any?(&:shipped?) && @order.return_authorizations.any? %>
  <table class="table">
    <thead data-hook="rma_header">
      <tr>
        <th><%= Spree.t(:rma_number) %></th>
        <th><%= Spree.t(:status) %></th>
        <th><%= Spree.t(:pre_tax_total) %></th>
        <th><%= "#{Spree.t('date')}/#{Spree.t('time')}" %></th>
        <th></th>
      </tr>
    </thead>
    <tbody>
      <% @return_authorizations.each do |return_authorization| %>
        <tr id="<%= spree_dom_id(return_authorization) %>" data-hook="rma_row">
          <td><%= return_authorization.number %></td>
          <td><%= Spree.t(return_authorization.state.downcase) %></td>
          <td><%= return_authorization.display_pre_tax_total.to_html %></td>
          <td><%= pretty_time(return_authorization.created_at) %></td>
          <td class="actions actions-2">
            <%= link_to_edit(return_authorization, no_text: true, class: 'edit') if can?(:edit, return_authorization) %>
            <% if can?(:delete, return_authorization) && !return_authorization.customer_returned_items? %>
              <%= link_to_delete return_authorization, no_text: true %>
            <% end %>
          </td>
        </tr>
      <% end %>
    </tbody>
  </table>
<% elsif @order.shipments.any?(&:shipped?) %>
  <div class="alert alert-info no-objects-found">
    <%= Spree.t(:no_resource_found, resource: plural_resource_name(Spree::ReturnAuthorization)) %>
  </div>
<% else %>
  <div data-hook="rma_cannot_create" class="alert alert-info no-objects-found">
    <%= Spree.t(:cannot_create_returns) %>
  </div>
<% end %>
{'fraction_non_alphanumeric': 0.1987329892069451, 'fraction_numerical': 0.0004692632566870014, 'mean_word_length': 3.603671706263499, 'pattern_counts': {'":': 0, '<': 131, '<?xml version=': 0, '>': 131, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3750643', 'n_tokens_mistral': 1568, 'n_tokens_neox': 1466, 'n_words': 235}