Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Add styles to edit/add address templates

weronka4e9f9534eaac
diff --git a/saleor/static/scss/demo/components/_buttons.scss b/saleor/static/scss/demo/components/_buttons.scss
index 8a615cdc5f..5cca4dcd7b 100644
--- a/saleor/static/scss/demo/components/_buttons.scss
+++ b/saleor/static/scss/demo/components/_buttons.scss
@@ -21,4 +21,13 @@
background-color: $darkgreen
}
}
+ &.danger {
+ background-color: $red;
+ color: $white;
+ padding: $global-padding $global-padding * 4;
+ font-size: $font-size-h5;
+ &:hover {
+ background-color: $darkred
+ }
+ }
}
\ No newline at end of file
diff --git a/saleor/static/scss/demo/components/_footer.scss b/saleor/static/scss/demo/components/_footer.scss
index d42dd48e0d..b075532728 100644
--- a/saleor/static/scss/demo/components/_footer.scss
+++ b/saleor/static/scss/demo/components/_footer.scss
@@ -1,7 +1,7 @@
.footer {
background-color: $gray;
padding: $global-padding * 2 0;
- margin-top: $global-margin * 2;
+ margin-top: $global-margin * 8;
@include media-breakpoint-down(xs) {
text-align: center;
}
@@ -26,4 +26,9 @@
margin-right: $global-margin;
}
}
+}
+
+//make footer stick to the bottom
+.maincontent {
+ min-height: calc(100vh - 294px - 191px - 30px);
}
\ No newline at end of file
diff --git a/saleor/static/scss/demo/components/_userprofile.scss b/saleor/static/scss/demo/components/_userprofile.scss
index 41c7a623be..2fd1316d85 100644
--- a/saleor/static/scss/demo/components/_userprofile.scss
+++ b/saleor/static/scss/demo/components/_userprofile.scss
@@ -65,4 +65,9 @@
}
}
}
+ &__address-edit {
+ &__form {
+ margin-bottom: $global-margin * 2;
+ }
+ }
}
\ No newline at end of file
diff --git a/saleor/static/scss/demo/variables.scss b/saleor/static/scss/demo/variables.scss
index fa50578d3a..85d6520fcf 100644
--- a/saleor/static/scss/demo/variables.scss
+++ b/saleor/static/scss/demo/variables.scss
@@ -16,6 +16,7 @@ $global-margin: 1rem;
$white: #fff;
$body-color: #333333;
$red: #EB5757;
+ $darkred: #c53636;
$green: #27AE60;
$darkgreen: #1b8a4a;
diff --git a/templates/demo/base.html b/templates/demo/base.html
index 3d9ed6de0f..d7f97d2900 100644
--- a/templates/demo/base.html
+++ b/templates/demo/base.html
@@ -89,7 +89,7 @@
{% endfor %}
</div>
{% endif %}
- <div class="container">
+ <div class="container maincontent">
{% block breadcrumb %}
{% endblock breadcrumb %}
{% block content %}
diff --git a/templates/demo/userprofile/address-delete.html b/templates/demo/userprofile/address-delete.html
index 0e37cd5a6b..86252321dc 100644
--- a/templates/demo/userprofile/address-delete.html
+++ b/templates/demo/userprofile/address-delete.html
@@ -4,16 +4,16 @@
{% block title %}{% trans "Delete address" %} — {{ block.super }}{% endblock %}
{% block breadcrumb %}
- {{ block.super }}
- <li><a href="{% url 'profile:details' %}">{% trans "Your profile" %}</a></li>
- <li><a href=".">{% trans "Delete address" %}</a></li>
+ <ul class="breadcrumbs list-unstyled">
+ <li><a href="{% url 'profile:details' %}">{% trans "Your profile" %}</a></li>
+ <li><a href=".">{% trans "Delete address" %}</a></li>
+ </ul>
{% endblock breadcrumb %}
{% block content %}
- <h2>{% trans "Are you sure you want to delete the following address?" %}</h2>
-
<div class="row">
- <div class="col-sm-6">
+ <div class="col-sm-8 col-md-6 offset-sm-2 offset-md-3">
+ <h1 class="text-xs-center">{% trans "Are you sure you want to delete the following address?" %}</h1>
<div class="panel panel-default">
<div class="panel-heading">
{{ address }}
@@ -22,12 +22,11 @@
<address>{% include "userprofile/snippets/address-details.html" with address=address %}</address>
</div>
</div>
+ <form method="post" novalidate>
+ {% csrf_token %}
+ <button type="submit" class="btn danger">{% trans "Delete" %}</button>
+ <a href="{% url 'profile:details' %}" class="btn secondary">{% trans "Cancel" %}</a>
+ </form>
</div>
</div>
-
- <form method="post" novalidate>
- {% csrf_token %}
- <button type="submit" class="btn btn-danger">{% trans "Delete" %}</button>
- <a href="{% url 'profile:details' %}" class="btn btn-link">{% trans "Cancel" %}</a>
- </form>
{% endblock content %}
diff --git a/templates/demo/userprofile/address-edit.html b/templates/demo/userprofile/address-edit.html
index f12d549e79..3fb5d2a2a5 100644
--- a/templates/demo/userprofile/address-edit.html
+++ b/templates/demo/userprofile/address-edit.html
@@ -5,25 +5,34 @@
{% block title %}{% trans "Edit Address" %} — {{ block.super }}{% endblock %}
{% block breadcrumb %}
- {{ block.super }}
+ <ul class="breadcrumbs list-unstyled">
+ <li><a href="/">{% trans "Home" %}</a></li>
<li><a href="{% url 'profile:details' %}">{% trans "Your profile" %}</a></li>
-{% if address_form.instance.pk %}
- <li><a href=".">{% trans "Edit address" %}</a></li>
-{% else %}
- <li><a href=".">{% trans "New address" %}</a></li>
-{% endif %}
+ {% if address_form.instance.pk %}
+ <li><a href=".">{% trans "Edit address" %}</a></li>
+ {% else %}
+ <li><a href=".">{% trans "New address" %}</a></li>
+ {% endif %}
+ </ul>
{% endblock breadcrumb %}
{% block content %}
-<div class="row">
- <div class="col-sm-8 col-sm-push-2">
+<div class="row userprofile__address-edit">
+ <div class="col-sm-8 col-md-6 offset-sm-2 offset-md-3">
<form method="post" novalidate>
{% csrf_token %}
- <h4>{% trans "Address" %}</h4>
- <br>
- {% include "userprofile/snippets/address-form.html" %}
+ <h1 class="text-xs-center">
+ {% if address_form.instance.pk %}
+ {% trans "Edit address" %}
+ {% else %}
+ {% trans "New address" %}
+ {% endif %}
+ </h1>
+ <div class="userprofile__address-edit__form">
+ {% include "userprofile/snippets/address-form.html" %}
+ </div>
<p class="text-right">
- <button type="submit" class="btn btn-primary">{% trans "Save changes" %}</button>
+ <button type="submit" class="btn primary">{% trans "Save changes" %}</button>
</p>
</form>
</div>
diff --git a/templates/demo/userprofile/snippets/address-form.html b/templates/demo/userprofile/snippets/address-form.html
index 92f8fdeee2..fb1ba85155 100644
--- a/templates/demo/userprofile/snippets/address-form.html
+++ b/templates/demo/userprofile/snippets/address-form.html
@@ -6,7 +6,7 @@
{% for line in address_form_lines %}
<div class="row">
{% for field in line %}
- <div class="col-sm-4">
+ <div class="col-sm-6">
{% bootstrap_field field %}
</div>
{% endfor %}