1. View, filter, and save Product Permutation. \n 2. Synchronised with Product Category page and all common functionality moved into base and base table css, js, and python files.

This commit is contained in:
2024-09-24 23:25:52 +01:00
parent 2954b2050c
commit 45ac0405b4
243 changed files with 6596 additions and 4460 deletions

View File

@@ -11,4 +11,38 @@
{% elif block_id == 'button_apply_filters' %}
<button id="{{ model.ID_BUTTON_APPLY_FILTERS }}" type="button" class="{{ model.FLAG_SUBMIT }}">Apply filters</button>
{% elif block_id == 'button_clear_filters' %}
{% elif block_id == 'buttons_table_default' %}
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_COLUMN }}">
<div class="{{ model.FLAG_ROW }}">
<div class="{{ model.FLAG_CONTAINER_INPUT }} {{ model.FLAG_COLUMN }}">
{% set block_id = 'button_apply_filters' %}
{% include 'components/common/buttons/_buttons_save_cancel.html' %}
</div>
<div class="{{ model.FLAG_CONTAINER_INPUT }} {{ model.FLAG_COLUMN }}">
{% set block_id = 'button_add' %}
{% include 'components/common/buttons/_buttons_save_cancel.html' %}
</div>
<div class="{{ model.FLAG_COLUMN }}">
<div class="{{ model.FLAG_CONTAINER_INPUT }}">
{% set block_id = 'button_save' %}
{% include 'components/common/buttons/_buttons_save_cancel.html' %}
</div>
<div class="{{ model.FLAG_CONTAINER_INPUT }}">
{% set block_id = 'button_cancel' %}
{% include 'components/common/buttons/_buttons_save_cancel.html' %}
</div>
</div>
</div>
</div>
{% elif block_id == 'container_buttons_save_cancel' %}
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_COLUMN }}">
<div class="{{ model.FLAG_CONTAINER_INPUT }}">
{% set block_id = 'button_save' %}
{% include 'components/common/buttons/_buttons_save_cancel.html' %}
</div>
<div class="{{ model.FLAG_CONTAINER_INPUT }}">
{% set block_id = 'button_cancel' %}
{% include 'components/common/buttons/_buttons_save_cancel.html' %}
</div>
</div>
{% endif %}

View File

@@ -1,8 +1,13 @@
{% if display_order is defined %}
<!-- Fix this
{# Fix this
<div class="{{ model.FLAG_SLIDER }} {{ model.FLAG_DISPLAY_ORDER }}" {{ model.ATTR_VALUE_CURRENT }}="{{ display_order }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ display_order }}"></div>
-->
<input type="number" class="{{ model.FLAG_SLIDER }} {{ model.FLAG_DISPLAY_ORDER }}" {{ model.ATTR_VALUE_CURRENT }}="{{ display_order }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ display_order }}" value="{{ display_order }}">
#}
<input type="number" class="{{ model.FLAG_SLIDER }} {{ model.FLAG_DISPLAY_ORDER }}"
{{ model.ATTR_VALUE_CURRENT }}="{{ display_order }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ display_order }}" value="{{ display_order }}">
{% else %}
<div class="{{ model.FLAG_SLIDER }} {{ model.FLAG_DISPLAY_ORDER }}" {{ model.ATTR_VALUE_CURRENT }} {{ model.ATTR_VALUE_PREVIOUS }}></div>
<input type="number" class="{{ model.FLAG_SLIDER }} {{ model.FLAG_DISPLAY_ORDER }}"
{{ model.ATTR_VALUE_CURRENT }} {{ model.ATTR_VALUE_PREVIOUS }}>
{#
<div class="{{ model.FLAG_SLIDER }} {{ model.FLAG_DISPLAY_ORDER }}" {{ model.ATTR_VALUE_CURRENT }} {{ model.ATTR_VALUE_PREVIOUS }}></div>
#}
{% endif %}

View File

@@ -0,0 +1 @@
<option value="0">Select</option>

View File

@@ -1,18 +0,0 @@
{% 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

@@ -1,20 +0,0 @@
{% 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 %}

View File

@@ -12,41 +12,3 @@
{% include 'components/common/buttons/_buttons_save_cancel.html' %}
</div>
</div>
<script type="module">
import Events from "{{ url_for('static', filename='js/lib/events.js') }}";
var idOverlayConfirm = "#{{ model.ID_OVERLAY_CONFIRM }}";
function hookupOverlayConfirm(callbackSuccess) {
/*
let overlay = document.querySelector("#{{ model.ID_OVERLAY_CONFIRM }}");
let textarea = overlay.querySelector('#{{ model.ID_TEXTAREA_CONFIRM }}');
let buttonCancel = overlay.querySelector('#{{ model.ID_BUTTON_CANCEL }}');
let buttonConfirm = overlay.querySelector('#{{ model.ID_BUTTON_CONFIRM }}');
*/
let selectorTextarea = idOverlayConfirm + ' textarea';
let selectorButtonCancel = idOverlayConfirm + ' button.' + flagCancel;
let selectorButtonConfirm = idOverlayConfirm + ' button.' + flagSubmit;
Events.initialiseEventHandler(selectorButtonCancel, flagInitialised, function(buttonCancel) {
buttonCancel.addEventListener('click', function() {
let overlay = document.querySelector(idOverlayConfirm);
overlay.style.visibility = 'hidden';
});
});
Events.initialiseEventHandler(selectorButtonConfirm, flagInitialised, function(buttonConfirm) {
buttonConfirm.addEventListener('click', function() {
let overlay = document.querySelector(idOverlayConfirm);
let textarea = overlay.querySelector('textarea');
overlay.style.visibility = 'hidden';
callbackSuccess(textarea.value);
});
});
}
function showOverlayConfirm() {
let overlay = document.querySelector(idOverlayConfirm);
overlay.classList.remove(flagCollapsed);
overlay.style.visibility = 'visible';
}
</script>

View File

@@ -8,27 +8,3 @@
{% include 'components/common/buttons/_buttons_save_cancel.html' %}
</div>
</div>
<script type="module">
import Events from "{{ url_for('static', filename='js/lib/events.js') }}";
var idOverlayError = "#{{ model.ID_OVERLAY_ERROR}}";
function hookupOverlayError() {
let overlay = document.querySelector(idOverlayError);
let selectorButtonCancel = idOverlayError + ' button.' + flagCancel;
Events.initialiseEventHandler(selectorButtonCancel, flagInitialised, function(buttonCancel) {
buttonCancel.onclick = function() {
overlay.style.visibility = 'hidden';
};
});
}
hookupOverlayError();
function showOverlayError(msgError) {
let overlay = document.querySelector("#{{ model.ID_OVERLAY_ERROR }}");
let labelError = overlay.querySelector('#{{ model.ID_LABEL_ERROR }}');
labelError.innerText = msgError;
overlay.style.visibility = 'visible';
}
</script>

View File

@@ -0,0 +1,17 @@
{% with _is_blank_row = (is_blank_row or model.currencies | length == 0 or currency is none) %}
{% if not _is_blank_row %}
<div
class="{{ model.FLAG_CURRENCY }}"
{{ model.ATTR_VALUE_CURRENT }}="{{ currency.id_currency }}"
{{ model.ATTR_VALUE_PREVIOUS }}="{{ currency.id_currency }}"
>{{ currency.symbol }}</div>
{% else %}
<div
class="{{ model.FLAG_CURRENCY }}"
{{ model.ATTR_VALUE_CURRENT }}=""
{{ model.ATTR_VALUE_PREVIOUS }}=""
></div>
{% endif %}
{% endwith %}

View File

@@ -0,0 +1,14 @@
{% if not is_blank_row %}
<div
class="{{ model.FLAG_PRODUCT }}"
{{ model.ATTR_VALUE_CURRENT }}="{{ product.id_product }}"
{{ model.ATTR_VALUE_PREVIOUS }}="{{ product.id_product }}"
>{{ product.name }}</div>
{% else %}
<div
class="{{ model.FLAG_PRODUCT }}"
{{ model.ATTR_VALUE_CURRENT }}=""
{{ model.ATTR_VALUE_PREVIOUS }}=""
></div>
{% endif %}

View File

@@ -0,0 +1,14 @@
{% if not is_blank_row %}
<div
class="{{ model.FLAG_PRODUCT_CATEGORY }}"
{{ model.ATTR_VALUE_CURRENT }}="{{ category.id_category }}"
{{ model.ATTR_VALUE_PREVIOUS }}="{{ category.id_category }}"
>{{ category.name }}</div>
{% else %}
<div
class="{{ model.FLAG_PRODUCT_CATEGORY }}"
{{ model.ATTR_VALUE_CURRENT }}=""
{{ model.ATTR_VALUE_PREVIOUS }}=""
></div>
{% endif %}

View File

@@ -0,0 +1,17 @@
{% with _is_blank_row = (is_blank_row or units_measurement_time_dict | length == 0 or permutation.id_unit_measurement_interval_expiration_unsealed is none) %}
{% if not _is_blank_row %}
{% set interval_recurrence = units_measurement_time_dict[permutation.id_unit_measurement_interval_expiration_unsealed] %}
<div
class="{{ model.FLAG_UNIT_MEASUREMENT_INTERVAL_EXPIRATION_UNSEALED }} {% if not permutation.does_expire_faster_once_unsealed %}{{ model.FLAG_COLLAPSED }}{% endif %}"
{{ model.ATTR_VALUE_CURRENT }}="{{ permutation.id_unit_measurement_interval_expiration_unsealed }}"
{{ model.ATTR_VALUE_PREVIOUS }}="{{ permutation.id_unit_measurement_interval_expiration_unsealed }}"
>{{ interval_recurrence.name_singular }}</div>
{% else %}
<div
class="{{ model.FLAG_UNIT_MEASUREMENT_INTERVAL_EXPIRATION_UNSEALED }} {{ model.FLAG_COLLAPSED }}"
{{ model.ATTR_VALUE_CURRENT }}=""
{{ model.ATTR_VALUE_PREVIOUS }}=""
></div>
{% endif %}
{% endwith %}

View File

@@ -0,0 +1,19 @@
{#
<select class="{{ model.FLAG_UNIT_MEASUREMENT_INTERVAL_RECURRENCE }}" value="{{ permutation.id_unit_measurement_interval_recurrence }}" {{ model.ATTR_VALUE_CURRENT }}="{{ permutation.id_unit_measurement_interval_recurrence }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ permutation.id_unit_measurement_interval_recurrence }}"></select>
#}
{% with _is_blank_row = (is_blank_row or units_measurement_time | length == 0 or permutation.id_unit_measurement_interval_recurrence is none) %}
{% if not _is_blank_row %}
{% set interval_recurrence = units_measurement_time[permutation.id_unit_measurement_interval_recurrence] | console_log %}
<div
class="{{ model.FLAG_UNIT_MEASUREMENT_INTERVAL_RECURRENCE }} {% if not permutation.is_subscription %}{{ model.FLAG_COLLAPSED }}{% endif %}"
{{ model.ATTR_VALUE_CURRENT }}="{{ permutation.id_unit_measurement_interval_recurrence }}"
{{ model.ATTR_VALUE_PREVIOUS }}="{{ permutation.id_unit_measurement_interval_recurrence }}"
>{{ interval_recurrence.name_singular }}</div>
{% else %}
<div
class="{{ model.FLAG_UNIT_MEASUREMENT_INTERVAL_RECURRENCE }} {{ model.FLAG_COLLAPSED }}"
{{ model.ATTR_VALUE_CURRENT }}=""
{{ model.ATTR_VALUE_PREVIOUS }}=""
></div>
{% endif %}
{% endwith %}

View File

@@ -0,0 +1,21 @@
{#
<select class="{{ model.FLAG_UNIT_MEASUREMENT_QUANTITY }}" {{ model.ATTR_VALUE_CURRENT }}="{{ permutation.id_unit_measurement_quantity }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ permutation.id_unit_measurement_quantity }}"></select>
#}
{% with _is_blank_row = (is_blank_row or units_measurement_dict | length == 0 or permutation.id_unit_measurement_quantity is none) %}
{% if not _is_blank_row %}
{% set interval_recurrence = units_measurement_dict[permutation.id_unit_measurement_quantity] | console_log %}
<div
class="{{ model.FLAG_UNIT_MEASUREMENT_QUANTITY }}"
{{ model.ATTR_VALUE_CURRENT }}="{{ permutation.id_unit_measurement_quantity }}"
{{ model.ATTR_VALUE_PREVIOUS }}="{{ permutation.id_unit_measurement_quantity }}"
>{{ interval_recurrence.name_singular }}</div>
{% else %}
<div
class="{{ model.FLAG_UNIT_MEASUREMENT_QUANTITY }}"
{{ model.ATTR_VALUE_CURRENT }}=""
{{ model.ATTR_VALUE_PREVIOUS }}=""
></div>
{% endif %}
{% endwith %}

View File

@@ -0,0 +1,22 @@
{#
{% 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 %}
#}
{% with _is_blank_row = (is_blank_row or variation_tree is not defined or variation_tree is none or is_blank_row is not defined or is_blank_row) %}
{% if not _is_blank_row %}
{% set str_ids_variations = variation_tree.to_variation_id_pairs_str() %}
{% set str_variations = variation_tree.to_preview_str() %}
<div
class="{{ model.FLAG_PRODUCT_VARIATIONS }}"
{{ model.ATTR_VALUE_CURRENT }}="{{ str_ids_variations }}"
{{ model.ATTR_VALUE_PREVIOUS }}="{{ str_ids_variations }}"
>{{ str_variations }}</div>
{% else %}
<div class="{{ model.FLAG_PRODUCT_VARIATIONS }}" {{ model.ATTR_VALUE_CURRENT }} {{ model.ATTR_VALUE_PREVIOUS }}></div>
{% endif %}
{% endwith %}

View File

@@ -0,0 +1,15 @@
{% with _is_blank_row = (is_blank_row or variation_tree is not defined or is_blank_row is not defined) %}
{% 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) %}
<div
class="{{ model.FLAG_PRODUCT_VARIATIONS }}"
{{ model.ATTR_VALUE_CURRENT }}="{{ json_str_variation_types }}"
{{ model.ATTR_VALUE_PREVIOUS }}="{{ json_str_variation_types }}"
>{{ model.join_with_linebreaks(names_variation_type) }}</div>
{% else %}
<div class="{{ model.FLAG_PRODUCT_VARIATIONS }}" {{ model.ATTR_VALUE_CURRENT }} {{ model.ATTR_VALUE_PREVIOUS }}></div>
{% endif %}
{% endwith %}

View File

@@ -1,70 +0,0 @@
{% if is_blank_row %}
<tr class="{{ model.FLAG_ROW_NEW }}" {{ model.ATTR_ID_PERMUTATION }}>
<td class="{{ model.FLAG_PRODUCT_CATEGORY }}">
<select class="{{ model.FLAG_PRODUCT_CATEGORY}}" {{ model.ATTR_VALUE_CURRENT }} {{ model.ATTR_VALUE_PREVIOUS }}>
{% for cat in model.category_list.categories %}
<option value="{{ cat.id_category }}">{{ cat.name }}</option>
{% endfor %}
</select>
</td>
<td class="{{ model.FLAG_PRODUCT }}">
<select class="{{ model.FLAG_PRODUCT }}" {{ model.ATTR_VALUE_CURRENT }} {{ model.ATTR_VALUE_PREVIOUS }}></select>
</td>
<td class="{{ model.FLAG_VARIATIONS }}">
<textarea class="{{ model.FLAG_VARIATIONS }}" {{ model.ATTR_VALUE_CURRENT }} {{ model.ATTR_VALUE_PREVIOUS }}></textarea>
</td>
<td class="{{ model.FLAG_QUANTITY_STOCK }}">
<input class="{{ model.FLAG_QUANTITY_STOCK }}" type="number" min="0" value="0" {{ model.ATTR_VALUE_CURRENT }}="0" {{ model.ATTR_VALUE_PREVIOUS }}>
</td>
<td class="{{ model.FLAG_QUANTITY_MIN }}">
<input class="{{ model.FLAG_QUANTITY_MIN }}" type="number" min="0" value="0" {{ model.ATTR_VALUE_CURRENT }}="0" {{ model.ATTR_VALUE_PREVIOUS }}>
</td>
<td class="{{ model.FLAG_QUANTITY_MAX }}">
<input class="{{ model.FLAG_QUANTITY_MAX }}" type="number" min="0" value="0" {{ model.ATTR_VALUE_CURRENT }}="0" {{ model.ATTR_VALUE_PREVIOUS }}>
</td>
<td class="{{ model.FLAG_COST_LOCAL_VAT_INCL }}">
</td>
<!-- <td><strong>{ { permutation.output_currency() }}</strong>{ { permutation.get_price_local() }}</td> -->
<td class="{{ model.FLAG_DETAIL }}">
<a>Detail</a>
</td>
</tr>
{% else %}
<tr {{ model.ATTR_ID_PERMUTATION }}="{{ permutation.id_permutation }}">
<td class="{{ model.FLAG_PRODUCT_CATEGORY }}">
<select class="{{ model.FLAG_PRODUCT_CATEGORY }}" {{ model.ATTR_VALUE_CURRENT }}="{{ category.id_category }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ category.id_category }}"> <!-- {{ model.ATTR_ID_CATEGORY }}="{{ category.id_category }}" -->
{% for c in model.category_list.categories %}
<option value="{{ c.id_category }}" {% if c.id_category == category.id_category %}{% endif %}>{{ c.name }}</option>
{% endfor %}
</select>
</td>
<td class="{{ model.FLAG_PRODUCT }}">
<select class="{{ model.FLAG_PRODUCT }}" {{ model.ATTR_VALUE_CURRENT }}="{{ product.id_product }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ product.id_product }}"> <!-- {{ model.ATTR_ID_PRODUCT }}="{{ product.id_product }} -->
{% for p in model.category_list.categories[model.category_list.get_index_category_from_id(category.id_category)].products %}
<option value="{{ p.id_product }}" {% if p.id_product == product.id_product %}{% endif %}>{{ p.name }}</option>
{% endfor %}
</select>
</td>
<td class="{{ model.FLAG_VARIATIONS }}">
{% set block_id = 'Textarea_Product_Permutation_Variations' %}
{% include 'layouts/_shared_store.html' %}
</td>
<td class="{{ model.FLAG_QUANTITY_STOCK }}">
<input class="{{ model.FLAG_QUANTITY_STOCK }}" type="number" min="0" value="{{ permutation.quantity_stock }}" {{ model.ATTR_VALUE_CURRENT }}="{{ permutation.quantity_stock }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ permutation.quantity_stock }}">
</td>
<td class="{{ model.FLAG_QUANTITY_MIN }}">
<input class="{{ model.FLAG_QUANTITY_MIN }}" type="number" min="0" value="{{ permutation.quantity_min }}" {{ model.ATTR_VALUE_CURRENT }}="{{ permutation.quantity_min }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ permutation.quantity_min }}">
</td>
<td class="{{ model.FLAG_QUANTITY_MAX }}">
<input class="{{ model.FLAG_QUANTITY_MAX }}" type="number" min="0" value="{{ permutation.quantity_max }}" {{ model.ATTR_VALUE_CURRENT }}="{{ permutation.quantity_max }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ permutation.quantity_max }}">
</td>
<td class="{{ model.FLAG_COST_LOCAL_VAT_INCL }}">
<strong>{{ permutation.output_currency() }}</strong>{{ permutation.cost_local }}
</td>
<!-- <td><strong>{{ permutation.output_currency() }}</strong>{ { permutation.get_price_local() }}</td> -->
<td class="{{ model.FLAG_DETAIL }}">
<a>Detail</a>
</td>
</tr>
{% endif %}

View File

@@ -1,16 +1,16 @@
{% if is_blank_row %}
<tr class="{{ model.FLAG_ROW_NEW }}" {{ model.ATTR_ID_CATEGORY }}>
<tr class="{{ model.FLAG_ROW_NEW }}" {{ model.ATTR_ID_PRODUCT_CATEGORY }}>
<td class="{{ model.FLAG_DISPLAY_ORDER }}">
{% include 'components/common/buttons/_slider_display_order.html' %}
</td>
<td class="{{ model.FLAG_PRODUCT_CATEGORY }}">
<textarea class="{{ model.FLAG_PRODUCT_CATEGORY }}" {{ model.ATTR_ID_CATEGORY }} {{ model.ATTR_VALUE_CURRENT }} {{ model.ATTR_VALUE_PREVIOUS }}></textarea>
<textarea class="{{ model.FLAG_PRODUCT_CATEGORY }}" {{ model.ATTR_ID_PRODUCT_CATEGORY }} {{ model.ATTR_VALUE_CURRENT }} {{ model.ATTR_VALUE_PREVIOUS }}></textarea>
</td>
<td class="{{ model.FLAG_NAME }}">
<textarea class="{{ model.FLAG_NAME }}" {{ model.ATTR_VALUE_CURRENT }} {{ model.ATTR_VALUE_PREVIOUS }}></textarea>
</td>
<td class="{{ model.FLAG_VARIATIONS }}">
<textarea class="{{ model.FLAG_VARIATIONS }}" {{ model.ATTR_VALUE_CURRENT }} {{ model.ATTR_VALUE_PREVIOUS }}></textarea>
<td class="{{ model.FLAG_PRODUCT_VARIATIONS }}">
<textarea class="{{ model.FLAG_PRODUCT_VARIATIONS }}" {{ model.ATTR_VALUE_CURRENT }} {{ model.ATTR_VALUE_PREVIOUS }}></textarea>
</td>
<td class="{{ model.FLAG_ACCESS_LEVEL }}" {{ model.ATTR_ID_ACCESS_LEVEL }}="1" {{ model.FLAG_ACCESS_LEVEL_REQUIRED }}="View">
<div class="{{ model.FLAG_ACCESS_LEVEL}}" {{ model.ATTR_ID_ACCESS_LEVEL }}="1">View</div>
@@ -31,9 +31,9 @@
<td class="{{ model.FLAG_NAME }}">
<textarea class="{{ model.FLAG_NAME }}" {{ model.ATTR_VALUE_CURRENT }}="{{ product.name }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ product.name }}">{{ product.name }}</textarea>
</td>
<td class="{{ model.FLAG_VARIATIONS }}">
<td class="{{ model.FLAG_PRODUCT_VARIATIONS }}">
{% include 'components/common/inputs/_textarea_product_variation_types.html' %}
<textarea class="{{ model.FLAG_VARIATIONS }}" {{ model.ATTR_VALUE_CURRENT }}="{{ product.description }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ product.description }}">{{ product.description }}</textarea>
<textarea class="{{ model.FLAG_PRODUCT_VARIATIONS }}" {{ model.ATTR_VALUE_CURRENT }}="{{ product.description }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ product.description }}">{{ product.description }}</textarea>
</td>
<td class="{{ model.FLAG_ACCESS_LEVEL }}" {{ model.ATTR_ID_ACCESS_LEVEL }}="1" {{ model.FLAG_ACCESS_LEVEL_REQUIRED }}="{{ product.name_access_level_required }}">
<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>

View File

@@ -1,5 +1,5 @@
{% if is_blank_row %}
<tr class="{{ model.FLAG_ROW_NEW }}" {{ model.ATTR_ID_CATEGORY }}>
<tr class="{{ model.FLAG_ROW_NEW }}" {{ model.ATTR_ID_PRODUCT_CATEGORY }}>
<td class="{{ model.FLAG_DISPLAY_ORDER }}">
{% include 'components/common/buttons/_slider_display_order.html' %}
</td>
@@ -12,8 +12,8 @@
<td class="{{ model.FLAG_DESCRIPTION }}">
<textarea class="{{ model.FLAG_DESCRIPTION }}" {{ model.ATTR_VALUE_CURRENT }} {{ model.ATTR_VALUE_PREVIOUS }}></textarea>
</td>
<td class="{{ model.FLAG_ACCESS_LEVEL }}" {{ model.ATTR_ID_ACCESS_LEVEL }}="1" {{ model.FLAG_ACCESS_LEVEL_REQUIRED }}="View">
<div class="{{ model.FLAG_ACCESS_LEVEL}}" {{ model.ATTR_ID_ACCESS_LEVEL }}="1">View</div>
<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 }}="true" {{ model.ATTR_VALUE_PREVIOUS }}="true">
@@ -34,8 +34,8 @@
<td class="{{ model.FLAG_DESCRIPTION }}">
<textarea class="{{ model.FLAG_DESCRIPTION }}" {{ model.ATTR_VALUE_CURRENT }}="{{ category.description }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ category.description }}">{{ category.description }}</textarea>
</td>
<td class="{{ model.FLAG_ACCESS_LEVEL }}" {{ model.ATTR_ID_ACCESS_LEVEL }}="1" {{ model.FLAG_ACCESS_LEVEL_REQUIRED }}="{{ category.name_access_level_required }}">
<div class="{{ model.FLAG_ACCESS_LEVEL}}" {{ model.ATTR_ID_ACCESS_LEVEL }}="{{ category.id_access_level_required }}" {{ 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 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 }}">

View File

@@ -0,0 +1,163 @@
{% if is_blank_row %}
<tr class="{{ model.FLAG_ROW_NEW }}" {{ model.ATTR_ID_PERMUTATION }}>
<td class="{{ model.FLAG_PRODUCT_CATEGORY }}" {{ model.ATTR_VALUE_CURRENT }}="0" {{ model.ATTR_VALUE_PREVIOUS }}="0">
<select class="{{ model.FLAG_PRODUCT_CATEGORY}}" {{ model.ATTR_VALUE_CURRENT }}="0" {{ model.ATTR_VALUE_PREVIOUS }}="0">
{% include 'components/common/inputs/_option_blank.html' %}
{% for cat in model.category_list_filters.categories %}
<option value="{{ cat.id_category }}">{{ cat.name }}</option>
{% endfor %}
</select>
</td>
<td class="{{ model.FLAG_PRODUCT }}" {{ model.ATTR_VALUE_CURRENT }}="0" {{ model.ATTR_VALUE_PREVIOUS }}="0">
<select class="{{ model.FLAG_PRODUCT }}" {{ model.ATTR_VALUE_CURRENT }}="0" {{ model.ATTR_VALUE_PREVIOUS }}="0">
{% include 'components/common/inputs/_option_blank.html' %}
{% for product in model.category_list_filters.categories[0].products %}
<option value="{{ product.id_product }}">{{ product.name }}</option>
{% endfor %}
</select>
</td>
<td class="{{ model.FLAG_PRODUCT_VARIATIONS }} {{ model.FLAG_COLLAPSED}}" {{ model.ATTR_VALUE_CURRENT }} {{ model.ATTR_VALUE_PREVIOUS }}>
{% include 'components/store/_preview_product_permutation_variations.html' %}
</td>
<td class="{{ model.FLAG_DESCRIPTION}}">
<textarea class="{{ model.FLAG_DESCRIPTION }}" {{ model.ATTR_VALUE_CURRENT }} {{ model.ATTR_VALUE_PREVIOUS }}></textarea>
</td>
<td class="{{ model.FLAG_QUANTITY_STOCK }}">
<input class="{{ model.FLAG_QUANTITY_STOCK }}" type="number" min="0" value="0" {{ model.ATTR_VALUE_CURRENT }}="0" {{ model.ATTR_VALUE_PREVIOUS }}="0">
</td>
<td class="{{ model.FLAG_QUANTITY_MIN }}">
<input class="{{ model.FLAG_QUANTITY_MIN }}" type="number" min="0" value="1" {{ model.ATTR_VALUE_CURRENT }}="1" {{ model.ATTR_VALUE_PREVIOUS }}="1">
</td>
<td class="{{ model.FLAG_QUANTITY_MAX }}">
<input class="{{ model.FLAG_QUANTITY_MAX }}" type="number" min="0" value="1" {{ model.ATTR_VALUE_CURRENT }}="1" {{ model.ATTR_VALUE_PREVIOUS }}="1">
</td>
<td class="{{ model.FLAG_COUNT_UNIT_MEASUREMENT_PER_QUANTITY_STEP }}">
<input class="{{ model.FLAG_COUNT_UNIT_MEASUREMENT_PER_QUANTITY_STEP }}"
type="number" min="0" value="1" {{ model.ATTR_VALUE_CURRENT }}="1" {{ model.ATTR_VALUE_PREVIOUS }}="1">
</td>
<td class="{{ model.FLAG_UNIT_MEASUREMENT_QUANTITY }}" {{ model.ATTR_VALUE_CURRENT }} {{ model.ATTR_VALUE_PREVIOUS }}>
{% include 'components/store/_preview_DDL_product_permutation_unit_measurement_quantity.html' %}
</td>
<td class="{{ model.FLAG_IS_SUBSCRIPTION }}">
<input class="{{ model.FLAG_IS_SUBSCRIPTION }}" type="checkbox" {{ model.ATTR_VALUE_CURRENT }}="false" {{ model.ATTR_VALUE_PREVIOUS }}="false">
</td>
<td class="{{ model.FLAG_COUNT_UNIT_MEASUREMENT_INTERVAL_RECURRENCE }}">
<input class="{{ model.FLAG_COUNT_UNIT_MEASUREMENT_INTERVAL_RECURRENCE }} {{ model.FLAG_COLLAPSED }}"
type="number" min="0" value="1" {{ model.ATTR_VALUE_CURRENT }}="1" {{ model.ATTR_VALUE_PREVIOUS }}="1">
</td>
<td class="{{ model.FLAG_UNIT_MEASUREMENT_INTERVAL_RECURRENCE }}" {{ model.ATTR_VALUE_CURRENT }} {{ model.ATTR_VALUE_PREVIOUS }}>
{% include 'components/store/_preview_DDL_product_permutation_interval_recurrence.html' %}
</td>
<td class="{{ model.FLAG_ID_STRIPE_PRODUCT }}">
<input class="{{ model.FLAG_ID_STRIPE_PRODUCT }}" type="text" {{ model.ATTR_VALUE_CURRENT }} {{ model.ATTR_VALUE_PREVIOUS }}>
</td>
<td class="{{ model.FLAG_DOES_EXPIRE_FASTER_ONCE_UNSEALED }}">
<input class="{{ model.FLAG_DOES_EXPIRE_FASTER_ONCE_UNSEALED }}" type="checkbox" {{ model.ATTR_VALUE_CURRENT }}="false" {{ model.ATTR_VALUE_PREVIOUS }}="false">
</td>
<td class="{{ model.FLAG_COUNT_UNIT_MEASUREMENT_INTERVAL_EXPIRATION_UNSEALED }}">
<input class="{{ model.FLAG_COUNT_UNIT_MEASUREMENT_INTERVAL_EXPIRATION_UNSEALED }} {{ model.FLAG_COLLAPSED }}"
type="number" min="0" value="1" {{ model.ATTR_VALUE_CURRENT }}="1" {{ model.ATTR_VALUE_PREVIOUS }}="1">
</td>
<td class="{{ model.FLAG_UNIT_MEASUREMENT_INTERVAL_EXPIRATION_UNSEALED }}" {{ model.ATTR_VALUE_CURRENT }} {{ model.ATTR_VALUE_PREVIOUS }}>
{% include 'components/store/_preview_DDL_product_permutation_interval_expiration_unsealed.html' %}
</td>
<td class="{{ model.FLAG_COST_LOCAL }}">
<input class="{{ model.FLAG_COST_LOCAL }}" type="number" min="0" step="0.01"
value="0" {{ model.ATTR_VALUE_CURRENT }}="0" {{ model.ATTR_VALUE_PREVIOUS }}>
</td>
<td class="{{ model.FLAG_CURRENCY_COST }}" {{ model.ATTR_VALUE_CURRENT }} {{ model.ATTR_VALUE_PREVIOUS }}>
{% include 'components/store/_preview_DDL_currency.html' %}
</td>
<td class="{{ model.FLAG_PROFIT_LOCAL_MIN }}">
<input class="{{ model.FLAG_PROFIT_LOCAL_MIN }}" type="number" min="0" step="0.01"
value="0" {{ model.ATTR_VALUE_CURRENT }}="0" {{ model.ATTR_VALUE_PREVIOUS }}>
</td>
<td class="{{ model.FLAG_LATENCY_MANUFACTURE_DAYS }}">
<input class="{{ model.FLAG_LATENCY_MANUFACTURE_DAYS }}" 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 }}="true" {{ model.ATTR_VALUE_PREVIOUS }}="true" checked>
</td>
</tr>
{% else %}
<tr {{ model.ATTR_ID_PRODUCT_PERMUTATION }}="{{ permutation.id_permutation }}">
<td class="{{ model.FLAG_PRODUCT_CATEGORY }}" {{ model.ATTR_VALUE_CURRENT }}="{{ permutation.id_category }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ permutation.id_category }}">
{% include 'components/store/_preview_DDL_product_category.html' %}
</td>
<td class="{{ model.FLAG_PRODUCT }}" {{ model.ATTR_VALUE_CURRENT }}="{{ permutation.id_product }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ permutation.id_product }}">
{% include 'components/store/_preview_DDL_product.html' %}
</td>
{% set variation_tree = permutation.variation_tree %}
{% set str_ids_variations = variation_tree.to_variation_id_pairs_str() if not (variation_tree is none) else '' %}
<td class="{{ model.FLAG_PRODUCT_VARIATIONS }} {{ model.FLAG_COLLAPSED }}" {{ model.ATTR_VALUE_CURRENT }}="{{ str_ids_variations }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ str_ids_variations }}">
{% include 'components/store/_preview_product_permutation_variations.html' %}
</td>
<td class="{{ model.FLAG_DESCRIPTION}}" {{ model.ATTR_VALUE_CURRENT }}="{{ permutation.description }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ permutation.description }}">
<textarea class="{{ model.FLAG_DESCRIPTION }}" {{ model.ATTR_VALUE_CURRENT }}="{{ permutation.description }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ permutation.description }}">{{ permutation.description }}</textarea>
</td>
<td class="{{ model.FLAG_QUANTITY_STOCK }}">
<input class="{{ model.FLAG_QUANTITY_STOCK }}" type="number" min="0" value="{{ permutation.quantity_stock }}" {{ model.ATTR_VALUE_CURRENT }}="{{ permutation.quantity_stock }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ permutation.quantity_stock }}">
</td>
<td class="{{ model.FLAG_QUANTITY_MIN }}">
<input class="{{ model.FLAG_QUANTITY_MIN }}" type="number" min="0" value="{{ permutation.quantity_min }}" {{ model.ATTR_VALUE_CURRENT }}="{{ permutation.quantity_min }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ permutation.quantity_min }}">
</td>
<td class="{{ model.FLAG_QUANTITY_MAX }}">
<input class="{{ model.FLAG_QUANTITY_MAX }}" type="number" min="0" value="{{ permutation.quantity_max }}" {{ model.ATTR_VALUE_CURRENT }}="{{ permutation.quantity_max }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ permutation.quantity_max }}">
</td>
<td class="{{ model.FLAG_COUNT_UNIT_MEASUREMENT_PER_QUANTITY_STEP }}">
<input class="{{ model.FLAG_COUNT_UNIT_MEASUREMENT_PER_QUANTITY_STEP }}" type="number" min="0" value="{{ permutation.count_unit_measurement_per_quantity_step }}" {{ model.ATTR_VALUE_CURRENT }}="{{ permutation.count_unit_measurement_per_quantity_step }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ permutation.count_unit_measurement_per_quantity_step }}">
</td>
<td class="{{ model.FLAG_UNIT_MEASUREMENT_QUANTITY }}" {{ model.ATTR_VALUE_CURRENT }}="{{ permutation.id_unit_measurement_quantity }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ permutation.id_unit_measurement_quantity }}">
{% include 'components/store/_preview_DDL_product_permutation_unit_measurement_quantity.html' %}
</td>
<td class="{{ model.FLAG_IS_SUBSCRIPTION }}">
<input class="{{ model.FLAG_IS_SUBSCRIPTION }}" type="checkbox" {{ model.ATTR_VALUE_CURRENT }}="{{ permutation.is_subscription }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ permutation.is_subscription }}">
</td>
<td class="{{ model.FLAG_COUNT_UNIT_MEASUREMENT_INTERVAL_RECURRENCE }}">
{% set value = permutation.count_interval_recurrence if permutation.count_interval_recurrence is not none else '' %}
<input class="{{ model.FLAG_COUNT_UNIT_MEASUREMENT_INTERVAL_RECURRENCE }} {% if not permutation.is_subscription %}{{ model.FLAG_COLLAPSED }}{% endif %}"
type="number" min="0" value="{{ value }}" {{ model.ATTR_VALUE_CURRENT }}="{{ value }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ value }}">
</td>
{% set value = permutation.id_unit_measurement_interval_recurrence if permutation.id_unit_measurement_interval_recurrence is not none else '' %}
<td class="{{ model.FLAG_UNIT_MEASUREMENT_INTERVAL_RECURRENCE }}" {{ model.ATTR_VALUE_CURRENT }}="{{ value }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ value }}">
{% include 'components/store/_preview_DDL_product_permutation_interval_recurrence.html' %}
</td>
<td class="{{ model.FLAG_ID_STRIPE_PRODUCT }}">
{% set value = permutation.id_stripe_product if permutation.id_stripe_product is not none else '' %}
<input class="{{ model.FLAG_ID_STRIPE_PRODUCT }}" type="text" value="{{ value }}" {{ model.ATTR_VALUE_CURRENT }}="{{ value }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ value }}">
</td>
<td class="{{ model.FLAG_DOES_EXPIRE_FASTER_ONCE_UNSEALED }}">
<input class="{{ model.FLAG_DOES_EXPIRE_FASTER_ONCE_UNSEALED }}" type="checkbox" {{ model.ATTR_VALUE_CURRENT }}="{{ permutation.does_expire_faster_once_unsealed }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ permutation.does_expire_faster_once_unsealed }}">
</td>
<td class="{{ model.FLAG_COUNT_UNIT_MEASUREMENT_INTERVAL_EXPIRATION_UNSEALED }}">
{% set value = permutation.count_interval_expiration_unsealed if permutation.count_interval_expiration_unsealed is not none else '' %}
<input class="{{ model.FLAG_COUNT_UNIT_MEASUREMENT_INTERVAL_EXPIRATION_UNSEALED }} {% if not permutation.does_expire_faster_once_unsealed %}{{ model.FLAG_COLLAPSED }}{% endif %}"
type="number" min="0" value="{{ value }}" {{ model.ATTR_VALUE_CURRENT }}="{{ value }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ value }}">
</td>
{% set value = permutation.id_unit_measurement_interval_expiration_unsealed if permutation.id_unit_measurement_interval_expiration_unsealed is not none else '' %}
<td class="{{ model.FLAG_UNIT_MEASUREMENT_INTERVAL_EXPIRATION_UNSEALED }}" {{ model.ATTR_VALUE_CURRENT }}="{{ value }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ value }}">
{% include 'components/store/_preview_DDL_product_permutation_interval_expiration_unsealed.html' %}
</td>
<td class="{{ model.FLAG_COST_LOCAL }}">
<input class="{{ model.FLAG_COST_LOCAL }}" type="number" min="0" value="{{ permutation.cost_local }}" {{ model.ATTR_VALUE_CURRENT }}="{{ permutation.cost_local }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ permutation.cost_local }}">
</td>
{% set currency = permutation.currency_cost %}
<td class="{{ model.FLAG_CURRENCY_COST }}" {{ 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_PROFIT_LOCAL_MIN }}">
<input class="{{ model.FLAG_PROFIT_LOCAL_MIN }}" type="number" min="0" value="{{ permutation.profit_local_min }}" {{ model.ATTR_VALUE_CURRENT }}="{{ permutation.profit_local_min }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ permutation.profit_local_min }}">
</td>
<td class="{{ model.FLAG_LATENCY_MANUFACTURE_DAYS }}">
<input class="{{ model.FLAG_LATENCY_MANUFACTURE_DAYS }}" type="number" min="0" value="{{ permutation.latency_manufacture_days }}" {{ model.ATTR_VALUE_CURRENT }}="{{ permutation.latency_manufacture_days }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ permutation.latency_manufacture_days }}">
</td>
<td class="{{ model.FLAG_ACTIVE }}">
<input class="{{ model.FLAG_ACTIVE }}" type="checkbox" {{ model.ATTR_VALUE_CURRENT }}="{{ permutation.active }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ permutation.active }}" {% if permutation.active %}checked{% endif %}>
</td>
</tr>
{% endif %}

View File

@@ -11,8 +11,8 @@
<td class="{{ model.FLAG_PRODUCT }}">
<select class="{{ model.FLAG_PRODUCT }}" {{ model.ATTR_VALUE_CURRENT }} {{ model.ATTR_VALUE_PREVIOUS }}></select>
</td>
<td class="{{ model.FLAG_VARIATIONS }}">
<textarea class="{{ model.FLAG_VARIATIONS }}" {{ model.ATTR_VALUE_CURRENT }} {{ model.ATTR_VALUE_PREVIOUS }}></textarea>
<td class="{{ model.FLAG_PRODUCT_VARIATIONS }}">
<textarea class="{{ model.FLAG_PRODUCT_VARIATIONS }}" {{ model.ATTR_VALUE_CURRENT }} {{ model.ATTR_VALUE_PREVIOUS }}></textarea>
</td>
<td class="{{ model.FLAG_COST_LOCAL_VAT_INCL }}">
<input class="{{ model.FLAG_COST_LOCAL_VAT_INCL }}" type="number" min="0" value="0" {{ model.ATTR_VALUE_CURRENT }}="0" {{ model.ATTR_VALUE_PREVIOUS }}>
@@ -49,7 +49,7 @@
{% else %}
<tr {{ model.ATTR_ID_STOCK_ITEM }}="{{ stock_item.id_stock_item }}">
<td class="{{ model.FLAG_PRODUCT_CATEGORY }}">
<select class="{{ model.FLAG_PRODUCT_CATEGORY }}" {{ model.ATTR_VALUE_CURRENT }}="{{ category.id_category }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ category.id_category }}"> <!-- {{ model.ATTR_ID_CATEGORY }}="{{ category.id_category }}" -->
<select class="{{ model.FLAG_PRODUCT_CATEGORY }}" {{ model.ATTR_VALUE_CURRENT }}="{{ category.id_category }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ category.id_category }}"> <!-- {{ model.ATTR_ID_PRODUCT_CATEGORY }}="{{ category.id_category }}" -->
{% for c in model.category_list.categories %}
<option value="{{ c.id_category }}" {% if c.id_category == category.id_category %}selected{% endif %}>{{ c.name }}</option>
{% endfor %}
@@ -62,9 +62,8 @@
{% endfor %}
</select>
</td>
<td class="{{ model.FLAG_VARIATIONS }}">
{% set block_id = 'Textarea_Product_Permutation_Variations' %}
{% include 'layouts/_shared_store.html' %}
<td class="{{ model.FLAG_PRODUCT_VARIATIONS }}">
{% include 'components/store/_preview_product_permutation_variations.html' %}
</td>
<td class="{{ model.FLAG_CURRENCY }}">
{{ permutation.output_currency() }}

View File

@@ -1,21 +1,54 @@
var attrFormType = "{{ model.ATTR_FORM_TYPE }}";
var attrIdCategory = "{{ model.ATTR_ID_CATEGORY }}";
var attrIdPermutation = "{{ model.ATTR_ID_PERMUTATION }}";
var attrIdProduct = "{{ model.ATTR_ID_PRODUCT }}";
var attrIdProductCategory = "{{ model.ATTR_ID_PRODUCT_CATEGORY }}";
var attrIdVariation = "{{ model.ATTR_ID_VARIATION }}";
var attrIdVariationType = "{{ model.ATTR_ID_VARIATION_TYPE }}";
var attrIdProductPermutation = "{{ model.ATTR_ID_PRODUCT_PERMUTATION }}";
var attrIdProductVariation = "{{ model.ATTR_ID_PRODUCT_VARIATION }}";
var attrIdProductVariationType = "{{ model.ATTR_ID_PRODUCT_VARIATION_TYPE }}";
var flagButtonBasketAdd = "{{ model.FLAG_BUTTON_BASKET_ADD }}";
var flagButtonBuyNow = "{{ model.FLAG_BUTTON_BUY_NOW }}";
var flagCategory = "{{ model.FLAG_PRODUCT_CATEGORY }}";
var flagProductCategory = "{{ model.FLAG_PRODUCT_CATEGORY }}";
var flagCostLocal = "{{ model.FLAG_COST_LOCAL }}";
var flagCountUnitMeasurementIntervalExpirationUnsealed = "{{ model.FLAG_COUNT_UNIT_MEASUREMENT_INTERVAL_EXPIRATION_UNSEALED }}";
var flagCountUnitMeasurementIntervalRecurrence = "{{ model.FLAG_COUNT_UNIT_MEASUREMENT_INTERVAL_RECURRENCE }}";
var flagCountUnitMeasurementPerQuantityStep = "{{ model.FLAG_COUNT_UNIT_MEASUREMENT_PER_QUANTITY_STEP }}";
var flagCurrencyCost = "{{ model.FLAG_CURRENCY_COST }}";
var flagDoesExpireFasterOnceUnsealed = "{{ model.FLAG_DOES_EXPIRE_FASTER_ONCE_UNSEALED }}";
var flagHasVariations = "{{ model.FLAG_HAS_VARIATIONS }}";
var flagIdStripeProduct = "{{ model.FLAG_ID_STRIPE_PRODUCT }}";
var flagIsNotEmpty = "{{ model.FLAG_IS_NOT_EMPTY }}";
var flagIsOutOfStock = "{{ model.FLAG_IS_OUT_OF_STOCK }}";
var flagIsSubscription = "{{ model.FLAG_IS_SUBSCRIPTION }}";
var flagLatencyManufactureDays = "{{ model.FLAG_LATENCY_MANUFACTURE_DAYS }}";
var flagLocationStorage = "{{ model.FLAG_LOCATION_STORAGE }}";
var flagNamePluralUnitMeasurementIntervalExpirationUnsealed = "{{ model.FLAG_NAME_PLURAL_UNIT_MEASUREMENT_INTERVAL_EXPIRATION_UNSEALED }}";
var flagNamePluralUnitMeasurementIntervalRecurrence = "{{ model.FLAG_NAME_PLURAL_UNIT_MEASUREMENT_INTERVAL_RECURRENCE }}";
var flagNamePluralUnitMeasurementQuantity = "{{ model.FLAG_NAME_PLURAL_UNIT_MEASUREMENT_QUANTITY }}";
var flagNameSingularUnitMeasurementIntervalExpirationUnsealed = "{{ model.FLAG_NAME_SINGULAR_UNIT_MEASUREMENT_INTERVAL_EXPIRATION_UNSEALED }}";
var flagNameSingularUnitMeasurementIntervalRecurrence = "{{ model.FLAG_NAME_SINGULAR_UNIT_MEASUREMENT_INTERVAL_RECURRENCE }}";
var flagNameSingularUnitMeasurementQuantity = "{{ model.FLAG_NAME_SINGULAR_UNIT_MEASUREMENT_QUANTITY }}";
var flagProduct = "{{ model.FLAG_PRODUCT }}";
var flagProductCategory = "{{ model.FLAG_PRODUCT_CATEGORY }}";
var flagProductPermutation = "{{ model.FLAG_PRODUCT_PERMUTATION }}";
var flagProductVariation = "{{ model.FLAG_PRODUCT_VARIATION }}";
var flagProductVariationType = "{{ model.FLAG_PRODUCT_VARIATION_TYPE }}";
var flagProfitLocalMin = "{{ model.FLAG_PROFIT_LOCAL_MIN }}";
var flagQuantity = "{{ model.FLAG_QUANTITY }}";
var flagQuantityMin = "{{ model.FLAG_QUANTITY_MIN }}";
var flagQuantityMax = "{{ model.FLAG_QUANTITY_MAX }}";
var flagQuantityStock = "{{ model.FLAG_QUANTITY_STOCK }}";
var flagVariations = "{{ model.FLAG_VARIATIONS }}";
var flagRegionStorage = "{{ model.FLAG_REGION_STORAGE }}";
var flagSymbolCurrencyCost = "{{ model.FLAG_SYMBOL_CURRENCY_COST }}";
var flagSymbolIsSuffixNotPrefixUnitMeasurementIntervalExpirationUnsealed = "{{ model.FLAG_SYMBOL_IS_SUFFIX_NOT_PREFIX_UNIT_MEASUREMENT_INTERVAL_EXPIRATION_UNSEALED }}";
var flagSymbolIsSuffixNotPrefixUnitMeasurementIntervalRecurrence = "{{ model.FLAG_SYMBOL_IS_SUFFIX_NOT_PREFIX_UNIT_MEASUREMENT_INTERVAL_RECURRENCE }}";
var flagSymbolIsSuffixNotPrefixUnitMeasurementQuantity = "{{ model.FLAG_SYMBOL_IS_SUFFIX_NOT_PREFIX_UNIT_MEASUREMENT_QUANTITY }}";
var flagSymbolUnitMeasurementIntervalExpirationUnsealed = "{{ model.FLAG_SYMBOL_UNIT_MEASUREMENT_INTERVAL_EXPIRATION_UNSEALED }}";
var flagSymbolUnitMeasurementIntervalRecurrence = "{{ model.FLAG_SYMBOL_UNIT_MEASUREMENT_INTERVAL_RECURRENCE }}";
var flagSymbolUnitMeasurementQuantity = "{{ model.FLAG_SYMBOL_UNIT_MEASUREMENT_QUANTITY }}";
var flagUnitMeasurementIntervalExpirationUnsealed = "{{ model.FLAG_UNIT_MEASUREMENT_INTERVAL_EXPIRATION_UNSEALED }}";
var flagUnitMeasurementIntervalRecurrence = "{{ model.FLAG_UNIT_MEASUREMENT_INTERVAL_RECURRENCE }}";
var flagUnitMeasurementQuantity = "{{ model.FLAG_UNIT_MEASUREMENT_QUANTITY }}";
var flagProductVariations = "{{ model.FLAG_PRODUCT_VARIATIONS }}";
var hashGetStoreProductCategory = "{{ model.HASH_GET_STORE_PRODUCT_CATEGORY }}";
var hashGetStoreProductPermutation = "{{ model.HASH_GET_STORE_PRODUCT_PERMUTATION }}";
var hashSaveStoreProductCategory = "{{ model.HASH_SAVE_STORE_PRODUCT_CATEGORY }}";
@@ -32,17 +65,16 @@ var idBasket = "#{{ model.ID_BASKET }}";
var idBasketContainer = "#{{ model.ID_BASKET_CONTAINER }}";
var idBasketTotal = "#{{ model.ID_BASKET_TOTAL }}";
var idButtonCheckout = "#{{ model.ID_BUTTON_CHECKOUT }}";
var idCategoryDefault = "{{ model.ID_CATEGORY_DEFAULT }}";
var idProductCategoryDefault = "{{ model.ID_PRODUCT_CATEGORY_DEFAULT }}";
var idCurrency = "#{{ model.ID_CURRENCY }}";
var idLabelBasketEmpty = "#{{ model.ID_LABEL_BASKET_EMPTY }}";
var idRegionDelivery = "#{{ model.ID_REGION_DELIVERY }}";
var keyIdCurrency = "{{ model.KEY_ID_CURRENCY }}";
var keyItems = "{{ model.KEY_ITEMS }}";
var keyIdPermutation = "{{ model.KEY_ID_PERMUTATION }}";
var keyIdProduct = "{{ model.KEY_ID_PRODUCT }}";
var keyIdRegionDelivery = "{{ model.KEY_ID_REGION_DELIVERY }}";
var keyIsIncludedVAT = "{{ model.KEY_IS_INCLUDED_VAT }}";
var keyNameVariation = "{{ model.KEY_NAME_VARIATION }}";
var keyNameVariationType = "{{ model.KEY_NAME_VARIATION_TYPE }}";
var typeFormBasketAdd = "{{ model.TYPE_FORM_BASKET_ADD }}";
var typeFormBasketEdit = "{{ model.TYPE_FORM_BASKET_EDIT }}";
var typeFormBasketEdit = "{{ model.TYPE_FORM_BASKET_EDIT }}";

View File

@@ -68,6 +68,7 @@
// var flagContactUs = "{{ model.FLAG_CONTACT_US }}";
var flagContainer = "{{ model.FLAG_CONTAINER }}";
var flagContainerInput = "{{ model.FLAG_CONTAINER_INPUT }}";
var flagCurrency = "{{ model.FLAG_CURRENCY }}";
var flagDelete = "{{ model.FLAG_DELETE }}";
var flagDescription = "{{ model.FLAG_DESCRIPTION }}";
var flagDetail = "{{ model.FLAG_DETAIL }}";
@@ -82,10 +83,12 @@
var flagAccessLevelRequired = "{{ model.FLAG_ACCESS_LEVEL_REQUIRED }}";
var flagImageLogo = "{{ model.FLAG_IMAGE_LOGO }}";
var flagInitialised = "{{ model.FLAG_INITIALISED }}";
var flagKeyPrimary = "{{ model.FLAG_KEY_PRIMARY }}";
// var flagKeyPrimary = "{{ model.FLAG_KEY_PRIMARY }}";
var flagMessage = "{{ model.FLAG_MESSAGE }}";
var flagMove = "move";
var flagName = "{{ model.FLAG_NAME }}";
var flagNameAttrOptionText = "{{ model.FLAG_NAME_ATTR_OPTION_TEXT}}";
var flagNameAttrOptionValue = "{{ model.FLAG_NAME_ATTR_OPTION_VALUE }}";
var flagNavAdminHome = "{{ model.FLAG_NAV_ADMIN_HOME }}";
var flagNavAdminStoreStripePrices = "{{ model.FLAG_NAV_ADMIN_STORE_STRIPE_PRICES }}";
var flagNavAdminStoreStripeProducts = "{{ model.FLAG_NAV_ADMIN_STORE_STRIPE_PRODUCTS }}";
@@ -188,6 +191,8 @@
var keyPrice = "{{ model.KEY_PRICE }}";
var keyQuantity = "{{ model.KEY_QUANTITY }}";
var keyShared = "shared";
var nameAttrOptionText = "{{ model.NAME_ATTR_OPTION_TEXT }}";
var nameAttrOptionValue = "{{ model.NAME_ATTR_OPTION_VALUE }}";
var nameCSRFToken = "{{ model.NAME_CSRF_TOKEN }}";
var _pathHost = "{{ model.get_url_host() }}";
var _rowBlank = null;
@@ -198,7 +203,7 @@
<!-- Stylesheets
<link href="{{ url_for('static', filename='css/main.css') }}" rel="stylesheet" type="text/css"/>
-->
<link rel="stylesheet" href="{{ url_for('static', filename='dist/css/main.css') }}">
<link rel="stylesheet" href="{{ url_for('static', filename='dist/css/main.bundle.css') }}">
</head>
<body data-page="{{ model.hash_page_current }}">
{% set user = model.get_user_session() %}

View File

@@ -5,12 +5,12 @@
<link rel="stylesheet" href="{{ url_for('static', filename='css/sections/store.css') }}">
<link rel="stylesheet" href="{{ url_for('static', filename='css/pages/store/product_categories.css') }}">
-->
<link rel="stylesheet" href="{{ url_for('static', filename='dist/css/store_product_categories.css') }}">
<link rel="stylesheet" href="{{ url_for('static', filename='dist/css/store_product_categories.bundle.css') }}">
<form id="{{ model.ID_FORM_FILTERS }}" class="{{ model.FLAG_FILTER }} {{ model.FLAG_ROW }} {{ model.FLAG_CARD }}" action="{{ url_for('routes_store_product_category.save_category') }}" method="POST"> <!-- {{ model.FLAG_CONTAINER }} -->
{{ model.form_filters.hidden_tag() }}
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_COLUMN }}">
<div class="{{ model.FLAG_CONTAINER_INPUT }} {{ model.FLAG_ROW }} {{ model.FLAG_FILTER }}">
<div class="{{ model.FLAG_CONTAINER_INPUT }} {{ model.FLAG_ROW }} {{ model.FLAG_FILTER }} {{ model.FLAG_IS_NOT_EMPTY }}">
{{ model.form_filters.is_not_empty.label }}
{{ model.form_filters.is_not_empty() }}
{% for error in model.form_filters.is_not_empty.errors %}
@@ -19,7 +19,7 @@
</div>
</div>
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_COLUMN }}">
<div class="{{ model.FLAG_CONTAINER_INPUT }} {{ model.FLAG_ROW }} {{ model.FLAG_FILTER }}">
<div class="{{ model.FLAG_CONTAINER_INPUT }} {{ model.FLAG_ROW }} {{ model.FLAG_FILTER }} {{ model.FLAG_ACTIVE }}">
{{ model.form_filters.active.label }}
{{ model.form_filters.active() }}
{% for error in model.form_filters.active.errors %}
@@ -27,6 +27,7 @@
{% endfor %}
</div>
</div>
{#
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_COLUMN }}">
<div class="{{ model.FLAG_CONTAINER_INPUT }} {{ model.FLAG_ROW }}">
{% set block_id = 'button_apply_filters' %}
@@ -59,6 +60,9 @@
</div>
</div>
-->
#}
{% set block_id = 'buttons_table_default' %}
{% include 'components/common/buttons/_buttons_save_cancel.html' %}
</form>
@@ -91,10 +95,11 @@
<script src="{{ url_for('routes_store.scripts_section_store') }}"></script>
<script type="module" src="{{ url_for('static', filename='js/pages/store/product_categories.js') }}"></script>
-->
<script src="{{ url_for('routes_store.scripts_section_store') }}"></script>
<script>
// pass arguments from model to JS
var flagIsNotEmpty = "{{ model.FLAG_IS_NOT_EMPTY }}";
var optionsAccessLevel = {{ model.convert_list_objects_to_list_options(model.access_levels) | tojson | safe }};
var accessLevels = {{ model.convert_list_objects_to_dict_json_by_attribute_key_default(model.access_levels) | tojson | safe }};
</script>
{% endblock %}

View File

@@ -8,13 +8,13 @@
<link rel="stylesheet" href="{{ url_for('static', filename='css/sections/store.css') }}">
<link rel="stylesheet" href="{{ url_for('static', filename='css/pages/store/product_permutations.css') }}">
-->
<link rel="stylesheet" href="{{ url_for('static', filename='dist/css/store_product_permutations.css') }}">
<link rel="stylesheet" href="{{ url_for('static', filename='dist/css/store_product_permutations.bundle.css') }}">
<!-- HTML content -->
<form id="{{ model.ID_FORM_FILTERS }}" class="{{ model.FLAG_ROW }} {{ model.FLAG_CARD }}" action="{{ url_for('routes_store_product_permutation.permutation_save') }}" method="POST"> <!-- {{ model.FLAG_CONTAINER }} -->
<form id="{{ model.ID_FORM_FILTERS }}" class="{{ model.FLAG_FILTER }} {{ model.FLAG_ROW }} {{ model.FLAG_CARD }}" action="{{ url_for('routes_store_product_permutation.save_permutation') }}" method="POST"> <!-- {{ model.FLAG_CONTAINER }} -->
{{ model.form_filters.hidden_tag() }}
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_COLUMN }}">
<div class="{{ model.FLAG_CONTAINER_INPUT }}">
<div class="{{ model.FLAG_CONTAINER_INPUT }} {{ model.FLAG_ROW }} {{ model.FLAG_FILTER }}">
{{ model.form_filters.id_category.label }}
{{ model.form_filters.id_category() }}
{% for error in model.form_filters.id_category.errors %}
@@ -23,7 +23,7 @@
</div>
</div>
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_COLUMN }}">
<div class="{{ model.FLAG_CONTAINER_INPUT }}">
<div class="{{ model.FLAG_CONTAINER_INPUT }} {{ model.FLAG_ROW }} {{ model.FLAG_FILTER }}">
{{ model.form_filters.id_product.label }}
{{ model.form_filters.id_product() }}
{% for error in model.form_filters.id_product.errors %}
@@ -32,7 +32,7 @@
</div>
</div>
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_COLUMN }}">
<div class="{{ model.FLAG_CONTAINER_INPUT }} {{ model.FLAG_ROW }}">
<div class="{{ model.FLAG_CONTAINER_INPUT }} {{ model.FLAG_ROW }} {{ model.FLAG_FILTER }}">
{{ model.form_filters.is_out_of_stock.label }}
{{ model.form_filters.is_out_of_stock() }}
{% for error in model.form_filters.is_out_of_stock.errors %}
@@ -41,7 +41,7 @@
</div>
</div>
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_COLUMN }}">
<div class="{{ model.FLAG_CONTAINER_INPUT }} {{ model.FLAG_ROW }}">
<div class="{{ model.FLAG_CONTAINER_INPUT }} {{ model.FLAG_ROW }} {{ model.FLAG_FILTER }}">
{{ model.form_filters.quantity_min.label }}
{{ model.form_filters.quantity_min() }}
{% for error in model.form_filters.quantity_min.errors %}
@@ -50,7 +50,7 @@
</div>
</div>
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_COLUMN }}">
<div class="{{ model.FLAG_CONTAINER_INPUT }} {{ model.FLAG_ROW }}">
<div class="{{ model.FLAG_CONTAINER_INPUT }} {{ model.FLAG_ROW }} {{ model.FLAG_FILTER }}">
{{ model.form_filters.quantity_max.label }}
{{ model.form_filters.quantity_max() }}
{% for error in model.form_filters.quantity_max.errors %}
@@ -58,11 +58,13 @@
{% endfor %}
</div>
</div>
<!--
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_COLUMN }} {{ model.FLAG_CONTAINER_INPUT }}">
{ { model.form_filters.submit() }}
{#
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_COLUMN }}">
<div class="{{ model.FLAG_CONTAINER_INPUT }} {{ model.FLAG_ROW }}">
{% set block_id = 'button_apply_filters' %}
{% include 'components/common/buttons/_buttons_save_cancel.html' %}
</div>
</div>
-->
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_COLUMN }}">
<div class="{{ model.FLAG_CONTAINER_INPUT }}">
{% set block_id = 'button_add' %}
@@ -87,33 +89,51 @@
</div>
</div>
-->
#}
{% set block_id = 'buttons_table_default' %}
{% include 'components/common/buttons/_buttons_save_cancel.html' %}
</form>
<table id="{{ model.ID_TABLE_MAIN }}" class="{{ model.FLAG_ROW }} {{ model.FLAG_CARD }}">
<thead>
<tr>
<th class="{{ model.FLAG_PRODUCT_CATEGORY }}">Category</th>
<th class="{{ model.FLAG_PRODUCT }}">Product</th>
<th class="{{ model.FLAG_VARIATIONS }}">Variations</th>
<th class="{{ model.FLAG_PRODUCT_VARIATIONS }} {{ model.FLAG_COLLAPSED }}">Variations</th>
<th class="{{ model.FLAG_DESCRIPTION }}">Description</th>
<th class="{{ model.FLAG_QUANTITY_STOCK }}">Quantity Stock</th>
<th class="{{ model.FLAG_QUANTITY_MIN }}">Quantity Min</th>
<th class="{{ model.FLAG_QUANTITY_MAX }}">Quantity Max</th>
<th class="{{ model.FLAG_COUNT_UNIT_MEASUREMENT_PER_QUANTITY_STEP }}">Quantity Step</th>
<th class="{{ model.FLAG_UNIT_MEASUREMENT_QUANTITY }}">Unit</th>
<th class="{{ model.FLAG_IS_SUBSCRIPTION }}">Subscription?</th>
<th class="{{ model.FLAG_COUNT_UNIT_MEASUREMENT_INTERVAL_RECURRENCE }}">Count Recurrence Interval</th>
<th class="{{ model.FLAG_UNIT_MEASUREMENT_INTERVAL_RECURRENCE }}">Recurrence Interval</th>
<th class="{{ model.FLAG_ID_STRIPE_PRODUCT }}">Stripe Product ID</th>
<th class="{{ model.FLAG_DOES_EXPIRE_FASTER_ONCE_UNSEALED }}">Expires Faster Once Unsealed?</th>
<th class="{{ model.FLAG_COUNT_UNIT_MEASUREMENT_INTERVAL_EXPIRATION_UNSEALED }}">Count Interval Expiration Unsealed</th>
<th class="{{ model.FLAG_UNIT_MEASUREMENT_INTERVAL_EXPIRATION_UNSEALED }}">Interval Expiration Unsealed</th>
<th class="{{ model.FLAG_COST_LOCAL }}">Cost</th>
<!-- <th>Price</th> -->
<th class="{{ model.FLAG_DETAIL }}">Link</th>
<th class="{{ model.FLAG_CURRENCY_COST }}">Cost Currency</th>
<th class="{{ model.FLAG_PROFIT_LOCAL_MIN }}">Profit Local Min</th>
<th class="{{ model.FLAG_LATENCY_MANUFACTURE_DAYS }}">Manufacturing Latency</th>
<th class="{{ model.FLAG_ACTIVE }}">Active</th>
</tr>
</thead>
<tbody>
{% set units_measurement_dict = model.convert_list_objects_to_dict_json_by_attribute_key_default(model.units_measurement) | console_log %}
{% set units_measurement_time_dict = model.convert_list_objects_to_dict_json_by_attribute_key_default(model.units_measurement_time) | console_log %}
{% set is_blank_row = False %}
{% for category in model.category_list.categories %}
{% for product in category.products %}
{% for permutation in product.permutations %}
{% include 'components/store/_permutation.html' %}
{% include 'components/store/_row_product_permutation.html' %}
{% endfor %}
{% endfor %}
{% endfor %}
{% set is_blank_row = True %}
{% include 'components/store/_permutation.html' %}
{% include 'components/store/_row_product_permutation.html' %}
</tbody>
</table>
@@ -121,30 +141,30 @@
{% include 'components/common/temporary/_overlay_error.html' %}
<!-- Include JavaScript
<script src="{{ url_for('routes_store.scripts_section_store') }}"></script>
<script type="module" src="{{ url_for('static', filename='js/pages/store/product_permutations.js') }}"></script>
<script type="module" src="{{ url_for('static', filename='dist/js/store_product_permutations.bundle.js') }}"></script>
-->
<script src="{{ url_for('routes_store.scripts_section_store') }}"></script>
<script>
// pass arguments from model to JS
/*
var idFilterCategory = "#{{ model.ID_FILTER_CATEGORY }}";
var idFilterProduct = "#{{ model.ID_FILTER_PRODUCT }}";
var idFilterIsOutOfStock = "#{{ model.ID_FILTER_IS_OUT_OF_STOCK }}";
var idFilterQuantityMin = "#{{ model.ID_FILTER_QUANTITY_MIN }}";
var idFilterQuantityMax = "#{{ model.ID_FILTER_QUANTITY_MAX }}";
*/
// var idFormFiltersPermutations = "#{ { model.ID_FORM_FILTERS_PERMUTATIONS } }";
var keyPermutations = "{{ model.KEY_PERMUTATIONS }}";
var currencies = {{ model.convert_list_objects_to_dict_json_by_attribute_key_default(model.currencies) | tojson | safe }};
var products = {{ model.convert_list_objects_to_dict_json_by_attribute_key_default(model.category_list.get_list_products()) | tojson | safe }};
var productCategories = {{ model.convert_list_objects_to_dict_json_by_attribute_key_default(model.category_list_filters.categories) | tojson | safe }};
var productVariations = {{ model.convert_list_objects_to_dict_json_by_attribute_key_default(model.variations) | tojson | safe }};
var productVariationTypes = {{ model.convert_list_objects_to_dict_json_by_attribute_key_default(model.variation_types) | tojson | safe }};
var unitMeasurements = {{ units_measurement_dict | tojson | safe }};
var unitMeasurementsTime = {{ units_measurement_time_dict | tojson | safe }};
var _rowBlankProductVariation = null;
{#
var productsByCategory = {{ model.category_list.get_product_option_lists_by_category() | tojson | safe }};
var listCategories = {{ model.category_list.to_list_categories() | tojson | safe }};
var listProducts = {{ model.category_list.to_product_option_list() | tojson | safe }};
var listVariations = {{ model.variations.to_list_variations() | tojson | safe }};
var listVariationTypes = {{ model.variations.to_list_variation_types() | tojson | safe }};
var dictVariations = Object.fromEntries(listVariations.map((variation, index) => [variation[attrIdVariation], variation]));
var dictVariationTypes = Object.fromEntries(listVariationTypes.map((variationType, index) => [variationType[attrIdVariationType], variationType]));
listVariations = listVariations.map((variation, index) => { return variation[attrIdVariation]; });
listVariationTypes = listVariationTypes.map((variationType, index) => { return variationType[attrIdVariationType]; });
var dictVariations = Object.fromEntries(listVariations.map((variation, index) => [variation[attrIdProductVariation], variation]));
var dictVariationTypes = Object.fromEntries(listVariationTypes.map((variationType, index) => [variationType[attrIdProductVariationType], variationType]));
listVariations = listVariations.map((variation, index) => { return variation[attrIdProductVariation]; });
listVariationTypes = listVariationTypes.map((variationType, index) => { return variationType[attrIdProductVariationType]; });
#}
/*
// hookup elements
$(document).ready(function() {

View File

@@ -77,7 +77,7 @@
<th class="{{ model.FLAG_DISPLAY_ORDER }}">Display Order</th>
<th class="{{ model.FLAG_PRODUCT_CATEGORY }}">Category</th>
<th class="{{ model.FLAG_NAME }}">Name</th>
<th class="{{ model.FLAG_VARIATIONS }}">Variations</th>
<th class="{{ model.FLAG_PRODUCT_VARIATIONS }}">Variations</th>
<th class="{{ model.FLAG_ACCESS_LEVEL }}">Access Level Required</th>
<th class="{{ model.FLAG_ACTIVE}}">Active</th>
</tr>
@@ -106,6 +106,6 @@
<script>
// pass arguments from model to JS
var flagIsNotEmpty = "{{ model.FLAG_IS_NOT_EMPTY }}";
var optionsAccessLevel = {{ model.convert_list_objects_to_list_options(model.access_levels) | tojson | safe }};
var accessLevels = {{ model.convert_list_objects_to_dict_json_by_attribute_key_default(model.access_levels) | tojson | safe }};
</script>
{% endblock %}

View File

@@ -79,7 +79,7 @@
<tr>
<th class="{{ model.FLAG_PRODUCT_CATEGORY }}">Category</th>
<th class="{{ model.FLAG_PRODUCT }}">Product</th>
<th class="{{ model.FLAG_VARIATIONS }}">Variations</th>
<th class="{{ model.FLAG_PRODUCT_VARIATIONS }}">Variations</th>
<th class="{{ model.FLAG_CURRENCY }}">Currency</th>
<th class="{{ model.FLAG_COST_LOCAL_VAT_INCL }}">Cost Local (VAT incl.)</th>
<th class="{{ model.FLAG_DATE_PURCHASED}}">Date Purchased</th>