Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

Add visual indication of default menu for store.

Matthew Kennedydf5b3715122d
diff --git a/backend/app/helpers/spree/admin/menu_helper.rb b/backend/app/helpers/spree/admin/menu_helper.rb
index d3dc42d4fc..2684e6f596 100644
--- a/backend/app/helpers/spree/admin/menu_helper.rb
+++ b/backend/app/helpers/spree/admin/menu_helper.rb
@@ -47,6 +47,10 @@ module Spree
menu_items_for_select
end
+
+ def default_menu_for_store?(menu)
+ menu.store.default_locale == menu.locale
+ end
end
end
end
diff --git a/backend/app/views/spree/admin/menus/index.html.erb b/backend/app/views/spree/admin/menus/index.html.erb
index a7e291c0c3..b3fe0da7b4 100644
--- a/backend/app/views/spree/admin/menus/index.html.erb
+++ b/backend/app/views/spree/admin/menus/index.html.erb
@@ -55,6 +55,7 @@
<th scope="col"><%= Spree.t('location') %></th>
<th scope="col"><%= Spree.t('store') %></th>
<th scope="col"><%= Spree.t('language') %></th>
+ <th class="text-center" scope="col"><%= Spree.t('default') %></th>
<th scope="col"></th>
</thead>
<tbody>
@@ -72,6 +73,11 @@
<td>
<%= locale_full_name(menu.locale) %>
</td>
+ <td class="text-center">
+ <% if default_menu_for_store?(menu) %>
+ <%= svg_icon name: "tick.svg", width: '20', height: '20' %>
+ <% end %>
+ </td>
<td class="actions" data-hook="admin_menus_index_row_actions">
<span class="d-flex justify-content-end">
<%= link_to_edit(menu, no_text: true) %>