1. Module bundling added to reduce server calls as each file was taking ~440 ms to load on public server.\n2. JavaScript lib files refactored with OOP for use with module bundling.

This commit is contained in:
2024-09-10 19:43:02 +01:00
parent da880da90f
commit cef903ff39
7678 changed files with 778712 additions and 1254 deletions

View File

@@ -3,10 +3,11 @@
{% block title %}{{ model.title }}{% endblock %}
{% block page_body %}
<!-- Include Stylesheets -->
<!-- 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 }}">
@@ -49,9 +50,10 @@
{% include 'components/common/temporary/_overlay_address.html' %}
<!-- Include JavaScript -->
<!-- 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' %}
<!--

View File

@@ -3,9 +3,10 @@
{% block title %}{{ model.title }}{% endblock %}
{% block page_body %}
<!-- Include Stylesheets -->
<!-- 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 }}">
@@ -25,9 +26,10 @@
</div>
</div>
<!-- Include JavaScript -->
<!-- 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' %}
<!--

View File

@@ -1,8 +1,10 @@
{% 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() }}
@@ -84,10 +86,11 @@
{% include 'components/common/temporary/_overlay_confirm.html' %}
{% include 'components/common/temporary/_overlay_error.html' %}
<!-- Include JavaScript -->
<!-- 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 }}";

View File

@@ -4,10 +4,10 @@
<!--
{ % 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 }} -->
@@ -119,10 +119,10 @@
{% include 'components/common/temporary/_overlay_confirm.html' %}
{% include 'components/common/temporary/_overlay_error.html' %}
<!-- Include JavaScript -->
<!-- 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
/*

View File

@@ -1,8 +1,10 @@
{% 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() }}
@@ -95,10 +97,11 @@
{% include 'components/common/temporary/_overlay_confirm.html' %}
{% include 'components/common/temporary/_overlay_error.html' %}
<!-- Include JavaScript -->
<!-- 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 }}";

View File

@@ -1,10 +1,12 @@
{% 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() }}
@@ -111,10 +113,11 @@
{% include 'components/common/temporary/_overlay_confirm.html' %}
{% include 'components/common/temporary/_overlay_error.html' %}
<!-- Include JavaScript -->
<!-- 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
/*

View File

@@ -6,9 +6,10 @@
{% 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/store/supplier.css') }}">
-->
<!-- HTML content -->
<div class="card">
@@ -93,9 +94,10 @@
</form>
</div>
<!-- Include JavaScript -->
<!-- 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>