From 92694c729fc8d3bb24eba535018f318939613b13 Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Wed, 21 Sep 2016 14:00:39 +1000 Subject: [PATCH] Move 'shopfront requires login' setting Move 'shopfront requires login' setting to 'shop preferences' tab in Profile Edit. Solves issue #901. --- .../enterprises/form/_primary_details.html.haml | 11 ----------- .../enterprises/form/_shop_preferences.html.haml | 12 ++++++++++++ config/locales/en.yml | 2 +- spec/features/admin/enterprises_spec.rb | 3 ++- 4 files changed, 15 insertions(+), 13 deletions(-) diff --git a/app/views/admin/enterprises/form/_primary_details.html.haml b/app/views/admin/enterprises/form/_primary_details.html.haml index ccf59c8a12..52b2ffebce 100644 --- a/app/views/admin/enterprises/form/_primary_details.html.haml +++ b/app/views/admin/enterprises/form/_primary_details.html.haml @@ -50,17 +50,6 @@ .five.columns.omega = f.radio_button :visible, false = f.label :visible, "Not Visible", :value => "false" -.row - .three.columns.alpha - %label= t '.shopfront_requires_login' - %div{'ofn-with-tip' => t('.shopfront_requires_login_tip')} - %a= t 'admin.whats_this' - .two.columns - = f.radio_button :require_login, false - = f.label :require_login, t('.shopfront_requires_login_false'), value: :false - .five.columns.omega - = f.radio_button :require_login, true - = f.label :require_login, t('.shopfront_requires_login_true'), value: :true .permalink{ ng: { controller: "permalinkCtrl" } } .row{ ng: { show: "Enterprise.sells == 'own' || Enterprise.sells == 'any'" } } .three.columns.alpha diff --git a/app/views/admin/enterprises/form/_shop_preferences.html.haml b/app/views/admin/enterprises/form/_shop_preferences.html.haml index 3085727f85..c78efa2ac6 100644 --- a/app/views/admin/enterprises/form/_shop_preferences.html.haml +++ b/app/views/admin/enterprises/form/_shop_preferences.html.haml @@ -33,3 +33,15 @@ .five.columns.omega = radio_button :enterprise, :preferred_shopfront_order_cycle_order, :orders_close_at, { 'ng-model' => 'Enterprise.preferred_shopfront_order_cycle_order' } = label :enterprise, :preferred_shopfront_order_cycle_order_orders_close_at, "Close Date" +.row + .alpha.eleven.columns + .three.columns.alpha + %label= t '.shopfront_requires_login' + %div{'ofn-with-tip' => t('.shopfront_requires_login_tip')} + %a= t 'admin.whats_this' + .three.columns + = f.radio_button :require_login, false + = f.label :require_login, t('.shopfront_requires_login_false'), value: :false + .five.columns.omega + = f.radio_button :require_login, true + = f.label :require_login, t('.shopfront_requires_login_true'), value: :true diff --git a/config/locales/en.yml b/config/locales/en.yml index 1d8707a7b9..f60f91ad96 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -196,7 +196,7 @@ en: status: Status manage: Manage form: - primary_details: + shop_preferences: shopfront_requires_login: "Shopfront requires login?" shopfront_requires_login_tip: "Choose whether customers must login to view the shopfront." shopfront_requires_login_false: "Public" diff --git a/spec/features/admin/enterprises_spec.rb b/spec/features/admin/enterprises_spec.rb index 4d09007584..7ea8810d5d 100644 --- a/spec/features/admin/enterprises_spec.rb +++ b/spec/features/admin/enterprises_spec.rb @@ -86,6 +86,7 @@ feature %q{ choose 'Own' # Require login to view shopfront + within(".side_menu") { click_link "Shop Preferences" } expect(page).to have_checked_field "enterprise_require_login_false" choose "Require customers to login" @@ -170,7 +171,6 @@ feature %q{ @enterprise.reload expect(@enterprise.owner).to eq user expect(page).to have_checked_field "enterprise_visible_true" - expect(page).to have_checked_field "enterprise_require_login_true" click_link "Business Details" page.should have_checked_field "enterprise_charges_sales_tax_true" @@ -190,6 +190,7 @@ feature %q{ click_link "Shop Preferences" page.should have_content 'This is my shopfront message.' page.should have_checked_field "enterprise_preferred_shopfront_order_cycle_order_orders_open_at" + expect(page).to have_checked_field "enterprise_require_login_true" end describe "producer properties" do