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.

Revert some unnecessary changes.

Matthew Kennedy4b4c3eaeb3db
diff --git a/backend/app/assets/stylesheets/spree/backend/components/_navbar.scss b/backend/app/assets/stylesheets/spree/backend/components/_navbar.scss
index 596ba98620..39b10ed086 100644
--- a/backend/app/assets/stylesheets/spree/backend/components/_navbar.scss
+++ b/backend/app/assets/stylesheets/spree/backend/components/_navbar.scss
@@ -48,9 +48,6 @@
color: $success;
}
}
-
-
}
-
}
}
diff --git a/backend/app/assets/stylesheets/spree/backend/components/_navigation.scss b/backend/app/assets/stylesheets/spree/backend/components/_navigation.scss
index 0cec02f0f8..63df434faa 100644
--- a/backend/app/assets/stylesheets/spree/backend/components/_navigation.scss
+++ b/backend/app/assets/stylesheets/spree/backend/components/_navigation.scss
@@ -4,3 +4,16 @@
top: 0;
cursor: pointer;
}
+
+ul#spreePageTabs {
+ li.nav-item {
+ margin-left: 0.2em;
+ a {
+ padding: 0.3rem 1rem;
+ }
+
+ &:first-child {
+ margin-left: 0;
+ }
+ }
+}
diff --git a/backend/app/assets/stylesheets/spree/backend/plugins/flatpickr.scss b/backend/app/assets/stylesheets/spree/backend/plugins/_flatpickr.scss
similarity index 100%
rename from backend/app/assets/stylesheets/spree/backend/plugins/flatpickr.scss
rename to backend/app/assets/stylesheets/spree/backend/plugins/_flatpickr.scss
diff --git a/backend/app/assets/stylesheets/spree/backend/plugins/_index.scss b/backend/app/assets/stylesheets/spree/backend/plugins/_index.scss
deleted file mode 100644
index 045121bb50..0000000000
--- a/backend/app/assets/stylesheets/spree/backend/plugins/_index.scss
+++ /dev/null
@@ -1,6 +0,0 @@
-@import 'sweetalert2_custom';
-@import 'jquery_ui';
-@import 'flatpickr';
-@import 'select2_bootstrap4';
-@import 'select2_custom';
-@import 'overscroll_indicator';
diff --git a/backend/app/assets/stylesheets/spree/backend/plugins/jquery_ui.scss b/backend/app/assets/stylesheets/spree/backend/plugins/_jquery_ui.scss
similarity index 100%
rename from backend/app/assets/stylesheets/spree/backend/plugins/jquery_ui.scss
rename to backend/app/assets/stylesheets/spree/backend/plugins/_jquery_ui.scss
diff --git a/backend/app/assets/stylesheets/spree/backend/plugins/overscroll_indicator.scss b/backend/app/assets/stylesheets/spree/backend/plugins/_nav_x.scss
similarity index 99%
rename from backend/app/assets/stylesheets/spree/backend/plugins/overscroll_indicator.scss
rename to backend/app/assets/stylesheets/spree/backend/plugins/_nav_x.scss
index 25ddcba620..f840bf8b18 100644
--- a/backend/app/assets/stylesheets/spree/backend/plugins/overscroll_indicator.scss
+++ b/backend/app/assets/stylesheets/spree/backend/plugins/_nav_x.scss
@@ -1,6 +1,6 @@
[data-nav-x-wrapper] {
position: relative;
- padding: 0 11px;
+ padding: 0;
overflow: hidden;
}
diff --git a/backend/app/assets/stylesheets/spree/backend/plugins/select2_bootstrap4.scss b/backend/app/assets/stylesheets/spree/backend/plugins/_select2_bootstrap4.scss
similarity index 100%
rename from backend/app/assets/stylesheets/spree/backend/plugins/select2_bootstrap4.scss
rename to backend/app/assets/stylesheets/spree/backend/plugins/_select2_bootstrap4.scss
diff --git a/backend/app/assets/stylesheets/spree/backend/plugins/select2_custom.scss b/backend/app/assets/stylesheets/spree/backend/plugins/_select2_custom.scss
similarity index 100%
rename from backend/app/assets/stylesheets/spree/backend/plugins/select2_custom.scss
rename to backend/app/assets/stylesheets/spree/backend/plugins/_select2_custom.scss
diff --git a/backend/app/assets/stylesheets/spree/backend/plugins/sweetalert2_custom.scss b/backend/app/assets/stylesheets/spree/backend/plugins/_sweetalert2_custom.scss
similarity index 100%
rename from backend/app/assets/stylesheets/spree/backend/plugins/sweetalert2_custom.scss
rename to backend/app/assets/stylesheets/spree/backend/plugins/_sweetalert2_custom.scss
diff --git a/backend/app/assets/stylesheets/spree/backend/shared/_base.scss b/backend/app/assets/stylesheets/spree/backend/shared/_base.scss
index 2365ffc502..b533904620 100644
--- a/backend/app/assets/stylesheets/spree/backend/shared/_base.scss
+++ b/backend/app/assets/stylesheets/spree/backend/shared/_base.scss
@@ -2,32 +2,6 @@
background: repeating-conic-gradient(#c7c7c7 0% 25%, transparent 0% 50%) 50% / 20px 20px
}
-figure.admin-img-holder {
- max-width: 285px;
- border: 2px solid grey;
- border-radius: $border-radius;
- overflow: hidden;
- display: inline-block;
-
- img {
- max-width: 100%;
- height: auto;
- }
- }
-
- ul#spreePageTabs {
- li.nav-item {
- margin-left: 0.2em;
- a {
- padding: 0.3rem 1rem;
- }
-
- &:first-child {
- margin-left: 0;
- }
- }
- }
-
.row {
padding: 0 0 15px 0;
}
@@ -70,18 +44,7 @@ figure.admin-img-holder {
color: rgba(0, 0, 0, 0.50);
}
-a#storeSelectorDropdown {
- svg {
- margin-bottom: 0;
- margin-left: 3px;
- }
-}
-
[data-show-info] {
color: $primary;
cursor: pointer;
-
- &:hover {
- color: darken($primary, 10) !important;
- }
}
diff --git a/backend/app/assets/stylesheets/spree/backend/spree_admin.css.scss b/backend/app/assets/stylesheets/spree/backend/spree_admin.css.scss
index 432b4fb0db..3c1e883a12 100644
--- a/backend/app/assets/stylesheets/spree/backend/spree_admin.css.scss
+++ b/backend/app/assets/stylesheets/spree/backend/spree_admin.css.scss
@@ -19,7 +19,12 @@
@import 'components/progress';
@import 'components/spinner';
-@import 'plugins/index';
+@import 'plugins/sweetalert2_custom';
+@import 'plugins/jquery_ui';
+@import 'plugins/flatpickr';
+@import 'plugins/select2_bootstrap4';
+@import 'plugins/select2_custom';
+@import 'plugins/nav_x';
@import 'shared/base';
@import 'shared/forms';
diff --git a/backend/app/views/spree/admin/menus/index.html.erb b/backend/app/views/spree/admin/menus/index.html.erb
index 9588e5daa4..410efc6ede 100644
--- a/backend/app/views/spree/admin/menus/index.html.erb
+++ b/backend/app/views/spree/admin/menus/index.html.erb
@@ -6,6 +6,18 @@
<%= button_link_to Spree.t('admin.navigation.add_new_menu'), new_object_url, { class: "btn-success", icon: 'add.svg', id: 'new_menu' } %>
<% end if can?(:create, Spree::Menu) %>
+<% content_for :page_tabs do %>
+ <li class="nav-item">
+ <%= link_to '#', class: "nav-link active d-flex align-items-center",
+ data: { show_info: true,
+ alert_kind: 'info',
+ alert_title: Spree.t('admin.navigation.managing_by_store_title'),
+ alert_html: (raw Spree.t( 'admin.navigation.managing_by_store', store: current_store.unique_name )) } do %>
+ <%= (svg_icon name: "info.svg", width: '18', height: '18', classes: 'mr-2') + current_store.unique_name %>
+ <% end %>
+ </li>
+<% end %>
+
<% content_for :table_filter do %>
<div data-hook="admin_menus_sidebar">
<%= search_form_for [:admin, @search] do |f| %>
diff --git a/backend/app/views/spree/admin/shared/_store_switcher.html.erb b/backend/app/views/spree/admin/shared/_store_switcher.html.erb
index ad7a67e497..64daeb4918 100644
--- a/backend/app/views/spree/admin/shared/_store_switcher.html.erb
+++ b/backend/app/views/spree/admin/shared/_store_switcher.html.erb
@@ -7,7 +7,7 @@
</span>
<a class="px-0 py-1 btn text-light" id="storeSelectorDropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
- <%= current_store.unique_name %> <%= svg_icon name: "chevron-down.svg", width: '12', height: '12' %>
+ <%= current_store.unique_name %> <%= svg_icon name: "chevron-down.svg", width: '12', height: '12', classes: 'ml-1 mb-0' %>
</a>
<div class="dropdown-menu dropdown-menu-left overflow-hidden mt-2 py-0" aria-labelledby="storeSelectorDropdown">
diff --git a/backend/app/views/spree/admin/stores/_form.html.erb b/backend/app/views/spree/admin/stores/_form.html.erb
index b2b7f6d5c6..724658c577 100644
--- a/backend/app/views/spree/admin/stores/_form.html.erb
+++ b/backend/app/views/spree/admin/stores/_form.html.erb
@@ -7,70 +7,61 @@
</h1>
</div>
<div class="card-body">
- <div class="row">
- <%= f.field_container :logo, class: ['form-group col-12 col-md-4'] do %>
- <% if @store.logo.attached? && @store.logo.variable? %>
- <%= image_tag main_app.url_for(@store.logo.variant(resize: '244x104>')) %>
- <% elsif @store.logo.attached? && @store.logo.image? %>
- <%= image_tag main_app.url_for(@store.logo) %>
- <% end %>
- <%= f.field_container :logo, class: ['form-group'] do %>
- <%= f.file_field :logo %>
- <%= f.label :logo, Spree.t(:logo) %><br>
- <%= f.error_message_on :logo %>
- <% end %>
+ <%= f.field_container :logo, class: ['form-group'] do %>
+ <% if @store.logo.attached? && @store.logo.variable? %>
+ <%= image_tag main_app.url_for(@store.logo.variant(resize: '244x104>')) %>
+ <% elsif @store.logo.attached? && @store.logo.image? %>
+ <%= image_tag main_app.url_for(@store.logo) %>
<% end %>
-
- <%= f.field_container :mailer_logo, class: ['form-group col-12 col-md-4'] do %>
- <% if @store.mailer_logo.attached? && @store.mailer_logo.variable? %>
- <%= image_tag main_app.url_for(@store.mailer_logo.variant(resize: '244x104>')) %>
- <% end %>
- <%= f.field_container :mailer_logo, class: ['form-group'] do %>
- <%= f.file_field :mailer_logo, accept: Spree::Store::MAILER_LOGO_CONTENT_TYPES.join(',') %>
- <%= f.label :mailer_logo, Spree.t(:mailer_logo) %><br>
- <%= f.error_message_on :mailer_logo %>
- <% end %>
+ <%= f.field_container :logo, class: ['form-group'] do %>
+ <%= f.label :logo, Spree.t(:logo) %><br>
+ <%= f.file_field :logo %>
+ <%= f.error_message_on :logo %>
<% end %>
-
- <%= f.field_container :favicon_image, class: ['form-group col-12 col-md-4'] do %>
- <% if @store.favicon_image.attached? && @store.favicon_image.variable? %>
- <figure class="admin-img-holder transparent-indicator-bg">
- <%= image_tag main_app.url_for(@store.favicon_image.variant(resize: '104x104')) %>
- </figure>
- <% end %>
- <%= f.field_container :favicon_image, class: ['form-group'] do %>
- <%= f.file_field :favicon_image, accept: Spree::Store::FAVICON_CONTENT_TYPES.join(',') %>
- <%= f.label :favicon_image, "#{Spree.t(:favicon)} (#{Spree.t(:favicon_upload_info)})" %>
- <%= f.error_message_on :favicon_image %>
- <% end %>
+ <% end %>
+ <%= f.field_container :mailer_logo, class: ['form-group'] do %>
+ <% if @store.mailer_logo.attached? && @store.mailer_logo.variable? %>
+ <%= image_tag main_app.url_for(@store.mailer_logo.variant(resize: '244x104>')) %>
<% end %>
- </div>
-
- <div class="row">
- <%= f.field_container :name, class: ['form-group col-12 col-md-6'] do %>
- <%= f.label :name, raw(Spree.t(:name) + required_span_tag) %>
- <%= f.text_field :name, class: 'form-control', required: true %>
- <%= f.error_message_on :name %>
+ <%= f.field_container :mailer_logo, class: ['form-group'] do %>
+ <%= f.label :mailer_logo, Spree.t(:mailer_logo) %><br>
+ <%= f.file_field :mailer_logo, accept: Spree::Store::MAILER_LOGO_CONTENT_TYPES.join(',') %>
+ <%= f.error_message_on :mailer_logo %>
<% end %>
- <%= f.field_container :code, class: ['form-group col-12 col-md-6'] do %>
- <%= f.label :code, raw(Spree.t(:code) + required_span_tag) %>
- <%= f.text_field :code, class: 'form-control', required: true %>
- <small class="form-text text-muted">
- <%= Spree.t('store_form.code_help') %>
- </small>
- <%= f.error_message_on :code %>
+ <% end %>
+ <%= f.field_container :favicon_image, class: ['form-group'] do %>
+ <% if @store.favicon_image.attached? && @store.favicon_image.variable? %>
+ <%= image_tag main_app.url_for(@store.favicon_image.variant(resize: '104x104')) %>
<% end %>
- <%= f.field_container :url, class: ['form-group col-12'] do %>
- <%= f.label :url, raw(Spree.t(:url) + required_span_tag) %>
- <div class="input-group mb-3">
- <div class="input-group-prepend">
- <span class="input-group-text" id="basic-addon3">https://</span>
- </div>
- <%= f.text_field :url, class: 'form-control', required: true %>
- </div>
- <%= f.error_message_on :url %>
+ <%= f.field_container :favicon_image, class: ['form-group'] do %>
+ <%= f.label :favicon_image, "#{Spree.t(:favicon)} (#{Spree.t(:favicon_upload_info)})" %><br>
+ <%= f.file_field :favicon_image, accept: Spree::Store::FAVICON_CONTENT_TYPES.join(',') %>
+ <%= f.error_message_on :favicon_image %>
<% end %>
- </div>
+ <% end %>
+ <%= f.field_container :name, class: ['form-group'] do %>
+ <%= f.label :name, raw(Spree.t(:name) + required_span_tag) %>
+ <%= f.text_field :name, class: 'form-control', required: true %>
+ <%= f.error_message_on :name %>
+ <% end %>
+ <%= f.field_container :code, class: ['form-group'] do %>
+ <%= f.label :code, raw(Spree.t(:code) + required_span_tag) %>
+ <%= f.text_field :code, class: 'form-control', required: true %>
+ <small class="form-text text-muted">
+ <%= Spree.t('store_form.code_help') %>
+ </small>
+ <%= f.error_message_on :code %>
+ <% end %>
+ <%= f.field_container :url, class: ['form-group'] do %>
+ <%= f.label :url, raw(Spree.t(:url) + required_span_tag) %>
+ <div class="input-group mb-3">
+ <div class="input-group-prepend">
+ <span class="input-group-text" id="basic-addon3">https://</span>
+ </div>
+ <%= f.text_field :url, class: 'form-control', required: true %>
+ </div>
+ <%= f.error_message_on :url %>
+ <% end %>
</div>
</div>
diff --git a/core/config/locales/en.yml b/core/config/locales/en.yml
index d1cd413264..65b588197f 100644
--- a/core/config/locales/en.yml
+++ b/core/config/locales/en.yml
@@ -611,6 +611,8 @@ en:
image_alt_text: Add alt text to your image
image_asset: Add a Promotion image or Link icon.
move_could_not_be_saved: 'ERROR: This move could not be saved.'
+ managing_by_store_title: 'Managing Menus By Store'
+ managing_by_store: <p>You are managing the menus for <b>%{store}</b>. To manage menus for other stores, change the global store using the drop-down in the main navbar found at the top of the screen.</p>
new_menu_item: New Menu Item
new_menu: New Menu
nested_under: Nested under