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 more info to the menu item bars so user can distinguish between them if the name is the same.

Matthew Kennedy1c8e658265af
diff --git a/backend/app/assets/stylesheets/spree/backend/shared/_base.scss b/backend/app/assets/stylesheets/spree/backend/shared/_base.scss
index c0ec658bb5..767813109d 100644
--- a/backend/app/assets/stylesheets/spree/backend/shared/_base.scss
+++ b/backend/app/assets/stylesheets/spree/backend/shared/_base.scss
@@ -35,3 +35,7 @@
.move-handle {
cursor: grab;
}
+
+.badge-light-muted-text {
+ color: rgba(0, 0, 0, 0.50);
+}
diff --git a/backend/app/views/spree/admin/menu_items/link_inputs/_url.html.erb b/backend/app/views/spree/admin/menu_items/link_inputs/_url.html.erb
index 88e2602f9e..ed3f2cf92f 100644
--- a/backend/app/views/spree/admin/menu_items/link_inputs/_url.html.erb
+++ b/backend/app/views/spree/admin/menu_items/link_inputs/_url.html.erb
@@ -1,14 +1,13 @@
+<%= f.field_container :url, class: ['form-group'] do %>
+ <%= f.label :url, Spree.t(:url) %>
+ <%= f.text_field :url, class: 'form-control' %>
+ <%= f.error_message_on :url %>
+<% end %>
- <%= f.field_container :url, class: ['form-group'] do %>
- <%= f.label :url, Spree.t(:url) %>
- <%= f.text_field :url, class: 'form-control' %>
- <%= f.error_message_on :url %>
- <% end %>
-
- <%= f.field_container :new_window do %>
- <div class="custom-control custom-checkbox">
- <%= f.check_box :new_window, class: 'custom-control-input' %>
- <%= f.label :new_window, Spree.t('admin.navigation.open_link_in_new_window'), class: 'custom-control-label' %>
- <%= f.error_message_on :new_window %>
- </div>
- <% end %>
+<%= f.field_container :new_window do %>
+ <div class="custom-control custom-checkbox">
+ <%= f.check_box :new_window, class: 'custom-control-input' %>
+ <%= f.label :new_window, Spree.t('admin.navigation.open_link_in_new_window'), class: 'custom-control-label' %>
+ <%= f.error_message_on :new_window %>
+ </div>
+<% end %>
diff --git a/backend/app/views/spree/admin/menus/nested_menu_items/_item_bar.html.erb b/backend/app/views/spree/admin/menus/nested_menu_items/_item_bar.html.erb
index 7295d24d69..9717537c7b 100644
--- a/backend/app/views/spree/admin/menus/nested_menu_items/_item_bar.html.erb
+++ b/backend/app/views/spree/admin/menus/nested_menu_items/_item_bar.html.erb
@@ -6,9 +6,12 @@
<div class="d-flex align-items-center w-100 truncate">
<div>
<%= item.name %>
-
+ <% if defined?(Spree::Frontend) && menu_item_link_to(item) != '#' %>
+ <small class="text-muted mt-0">-></small> <span class="badge badge-light badge-light-muted-text"><%= menu_item_link_to(item) %></span>
+ <% end %>
<small class="form-text text-muted mt-0">
- <%= item.item_type %>
+ <%= "#{Spree.t('admin.navigation.type')}: #{item.item_type}" %>
+ <%= "| #{Spree.t('admin.navigation.code')}: #{item.code}" if item.code.present? %>
</small>
</div>
diff --git a/core/config/locales/en.yml b/core/config/locales/en.yml
index bc31c0f380..95f34506c4 100644
--- a/core/config/locales/en.yml
+++ b/core/config/locales/en.yml
@@ -602,6 +602,7 @@ en:
subtitle: Subtitle
settings: Settings
set_a_code: Give your Menu Item a code, this is optional, but can be useful if you need to identify this menu item.
+ type: Type
used_in: Used In
unique_code: Unique Code
you_have_no_menus: You have no Menus, click the Add New Menu button to create your first Menu.