<p>
Here you can see errors related to your API's integration with 3scale, in particular in calls made to methods of 3scale's Service Management API.
</br>
Please refer to the
<%= link_to('API ActiveDocs', provider_admin_api_docs_path(anchor: '/service_management_api'), target:'_blank') %>
documentation section on using 3scale's Service Management API.
</p>

<% @service_errors.each do |service, errors| %>
  <h3><%= service.name %></h3>
  <div id="transaction_errors_container_<%= service.id %>">
    <% if errors.empty? %>
      <%= render :partial => 'no_errors' %>
    <% else %>
      <div class="operations"><%= fancy_button_to 'Purge', admin_errors_path(:service_id => service.id),
        :method => :delete, :class => 'delete', :remote => true %></div>
     <table class="data" id="transaction_errors">
         <thead>
          <tr>
            <th>Time (UTC)</th>
            <th>Error</th>
          </tr>
        </thead>
        <tbody>
          <% errors.each do |error| %>
            <tr class="<%= error.code %>">
              <td class="first"><%= error.timestamp %></td>
              <td><%= h error.message %></td>
            </tr>
          <% end %>
        </tbody>
      </table>
      <%= will_paginate(errors) %>
    <% end %>
  </div>
<% end %>
