diff --git a/src/dashboard/templates/dashboard/prodphoto_create_form.html b/src/dashboard/templates/dashboard/prodphoto_create_form.html index 31e4666..624cb40 100644 --- a/src/dashboard/templates/dashboard/prodphoto_create_form.html +++ b/src/dashboard/templates/dashboard/prodphoto_create_form.html @@ -3,7 +3,7 @@ {% block content %}
-

Add photo

+

Add photo to {{product.name}}

diff --git a/src/media/products/images/pantomime.png b/src/media/products/images/pantomime.png deleted file mode 100644 index b255f9c..0000000 Binary files a/src/media/products/images/pantomime.png and /dev/null differ diff --git a/src/static/images/coffee_banner.jpeg b/src/static/images/coffee_banner.jpeg deleted file mode 100644 index 03cd426..0000000 Binary files a/src/static/images/coffee_banner.jpeg and /dev/null differ diff --git a/src/static/images/coffee_banner.jpg b/src/static/images/coffee_banner.jpg new file mode 100644 index 0000000..26177fb Binary files /dev/null and b/src/static/images/coffee_banner.jpg differ diff --git a/src/static/images/fairtrade_banner.jpg b/src/static/images/fairtrade_banner.jpg new file mode 100644 index 0000000..5b934de Binary files /dev/null and b/src/static/images/fairtrade_banner.jpg differ diff --git a/src/static/images/reviews_banner.jpg b/src/static/images/reviews_banner.jpg new file mode 100644 index 0000000..ae8dd3c Binary files /dev/null and b/src/static/images/reviews_banner.jpg differ diff --git a/src/static/scripts/index.js b/src/static/scripts/index.js index e7820e6..27fd2b6 100644 --- a/src/static/scripts/index.js +++ b/src/static/scripts/index.js @@ -3,6 +3,8 @@ import { getCookie, setCookie } from "./cookie.js" // Get the modal const modal = document.querySelector(".modal-menu"); +const showBtn = document.querySelector(".show-modal"); + // Get the element that closes the modal const closeBtn = document.querySelector(".close-modal"); @@ -14,9 +16,13 @@ closeBtn.addEventListener("click", event => { setCookie('newsletter-modal', 'true', oneDay) }) +showBtn.addEventListener("click", event => { + modal.style.display = "block"; + setCookie('newsletter-modal', 'true', oneDay) +}) + const scrollFunction = () => { let modalDismissed = getCookie('newsletter-modal') - console.log(modalDismissed) if (modalDismissed != 'true') { if (document.body.scrollTop > 600 || document.documentElement.scrollTop > 600) { modal.style.display = "block"; diff --git a/src/static/scripts/payment.js b/src/static/scripts/payment.js index 1c3345f..52ffeef 100644 --- a/src/static/scripts/payment.js +++ b/src/static/scripts/payment.js @@ -1,6 +1,6 @@ import { getCookie } from "./cookie.js" -let form = document.querySelector('form') +let form = document.querySelector('.order-create-form') // Render the PayPal button into #paypal-button-container paypal.Buttons({ diff --git a/src/static/scripts/product_gallery.js b/src/static/scripts/product_gallery.js index eecc3bd..dc79a7e 100644 --- a/src/static/scripts/product_gallery.js +++ b/src/static/scripts/product_gallery.js @@ -1,5 +1,5 @@ const gallery = document.querySelectorAll('.gallery__thumbnail') -const productImage = document.querySelector('.product__image') +const productImage = document.querySelector('.gallery__image') let currentImg = document.querySelector('.gallery__thumbnail--focus') gallery.forEach(image => { diff --git a/src/static/styles/dashboard.css b/src/static/styles/dashboard.css index 1f35734..239348e 100644 --- a/src/static/styles/dashboard.css +++ b/src/static/styles/dashboard.css @@ -366,6 +366,10 @@ main article { text-decoration: none; } +.product__figure img { + max-height: 400px; +} + .product__detail { display: grid; diff --git a/src/static/styles/main.css b/src/static/styles/main.css index 30668be..35ca17d 100644 --- a/src/static/styles/main.css +++ b/src/static/styles/main.css @@ -196,13 +196,24 @@ input[type=submit], cursor: pointer; } -button, +button:hover, input[type=submit]:hover, .action-button:hover { background-color: var(--yellow-alt-color); } +/* Contact form + ========================================================================== */ +.contact-form label { + display: block; +} + +:is(.contact-form) input, select, textarea { + width: 100%; + max-width: 600px; +} + @@ -252,7 +263,7 @@ footer > section { background-color: var(--bg-color); margin: 25vh auto; padding: 20px; - border: var(--default-border); + border: 2rem solid var(--bg-alt-color); max-width: 40rem; } @@ -545,10 +556,14 @@ article + article { aspect-ratio: 1/1; } -.gallery__image { +.gallery__image-wrapper { text-align: center; } +.gallery__image { + max-height: 600px; +} + .gallery__thumbnail--focus { border-color: var(--yellow-color); } diff --git a/src/storefront/cart.py b/src/storefront/cart.py index 906e10e..92e2ebd 100644 --- a/src/storefront/cart.py +++ b/src/storefront/cart.py @@ -68,7 +68,10 @@ class Cart: def clear(self): del self.session[settings.CART_SESSION_ID] - del self.session['coupon_code'] + try: + del self.session['coupon_code'] + except KeyError: + pass self.session.modified = True def build_order_params(self): diff --git a/src/storefront/forms.py b/src/storefront/forms.py index b962d6a..06275b1 100644 --- a/src/storefront/forms.py +++ b/src/storefront/forms.py @@ -95,11 +95,9 @@ class OrderCreateForm(forms.ModelForm): class Meta: model = Order fields = ( - 'coupon', 'total_net_amount', ) widgets = { - 'coupon': forms.HiddenInput(), 'total_net_amount': forms.HiddenInput() } diff --git a/src/storefront/tasks.py b/src/storefront/tasks.py index dadbf7f..ae3350f 100644 --- a/src/storefront/tasks.py +++ b/src/storefront/tasks.py @@ -14,7 +14,7 @@ COTACT_FORM_TEMPLATE = 'storefront/contact_form' def contact_form_email(formdata): send_templated_mail( template_name=COTACT_FORM_TEMPLATE, - from_email=settings.DEFAULT_FROM_EMAIL, + from_email=formdata['email_address'], recipient_list=[settings.DEFAULT_CONTACT_EMAIL], context=formdata ) diff --git a/src/storefront/templates/storefront/about.html b/src/storefront/templates/storefront/about.html index eb35732..b4be59b 100644 --- a/src/storefront/templates/storefront/about.html +++ b/src/storefront/templates/storefront/about.html @@ -8,7 +8,7 @@
- + Banner
diff --git a/src/storefront/templates/storefront/contact_form.html b/src/storefront/templates/storefront/contact_form.html index a0faae2..7aaba21 100644 --- a/src/storefront/templates/storefront/contact_form.html +++ b/src/storefront/templates/storefront/contact_form.html @@ -6,7 +6,7 @@

Contact us

- + {% csrf_token %} {{form.as_p}}

diff --git a/src/storefront/templates/storefront/fairtrade.html b/src/storefront/templates/storefront/fairtrade.html new file mode 100644 index 0000000..4b34b9b --- /dev/null +++ b/src/storefront/templates/storefront/fairtrade.html @@ -0,0 +1,34 @@ +{% extends "base.html" %} +{% load static %} + +{% block content %} +

+
+

Fair Trade and Organic

+
+
+
+ Banner +
+
+
+

We pay a steep premium for these beans, which are typically from smaller farms that are organized into co-ops. These farms take pride in their coffees, as the farmers make a living wage and their families are able to live in a healthier, more secure environment than farmers who grow a conventional coffee crop. The quality of our coffee is consistent, in part due to the quality of organic and fair trade beans.

+
+ Fair trade +
+ +

Farmers, growers, fishers and workers are the heart of the fair trade movement. Purchasing Fair Trade Certified™ products is a choice to support responsible companies, protect the environment, and empower farmers, workers and fishers.

+ +

Better for you

+

Buying fair trade lets you feel good about the products you bring into your home.

+ +

Better for others

+

Buying fair trade ensures a more equitable world by protecting and empowering the people behind our products

+ +

Better for the planet

+

Buying fair trade creates a more sustainable environment by improving systems and equipment in producer groups around the world.

+ +

When you choose our Coffee with the Fair Trade Certified™ seal, you can be sure that the people behind it worked in safe, healthy conditions and earned additional money to uplift their communities. It’s an easy way to have a direct, positive impact global communities. When you choose our Fair Trade Certified™ coffee, you’re voting with your dollar to support responsible businesses, empower farmers, and protect the environment. Fair trade is a way of supporting safe, healthy working conditions and extra income for the people behind our products through your everyday purchases

+
+
+{% endblock %} diff --git a/src/storefront/templates/storefront/order_form.html b/src/storefront/templates/storefront/order_form.html index d4e46d4..41d95f1 100644 --- a/src/storefront/templates/storefront/order_form.html +++ b/src/storefront/templates/storefront/order_form.html @@ -46,7 +46,7 @@

Order summary

- + {% csrf_token %} {{form.as_p}} diff --git a/src/storefront/templates/storefront/partials/_newsletter.html b/src/storefront/templates/storefront/partials/_newsletter.html new file mode 100644 index 0000000..d82f757 --- /dev/null +++ b/src/storefront/templates/storefront/partials/_newsletter.html @@ -0,0 +1,450 @@ +
+ + + + + + + + +
+
+
+
Get 10% OFF
+
+
+
+
+

+ Subscribe to get 10% off your first order! +

+
+
+
+ +
+ +
+ +

+
+ +
+ +
+ +

+
+

+ +

+
+
+
+
+ +
+ diff --git a/src/storefront/templates/storefront/product_detail.html b/src/storefront/templates/storefront/product_detail.html index 611c939..b277ac2 100644 --- a/src/storefront/templates/storefront/product_detail.html +++ b/src/storefront/templates/storefront/product_detail.html @@ -12,13 +12,13 @@ {{ photo }} {% endfor %}
-