1. Refactoring form objects and database objects to use inheritance and abstract base class for consistency and reduced redundancy.\n2. Contact us page button links updated to resolve error of missing link causing page refresh instead of expected functionality.

This commit is contained in:
2024-09-10 12:09:50 +01:00
parent b3e801e1ec
commit 2d55fe6239
709 changed files with 5158 additions and 1512 deletions

View File

@@ -0,0 +1,35 @@
<!-- Basket Item -->
<!-- requires:
Basket_Item basket_item
bool show_delivery_option
-->
<div class="container row">
{% set product = basket_item.product %}
{% set permutation = product.get_permutation_selected() %}
<div class="container">
<img class="img-thumbnail" src="{{ product.get_image_from_index(0).url }}" alt="Basket icon"> <!-- model.get_many_product_image_src(product.id_product, '', True, 'THUMBNAIL') -->
</div>
{% set form = product.form_basket_edit %}
<!-- <form {{ model.attr_form_type }}="{{ form.form_type }}" {{ model.attr_id_product }}="{{ product.id }}" class="container column" action="{{ url_for('basket_add') }}" method="POST"> -->
<form {{ model.attr_form_type }}="{{ form.form_type }}" class="{{ model.flag_container }} {{ model.flag_column }}" {{ model.attr_id_product }}="{{ product.id_product}}" {{ model.attr_id_permutation }}="{{ permutation.id_permutation }}"> <!-- id="form_basket_item_id_{{ basket_item.product.id }}" -->
{{ form.hidden_tag() }}
<h2>{{ product.name }}</h2>
{% if permutation.is_available %}
<h3 style="white-space: nowrap;">{{ basket_item.quantity }} x {{ product.output_price(model.app.is_included_VAT) }} = {{ basket_item.output_subtotal() }}</h3>
{% set tmp_quantity = basket_item.quantity %}
{% include 'components/common/inputs/_input_number_plus_minus.html' %}
{% elif permutation.is_unavailable_in_currency_or_region %}
<h3 style="white-space: nowrap;">Product not available in currency and region</h3>
{% else %}
<h3 style="white-space: nowrap;">Product not available</h3>
{% endif %}
<a class="{{ model.FLAG_DELETE }}">Delete</a>
{% if show_delivery_option %}
<div class="{{ model.flag_container_input }}">
{{ product.form_delivery_option.label }}
{{ product.form_delivery_option() }}
</div>
{% endif %}
<script>console.log('creating basket item for:');console.log('product id: {{ product.id_product }}');console.log('permutation id: {{ product.get_id_permutation() }}');console.log('quantity: {{ basket_item.quantity }}');</script>
</form>
</div>