<h2><%= t('access', :scope => 'spree.api') %></h2>

<% if @user.api_key.present? %>
  <p><strong><%= t('key', :scope => 'spree.api') %></strong> <%= @user.api_key %></p>

  <%= form_tag spree.clear_api_key_admin_user_path(@user), :method => :put do %>
    <%= button t('clear_key', :scope => 'spree.api') %>
  <% end %>

  <%= form_tag spree.generate_api_key_admin_user_path(@user), :method => :put do %>
    <%= button t('regenerate_key', :scope => 'spree.api') %>
  <% end %>

<% else %>

  <p><%= t('no_key', :scope => 'spree.api') %></p>
  <%= form_tag spree.generate_api_key_admin_user_path(@user), :method => :put do %>
    <%= button t('generate_key', :scope => 'spree.api') %>
  <% end %>
<% end %>
