1.started removal of CDNs.\n 2. Improved modular structure for all parts of project including database.

This commit is contained in:
2024-08-30 23:27:28 +01:00
parent 9de1ccce16
commit ba50aec9c9
2895 changed files with 490579 additions and 7561 deletions

View File

@@ -0,0 +1,24 @@
<!-- Store Product Card
for insertion in _store_product_category_card
-->
{% if product.has_permutations() %}
{% set permutation = product.get_permutation_selected() %}
<div class="card subcard" {{ model.attr_id_product }}="{{ product.id_product }}" {{ model.attr_id_permutation }}="{{ permutation.id_permutation }}">
<div class="container">
<img class="img-product" src="{{ permutation.get_image_from_index(0).url }}" alt="Template product image"> <!-- model.get_many_product_image_src(product.id_product, '', True, 'FULL') -->
</div>
{% if permutation.is_available() %}
{% set form = product.form_basket_add %}
<form {{ model.attr_form_type }}="{{ form.form_type }}" {{ model.attr_id_product }}="{{ product.id_product }}" {{ model.attr_id_permutation }}="{{ permutation.id_permutation }}" class="container column" action="{{ url_for('basket_add') }}" method="POST">
{{ form.hidden_tag() }}
<h2>{{ product.name }}</h2>
<h3>{{ permutation.output_price(model.is_included_VAT) }}</h3>
{% set tmp_quantity = 1 %}
{% include '_block_input_number_plus_minus.html' %}
{{ form.submit() }}
<p>Get it: <strong>{{ permutation.output_delivery_date() }}</strong></p>
</form>
{% endif %}
<!-- { % inc !!!! broken to ignore !!!! lude '_block_store_product_price!!!! broken to ignore !!!!.html' % } -->
</div>
{% endif %}

View File

@@ -0,0 +1,16 @@
<!-- Product price display with purchase options -->
<div class="container column">
<h2>{{ product.output_price() }}</h2> <!-- product.price_GBP -->
{% set form = product.form_basket_add %}
<form {{ model.attr_form_type }}="{{ form.form_type }}" {{ model.attr_id_product }}="{{ product.id_product }}" {{ model.attr_id_permutation }}="{{ permutation.id_permutation }}" class="container column">
{{ form.hidden_tag() }}
{% set tmp_quantity = 1 %}
{% include '_block_input_number_plus_minus.html' %}
{{ form.submit() }}
</form>
<!--
<button class="{{ model.flag_btn_basket_add }}" type="submit" {{ model.attr_id_product }}="{{ product.id }}">Add to basket</button>
<button class="{{ model.flag_btn_buy_now }}" type="submit" {{ model.attr_id_product }}="{{ product.id }}">Buy it now</button>
-->
</div>

View File

@@ -0,0 +1,26 @@
{% extends 'layout.html' %}
{% block title %}{{ model.title }}{% endblock %}
{% block page_body %}
<!-- Include Stylesheet -->
<link rel="stylesheet" href="{{ url_for('static', filename='css/home.css') }}">
<!-- HTML content -->
<div class="card">
<div class="container column">
<h1>Offering a full suite of software engineering services.</h1>
</div>
</div>
<!-- Include JavaScript -->
<script src="{{ url_for('static', filename='js/home.js') }}"></script>
<script>
var hashPageCurrent = "{{ model.hash_page_home }}";
$(document).ready(function() {
hookupPageHome();
});
</script>
{% endblock %}

View File

@@ -0,0 +1,140 @@
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="utf-8"/>
<title>{% block title %}{% endblock %} - PARTS</title>
<!-- Scripts -->
<script src="{{ url_for('static', filename='js/shared.js') }}"></script>
<script src="https://code.jquery.com/jquery-3.7.1.js"></script> <!-- Include jQuery from a CDN -->
<script>
var flagBtnOverlayClose = "{{ model.flag_btn_overlay_close }}";
var flagBtnSubmit = "{{ model.flag_btn_submit }}";
var flagCard = "{{ model.flag_card }}";
var flagCollapsible = "{{ model.flag_collapsible }}";
var flagColumn = "{{ model.flag_column }}";
var flagContainer = "{{ model.flag_container }}";
var flagContainerInput = "{{ model.flag_container_input }}";
var flagRow = "{{ model.flag_row }}";
var flagScrollable = "{{ model.flag_scrollable }}";
var flagBtnOverlayClose = "{{ model.flag_btn_overlay_close }}";
var flagInitialised = "{{ model.flag_initalised }}";
var flagSubmitted = "{{ model.flag_submitted }}";
var hashPageContact = "{{ model.hash_page_contact }}";
var hashPageErrorNoPermission = "{{ model.hash_page_error_no_permission }}";
var hashPageHome = "{{ model.hash_page_home }}";
var hashPageStoreHome = "{{ model.hash_page_store_home }}";
var hashPageStoreProduct = "{{ model.hash_page_store_product }}";
var idFormCurrency = "#{{ model.id_form_currency }}";
var idFormDeliveryRegion = "#{{ model.id_form_delivery_region }}";
var idFormIsIncludedVAT = "#{{ model.id_form_is_included_VAT }}";
var idNavContact = "#{{ model.id_nav_contact }}";
var idNavHome = "#{{ model.id_nav_home }}";
var idNavStoreHome = "#{{ model.id_nav_store_home }}";
var idNavStoreProduct = "#{{ model.id_nav_store_product }}";
var idPageBody = "#{{ model.id_page_body }}";
var isUserLoggedIn = {{ model.output_bool(model.is_user_logged_in) }};
var keyBasket = "{{ model.key_basket }}";
var keyForm = "{{ model.key_form }}";
var keyPrice = "{{ model.key_price }}";
var keyQuantity = "{{ model.key_quantity }}";
var keyShared = "shared";
var _pathHost = "{{ model.url_host }}";
</script>
<!-- Stylesheets -->
<link href="{{ url_for('static', filename='css/shared.css') }}" rel="stylesheet" type="text/css"/>
</head>
<body>
<div class="header card">
<div class="container">
<img class="header-logo" src="{{ url_for('static', filename='images/Logo.png') }}" alt="PARTS logo">
</div>
<div class="container">
<h1>Precision And Research Technology Systems Limited</h1>
</div>
</div>
<div class="topnav container row">
<div class="container column">
<a id="{{ model.id_nav_home }}">Home</a> <!-- href="{{ url_for('home') }}" -->
</div>
<div class="container column">
<a id="{{ model.id_nav_store_home }}">Store</a>
</div>
<div class="container column">
<!-- <a href="{ url_ for('create_price_dummy') }">Create template price</a> -->
<form id="{{ model.id_form_is_included_VAT }}" class="container" action="{{ url_for('set_is_included_VAT') }}" method="POST">
{{ model.form_is_included_VAT.hidden_tag() }}
<div class="container-input">
{{ model.form_is_included_VAT.is_included.label }}
{{ model.form_is_included_VAT.is_included() }}
{% for error in model.form_is_included_VAT.is_included.errors %}
<p class="error">{{ error }}</p>
{% endfor %}
</div>
</form>
</div>
<div class="container column">
<form id="{{ model.id_form_delivery_region }}" class="container" action="{{ url_for('set_delivery_region') }}" method="POST">
{{ model.form_delivery_region.hidden_tag() }}
<div class="container-input">
{{ model.form_delivery_region.id_region_delivery.label }}
{{ model.form_delivery_region.id_region_delivery() }}
{% for error in model.form_delivery_region.id_region_delivery.errors %}
<p class="error">{{ error }}</p>
{% endfor %}
</div>
</form>
</div>
<div class="container column">
<form id="{{ model.id_form_currency }}" class="container" action="{{ url_for('set_currency') }}" method="POST">
{{ model.form_currency.hidden_tag() }}
<div class="container-input">
{{ model.form_currency.id_currency.label }}
{{ model.form_currency.id_currency() }}
{% for error in model.form_currency.id_currency.errors %}
<p class="error">{{ error }}</p>
{% endfor %}
</div>
</form>
</div>
<div class="container column">
<a href="{{ url_for('logout') if model.is_user_logged_in else url_for('login') }}" style="float:right">{{ 'Logout' if model.is_user_logged_in else 'Login' }}</a>
</div>
</div>
<!-- Page body -->
<div id="{{ model.id_page_body }}" class="container" style="display: block;">
{% block page_body %}{% endblock %}
</div>
<div class="footer">
<h4>Copyright (C) Precision And Research Technology Systems Limited. All rights reserved.</h4>
<h5>Company number 13587499</h5>
</div>
</body>
</html>
<!-- Scripts --
<script src="{{ url_for('static', filename='js/main.js') }}"></script>
-->
<!-- Include jQuery from a CDN --
<script src="https://code.jquery.com/jquery-3.7.1.js"></script>
-->
<script>
$(document).ready(function() {
// alert("naughty boy");
hookupShared();
});
</script>

View File

@@ -0,0 +1,9 @@
<!-- Store Product Category Card -->
<div class="card" {{ model.attr_product_category_id }}="{{ cat.id_category }}">
<h3 style="width: 100%; justify-self: left; margin-left: 3vh; display: inline-flex;">{{ cat.name }}</h4>
<div class="container">
{% for product in cat.products %}
{% include '_block_store_product.html' %}
{% endfor %}
</div>
</div>

View File

@@ -0,0 +1,66 @@
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="utf-8"/>
<title>{% block title %}{% endblock %} - PARTS</title>
<!-- Scripts -->
<script src="{{ url_for('static', filename='js/shared.js') }}"></script>
<script src="https://code.jquery.com/jquery-3.7.1.js"></script> <!-- Include jQuery from a CDN -->
<!-- Stylesheets -->
<link href="{{ url_for('static', filename='css/shared.css') }}" rel="stylesheet" type="text/css"/>
</head>
<body>
<div class="header card">
<div class="content">
<img class="header-logo" src="{{ url_for('static', filename='images/Logo.png') }}" alt="PARTS logo">
</div>
<div class="content">
<h1>Precision And Research Technology Systems Limited</h1>
</div>
</div>
<div class="topnav">
<a href="{{ url_for('routes_core.home') }}">Home</a> <!-- -->
<a href="{{ url_for('routes_store.store_home') }}">Store</a>
<!--
<a href="{{ url_for('get_publishable_key') }}">Get Key</a>
<a href="{{ url_for('get_checkout_session') }}">Get Session</a>
<!-- POST request form --
<form id="formCreateCheckoutSession" action="{{ url_for('create_checkout_session') }}" method="POST" style="display: none; visibility: hidden;">
<!-- your form fields go here --
<input type="submit" value="Submit">
</form>
<a href="#" onclick="document.getElementById('formCreateCheckoutSession').submit();">About - Post Session</a>
-->
<a href="{{ url_for('routes_core.contact') }}" style="float:right">Contact</a>
</div>
<div class="content">
{% block content %}{% endblock %}
</div>
<div class="footer">
<h4>Copyright (C) Precision And Research Technology Systems Limited. All rights reserved.</h4>
<h5>Company number 13587499</h5>
</div>
</body>
</html>
<!-- Scripts --
<script src="{{ url_for('static', filename='js/main.js') }}"></script>
-->
<!-- Include jQuery from a CDN --
<script src="https://code.jquery.com/jquery-3.7.1.js"></script>
-->
<script>
$(document).ready(function() {
// alert("naughty boy");
});
</script>