diff --git a/frontend/app/assets/javascripts/spree/frontend/checkout/address.js b/frontend/app/assets/javascripts/spree/frontend/checkout/address.js
index 5dc00423725..2f8e6f18d57 100644
--- a/frontend/app/assets/javascripts/spree/frontend/checkout/address.js
+++ b/frontend/app/assets/javascripts/spree/frontend/checkout/address.js
@@ -43,7 +43,6 @@ Spree.ready(function($) {
var statePara = $("#" + region + "state");
var stateSelect = statePara.find("select");
var stateInput = statePara.find("input");
- var stateSpanRequired = statePara.find('[id$="state-required"]');
if (states.length > 0) {
var selected = parseInt(stateSelect.val());
stateSelect.html("");
@@ -68,21 +67,21 @@ Spree.ready(function($) {
statePara.show();
if (statesRequired) {
stateSelect.addClass("required");
- stateSpanRequired.show();
+ statePara.addClass("field-required");
} else {
stateSelect.removeClass("required");
- stateSpanRequired.hide();
+ statePara.removeClass("field-required");
}
stateInput.removeClass("required");
} else {
stateSelect.hide().prop("disabled", true);
stateInput.show();
if (statesRequired) {
- stateSpanRequired.show();
+ statePara.addClass("field-required");
stateInput.addClass("required");
} else {
stateInput.val("");
- stateSpanRequired.hide();
+ statePara.removeClass("field-required");
stateInput.removeClass("required");
}
statePara.toggle(!!statesRequired);
diff --git a/frontend/app/assets/stylesheets/spree/frontend/screen.css.scss b/frontend/app/assets/stylesheets/spree/frontend/screen.css.scss
index 0c467b42bb8..5a78fac412e 100644
--- a/frontend/app/assets/stylesheets/spree/frontend/screen.css.scss
+++ b/frontend/app/assets/stylesheets/spree/frontend/screen.css.scss
@@ -143,10 +143,27 @@ label.error {
margin-top: 3px;
}
-span.required {
- color: $c_red;
- font-weight: bold;
- font-size: 1.2em;
+.field {
+ padding: 10px 0;
+
+ label {
+ display: inline-block;
+ margin-bottom: 5px;
+ }
+
+ input,
+ select {
+ display: block;
+ }
+
+ &-required label:after {
+ content: "*";
+ display: inline-block;
+ color: $c_red;
+ font-weight: bold;
+ font-size: 1.2em;
+ margin-left: 3px;
+ }
}
fieldset {
@@ -645,6 +662,10 @@ ul#products {
/*--------------------------------------*/
/* Checkout
/*--------------------------------------*/
+.checkout_form_wrapper {
+ text-align: left;
+}
+
.out-of-stock {
background: #df0000;
color: white;
@@ -881,7 +902,7 @@ ul#products {
.shipping-methods {
list-style: none;
margin: 0;
- padding: none;
+ padding: 10px 0;
.shipping-method {
display: inline-block;
diff --git a/frontend/app/views/spree/address/_form.html.erb b/frontend/app/views/spree/address/_form.html.erb
index 6710c1564f5..2b38b7720b2 100644
--- a/frontend/app/views/spree/address/_form.html.erb
+++ b/frontend/app/views/spree/address/_form.html.erb
@@ -1,39 +1,39 @@
<% address_id = address_type.chars.first %>
>
-
>
- <%= form.label :firstname, t('spree.first_name') %>*
+
>
+ <%= form.label :firstname, t('spree.first_name') %>
<%= form.text_field :firstname, class: 'required', autocomplete: address_type + ' given-name', required: true, autofocus: true %>
-
+
-
>
- <%= form.label :lastname, t('spree.last_name') %>
+
>
+ <%= form.label :lastname, t('spree.last_name') %>
<%= form.text_field :lastname, autocomplete: address_type + ' family-name' %>
-
+
<% if Spree::Config[:company] %>
-
>
- <%= form.label :company, t('spree.company') %>
+
>
+ <%= form.label :company, t('spree.company') %>
<%= form.text_field :company, autocomplete: address_type + ' organization' %>
-
+
<% end %>
-
>
- <%= form.label :address1, t('spree.street_address') %>*
+
>
+ <%= form.label :address1, t('spree.street_address') %>
<%= form.text_field :address1, class: 'required', autocomplete: address_type + ' address-line1', required: true %>
-
+
-
>
- <%= form.label :address2, I18n.t('spree.street_address_2') %>
+
>
+ <%= form.label :address2, I18n.t('spree.street_address_2') %>
<%= form.text_field :address2, autocomplete: address_type + ' address-line2' %>
-
+
-
>
- <%= form.label :city, t('spree.city') %>*
+
>
+ <%= form.label :city, t('spree.city') %>
<%= form.text_field :city, class: 'required', autocomplete: address_type + ' address-level2', required: true %>
-
+
-
>
- <%= form.label :country_id, t('spree.country') %>*
+
>
+ <%= form.label :country_id, t('spree.country') %>
>
<%= form.collection_select :country_id, available_countries, :id, :name, {},
class: 'required',
@@ -41,12 +41,12 @@
required: true
%>
-
+
<% if Spree::Config[:address_requires_state] %>
-
>
+
>
<% have_states = !address.country.states.empty? %>
- <%= form.label :state, t('spree.state') %>>*
+ <%= form.label :state, t('spree.state') %>
<%=
@@ -73,24 +73,24 @@
-
+
<% end %>
-
>
- <%= form.label :zipcode, t('spree.zip') %><% if address.require_zipcode? %>*<% end %>
+
>
+ <%= form.label :zipcode, t('spree.zip') %>
<%= form.text_field :zipcode, class: "#{'required' if address.require_zipcode?}", autocomplete: address_type + ' postal-code', required: true %>
-
+
-
>
- <%= form.label :phone, t('spree.phone') %><% if address.require_phone? %>*<% end %>
+
>
+ <%= form.label :phone, t('spree.phone') %>
<% phone_hash = address.require_phone? ? { class: 'required', required: true } : {} %>
<%= form.phone_field :phone, phone_hash.merge({ autocomplete: address_type + ' home tel' }) %>
-
+
<% if Spree::Config[:alternative_shipping_phone] %>
-
>
- <%= form.label :alternative_phone, t('spree.alternative_phone') %>
+
>
+ <%= form.label :alternative_phone, t('spree.alternative_phone') %>
<%= form.phone_field :alternative_phone, autocomplete: address_type + ' tel'%>
-
+
<% end %>
diff --git a/frontend/app/views/spree/checkout/_address.html.erb b/frontend/app/views/spree/checkout/_address.html.erb
index 9f2d2a25527..58f73fc5c54 100644
--- a/frontend/app/views/spree/checkout/_address.html.erb
+++ b/frontend/app/views/spree/checkout/_address.html.erb
@@ -11,10 +11,10 @@
+
<% ship_form.object.shipping_rates.each do |rate| %>
-
- <%= form.label :coupon_code %>
+ <%= form.label :coupon_code %>
<%= form.text_field :coupon_code %>