Skip to content
Snippets Groups Projects
Commit 39cd1d02 authored by Pelle Koster's avatar Pelle Koster
Browse files

style checkout page

parent 2a488b36
No related branches found
No related tags found
No related merge requests found
...@@ -7,6 +7,7 @@ import sys ...@@ -7,6 +7,7 @@ import sys
def main(): def main():
"""Run administrative tasks.""" """Run administrative tasks."""
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "stripe_checkout.settings.dev") os.environ.setdefault("DJANGO_SETTINGS_MODULE", "stripe_checkout.settings.dev")
os.environ.setdefault("CONFIG_FILENAME", "config.json")
try: try:
from django.core.management import execute_from_command_line from django.core.management import execute_from_command_line
except ImportError as exc: except ImportError as exc:
......
body {
font-family: sans-serif;
color: #101010;
}
.flex {
display: flex;
}
.flex.center {
justify-content: center;
align-items: center;
}
.flex.column {
flex-direction: column;
}
.checkout-summary {
display: grid;
grid-template-rows: auto;
grid-template-columns: 3fr 1fr;
max-width: 300px;
padding: 4px;
margin: 10px;
}
.checkout-summary .item {
padding: 0px 4px 4px 0px;
border-right-style: solid;
border-width: 1px;
}
.checkout-summary .price {
padding-left: 4px;
text-align: right;
}
.checkout-summary .total {
padding-top: 4px;
border-top-style: solid;
border-top-width: 1px;
font-weight: bold;
}
.checkout-card {
padding: 2rem;
border: solid;
border-radius: 2rem;
border-width: 1px;
max-width: 800px;
}
.button {
background-color: #04aa6d; /* Green */
border: none;
color: white;
border-radius: 4px;
height: 32px;
padding: 0 12px 0 12px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
max-width: fit-content;
cursor: pointer;
}
.button:active,
.button:hover {
background-color: #03794e;
}
#checkout-form {
width: 100%;
max-width: 200px;
}
#checkout-form > label {
font-size: smaller;
margin-bottom: 2px;
}
#checkout-form > input,
#checkout-form > select {
margin-bottom: 10px;
width: 100%;
}
#checkout-form > input {
width: 192px;
}
\ No newline at end of file
...@@ -3,28 +3,32 @@ ...@@ -3,28 +3,32 @@
Checkout Checkout
{% endblock title %} {% endblock title %}
{% block body %} {% block body %}
{% if shopping_cart|length > 0 %} <div class="checkout flex center">
<div class="checkout"> <div class="checkout-card flex center column">
<h1>Please confirm a payment method</h1> {% if shopping_cart|length > 0 %}
<table> <h1>Please confirm your payment</h1>
{% for item in shopping_cart %} <div class="checkout-summary">
<tr> {% for item in shopping_cart %}
<td>{{ item.display_name }}</td> <div class="item">{{ item.display_name }}</div>
<td>€{{ item.price }}</td> <div class="price">€{{ item.price }}</div>
</tr> {% endfor %}
{% endfor %} <div class="total item">Total</div>
<tr> <div class="total price">€{{ total }}</div>
<td>Total</td> </div>
<td>€{{ total }}</td> <form id="checkout-form" class="flex column"method="post">
</tr> {% for field in form %}
</table> <label class="label">{{ field.label }}</label>
<form id="checkout_form" method="post"> {{ field }}
{{ form }} {% endfor %}
{% csrf_token %} {% csrf_token %}
<input type="submit" value="confirm"> <div class="flex center">
</form> <input type="submit" class="button" value="confirm">
</div>
</form>
</div>
{% else %}
<p>You have nothing to pay for</p>
</div> </div>
{% else %} </div>
<p>You have nothing to pay for</p> {% endif %}
{% endif %}
{% endblock body %} {% endblock body %}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment