mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-07 22:46:06 +00:00
Convert spree admin users api fields partial from erb to haml
This commit is contained in:
@@ -1,31 +0,0 @@
|
||||
<fieldset data-hook="admin_user_api_key" class="omega six columns">
|
||||
<legend><%= Spree.t('access', :scope => 'api') %></legend>
|
||||
|
||||
<% if @user.spree_api_key.present? %>
|
||||
<div class="field">
|
||||
<%= label_tag Spree.t('key', :scope => 'api') %>:
|
||||
<%= @user.spree_api_key %>
|
||||
</div>
|
||||
<div class="filter-actions actions">
|
||||
<%= form_tag spree.clear_api_key_admin_user_path(@user), :method => :put do %>
|
||||
<%= button Spree.t('clear_key', :scope => 'api'), 'icon-trash' %>
|
||||
<% end %>
|
||||
|
||||
<span class="or"><%= Spree.t(:or)%></span>
|
||||
|
||||
<%= form_tag spree.generate_api_key_admin_user_path(@user), :method => :put do %>
|
||||
<%= button Spree.t('regenerate_key', :scope => 'api'), 'icon-refresh' %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<% else %>
|
||||
|
||||
<div class="no-objects-found"><%= Spree.t('no_key', :scope => 'api') %></div>
|
||||
|
||||
<div class="filter-actions actions">
|
||||
<%= form_tag spree.generate_api_key_admin_user_path(@user), :method => :put do %>
|
||||
<%= button Spree.t('generate_key', :scope => 'api'), 'icon-key' %>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
</fieldset>
|
||||
18
app/views/spree/admin/users/_api_fields.html.haml
Normal file
18
app/views/spree/admin/users/_api_fields.html.haml
Normal file
@@ -0,0 +1,18 @@
|
||||
%fieldset.omega.six.columns
|
||||
%legend= Spree.t('access', :scope => 'api')
|
||||
- if @user.spree_api_key.present?
|
||||
.field
|
||||
= label_tag Spree.t('key', :scope => 'api')
|
||||
= ":"
|
||||
= @user.spree_api_key
|
||||
.filter-actions.actions
|
||||
= form_tag spree.clear_api_key_admin_user_path(@user), method: :put do
|
||||
= button Spree.t('clear_key', :scope => 'api'), 'icon-trash'
|
||||
%span.or= Spree.t(:or)
|
||||
= form_tag spree.generate_api_key_admin_user_path(@user), method: :put do
|
||||
= button Spree.t('regenerate_key', :scope => 'api'), 'icon-refresh'
|
||||
- else
|
||||
.no-objects-found= Spree.t('no_key', :scope => 'api')
|
||||
.filter-actions.actions
|
||||
= form_tag spree.generate_api_key_admin_user_path(@user), method: :put do
|
||||
= button Spree.t('generate_key', :scope => 'api'), 'icon-key'
|
||||
Reference in New Issue
Block a user