Feat: Active column changed to add / delete / undelete buttons column on all table pages. \n Fix(UI): Product Permutations page preview Variations now shows when appropriate.

This commit is contained in:
2024-11-11 10:49:55 +00:00
parent 0422059669
commit fe524d6cb8
37 changed files with 165 additions and 274 deletions

View File

@@ -33,9 +33,8 @@
{{ model.ATTR_VALUE_CURRENT }}="" {{ model.ATTR_VALUE_PREVIOUS }}=""
></div>
</td>
<td class="{{ model.FLAG_ACTIVE }}">
<input class="{{ model.FLAG_ACTIVE }}" type="checkbox" checked {{ model.ATTR_VALUE_CURRENT }}="{{ model.FLAG_BOOL_TRUE }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ model.FLAG_BOOL_TRUE }}">
</td>
{% set active = true %}
{% include 'components/store/_td_active.html' %}
</tr>
{% else %}
<tr class="{{ model.FLAG_MANUFACTURING_PURCHASE_ORDER }}" {{ model.ATTR_ID_MANUFACTURING_PURCHASE_ORDER }}="{{ order.id_order }}">
@@ -79,8 +78,7 @@
{{ model.ATTR_VALUE_PREVIOUS }}="{{ order.price_total_local_VAT_incl }}"
></div>
</td>
<td class="{{ model.FLAG_ACTIVE }}">
<input class="{{ model.FLAG_ACTIVE }}" type="checkbox" {% if order.active %}checked{% endif %} {{ model.ATTR_VALUE_CURRENT }}="{{ order.active | lower }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ order.active | lower }}">
</td>
{% set active = order.active %}
{% include 'components/store/_td_active.html' %}
</tr>
{% endif %}

View File

@@ -23,9 +23,8 @@
>
<div class="{{ model.FLAG_ACCESS_LEVEL}}" {{ model.ATTR_ID_ACCESS_LEVEL }}="1">View</div>
</td>
<td class="{{ model.FLAG_ACTIVE }}">
<input class="{{ model.FLAG_ACTIVE }}" type="checkbox" checked {{ model.ATTR_VALUE_CURRENT }}="{{ model.FLAG_BOOL_TRUE }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ model.FLAG_BOOL_TRUE }}">
</td>
{% set active = true %}
{% include 'components/store/_td_active.html' %}
</tr>
{% else %}
<tr class="{{ model.FLAG_PRODUCT }}" {{ model.ATTR_ID_PRODUCT }}="{{ product.id_product }}">
@@ -55,8 +54,7 @@
>
<div class="{{ model.FLAG_ACCESS_LEVEL}}" {{ model.ATTR_ID_ACCESS_LEVEL }}="{{ product.id_access_level_required }}" {{ model.ATTR_VALUE_CURRENT }}="{{ product.id_access_level_required }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ product.id_access_level_required }}">{{ product.name_access_level_required }}</div>
</td>
<td class="{{ model.FLAG_ACTIVE }}">
<input class="{{ model.FLAG_ACTIVE }}" type="checkbox" {% if product.active %}checked{% endif %} {{ model.ATTR_VALUE_CURRENT }}="{{ product.active | lower }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ product.active | lower }}">
</td>
{% set active = product.active %}
{% include 'components/store/_td_active.html' %}
</tr>
{% endif %}

View File

@@ -15,9 +15,8 @@
<td class="{{ model.FLAG_ACCESS_LEVEL }}" {{ model.ATTR_VALUE_CURRENT }}="1" {{ model.ATTR_VALUE_PREVIOUS }}="1">
<div class="{{ model.FLAG_ACCESS_LEVEL}}" {{ model.ATTR_VALUE_CURRENT }}="1" {{ model.ATTR_VALUE_PREVIOUS }}="1">View</div>
</td>
<td class="{{ model.FLAG_ACTIVE }}">
<input class="{{ model.FLAG_ACTIVE }}" type="checkbox" checked {{ model.ATTR_VALUE_CURRENT }}="{{ model.FLAG_BOOL_TRUE }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ model.FLAG_BOOL_TRUE }}">
</td>
{% set active = true %}
{% include 'components/store/_td_active.html' %}
</tr>
{% else %}
<tr class="{{ model.FLAG_PRODUCT_CATEGORY }}" {{ model.ATTR_ID_PRODUCT_CATEGORY }}="{{ category.id_category }}">
@@ -37,8 +36,7 @@
<td class="{{ model.FLAG_ACCESS_LEVEL }}" {{ model.ATTR_VALUE_CURRENT }}="{{ category.id_access_level_required }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ category.id_access_level_required }}">
<div class="{{ model.FLAG_ACCESS_LEVEL}}" {{ model.ATTR_VALUE_CURRENT }}="{{ category.id_access_level_required }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ category.id_access_level_required }}">{{ category.name_access_level_required }}</div>
</td>
<td class="{{ model.FLAG_ACTIVE }}">
<input class="{{ model.FLAG_ACTIVE }}" type="checkbox" {% if category.active %}checked{% endif %} {{ model.ATTR_VALUE_CURRENT }}="{{ category.active | lower }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ category.active | lower }}">
</td>
{% set active = category.active %}
{% include 'components/store/_td_active.html' %}
</tr>
{% endif %}

View File

@@ -75,9 +75,8 @@
<td class="{{ model.FLAG_LATENCY_MANUFACTURE }}">
<input class="{{ model.FLAG_LATENCY_MANUFACTURE }}" type="number" min="0" value="1" {{ model.ATTR_VALUE_CURRENT }}="1" {{ model.ATTR_VALUE_PREVIOUS }}>
</td>
<td class="{{ model.FLAG_ACTIVE }}">
<input class="{{ model.FLAG_ACTIVE }}" type="checkbox" {{ model.ATTR_VALUE_CURRENT }}="{{ model.FLAG_BOOL_TRUE }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ model.FLAG_BOOL_TRUE }}" checked>
</td>
{% set active = true %}
{% include 'components/store/_td_active.html' %}
</tr>
{% else %}
<tr class="{{ model.FLAG_PRODUCT_PERMUTATION }}" {{ model.ATTR_ID_PRODUCT_PERMUTATION }}="{{ permutation.id_permutation }}">
@@ -166,8 +165,7 @@
<td class="{{ model.FLAG_LATENCY_MANUFACTURE }}">
<input class="{{ model.FLAG_LATENCY_MANUFACTURE }}" type="number" min="0" value="{{ permutation.latency_manufacture }}" {{ model.ATTR_VALUE_CURRENT }}="{{ permutation.latency_manufacture }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ permutation.latency_manufacture }}">
</td>
<td class="{{ model.FLAG_ACTIVE }}">
<input class="{{ model.FLAG_ACTIVE }}" type="checkbox" {{ model.ATTR_VALUE_CURRENT }}="{{ permutation.active | lower }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ permutation.active | lower }}" {% if permutation.active %}checked{% endif %}>
</td>
{% set active = permutation.active %}
{% include 'components/store/_td_active.html' %}
</tr>
{% endif %}

View File

@@ -15,15 +15,8 @@
<td class="{{ model.FLAG_PRODUCT_VARIATIONS}} {{ model.FLAG_COLLAPSED }}">
{% include 'components/store/_preview_product_variation_type_variations.html' %}
</td>
<td class="{{ model.FLAG_ACTIVE }}">
{#
<input class="{{ model.FLAG_ACTIVE }}" type="checkbox" checked {{ model.ATTR_VALUE_CURRENT }}="{{ model.FLAG_BOOL_TRUE }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ model.FLAG_BOOL_TRUE }}">
#}
<button type="button" class="{{ model.FLAG_ACTIVE }} {{ model.FLAG_DELETE }}"
{{ model.ATTR_VALUE_CURRENT }}="{{ model.FLAG_BOOL_TRUE }}"
{{ model.ATTR_VALUE_PREVIOUS }}="{{ model.FLAG_BOOL_TRUE }}"
>x</button>
</td>
{% set active = true %}
{% include 'components/store/_td_active.html' %}
</tr>
{% else %}
<tr class="{{ model.FLAG_PRODUCT_VARIATION_TYPE }}" {{ model.ATTR_ID_PRODUCT_VARIATION_TYPE }}="{{ variation_type.id_type }}">
@@ -52,14 +45,7 @@
<td class="{{ model.FLAG_PRODUCT_VARIATIONS}} {{ model.FLAG_COLLAPSED }}">
{% include 'components/store/_preview_product_variation_type_variations.html' %}
</td>
<td class="{{ model.FLAG_ACTIVE }}">
{#
<input class="{{ model.FLAG_ACTIVE }}" type="checkbox" {% if variation_type.active %}checked{% endif %} {{ model.ATTR_VALUE_CURRENT }}="{{ variation_type.active | lower }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ variation_type.active | lower }}">
#}
<button type="button" class="{{ model.FLAG_ACTIVE }} {% if variation_type.active %}{{ model.FLAG_DELETE }}{% endif %}"
{{ model.ATTR_VALUE_CURRENT }}="{{ variation_type.active | lower }}"
{{ model.ATTR_VALUE_PREVIOUS }}="{{ variation_type.active | lower }}"
>{% if variation_type.active %}x{% else %}+{% endif %}</button>
</td>
{% set active = variation_type.active %}
{% include 'components/store/_td_active.html' %}
</tr>
{% endif %}

View File

@@ -54,9 +54,8 @@
{{ model.ATTR_VALUE_PREVIOUS }}
/>
</td>
<td class="{{ model.FLAG_ACTIVE }}">
<input type="checkbox" class="{{ model.FLAG_ACTIVE }}" checked {{ model.ATTR_VALUE_CURRENT }}="{{ model.FLAG_BOOL_TRUE }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ model.FLAG_BOOL_TRUE }}" />
</td>
{% set active = true %}
{% include 'components/store/_td_active.html' %}
</tr>
{% else %}
<tr class="{{ model.FLAG_STOCK_ITEM }}" {{ model.ATTR_ID_STOCK_ITEM }}="{{ stock_item.id_stock }}">
@@ -142,8 +141,7 @@
{{ model.ATTR_VALUE_PREVIOUS }}="{{ model.format_datetime(stock_item.date_consumed) }}"
/>
</td>
<td class="{{ model.FLAG_ACTIVE }}">
<input type="checkbox" {{ "checked" if stock_item.active else "" }} {{ model.ATTR_VALUE_CURRENT }}="{{ stock_item.active | lower }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ stock_item.active | lower }}" />
</td>
{% set active = stock_item.active %}
{% include 'components/store/_td_active.html' %}
</tr>
{% endif %}

View File

@@ -27,9 +27,8 @@
<td class="{{ model.FLAG_CURRENCY }}" {{ model.ATTR_VALUE_CURRENT }}="" {{ model.ATTR_VALUE_PREVIOUS }}="">
{% include 'components/store/_preview_DDL_currency.html' %}
</td>
<td class="{{ model.FLAG_ACTIVE }}">
<input class="{{ model.FLAG_ACTIVE }}" type="checkbox" checked {{ model.ATTR_VALUE_CURRENT }}="{{ model.FLAG_BOOL_TRUE }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ model.FLAG_BOOL_TRUE }}">
</td>
{% set active = true %}
{% include 'components/store/_td_active.html' %}
</tr>
{% else %}
<tr class="{{ model.FLAG_SUPPLIER }}" {{ model.ATTR_ID_SUPPLIER }}="{{ supplier.id_supplier }}">
@@ -62,8 +61,7 @@
<td class="{{ model.FLAG_CURRENCY }}" {{ model.ATTR_VALUE_CURRENT }}="{{ currency.id_currency }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ currency.id_currency }}">
{% include 'components/store/_preview_DDL_currency.html' %}
</td>
<td class="{{ model.FLAG_ACTIVE }}">
<input class="{{ model.FLAG_ACTIVE }}" type="checkbox" checked {{ model.ATTR_VALUE_CURRENT }}="{{ supplier.active | lower }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ supplier.active | lower }}">
</td>
{% set active = supplier.active %}
{% include 'components/store/_td_active.html' %}
</tr>
{% endif %}

View File

@@ -22,9 +22,8 @@
{{ model.ATTR_VALUE_CURRENT }}="" {{ model.ATTR_VALUE_PREVIOUS }}=""
></div>
</td>
<td class="{{ model.FLAG_ACTIVE }}">
<input class="{{ model.FLAG_ACTIVE }}" type="checkbox" checked {{ model.ATTR_VALUE_CURRENT }}="{{ model.FLAG_BOOL_TRUE }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ model.FLAG_BOOL_TRUE }}">
</td>
{% set active = true %}
{% include 'components/store/_td_active.html' %}
</tr>
{% else %}
<tr class="{{ model.FLAG_SUPPLIER_PURCHASE_ORDER }}" {{ model.ATTR_ID_SUPPLIER_PURCHASE_ORDER }}="{{ order.id_order }}">
@@ -61,8 +60,7 @@
{{ model.ATTR_VALUE_PREVIOUS }}="{{ order.cost_total_local_VAT_incl }}"
></div>
</td>
<td class="{{ model.FLAG_ACTIVE }}">
<input class="{{ model.FLAG_ACTIVE }}" type="checkbox" checked {{ model.ATTR_VALUE_CURRENT }}="{{ order.active | lower }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ order.active | lower }}">
</td>
{% set active = order.active %}
{% include 'components/store/_td_active.html' %}
</tr>
{% endif %}

View File

@@ -0,0 +1,13 @@
{% with _active = (active is not defined or active or active is none) %}
<td class="{{ model.FLAG_ACTIVE }}">
{#
<input class="{{ model.FLAG_ACTIVE }}" type="checkbox" {% if active %}checked{% endif %} {{ model.ATTR_VALUE_CURRENT }}="{{ active | lower }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ active | lower }}">
#}
<button type="button" class="{{ model.FLAG_ACTIVE }} {% if active %}{{ model.FLAG_DELETE }}{% endif %}"
{{ model.ATTR_VALUE_CURRENT }}="{{ active | lower }}"
{{ model.ATTR_VALUE_PREVIOUS }}="{{ active | lower }}"
>{% if active %}x{% else %}+{% endif %}</button>
</td>
{% endwith %}