Warn when allowing guest orders and order changes

This commit is contained in:
Maikel Linke
2017-01-06 16:32:38 +11:00
committed by Rob Harrington
parent db4a528ba3
commit 12a6f652ad
4 changed files with 19 additions and 9 deletions

View File

@@ -0,0 +1,3 @@
form[name="enterprise_form"] div.row.warning {
color: #DA7F52;
}

View File

@@ -4,7 +4,7 @@ class Api::Admin::EnterpriseSerializer < ActiveModel::Serializer
attributes :preferred_shopfront_message, :preferred_shopfront_closed_message, :preferred_shopfront_taxon_order, :preferred_shopfront_order_cycle_order
attributes :preferred_product_selection_from_inventory_only
attributes :owner, :users, :tag_groups, :default_tag_group
attributes :require_login
attributes :require_login, :allow_guest_orders, :allow_order_changes
has_one :owner, serializer: Api::Admin::UserSerializer
has_many :users, serializer: Api::Admin::UserSerializer

View File

@@ -51,12 +51,18 @@
%label= t '.allow_guest_orders'
%div{'ofn-with-tip' => t('.allow_guest_orders_tip')}
%a= t 'admin.whats_this'
.three.columns
= f.radio_button :allow_guest_orders, true
= f.label :allow_guest_orders, t('.allow_guest_orders_true'), value: :true
.five.columns.omega
= f.radio_button :allow_guest_orders, false
= f.label :allow_guest_orders, t('.allow_guest_orders_false'), value: :false
.eight.columns.omega
.row
.three.columns.alpha
= f.radio_button :allow_guest_orders, true, "ng-model" => "Enterprise.allow_guest_orders", "ng-value" => "true"
= f.label :allow_guest_orders, t('.allow_guest_orders_true'), value: :true
.five.columns.omega
= f.radio_button :allow_guest_orders, false, "ng-model" => "Enterprise.allow_guest_orders", "ng-value" => "false"
= f.label :allow_guest_orders, t('.allow_guest_orders_false'), value: :false
.row.warning{ng: {show: 'Enterprise.allow_guest_orders && Enterprise.allow_order_changes'}}
.eight.columns.alpha.omega
%i.icon-warning-sign
= t '.recommend_require_login'
.row
.alpha.eleven.columns
.three.columns.alpha
@@ -64,8 +70,8 @@
%div{'ofn-with-tip' => t('.allow_order_changes_tip')}
%a= t 'admin.whats_this'
.three.columns
= f.radio_button :allow_order_changes, false
= f.radio_button :allow_order_changes, false, "ng-model" => "Enterprise.allow_order_changes", "ng-value" => "false"
= f.label :allow_order_changes, t('.allow_order_changes_false'), value: :false
.five.columns.omega
= f.radio_button :allow_order_changes, true
= f.radio_button :allow_order_changes, true, "ng-model" => "Enterprise.allow_order_changes", "ng-value" => "true"
= f.label :allow_order_changes, t('.allow_order_changes_true'), value: :true

View File

@@ -391,6 +391,7 @@ en:
shopfront_requires_login_tip: "Choose whether customers must login to view the shopfront or if it's visible to everybody."
shopfront_requires_login_false: "Public"
shopfront_requires_login_true: "Visible to registered customers only"
recommend_require_login: "We recommend to require users to login when orders can be changed."
allow_guest_orders: "Guest orders"
allow_guest_orders_tip: "Allow checkout as guest or require a registered user."
allow_guest_orders_false: "Require login to order"