<% admin_breadcrumb(link_to plural_resource_name(Spree::LegacyUser), spree.admin_users_path) %> <% admin_breadcrumb(@user.email) %> <%= render 'spree/admin/users/sidebar' %> <%= render 'spree/admin/users/tabs', current: :account %> <%= render partial: 'spree/admin/users/user_page_actions' %>
<%= Spree.user_class.model_name.human %>
<%= render partial: 'spree/shared/error_messages', locals: { target: @user } %>
<%= form_for [:admin, @user], as: :user, url: admin_user_url(@user), method: :put do |f| %> <%= render partial: 'form', locals: { f: f } %> <% if can?(:update, @user) %>
<%= render partial: 'spree/admin/shared/edit_resource_links', locals: { collection_url: admin_users_url } %>
<% end %> <% end %>
<% if can?(:update, @user) %>
<%= t('.api_access') %> <% if @user.spree_api_key.present? %>
<%= t('.key') %>: <% if @user == try_spree_current_user %> <%= @user.spree_api_key %> <% else %> (<%= t('spree.hidden') %>) <% end %>
<%= button_to t('.clear_key'), spree.clear_api_key_admin_user_path(@user), method: :put, data: { confirm: t('.confirm_clear_key') }, class: 'btn btn-primary' %> <%= button_to t('.regenerate_key'), spree.generate_api_key_admin_user_path(@user), method: :put, data: { confirm: t('.confirm_regenerate_key') }, class: 'btn btn-primary' %>
<% else %>
<%= t('.no_key') %>
<%= button_to t('.generate_key'), spree.generate_api_key_admin_user_path(@user), method: :put, class: 'btn btn-primary' %>
<% end %>
<% end %>