diff --git a/app/assets/javascripts/admin/enterprises/enterprises.js.coffee b/app/assets/javascripts/admin/enterprises/enterprises.js.coffee index da122761b8..bd721c14e4 100644 --- a/app/assets/javascripts/admin/enterprises/enterprises.js.coffee +++ b/app/assets/javascripts/admin/enterprises/enterprises.js.coffee @@ -1 +1,26 @@ -angular.module("admin.enterprises", [ "admin.paymentMethods", "admin.utils", "admin.shippingMethods", "admin.users", "textAngular", "admin.side_menu", "admin.taxons", 'admin.indexUtils', 'admin.tagRules', 'admin.dropdown', 'ngSanitize'] ) \ No newline at end of file +angular.module("admin.enterprises", [ + "admin.paymentMethods", + "admin.utils", + "admin.shippingMethods", + "admin.users", + "textAngular", + "admin.side_menu", + "admin.taxons", + 'admin.indexUtils', + 'admin.tagRules', + 'admin.dropdown', + 'ngSanitize'] +) +# For more options: https://github.com/textAngular/textAngular/blob/master/src/textAngularSetup.js +.config [ + '$provide', ($provide) -> + $provide.decorator 'taTranslations', [ + '$delegate' + (taTranslations) -> + taTranslations.insertLink = { + tooltip: t('admin.enterprises.form.shop_preferences.shopfront_message_link_tooltip'), + dialogPrompt: t('admin.enterprises.form.shop_preferences.shopfront_message_link_prompt') + } + taTranslations + ] +] diff --git a/config/locales/en.yml b/config/locales/en.yml index a6609f2f5a..ba0f84f614 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -724,23 +724,25 @@ en: enable_subscriptions_tip: "Enable subscriptions functionality?" enable_subscriptions_false: "Disabled" enable_subscriptions_true: "Enabled" - shopfront_message: Shopfront Message + shopfront_message: "Shopfront Message" shopfront_message_placeholder: > An optional explanation for customers detailing how your shopfront works, to be displayed above the product list on your shop page. - shopfront_closed_message: Shopfront Closed Message + shopfront_message_link_tooltip: "Insert / edit link" + shopfront_message_link_prompt: "Please enter a URL to insert" + shopfront_closed_message: "Shopfront Closed Message" shopfront_closed_message_placeholder: > A message which provides a more detailed explanation about why your shop is closed and/or when customers can expect it to open again. This is displayed on your shop only when you have no active order cycles (ie. shop is closed). - shopfront_category_ordering: Shopfront Category Ordering - open_date: Open Date - close_date: Close Date + shopfront_category_ordering: "Shopfront Category Ordering" + open_date: "Open Date" + close_date: "Close Date" social: - twitter_placeholder: eg. @the_prof - instagram_placeholder: eg. the_prof - facebook_placeholder: eg. www.facebook.com/PageNameHere - linkedin_placeholder: eg. www.linkedin.com/in/YourNameHere + twitter_placeholder: "eg. @the_prof" + instagram_placeholder: "eg. the_prof" + facebook_placeholder: "eg. www.facebook.com/PageNameHere" + linkedin_placeholder: "eg. www.linkedin.com/in/YourNameHere" stripe_connect: connect_with_stripe: "Connect with Stripe" stripe_connect_intro: "To accept payments using credit card, you will need to connect your stripe account to the Open Food Network. Use the button to the right to get started." diff --git a/spec/features/admin/enterprises_spec.rb b/spec/features/admin/enterprises_spec.rb index 4745457439..549b97f782 100644 --- a/spec/features/admin/enterprises_spec.rb +++ b/spec/features/admin/enterprises_spec.rb @@ -205,6 +205,12 @@ feature %q{ page.should have_checked_field "enterprise_preferred_shopfront_order_cycle_order_orders_open_at" expect(page).to have_checked_field "enterprise_require_login_true" expect(page).to have_checked_field "enterprise_enable_subscriptions_true" + + # Test that the right input alert text is displayed + accept_alert('Please enter a URL to insert') do + first('.ta-text').click + first('button[name="insertLink"]').click + end end describe "producer properties" do