-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
_navigation_solidus_admin.html.erb
101 lines (93 loc) 路 4.41 KB
/
_navigation_solidus_admin.html.erb
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<% default_store = Spree::Store.default %>
<div class="solidus-admin--nav--wrapper">
<aside class="solidus-admin--nav">
<header class="solidus-admin--nav--section">
<%= link_to spree.admin_path, class: 'solidus-admin--nav--logo' do %>
<%= image_tag(Spree::Config[:admin_interface_logo]) %>
<%- end %>
<%= link_to "//#{default_store.url}", target: '_blank', class: 'solidus-admin--nav--store-link' do %>
<div style="flex-grow: 1">
<span class="solidus-admin--nav--store-link--name"><%= default_store.name %></span>
<span class="solidus-admin--nav--store-link--url"><%= default_store.url %></span>
</div>
<svg aria-hidden="true"><use xlink:href="<%= image_path('spree/backend/themes/solidus_admin/remixicon.symbol.svg') %>#ri-arrow-right-up-line"></use></svg>
<% end %>
</header>
<nav class="solidus-admin--nav--section">
<ul class="solidus-admin--nav--menu">
<%= render 'spree/admin/shared/tabs' %>
</ul>
</nav>
<footer class="solidus-admin--nav--section">
<% if defined? SolidusAdmin %>
<ul class="solidus-admin--nav--menu">
<li class="tab-with-icon">
<label class="icon_link with-tip">
<span
id="solidus-admin-switch-label"
class="text"
data-legacy-label="<%= 'spree.navigation.switch_to_legacy'.then { t(_1, default: t(_1, locale: :en)) } %>"
data-admin-label="<%= 'spree.navigation.switch_to_solidus_admin'.then { t(_1, default: t(_1, locale: :en)) } %>"
></span>
<span><input type="checkbox" id="solidus-admin-switch" class="solidus-admin--nav--switch"/></span>
</label>
</li>
</ul>
<% end %>
<% if spree_current_user %>
<details class="solidus-admin--nav--footer" aria-label="Account">
<summary>
<svg aria-hidden="true"><use xlink:href="<%= image_path('spree/backend/themes/solidus_admin/remixicon.symbol.svg') %>#ri-user-smile-fill"></use></svg>
<div>
<%= spree_current_user&.email || "Test user" %>
</div>
</summary>
<ul>
<% if (available_locales = Spree.i18n_available_locales).any? %>
<li>
<label>
<svg aria-hidden="true"><use xlink:href="<%= image_path('spree/backend/themes/solidus_admin/remixicon.symbol.svg') %>#ri-global-line"></use></svg>
<select class="js-locale-selection">
<%= options_for_select(
available_locales
.map do |locale|
[
t(
"spree.i18n.this_file_language",
locale: locale,
default: locale.to_s,
fallback: false
),
locale
]
end
.sort,
selected: I18n.locale
) %>
</select>
<svg aria-hidden="true"><use xlink:href="<%= image_path('spree/backend/themes/solidus_admin/remixicon.symbol.svg') %>#ri-expand-up-down-line"></use></svg>
</label>
</li>
<% end %>
<% if can?(:admin, spree_current_user) %>
<li data-hook="user-account-link">
<%= link_to(spree.edit_admin_user_path(spree_current_user)) do %>
<svg aria-hidden="true"><use xlink:href="<%= image_path('spree/backend/themes/solidus_admin/remixicon.symbol.svg') %>#ri-user-3-line"></use></svg>
<span><%= t('spree.my_account') %></span>
<% end %>
</li>
<% end %>
<% if spree.respond_to? :admin_logout_path %>
<li data-hook="user-logout-link">
<%= link_to spree.admin_logout_path, method: Devise.sign_out_via, rel: "" do %>
<svg aria-hidden="true"><use xlink:href="<%= image_path('spree/backend/themes/solidus_admin/remixicon.symbol.svg') %>#ri-logout-box-line"></use></svg>
<span><%= t("spree.logout") %></span>
<% end %>
</li>
<% end %>
</ul>
</details>
<% end %>
</footer>
</aside>
</div>