diff --git a/src/core/tasks.py b/src/core/tasks.py
index 27d0468..91a5ac1 100644
--- a/src/core/tasks.py
+++ b/src/core/tasks.py
@@ -19,7 +19,7 @@ ORDER_REFUND_TEMPLATE = 'storefront/order_refund'
def send_order_confirmation_email(order):
send_templated_mail(
template_name=CONFIRM_ORDER_TEMPLATE,
- from_email=settings.DEFAULT_FROM_EMAIL,
+ from_email=settings.ORDER_FROM_EMAIL,
recipient_list=[order['email']],
context=order
)
@@ -30,7 +30,7 @@ def send_order_confirmation_email(order):
def send_order_shipped_email(data):
send_templated_mail(
template_name=SHIP_ORDER_TEMPLATE,
- from_email=settings.DEFAULT_FROM_EMAIL,
+ from_email=settings.ORDER_FROM_EMAIL,
recipient_list=[data['email']],
context=data
)
diff --git a/src/ptcoffee/config.py b/src/ptcoffee/config.py
index f57381e..eb89470 100644
--- a/src/ptcoffee/config.py
+++ b/src/ptcoffee/config.py
@@ -32,6 +32,7 @@ ANYMAIL_CONFIG = {
SERVER_EMAIL = os.environ.get('SERVER_EMAIL', '')
DEFAULT_FROM_EMAIL = os.environ.get('DEFAULT_FROM_EMAIL', '')
DEFAULT_CONTACT_EMAIL = os.environ.get('DEFAULT_CONTACT_EMAIL', '')
+ORDER_FROM_EMAIL = os.environ.get('ORDER_FROM_EMAIL', '')
STATIC_ROOT_PATH = os.environ.get('STATIC_ROOT_PATH', '/var/www/ptcoffee-dev/static/')
SECURE_HSTS_SECONDS = os.environ.get('SECURE_HSTS_SECONDS', 3600)
diff --git a/src/static/images/site_banner.jpg b/src/static/images/site_banner.jpg
index d78da3c..71a8105 100644
Binary files a/src/static/images/site_banner.jpg and b/src/static/images/site_banner.jpg differ
diff --git a/src/static/styles/main.css b/src/static/styles/main.css
index 329a342..5c98062 100644
--- a/src/static/styles/main.css
+++ b/src/static/styles/main.css
@@ -218,13 +218,26 @@ input[type=submit]:hover,
/* Contact form
========================================================================== */
+.contact-form {
+ display: grid;
+ grid-template-columns: repeat(2, 1fr);
+ gap: 0 2rem;
+}
+
+.contact-form p:nth-child(6) {
+ grid-column: span 2;
+}
+
+.contact-form p:last-child {
+ grid-column: 2;
+}
+
.contact-form label {
display: block;
}
:is(.contact-form) input, select, textarea {
width: 100%;
- max-width: 600px;
}
@@ -476,12 +489,15 @@ section:not(:last-child) {
background-image: url("/static/images/site_banner.jpg");
}
.site__banner--fairtrade {
+ padding: 6rem 1rem;
background-image: url("/static/images/fairtrade_banner.jpg");
}
.site__banner--reviews {
+ padding: 6rem 1rem;
background-image: url("/static/images/reviews_banner.jpg");
}
.site__banner--about {
+ padding: 6rem 1rem;
background-image: url("/static/images/coffee_banner.jpg");
}
@@ -791,6 +807,15 @@ article + article {
grid-column: 2;
grid-row: 1;
}
+
+ .item__form {
+ flex-direction: column;
+ }
+
+ .item__form *:not(:last-child) {
+ margin-bottom: 1rem;
+ width: 100%;
+ }
}
diff --git a/src/storefront/cart.py b/src/storefront/cart.py
index 5ab3a40..4572634 100644
--- a/src/storefront/cart.py
+++ b/src/storefront/cart.py
@@ -62,10 +62,12 @@ class Cart:
self.session.modified = True
logger.info(f'\nCart:\n{self.cart}\n')
- def remove(self, product):
+ def remove(self, product, grind):
product_id = str(product.id)
if product_id in self.cart:
- del self.cart[product_id]
+ del self.cart[product_id]['variations'][grind]
+ if not self.cart[product_id]['variations']:
+ del self.cart[product_id]
self.save()
def __iter__(self):
diff --git a/src/storefront/forms.py b/src/storefront/forms.py
index 78891a5..51b9ff6 100644
--- a/src/storefront/forms.py
+++ b/src/storefront/forms.py
@@ -133,8 +133,7 @@ class ContactForm(forms.Form):
(OTHER, 'Other (please describe below)'),
]
- first_name = forms.CharField()
- last_name = forms.CharField()
+ full_name = forms.CharField()
email_address = forms.EmailField()
referal = forms.ChoiceField(
label='How did you find our website?',
diff --git a/src/storefront/templates/storefront/cart_detail.html b/src/storefront/templates/storefront/cart_detail.html
index 2b107d2..418d1dd 100644
--- a/src/storefront/templates/storefront/cart_detail.html
+++ b/src/storefront/templates/storefront/cart_detail.html
@@ -1,4 +1,5 @@
{% extends "base.html" %}
+{% load grind_filter %}
{% block head_title %}Cart | {% endblock %}
@@ -15,20 +16,18 @@
Grind:
- {% for key, value in item.variations.items %} -{{key}}
-
- Remove from cart +
{{ key|get_grind_display }}
+
${{item.price}}
diff --git a/src/storefront/templates/storefront/contact_form.html b/src/storefront/templates/storefront/contact_form.html index 6e5b12b..252f46a 100644 --- a/src/storefront/templates/storefront/contact_form.html +++ b/src/storefront/templates/storefront/contact_form.html @@ -13,9 +13,9 @@ Please contact us, we’re happy to help you over the phoneOr send us a message using the form below and we'll email you back as soon as we can.
Or send us a message using the form below and we'll email you back as soon as we can.