From cf0ad179a1e4ec4a684a951ca8e77856d37a2912 Mon Sep 17 00:00:00 2001 From: Luis Ramos Date: Wed, 13 May 2020 15:32:32 +0100 Subject: [PATCH 1/3] Move hubs_sidebar to the last 4 columns at the top of the page --- .../admin/shipping_methods/_form.html.haml | 46 +++++++++---------- .../admin/shipping_methods/edit.html.haml | 5 +- 2 files changed, 26 insertions(+), 25 deletions(-) diff --git a/app/views/spree/admin/shipping_methods/_form.html.haml b/app/views/spree/admin/shipping_methods/_form.html.haml index 450febb31b..923e7b205c 100644 --- a/app/views/spree/admin/shipping_methods/_form.html.haml +++ b/app/views/spree/admin/shipping_methods/_form.html.haml @@ -1,4 +1,4 @@ -=admin_inject_shipping_method += admin_inject_shipping_method .alpha.eleven.columns{ "ng-app" => "admin.shippingMethods", "ng-controller" => "shippingMethodCtrl" } .row @@ -46,26 +46,26 @@ .alpha.eleven.columns = render partial: 'spree/admin/shared/calculator_fields', locals: { f: f } -.alpha.six.columns - .alpha.six.columns - %fieldset.categories.no-border-bottom - %legend{align: "center"}= t('.categories') - = f.field_container :categories do - - Spree::ShippingCategory.all.each do |category| - = label_tag do - = check_box_tag('shipping_method[shipping_categories][]', category.id, @shipping_method.shipping_categories.include?(category)) - = category.name - %br/ - = error_message_on :shipping_method, :shipping_category_id + .row + .alpha.eleven.columns + %fieldset.categories.no-border-bottom + %legend{align: "center"}= t('.categories') + = f.field_container :categories do + - Spree::ShippingCategory.all.each do |category| + = label_tag do + = check_box_tag('shipping_method[shipping_categories][]', category.id, @shipping_method.shipping_categories.include?(category)) + = category.name + %br/ + = error_message_on :shipping_method, :shipping_category_id - .alpha.six.columns - %fieldset.no-border-bottom - %legend{align: "center"}= t('.zones') - = f.field_container :zones do - - shipping_method_zones = @shipping_method.zones.to_a - - Spree::Zone.all.each do |zone| - = label_tag do - = check_box_tag('shipping_method[zones][]', zone.id, shipping_method_zones.include?(zone)) - = zone.name - %br/ - = error_message_on :shipping_method, :zone_id + .alpha.eleven.columns + %fieldset.no-border-bottom + %legend{align: "center"}= t('.zones') + = f.field_container :zones do + - shipping_method_zones = @shipping_method.zones.to_a + - Spree::Zone.all.each do |zone| + = label_tag do + = check_box_tag('shipping_method[zones][]', zone.id, shipping_method_zones.include?(zone)) + = zone.name + %br/ + = error_message_on :shipping_method, :zone_id diff --git a/app/views/spree/admin/shipping_methods/edit.html.haml b/app/views/spree/admin/shipping_methods/edit.html.haml index dc6d879e45..c64fee62ca 100644 --- a/app/views/spree/admin/shipping_methods/edit.html.haml +++ b/app/views/spree/admin/shipping_methods/edit.html.haml @@ -12,7 +12,8 @@ %fieldset.no-border-top = render partial: 'form', locals: { f: f } .one.column   - = render partial: 'spree/admin/shared/hubs_sidebar', locals: { f: f, klass: :shipping_method } + .alpha.four.columns + = render partial: 'spree/admin/shared/hubs_sidebar', locals: { f: f, klass: :shipping_method } .clear - %div + .row = render partial: 'spree/admin/shared/edit_resource_links' From d017c0b70195ec6d3311c761fabd591105180714 Mon Sep 17 00:00:00 2001 From: Luis Ramos Date: Wed, 13 May 2020 15:34:29 +0100 Subject: [PATCH 2/3] Change base translation from applies to active so the naming is consistent: ship methods can be active or inactive for an enterprises which means they can be linked or not to that enterprise --- config/locales/en.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/config/locales/en.yml b/config/locales/en.yml index e2a70ff412..c952f8fb30 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -741,12 +741,12 @@ en: ofn_uid: OFN UID ofn_uid_tip: The unique id used to identify the enterprise on Open Food Network. shipping_methods: - name: Name - applies: Applies? - manage: Manage Shipping Methods - create_button: Create New Shipping Method - create_one_button: Create One Now - no_method_yet: You don't have any shipping methods yet. + name: "Name" + applies: "Active?" + manage: "Manage Shipping Methods" + create_button: "Create New Shipping Method" + create_one_button: "Create One Now" + no_method_yet: "You don't have any shipping methods yet." shop_preferences: shopfront_requires_login: "Publicly visible shopfront?" shopfront_requires_login_tip: "Choose whether customers must login to view the shopfront or if it's visible to everybody." From a6ea79d3a588f8189df5884194f534053898af90 Mon Sep 17 00:00:00 2001 From: Luis Ramos Date: Wed, 13 May 2020 15:35:01 +0100 Subject: [PATCH 3/3] Add warning message to enterprise ship methods list and ship method edit page --- app/views/admin/enterprises/form/_shipping_methods.html.haml | 2 ++ app/views/spree/admin/shipping_methods/_form.html.haml | 2 ++ config/locales/en.yml | 1 + 3 files changed, 5 insertions(+) diff --git a/app/views/admin/enterprises/form/_shipping_methods.html.haml b/app/views/admin/enterprises/form/_shipping_methods.html.haml index 877b650c9e..68f7332ef3 100644 --- a/app/views/admin/enterprises/form/_shipping_methods.html.haml +++ b/app/views/admin/enterprises/form/_shipping_methods.html.haml @@ -1,4 +1,6 @@ - if @shipping_methods.count > 0 + .row + = t 'spree.admin.shipping_methods.form.deactivation_warning' %table %thead %tr diff --git a/app/views/spree/admin/shipping_methods/_form.html.haml b/app/views/spree/admin/shipping_methods/_form.html.haml index 923e7b205c..b95481cc04 100644 --- a/app/views/spree/admin/shipping_methods/_form.html.haml +++ b/app/views/spree/admin/shipping_methods/_form.html.haml @@ -1,6 +1,8 @@ = admin_inject_shipping_method .alpha.eleven.columns{ "ng-app" => "admin.shippingMethods", "ng-controller" => "shippingMethodCtrl" } + .row + = t '.deactivation_warning' .row .alpha.three.columns = f.label :name, t(:name) diff --git a/config/locales/en.yml b/config/locales/en.yml index c952f8fb30..14231b0233 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -3246,6 +3246,7 @@ See the %{link} to find out more about %{sitename}'s features and to start using zones: "Zones" both: "Both Checkout and Back office" back_end: "Back office only" + deactivation_warning: "De-activating a shipping method can make the shipping method disappear from your list. Alternatively, you can hide a shipping method from the checkout page by setting the option 'Display' to 'back office only'." payment_methods: new: new_payment_method: "New Payment Method"