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 aac01e687f
commit 0c88f161c3
7678 changed files with 778712 additions and 1254 deletions

View File

@@ -3,10 +3,11 @@
{% block title %}{{ model.title }}{% endblock %}
{% block page_body %}
<!-- Include Stylesheet -->
<!-- Include Stylesheet
<link rel="stylesheet" href="{{ url_for('static', filename='css/sections/core.css') }}">
<link rel="stylesheet" href="{{ url_for('static', filename='css/pages/core/admin_home.css') }}">
-->
<!-- HTML content -->
<div class="{{ model.FLAG_CARD }} {{ model.FLAG_ROW }}">
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_COLUMN }}">
@@ -37,10 +38,10 @@
</div>
</div>
<!-- Include JavaScript -->
<!-- Include JavaScript
<script type="module" src="{{ url_for('static', filename='js/sections/core.js') }}"></script>
<script type="module" src="{{ url_for('static', filename='js/pages/core/admin_home.js') }}"></script>
<!-- <script type="module" src="{{ url_for('static', filename='js/pages/store/base.js') }}"></script> -->
<!- <script type="module" src="{{ url_for('static', filename='js/pages/store/base.js') }}"></script> -->
<!--
<script>

View File

@@ -3,9 +3,10 @@
{% block title %}{{ model.title }}{% endblock %}
{% block page_body %}
<!-- Include Stylesheet -->
<!-- Include Stylesheet
<link rel="stylesheet" href="{{ url_for('static', filename='css/sections/core.css') }}">
<link rel="stylesheet" href="{{ url_for('static', filename='css/pages/core/contact.css') }}">
-->
<script src="https://www.google.com/recaptcha/enterprise.js?render=6Lf8Q8cpAAAAAFAawGu4-ma60bvbEixNVTVvRzKe"></script> <!-- reCaptcha Integration -->
@@ -86,10 +87,11 @@
</div>
</div>
<!-- Include JavaScript -->
<!-- Include JavaScript
<script type="module" src="{{ url_for('static', filename='js/sections/core.js') }}"></script>
<script type="module" src="{{ url_for('static', filename='js/pages/core/contact.js') }}"></script>
-->
<script>
var idEmail = "#{{ model.ID_EMAIL }}";
var idMessage = "#{{ model.ID_MESSAGE }}";

View File

@@ -3,9 +3,10 @@
{% extends 'layouts/layout.html' %}
{% block page_body %}
<!-- Include Stylesheet -->
<!-- Include Stylesheet
<link rel="stylesheet" href="{{ url_for('static', filename='css/sections/core.css') }}" />
<link rel="stylesheet" href="{{ url_for('static', filename='css/pages/core/home.css') }}" />
-->
<!-- HTML content -->
<div>
@@ -14,9 +15,10 @@
{% include 'components/common/buttons/_buttons_save_cancel.html' %}
</div>
<!-- Include JavaScript -->
<!-- Include JavaScript
<script type="module" src="{{ url_for('static', filename='js/sections/core.js') }}"></script>
<script type="module" src="{{ url_for('static', filename='js/pages/core/home.js') }}"></script>
-->
<!--
<script>

View File

@@ -5,10 +5,11 @@
{% block title %}{{ model.title }}{% endblock %}
{% block page_body %}
<!-- Include Stylesheet -->
<!-- Include Stylesheet
<link rel="stylesheet" href="{{ url_for('static', filename='css/sections/core.css') }}" />
<link rel="stylesheet" href="{{ url_for('static', filename='css/pages/core/services.css') }}" />
-->
<!-- HTML content -->
<div class="{{ model.FLAG_CARD }}">
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_COLUMN }}">
@@ -101,10 +102,11 @@
</ul>
</div>
<!-- Include JavaScript -->
<!-- Include JavaScript
<script type="module" src="{{ url_for('static', filename='js/sections/core.js') }}"></script>
<script type="module" src="{{ url_for('static', filename='js/pages/core/services.js') }}"></script>
-->
<!--
<script>
var hashPageCurrent = "{{ model.HASH_PAGE_SERVICES }}";

View File

@@ -3,10 +3,11 @@
{% block title %}{{ model.title }}{% endblock %}
{% block page_body %}
<!-- Include Stylesheet -->
<!-- Include Stylesheet
<link rel="stylesheet" href="{{ url_for('static', filename='css/sections/legal.css') }}">
<link rel="stylesheet" href="{{ url_for('static', filename='css/pages/legal/license.css') }}">
-->
<!-- HTML content -->
<div class="{{ model.FLAG_CARD }} {{ model.FLAG_COLUMN }}">
<p>Copyright &copy; 2024 Precision And Research Technology Systems Limited
@@ -21,10 +22,11 @@
</p>
</div>
<!-- Include JavaScript -->
<!-- Include JavaScript
<script type="module" src="{{ url_for('static', filename='js/sections/legal.js') }}"></script>
<script type="module" src="{{ url_for('static', filename='js/pages/legal/license.js') }}"></script>
-->
<!--
<script>
var hashPageCurrent = "{{ model.HASH_PAGE_LICENSE }}";

View File

@@ -3,9 +3,10 @@
{% block title %}{{ model.title }}{% endblock %}
{% block page_body %}
<!-- Include Stylesheet -->
<!-- Include Stylesheet
<link rel="stylesheet" href="{{ url_for('static', filename='css/sections/legal.css') }}">
<link rel="stylesheet" href="{{ url_for('static', filename='css/pages/legal/privacy_notice.css') }}">
-->
<!-- HTML content -->
<div class="{{ model.FLAG_CARD }} {{ model.FLAG_COLUMN }}">
@@ -80,9 +81,10 @@
<p>1 May 2024</p>
</div>
<!-- Include JavaScript -->
<!-- Include JavaScript
<script type="module" src="{{ url_for('static', filename='js/sections/legal.js') }}"></script>
<script type="module" src="{{ url_for('static', filename='js/pages/legal/privacy_notice.js') }}"></script>
-->
<!--
<script>

View File

@@ -3,9 +3,10 @@
{% block title %}{{ model.title }}{% endblock %}
{% block page_body %}
<!-- Include Stylesheet -->
<!-- Include Stylesheet
<link rel="stylesheet" href="{{ url_for('static', filename='css/sections/legal.css') }}">
<link rel="stylesheet" href="{{ url_for('static', filename='css/pages/legal/services.css') }}">
-->
<!-- HTML content -->
<div class="{{ model.FLAG_CARD }} {{ model.FLAG_COLUMN }}">
@@ -1946,9 +1947,10 @@
</table>
</div>
<!-- Include JavaScript -->
<!-- Include JavaScript
<script type="module" src="{{ url_for('static', filename='js/sections/legal.js') }}"></script>
<script type="module" src="{{ url_for('static', filename='js/pages/legal/retention_schedule.js') }}"></script>
-->
<!--
<script>

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>

View File

@@ -3,10 +3,10 @@
{% extends 'layouts/layout.html' %}
{% block page_body %}
<!-- Include Stylesheet -->
<!-- Include Stylesheet
<link rel="stylesheet" href="{{ url_for('static', filename='css/sections/user.css') }}" />
<link rel="stylesheet" href="{{ url_for('static', filename='css/pages/user.css') }}" />
-->
<!-- HTML content -->
<div>
{% set firstname = 'new user' if user.firstname is none else user.firstname %}
@@ -15,9 +15,10 @@
{% include 'components/common/buttons/_buttons_save_cancel.html' %}
</div>
<!-- Include JavaScript -->
<!-- Include JavaScript
<script type="module" src="{{ url_for('static', filename='js/sections/user.js') }}"></script>
<script type="module" src="{{ url_for('static', filename='js/pages/user.js') }}"></script>
-->
<!--
<script>