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.

Store form UX fixes

Damian Legawiec32e2f356f24f
diff --git a/backend/app/views/spree/admin/stores/_form.html.erb b/backend/app/views/spree/admin/stores/_form.html.erb
index febb96d485..608cec9ce6 100644
--- a/backend/app/views/spree/admin/stores/_form.html.erb
+++ b/backend/app/views/spree/admin/stores/_form.html.erb
@@ -37,11 +37,19 @@
<%= 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) %>
- <%= f.text_field :url, class: 'form-control', required: true %>
+ <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>
@@ -124,13 +132,20 @@
<%= f.field_container :checkout_zone_id, class: ['form-group'] do %>
<%= f.label :checkout_zone_id, Spree.t(:zone) %>
<%= f.select :checkout_zone_id, options_for_select(@zones, selected_checkout_zone(@store)&.id), { include_blank: Spree.t(:no_limits_zone) }, { class: 'select2' } %>
- <%= f.label :checkout_zone_id, Spree.t('i18n.checkout_zone_warning_html'), class: 'alert alert-warning col-12' %>
+ <small class="form-text text-muted">
+ <%= raw(Spree.t('store_form.checkout_zone_help')) %>
+ </small>
<%= f.error_message_on :checkout_zone_id %>
<% end %>
<%= f.field_container :default_locale, class: ['form-group'] do %>
<%= f.label :default_locale, Spree.t('i18n.language') %>
<%= f.select :default_locale, options_from_collection_for_select(all_locales_options, :last, :first, @store.default_locale), {}, { class: 'select2' } %>
<%= f.error_message_on :default_locale %>
+ <% unless defined?(SpreeI18n) %>
+ <small class="form-text text-muted">
+ Install <a href="https://github.com/spree-contrib/spree_i18n">Spree I18n extension</a> to add more languages.
+ </small>
+ <% end %>
<% end %>
<%= f.field_container :default_country_id, class: ['form-group'] do %>
<%= f.label :default_country_id, Spree.t('i18n.default_country') %>
@@ -149,17 +164,32 @@
<div class="card-body">
<%= f.field_container :facebook, class: ['form-group'] do %>
<%= f.label :facebook, Spree.t(:facebook) %>
- <%= f.text_field :facebook, class: 'form-control' %>
+ <div class="input-group mb-3">
+ <div class="input-group-prepend">
+ <span class="input-group-text" id="basic-addon3">https://facebook.com</span>
+ </div>
+ <%= f.text_field :facebook, class: 'form-control' %>
+ </div>
<%= f.error_message_on :facebook %>
<% end %>
<%= f.field_container :twitter, class: ['form-group'] do %>
<%= f.label :twitter, Spree.t(:twitter) %>
- <%= f.text_field :twitter, class: 'form-control' %>
+ <div class="input-group mb-3">
+ <div class="input-group-prepend">
+ <span class="input-group-text" id="basic-addon3">https://twitter.com</span>
+ </div>
+ <%= f.text_field :twitter, class: 'form-control' %>
+ </div>
<%= f.error_message_on :twitter %>
<% end %>
<%= f.field_container :instagram, class: ['form-group'] do %>
<%= f.label :instagram, Spree.t(:instagram) %>
- <%= f.text_field :instagram, class: 'form-control' %>
+ <div class="input-group mb-3">
+ <div class="input-group-prepend">
+ <span class="input-group-text" id="basic-addon3">https://instagram.com</span>
+ </div>
+ <%= f.text_field :instagram, class: 'form-control' %>
+ </div>
<%= f.error_message_on :instagram %>
<% end %>
</div>
diff --git a/core/config/locales/en.yml b/core/config/locales/en.yml
index de8f6f0ad9..02100d4c17 100644
--- a/core/config/locales/en.yml
+++ b/core/config/locales/en.yml
@@ -960,8 +960,6 @@ en:
supported_locales: Supported Locales
this_file_language: English (US)
translations: Translations
- checkout_zone_warning_html: "Selecting a Zone will limit customers on Checkout to Addresses in Countries in that Zone. <br />
- Please see documentation: <a href='https://guides.spreecommerce.org/user/configuration/configuring_geography.html#zones' target='_blank' class='alert-link'>https://guides.spreecommerce.org/user/configuration/configuring_geography.html#zones</a>"
icon: Icon
image: Image
images: Images
@@ -1659,6 +1657,10 @@ en:
unable_to_create: Unable to create store.
unable_to_update: Unable to update store.
unable_to_delete: Unable to delete store.
+ store_form:
+ code_help: "Store unique identifier, which is an abbreviated version of the store’s name (used as the layout directory name, and also helpful for separating templates by store)"
+ checkout_zone_help: "Selecting a Zone will limit customers on Checkout to Addresses in Countries or States in that Zone.
+ For more information <a href='https://guides.spreecommerce.org/user/configuration/configuring_geography.html#zones' target='_blank' class='alert-link'>please see documentation</a>"
store_set_default_button: Set as default
stores: Stores
store_credit_name: Store Credit