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,17 @@
<!-- Input Number with +/- buttons -->
<!-- requires:
Product product
Form_Product form - with product id attribute for accessing input element attribute
int tmp_quantity - placeholder
-->
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_ROW }}">
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_COLUMN }}" style="flex: none;">
<div class="btn-decrement" {{ model.ATTR_ID_PRODUCT }}="{{ product.id_product }}" {{ model.ATTR_ID_PERMUTATION }}="{{ permutation.id_permutation }}" {{ model.ATTR_FORM_TYPE }}="{{ form.form_type }}">-</div>
</div>
<div class="{{ model.FLAG_CONTAINER }}-input {{ model.FLAG_COLUMN }}" style="flex: none;">
{{ form.quantity(value=tmp_quantity) }} <!-- model.attr_id_product=product.id -->
</div>
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_COLUMN }}" style="flex: none;">
<div class="btn-increment" {{ model.ATTR_ID_PRODUCT }}="{{ product.id_product }}" {{ model.ATTR_ID_PERMUTATION }}="{{ permutation.id_permutation }}" {{ model.ATTR_FORM_TYPE }}="{{ form.form_type }}">+</div>
</div>
</div>

View File

@@ -0,0 +1,18 @@
{% if variation_tree is not defined %}
{% set is_blank_row = True %}
{% endif %}
{% if is_blank_row is not defined %}
{% set is_blank_row = True %}
{% endif %}
{% if not is_blank_row %}
{% set json_str_variations = permutation.variation_tree.to_json_str() %}
<textarea
class="{{ model.FLAG_VARIATIONS }}"
{{ model.ATTR_VALUE_CURRENT }}="{{ json_str_variations }}"
{{ model.ATTR_VALUE_PREVIOUS }}="{{ json_str_variations }}"
>{{ permutation.variation_tree.to_str_textarea() }}</textarea>
{% else %}
<textarea class="{{ model.FLAG_VARIATIONS }}" {{ model.ATTR_VALUE_CURRENT }} {{ model.ATTR_VALUE_PREVIOUS }}></textarea>
{% endif %}

View File

@@ -0,0 +1,20 @@
{% if variation_tree is not defined %}
{% set is_blank_row = True %}
{% endif %}
{% if is_blank_row is not defined %}
{% set is_blank_row = True %}
{% endif %}
{% if not is_blank_row %}
{# % set json_str_variation_types = product.get_json_str_types_variation_trees() % #}
{% set names_variation_type = product.get_variation_types_unique() %}
{% set json_str_variation_types = jsonify(names_variation_type) %}
<textarea
class="{{ model.FLAG_VARIATIONS }}"
{{ model.ATTR_VALUE_CURRENT }}="{{ json_str_variation_types }}"
{{ model.ATTR_VALUE_PREVIOUS }}="{{ json_str_variation_types }}"
>{{ model.join_with_linebreaks(names_variation_type) }}</textarea>
{% else %}
<textarea class="{{ model.FLAG_VARIATIONS }}" {{ model.ATTR_VALUE_CURRENT }} {{ model.ATTR_VALUE_PREVIOUS }}></textarea>
{% endif %}