Repository navigation
Expand file tree
/
Copy pathcomponent.html.erb
More file actions
51 lines (48 loc) 路 1.97 KB
/
Copy pathcomponent.html.erb
File metadata and controls
51 lines (48 loc) 路 1.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<%= render component('ui/panel').new(title: t('.api_access')) do %>
<section>
<% if @user.spree_api_key.present? %>
<div id="current-api-key">
<h2 class="py-1.5 font-semibold"><%= t('.key') %></h2>
<% if @user == helpers.current_solidus_admin_user %>
<%= @user.spree_api_key %>
<% else %>
<i>(<%= t('spree.hidden') %>)</i>
<% end %>
</div>
<div class="py-1.5 text-center">
<%= form_with url: spree.admin_user_api_key_path(@user), method: :delete, local: true, html: { class: 'clear_api_key inline-flex' } do %>
<%= render component("ui/button").new(
text: t('.clear_key'),
scheme: :secondary,
type: :submit,
"data-turbo-confirm": t(".confirm.title"),
"data-confirm-details": t(".confirm.clear.details"),
"data-confirm-button": t(".confirm.clear.button"),
) %>
<% end %>
<%= form_with url: spree.admin_user_api_key_path(@user), method: :post, local: true, html: { class: 'regen_api_key inline-flex' } do %>
<%= render component("ui/button").new(
text: t('.regenerate_key'),
scheme: :secondary,
type: :submit,
"data-turbo-confirm": t(".confirm.title"),
"data-confirm-details": t(".confirm.regenerate.details"),
"data-confirm-button": t(".confirm.regenerate.button")
) %>
<% end %>
</div>
<% else %>
<div class="no-objects-found"><%= t('.no_key') %></div>
<div class="filter-actions actions">
<div class="py-1.5 text-center">
<%= form_with url: spree.admin_user_api_key_path(@user), method: :post, local: true, html: { class: 'generate_api_key inline-flex' } do %>
<%= render component("ui/button").new(
text: t('.generate_key'),
type: :submit,
) %>
<% end %>
</div>
</div>
<% end %>
</section>
<% end %>