<div id="application_keys"
     data-object="cinstance"
     data-url="<%= admin_buyers_application_path(cinstance, :format => :json) %>" >

  <table class="list">
      <%= render :partial => 'buyers/applications/api_credentials',
                 :locals => {:cinstance => cinstance, :regenerate => true } %>
  </table>

  <% if cinstance.backend_version == "2" && cinstance.service.app_keys_allowed? %>
    <div id="app-keys-operations" class="operations" <%= "style='display:none;'" unless cinstance.application_keys.can_add? %>>
      <% if cinstance.custom_keys_enabled? %>
        <%= link_to 'Add Custom key', new_provider_admin_application_key_path(cinstance),
                    :class => 'fancybox action add', 'data-autodimensions' => 'true' %>
      <% end -%>
      <%= fancy_link_to 'Add Random key', provider_admin_application_keys_path(cinstance),
                          :method  => :post,
                          :remote  => true,
                          :class   => 'create_key' %>
    </div>

    <% if cinstance.backend_version.app_id? %>
      <p id="app-keys-limit-warning" style='font-style:italic;display:<%= cinstance.application_keys.can_add? ? 'none' : 'block' %>;'>
        Keys limit reached.
      </p>
    <% end %>
  <% end %>
</div>
