Skip to content

Commit

Permalink
Fixed styling issues in address forms
Browse files Browse the repository at this point in the history
  • Loading branch information
jrief committed Mar 17, 2018
1 parent fba1b2e commit f9ca370
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 33 deletions.
46 changes: 13 additions & 33 deletions shop/static/shop/css/_django-angular.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,39 +16,17 @@
}

form {
.ng-invalid-bound.ng-pristine, .ng-invalid.ng-dirty {
.ng-invalid-bound.ng-pristine, .ng-invalid.ng-dirty, &.ng-submitted .ng-invalid {
border-color: #e9322d;
}
.ng-invalid-bound.ng-pristine:focus, .ng-invalid.ng-dirty:focus {
box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #ce8483;
}
}

shop-auth-form {
.ng-invalid.ng-touched {
border-color: #e9322d;
label.djng-field-required::after {
content: "\00a0*";
}
}

.shop-form-error {
position: absolute;
list-style: none;
top: 0;
right: 5px;
li {
color: #e9322d;
font-weight: bold;
white-space: nowrap;
padding-left: 8px;
padding-right: 4px;
border: 1px dotted #e9322d;
border-radius: 3px;
background: #f2dede;
opacity: 0.85;
&::before {
content: "\2716";
margin-right: 10px;
}
.has-feedback .form-control {
padding-right: 12px;
}
}

Expand Down Expand Up @@ -80,18 +58,20 @@ ul.djng-form-errors, ul.djng-field-errors {
}
}

label.djng-field-required::after {
content: "\00a0*";
}

ul.djng-field-errors {
position: absolute;
li.invalid:before {
li.invalid::before {
content: "\2716";
margin-right: 10px;
}
li.valid:before {
li.valid::before {
color: #00c900;
content: "\2714";
}
}

button.btn > i {
width: 1.5em;
display: inline-block;
text-align: center;
}
28 changes: 28 additions & 0 deletions shop/static/shop/css/_django-shop.scss
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,31 @@ table tr {
list-style: none;
}
}

shop-auth-form {
.ng-invalid.ng-touched {
border-color: #e9322d;
}
}

.shop-form-error {
position: absolute;
list-style: none;
top: 0;
right: 5px;
li {
color: #e9322d;
font-weight: bold;
white-space: nowrap;
padding-left: 8px;
padding-right: 4px;
border: 1px dotted #e9322d;
border-radius: 3px;
background: #f2dede;
opacity: 0.85;
&::before {
content: "\2716";
margin-right: 10px;
}
}
}
2 changes: 2 additions & 0 deletions shop/templates/shop/checkout/billing-address-form.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@
</select>
</div>
{% endif %}
{% spaceless %}
{{ billing_address_form.as_div }}
{% endspaceless %}
{% if billing_address_form.multi_addr %}
<div class="form-group" ng-show="billing_address.siblings_summary.length>1 || billing_address.siblings_summary.length>0 && billing_address.active_priority=='add'">
<button class="btn btn-danger btn-xs" ng-click="deleteSiblingAddress()">
Expand Down
2 changes: 2 additions & 0 deletions shop/templates/shop/checkout/shipping-address-form.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@
</select>
</div>
{% endif %}
{% spaceless %}
{{ shipping_address_form.as_div }}
{% endspaceless %}
{% if shipping_address_form.multi_addr %}
<div class="form-group" ng-show="shipping_address.siblings_summary.length>1 || shipping_address.siblings_summary.length>0 && shipping_address.active_priority=='add'">
<button class="btn btn-danger btn-xs" ng-click="deleteSiblingAddress()">
Expand Down

0 comments on commit f9ca370

Please sign in to comment.