mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Improve message in private shopfront when closed or when user is not logged in
This commit is contained in:
@@ -7,7 +7,9 @@
|
||||
- if spree_current_user.nil?
|
||||
= t '.require_login_html',
|
||||
{login: ('<a auth="login">' + t('.login') + '</a>').html_safe,
|
||||
register: ('<a auth="signup">' + t('.register') + '</a>').html_safe}
|
||||
signup: ('<a auth="signup">' + t('.signup') + '</a>').html_safe,
|
||||
contact: link_to(t('.contact'), '#contact'),
|
||||
enterprise: current_distributor.name}
|
||||
- else
|
||||
= t '.require_customer_html',
|
||||
{contact: link_to(t('.contact'), '#contact'),
|
||||
|
||||
@@ -1165,12 +1165,11 @@ en:
|
||||
shop:
|
||||
messages:
|
||||
login: "login"
|
||||
register: "register"
|
||||
signup: "signup"
|
||||
contact: "contact"
|
||||
require_customer_login: "This shop is for customers only."
|
||||
require_login_html: "Please %{login} if you have an account already. Otherwise, %{register} to become a customer."
|
||||
require_customer_html: "Please %{contact} %{enterprise} to become a customer."
|
||||
|
||||
require_customer_login: "Only approved customers can access this shop."
|
||||
require_login_html: "If you're already an approved customer, %{login} or %{signup} to proceed. Want to start shopping here? Please %{contact} %{enterprise} and ask about joining."
|
||||
require_customer_html: "If you'd like to start shopping here, please %{contact} %{enterprise} to ask about joining."
|
||||
|
||||
# Front-end controller translations
|
||||
card_could_not_be_updated: Card could not be updated
|
||||
|
||||
@@ -462,8 +462,8 @@ feature "As a consumer I want to shop with a distributor", js: true do
|
||||
context "when not logged in" do
|
||||
it "tells us to login" do
|
||||
visit shop_path
|
||||
expect(page).to have_content "This shop is for customers only."
|
||||
expect(page).to have_content "Please login"
|
||||
expect(page).to have_content "Only approved customers can access this shop."
|
||||
expect(page).to have_content "login or signup"
|
||||
expect(page).to have_no_content product.name
|
||||
end
|
||||
end
|
||||
@@ -479,8 +479,8 @@ feature "As a consumer I want to shop with a distributor", js: true do
|
||||
context "as non-customer" do
|
||||
it "tells us to contact enterprise" do
|
||||
visit shop_path
|
||||
expect(page).to have_content "This shop is for customers only."
|
||||
expect(page).to have_content "Please contact #{distributor.name}"
|
||||
expect(page).to have_content "Only approved customers can access this shop."
|
||||
expect(page).to have_content "please contact #{distributor.name}"
|
||||
expect(page).to have_no_content product.name
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user