From 9fb0f54d389f4d449e4f85bb1b4586847cbf58ca Mon Sep 17 00:00:00 2001 From: Michael Drury <mpdrury15@gmail.com> Date: Tue, 2 May 2023 14:09:04 +0100 Subject: [PATCH] fixed messgages not displaying for incorrect regex for forms and styled error, changed color on hover of discount --- instance/app.db | Bin 20480 -> 20480 bytes shop/static/styles.css | 16 +++++++++++++--- shop/templates/cart.html | 1 - shop/templates/checkout.html | 15 +++++++++++++-- shop/templates/shopping.html | 4 ++-- 5 files changed, 28 insertions(+), 8 deletions(-) diff --git a/instance/app.db b/instance/app.db index 1a037ffa268422768afc93d13348d9b7c4dbcd44..107cce3346fdbba44b4e13d1ac8b616e45a35598 100644 GIT binary patch delta 74 zcmZozz}T>Wae_3X_e2?IM(>RY3;B8ZyBL`Hv>5ob_(k~^Z5C7z;S=QV0t(hiH<mH7 dGe|c^3i3`il*^yINbUs-0|P_Z=05o%0|3OC6CeNp delta 83 zcmZozz}T>Wae_3X^F$eEM(2$Q3;B5&7#NuO7BTR5@r&{;+AOFb!Y9Vx#n1rccQI5+ mH%9V`=4K{mB&Oy}UN0v)*<UVr@&dV6EG3NW44eDpiwpp*QWvBE diff --git a/shop/static/styles.css b/shop/static/styles.css index 795e0db..1d83833 100644 --- a/shop/static/styles.css +++ b/shop/static/styles.css @@ -227,6 +227,7 @@ li { .item_cart_name { font-size: 200%; color: black; + font-family: Andale Mono, monospace; } .item_cart_name:hover { @@ -287,13 +288,13 @@ li { .checkout_price { padding-left: 20px; - font-size: 150%; + font-size: 100%; } .checkout_box { width: 50%; border: 3px solid black; - transform: translate(50%, 10%); + transform: translate(50%, 0%); } .checkout_login_form { @@ -537,4 +538,13 @@ li { justify-content: center; align-items: center; font-family: Andale Mono, monospace; -} \ No newline at end of file +} + +.discount_div:hover { + color: #D49B30; +} + +.input_error { + color: red; + margin: 0px; +} diff --git a/shop/templates/cart.html b/shop/templates/cart.html index cfb9109..3d7e103 100644 --- a/shop/templates/cart.html +++ b/shop/templates/cart.html @@ -56,7 +56,6 @@ <p>price: £{{ item.product_price }}</p> <p>item id: {{ item.product_id }}</p> </div> - {% endfor %} </div> diff --git a/shop/templates/checkout.html b/shop/templates/checkout.html index 68ffb59..5b66821 100644 --- a/shop/templates/checkout.html +++ b/shop/templates/checkout.html @@ -18,11 +18,21 @@ <p class = "checkout_line1"> {{ form.security_pin.label }} {{ form.security_pin(class = "input_field") }} + {% if form.security_pin.errors %} + {% for error in form.security_pin.errors %} + <p class = "input_error">{{ error }}</p> + {% endfor %} + {% endif %} </p> <p class="hiden1">please enter cart CSV security pin</p> <p class = "checkout_line2"> {{ form.card_num.label }} {{ form.card_num(class = "input_field") }} + {% if form.card_num.errors %} + {% for error in form.card_num.errors %} + <p class = "input_error">{{ error }}</p> + {% endfor %} + {% endif %} </p> <p class="hiden2">please enter card number</p> <p class = "checkout_line3"> @@ -30,12 +40,13 @@ {{ form.month(class = "input_field") }} / {{ form.year(class = "input_field") }} </p> - <p class="hiden3">please enter expiery date in form month / year</p> + <p class="hiden3">please enter expiery date in form month / yvear</p> <p class = "checkout_line"> - {{ form.submit(class = "input_field") }} + {{ form.submit(class = "add_to_button") }} </p> </div> </form> + </div> {% endblock %} diff --git a/shop/templates/shopping.html b/shop/templates/shopping.html index db25cea..96d98e6 100644 --- a/shop/templates/shopping.html +++ b/shop/templates/shopping.html @@ -14,7 +14,7 @@ <div class = "shopping_right_text"> {{ order_by_form.csrf_token }} <p> - {{ order_by_form.order.label }} {{ order_by_form.order(class = "field_order_by") }} {{ order_by_form.submit(class = "field_order_by") }} + {{ order_by_form.order.label }} {{ order_by_form.order(class = "field_order_by") }} {{ order_by_form.submit(class = "add_to_button") }} </p> </div> </form> @@ -23,7 +23,7 @@ <div class = "shopping_right_text"> {{ type_form.csrf_token }} <p> - {{ type_form.type.label }} {{ type_form.type(class = "field_order_by") }} {{ type_form.submit1(class = "field_order_by") }} + {{ type_form.type.label }} {{ type_form.type(class = "field_order_by") }} {{ type_form.submit1(class = "add_to_button") }} </p> </div> </form> -- GitLab