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,68 @@
{% extends 'layouts/layout.html' %}
{% block title %}{{ model.title }}{% endblock %}
{% block page_body %}
<!-- Include Stylesheets -->
<link rel="stylesheet" href="{{ url_for('static', filename='css/sections/store.css') }}">
<link rel="stylesheet" href="{{ url_for('static', filename='css/store/basket.css') }}">
<!-- HTML content -->
<div class="{{ model.FLAG_CARD }}">
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_COLUMN }}">
<div id="{{ model.ID_CONTAINER_INFO_DELIVERY }}" class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_ROW }}" style="border-bottom: 1px black;">
<h2>Delivery Information</h2>
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_ROW }}">
Valid delivery information not submitted
</div>
</div>
<div id="{{ model.ID_CONTAINER_INFO_BILLING }}" class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_ROW }}" style="border-bottom: 1px black;">
<h2>Billing Information</h2>
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_ROW }}">
Valid billing information not submitted
</div>
</div>
<div class="{{ model.FLAG_CONTAINER }}">
<div id="{{ model.ID_BASKET_CONTAINER }}">
{% include 'components/store/_basket.html' %}
</div>
<!-- Comes with basket block
<div class="{{ model.FLAG_CONTAINER }}">
<!-- subtotal --
<h2 id="id_basket_total">Order total: £{{ model.OUTPUT_BASKET_TOTAL() }}</h2>
<!-- checkout button - hidden unless valid details entered everywhere above --
<button type="submit" class="{{ model.FLAG_BTN_SUBMIT }}">Complete Purchase</button>
</div>
-->
</div>
</div>
</div>
{% set form = model.form_delivery %}
{% set overlay_id = model.id_overlay_info_delivery %}
{% set overlay_title = 'Delivery Information' %}
{% include 'components/common/temporary/_overlay_address.html' %}
{% set form = model.form_billing %}
{% set overlay_id = model.id_overlay_info_billing %}
{% set overlay_title = 'Billing Information' %}
{% include 'components/common/temporary/_overlay_address.html' %}
<!-- Include JavaScript -->
<script src="{{ url_for('routes_store.scripts_section_store') }}"></script>
<script type="module" src="{{ url_for('static', filename='js/pages/store/basket.js') }}"></script>
{% set block_id = 'checkout' %}
{% include 'layouts/_shared_store.html' %}
<!--
<script>
var hashPageCurrent = "{{ model.HASH_PAGE_STORE_BASKET }}";
$(document).ready(function() {
console.log('Hooking up store basket review page...');
hookupStorePageBasket();
// hookupStorePageBilling();
});
</script>
-->
{% endblock %}

View File

@@ -0,0 +1,43 @@
{% extends 'layouts/layout.html' %}
{% block title %}{{ model.title }}{% endblock %}
{% block page_body %}
<!-- Include Stylesheets -->
<link rel="stylesheet" href="{{ url_for('static', filename='css/sections/store.css') }}">
<link rel="stylesheet" href="{{ url_for('static', filename='css/store/checkout_success.css') }}">
<!-- HTML content -->
<div class="{{ model.FLAG_CARD }}">
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_COLUMN }}">
<div id="{{ model.ID_CONTAINER_INFO_DELIVERY }}" class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_ROW }}" style="border-bottom: 1px black;">
<h2>Order successful!</h2>
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_ROW }}">
<div class="{{ model.FLAG_LABEL }}"><strong>Order reference: {{ model.CHECKOUT_SESSION.ID }}</strong></div>
<div class="{{ model.FLAG_LABEL }}">You will receive an order acknowledgement by email</div>
</div>
{% if model.IS_USER_LOGGED_IN %}
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_ROW }}">
<h3>Your order:</h3>
</div>
{% endif %}
</div>
</div>
</div>
<!-- Include JavaScript -->
<script src="{{ url_for('routes_store.scripts_section_store') }}"></script>
<script type="module" src="{{ url_for('static', filename='js/pages/store/checkout_success.js') }}"></script>
{% set block_id = 'checkout' %}
{% include 'layouts/_shared_store.html' %}
<!--
<script>
var hashPageCurrent = "{{ model.HASH_PAGE_STORE_BASKET }}";
$(document).ready(function() {
console.log('Hooking up store checkout success page...');
hookupStorePageCheckoutSuccess();
});
</script>
-->
{% endblock %}

View File

@@ -0,0 +1,7 @@
{% extends 'layouts/layout.html' %}
{% block title %}{{ model.title }}{% endblock %}
{% block page_body %}
{% include 'components/store/_home_body.html' %}
{% endblock %}

View File

@@ -0,0 +1,96 @@
{% extends 'layouts/layout.html' %}
{% block page_body %}
<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') }}">
<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 }}">
{{ model.form_filters.is_not_empty.label }}
{{ model.form_filters.is_not_empty() }}
{% for error in model.form_filters.is_not_empty.errors %}
<p class="error">{{ error }}</p>
{% endfor %}
</div>
</div>
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_COLUMN }}">
<div class="{{ model.FLAG_CONTAINER_INPUT }} {{ model.FLAG_ROW }} {{ model.FLAG_FILTER }}">
{{ model.form_filters.active.label }}
{{ model.form_filters.active() }}
{% for error in model.form_filters.active.errors %}
<p class="error">{{ error }}</p>
{% 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' %}
{% 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' %}
{% 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_save' %}
{% 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_cancel' %}
{% include 'components/common/buttons/_buttons_save_cancel.html' %}
</div>
</div>
<!--
<div class="{{ model.FLAG_ROW }} {{ model.FLAG_CARD }}">
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_COLUMN }}">
</div>
</div>
-->
</form>
<table id="{{ model.ID_TABLE_MAIN }}" class="{{ model.FLAG_ROW }} {{ model.FLAG_CARD }}">
<thead>
<tr class="{{ model.FLAG_PRODUCT_CATEGORY }}">
<th class="{{ model.FLAG_DISPLAY_ORDER }}">Display Order</th>
<th class="{{ model.FLAG_CODE }}">Code</th>
<th class="{{ model.FLAG_NAME }}">Name</th>
<th class="{{ model.FLAG_DESCRIPTION }}">Description</th>
<th class="{{ model.FLAG_ACCESS_LEVEL }}">Access Level Required</th>
<th class="{{ model.FLAG_ACTIVE}}">Active</th>
</tr>
</thead>
<tbody>
{% set is_blank_row = False %}
{% for category in model.category_list.categories %}
{% include 'components/store/_row_product_category.html' %}
{% endfor %}
{% set is_blank_row = True %}
{% include 'components/store/_row_product_category.html' %}
</tbody>
</table>
{% include 'components/common/temporary/_overlay_confirm.html' %}
{% 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_categories.js') }}"></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 }};
</script>
{% endblock %}

View File

@@ -0,0 +1,155 @@
{% extends 'layouts/layout.html' %}
{% block page_body %}
<!--
{ % set product = model.product %}
{ % set permutation = product.get_permutation_selected() %}
-->
<script>console.log("test 1");</script>
<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') }}">
<!-- 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 }} -->
{{ model.form_filters.hidden_tag() }}
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_COLUMN }}">
<div class="{{ model.FLAG_CONTAINER_INPUT }}">
{{ model.form_filters.id_category.label }}
{{ model.form_filters.id_category() }}
{% for error in model.form_filters.id_category.errors %}
<p class="error">{{ error }}</p>
{% endfor %}
</div>
</div>
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_COLUMN }}">
<div class="{{ model.FLAG_CONTAINER_INPUT }}">
{{ model.form_filters.id_product.label }}
{{ model.form_filters.id_product() }}
{% for error in model.form_filters.id_product.errors %}
<p class="error">{{ error }}</p>
{% endfor %}
</div>
</div>
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_COLUMN }}">
<div class="{{ model.FLAG_CONTAINER_INPUT }} {{ model.FLAG_ROW }}">
{{ 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 %}
<p class="error">{{ error }}</p>
{% endfor %}
</div>
</div>
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_COLUMN }}">
<div class="{{ model.FLAG_CONTAINER_INPUT }} {{ model.FLAG_ROW }}">
{{ model.form_filters.quantity_min.label }}
{{ model.form_filters.quantity_min() }}
{% for error in model.form_filters.quantity_min.errors %}
<p class="error">{{ error }}</p>
{% endfor %}
</div>
</div>
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_COLUMN }}">
<div class="{{ model.FLAG_CONTAINER_INPUT }} {{ model.FLAG_ROW }}">
{{ model.form_filters.quantity_max.label }}
{{ model.form_filters.quantity_max() }}
{% for error in model.form_filters.quantity_max.errors %}
<p class="error">{{ error }}</p>
{% endfor %}
</div>
</div>
<!--
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_COLUMN }} {{ model.FLAG_CONTAINER_INPUT }}">
{ { model.form_filters.submit() }}
</div>
-->
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_COLUMN }}">
<div class="{{ model.FLAG_CONTAINER_INPUT }}">
{% set block_id = 'button_add' %}
{% 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_save' %}
{% 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_cancel' %}
{% include 'components/common/buttons/_buttons_save_cancel.html' %}
</div>
</div>
<!--
<div class="{{ model.FLAG_ROW }} {{ model.FLAG_CARD }}">
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_COLUMN }}">
</div>
</div>
-->
</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_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_COST_LOCAL }}">Cost</th>
<!-- <th>Price</th> -->
<th class="{{ model.FLAG_DETAIL }}">Link</th>
</tr>
</thead>
<tbody>
{% 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' %}
{% endfor %}
{% endfor %}
{% endfor %}
{% set is_blank_row = True %}
{% include 'components/store/_permutation.html' %}
</tbody>
</table>
{% include 'components/common/temporary/_overlay_confirm.html' %}
{% 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>
// 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 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]; });
/*
// hookup elements
$(document).ready(function() {
console.log('Hooking up store product permutation page...');
hookupStorePageProductPermutation();
});
*/
</script>
{% endblock %}

View File

@@ -0,0 +1,107 @@
{% extends 'layouts/layout.html' %}
{% block page_body %}
<link rel="stylesheet" href="{{ url_for('static', filename='css/sections/store.css') }}">
<link rel="stylesheet" href="{{ url_for('static', filename='css/pages/store/products.css') }}">
<form id="{{ model.ID_FORM_FILTERS }}" class="{{ model.FLAG_FILTER }} {{ model.FLAG_ROW }} {{ model.FLAG_CARD }}" action="{{ url_for('routes_store_product.save_product') }}" 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.form_filters.id_category.label }}
{{ model.form_filters.id_category() }}
{% for error in model.form_filters.id_category.errors %}
<p class="error">{{ error }}</p>
{% endfor %}
</div>
</div>
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_COLUMN }}">
<div class="{{ model.FLAG_CONTAINER_INPUT }} {{ model.FLAG_ROW }} {{ model.FLAG_FILTER }}">
{{ model.form_filters.is_not_empty.label }}
{{ model.form_filters.is_not_empty() }}
{% for error in model.form_filters.is_not_empty.errors %}
<p class="error">{{ error }}</p>
{% endfor %}
</div>
</div>
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_COLUMN }}">
<div class="{{ model.FLAG_CONTAINER_INPUT }} {{ model.FLAG_ROW }} {{ model.FLAG_FILTER }}">
{{ model.form_filters.active.label }}
{{ model.form_filters.active() }}
{% for error in model.form_filters.active.errors %}
<p class="error">{{ error }}</p>
{% 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' %}
{% 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' %}
{% 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_save' %}
{% 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_cancel' %}
{% include 'components/common/buttons/_buttons_save_cancel.html' %}
</div>
</div>
<!--
<div class="{{ model.FLAG_ROW }} {{ model.FLAG_CARD }}">
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_COLUMN }}">
</div>
</div>
-->
</form>
<table id="{{ model.ID_TABLE_MAIN }}" class="{{ model.FLAG_ROW }} {{ model.FLAG_CARD }}">
<thead>
<tr class="{{ model.FLAG_PRODUCT }}">
<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_ACCESS_LEVEL }}">Access Level Required</th>
<th class="{{ model.FLAG_ACTIVE}}">Active</th>
</tr>
</thead>
<tbody>
{% set is_blank_row = False %}
{% for category in model.category_list.categories %}
{% for product in category.products %}
{% include 'components/store/_row_product.html' %}
{% endfor %}
{% endfor %}
{% set is_blank_row = True %}
{% include 'components/store/_row_product.html' %}
</tbody>
</table>
{% include 'components/common/temporary/_overlay_confirm.html' %}
{% 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/products.js') }}"></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 }};
</script>
{% endblock %}

View File

@@ -0,0 +1,141 @@
{% extends 'layouts/layout.html' %}
{% block page_body %}
<script>console.log("test 1");</script>
<link rel="stylesheet" href="{{ url_for('static', filename='css/sections/store.css') }}">
<link rel="stylesheet" href="{{ url_for('static', filename='css/pages/store/stock_items.css') }}">
<!-- HTML content -->
<form id="{{ model.ID_FORM_FILTERS_STOCK }}" class="{{ model.FLAG_ROW }} {{ model.FLAG_CARD }}" action="{{ url_for('routes_store.stock_filter') }}" 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.form_filters.id_category.label }}
{{ model.form_filters.id_category() }}
{% for error in model.form_filters.id_category.errors %}
<p class="error">{{ error }}</p>
{% endfor %}
</div>
</div>
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_COLUMN }}">
<div class="{{ model.FLAG_CONTAINER_INPUT }}">
{{ model.form_filters.id_product.label }}
{{ model.form_filters.id_product() }}
{% for error in model.form_filters.id_product.errors %}
<p class="error">{{ error }}</p>
{% endfor %}
</div>
</div>
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_COLUMN }}">
<div class="{{ model.FLAG_CONTAINER_INPUT }}">
{{ 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 %}
<p class="error">{{ error }}</p>
{% endfor %}
</div>
<div class="{{ model.FLAG_CONTAINER_INPUT }}">
{{ model.form_filters.quantity_min.label }}
{{ model.form_filters.quantity_min() }}
{% for error in model.form_filters.quantity_min.errors %}
<p class="error">{{ error }}</p>
{% endfor %}
</div>
<div class="{{ model.FLAG_CONTAINER_INPUT }}">
{{ model.form_filters.quantity_max.label }}
{{ model.form_filters.quantity_max() }}
{% for error in model.form_filters.quantity_max.errors %}
<p class="error">{{ error }}</p>
{% endfor %}
</div>
</div>
<!--
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_COLUMN }} {{ model.FLAG_CONTAINER_INPUT }}">
{ { model.form_filters.submit() }}
</div>
-->
<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' %}
{% set block_id = 'button_cancel' %}
{% include 'components/common/buttons/_buttons_save_cancel.html' %}
{% set block_id = 'button_add' %}
{% include 'components/common/buttons/_buttons_save_cancel.html' %}
</div>
</div>
</form>
<!--
<div class="{{ model.FLAG_ROW }} {{ model.FLAG_CARD }}">
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_COLUMN }}">
</div>
</div>
-->
<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_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>
<th class="{{ model.FLAG_DATE_RECEIVED }}">Date Received</th>
<th class="{{ model.FLAG_LOCATION_STORAGE }}">Storage Location</th>
<!--<th class="{{ model.FLAG_IS_SEALED }}">Is Sealed</th>-->
<th class="{{ model.FLAG_DATE_UNSEALED }}">Date Unsealed</th>
<th class="{{ model.FLAG_DATE_EXPIRATION }}">Date Expiration</th>
<!--<th class="{{ model.FLAG_IS_CONSUMED }}">Is Consumed</th>-->
<th class="{{ model.FLAG_DATE_CONSUMED }}">Date Consumed</th>
<th class="{{ model.FLAG_ACTIVE }}">Active</th>
</tr>
</thead>
<tbody>
{% set is_blank_row = False %}
{% for category in model.category_list.categories %}
{% for product in category.products %}
{% for permutation in product.permutations %}
{% for stock_item in permutation.stock_items %}
{% set is_blank_row = False %}
{% include 'components/store/_stock_item.html' %}
{% endfor %}
{% endfor %}
{% endfor %}
{% endfor %}
{% set is_blank_row = True %}
{% include 'components/store/_stock_item.html' %}
</tbody>
</table>
{% include 'components/common/temporary/_overlay_confirm.html' %}
{% 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/stock_items.js') }}"></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 dictListsProducts = {{ 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 }};
/*
// hookup elements
$(document).ready(function() {
console.log('Hooking up store stock page...');
hookupStorePageStockItem();
});
*/
</script>
{% endblock %}

View File

@@ -0,0 +1,114 @@
{% extends 'layouts/layout.html' %}
{% block title %}{{ model.title }}{% endblock %}
{% block page_body %}
{% set supplier = model.supplier %}
{% set block_id = 'styles' %}
{% include 'layouts/_shared_store.html' %}
<link rel="stylesheet" href="{{ url_for('static', filename='css/sections/store.css') }}">
<link rel="stylesheet" href="{{ url_for('static', filename='css/pages/page_store_supplier.css') }}">
<!-- HTML content -->
<div class="card">
<form id="{{ model.ID_FORM_SUPPLIER }}" class="{{ model.FLAG_CONTAINER }}" action="{{ url_for('routes_store.supplier') }}" method="POST">
<h2 class="label-title">Supplier</h2>
{{ model.form.hidden_tag() }}
<div class="card subcard">
<div class="container-input">
{{ model.form.name_company.label }}
{{ model.form.name_company(size=100) }}
{% for error in model.form.name_company.errors %}
<p class="{{ model.FLAG_ERROR }}">{{ error }}</p>
{% endfor %}
</div>
</div>
<div class="card subcard">
<h3>Contact</h3>
<div class="container-input">
{{ model.form.name_contact.label }}
{{ model.form.name_contact(size=50) }}
{% for error in model.form.name_contact.errors %}
<p class="{{ model.FLAG_ERROR }}">{{ error }}</p>
{% endfor %}
</div>
<div class="container-input">
{{ model.form.department_contact.label }}
{{ model.form.department_contact(size=50) }}
{% for error in model.form.department_contact.errors %}
<p class="{{ model.FLAG_ERROR }}">{{ error }}</p>
{% endfor %}
</div>
<div class="container-input">
{{ model.form.id_address.label }}
{{ model.form.id_address() }}
{% for error in model.form.id_address.errors %}
<p class="{{ model.FLAG_ERROR }}">{{ error }}</p>
{% endfor %}
<button id="{{ model.ID_BUTTON_ADD_SUPPLIER }}">Add new address</button>
</div>
<div class="container-input">
{{ model.form.phone_number.label }}
{{ model.form.phone_number(size=20) }}
{% for error in model.form.phone_number.errors %}
<p class="{{ model.FLAG_ERROR }}">{{ error }}</p>
{% endfor %}
</div>
<div class="container-input">
{{ model.form.fax.label }}
{{ model.form.fax(size=20) }}
{% for error in model.form.fax.errors %}
<p class="{{ model.FLAG_ERROR }}">{{ error }}</p>
{% endfor %}
</div>
<div class="container-input">
{{ model.form.email.label }}
{{ model.form.email(size=254) }}
{% for error in model.form.email.errors %}
<p class="{{ model.FLAG_ERROR }}">{{ error }}</p>
{% endfor %}
</div>
<div class="container-input">
{{ model.form.website.label }}
{{ model.form.website(size=254) }}
{% for error in model.form.website.errors %}
<p class="{{ model.FLAG_ERROR }}">{{ error }}</p>
{% endfor %}
</div>
<div class="container-input">
{{ model.form.id_currency.label }}
{{ model.form.id_currency() }}
{% for error in model.form.id_currency.errors %}
<p class="{{ model.FLAG_ERROR }}">{{ error }}</p>
{% endfor %}
</div>
<div class="container-input">
{{ model.form.recaptcha() }}
</div>
<div class="container-input">
{{ model.form.submit() }}
</div>
</div>
</form>
</div>
<!-- Include JavaScript -->
<script src="{{ url_for('routes_store.scripts_section_store') }}"></script>
<script type="module" src="{{ url_for('static', filename='js/pages/store/supplier.js') }}"></script>
<!--
<script>
// pass arguments from model to JS
var hashPageCurrent = "{{ model.HASH_PAGE_STORE_SUPPLIER }}";
/*
// hookup elements
$(document).ready(function() {
console.log('Hooking up store supplier page...');
hookupStorePageSupplier();
});
*/
</script>
-->
{% endblock %}