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:
10
templates/components/common/temporary/_overlay_address.html
Normal file
10
templates/components/common/temporary/_overlay_address.html
Normal file
@@ -0,0 +1,10 @@
|
||||
{% extends '_template_overlay.html' %}
|
||||
|
||||
<!-- Requirements
|
||||
Form_Billing form
|
||||
string overlay_id
|
||||
string overlay_title
|
||||
-->
|
||||
{% block overlay_body %}
|
||||
{% include 'components/store/_address.html' %}
|
||||
{% endblock %}
|
||||
50
templates/components/common/temporary/_overlay_confirm.html
Normal file
50
templates/components/common/temporary/_overlay_confirm.html
Normal file
@@ -0,0 +1,50 @@
|
||||
<div class="{{ model.FLAG_OVERLAY }} {{ model.FLAG_COLLAPSED }} {{ model.FLAG_CARD }}" id="{{ model.ID_OVERLAY_CONFIRM }}" style="visibility: hidden;" z-index="2">
|
||||
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_ROW }}">
|
||||
<h2>Are you sure?</h2>
|
||||
</div>
|
||||
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_ROW }}">
|
||||
<textarea id="{{ model.ID_TEXTAREA_CONFIRM }}" rows="4" cols="50"></textarea>
|
||||
</div>
|
||||
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_ROW }}">
|
||||
{% set block_id = 'button_cancel' %}
|
||||
{% include 'components/common/buttons/_buttons_save_cancel.html' %}
|
||||
{% set block_id = 'button_confirm' %}
|
||||
{% include 'components/common/buttons/_buttons_save_cancel.html' %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
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;
|
||||
|
||||
initialiseEventHandler(selectorButtonCancel, flagInitialised, function(buttonCancel) {
|
||||
buttonCancel.addEventListener('click', function() {
|
||||
let overlay = document.querySelector(idOverlayConfirm);
|
||||
overlay.style.visibility = 'hidden';
|
||||
});
|
||||
});
|
||||
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>
|
||||
32
templates/components/common/temporary/_overlay_error.html
Normal file
32
templates/components/common/temporary/_overlay_error.html
Normal file
@@ -0,0 +1,32 @@
|
||||
<div class="{{ model.FLAG_OVERLAY }} {{ model.FLAG_COLLAPSED }} {{ model.FLAG_CARD }}" id="{{ model.ID_OVERLAY_ERROR }}" style="visibility: hidden;" z-index="2">
|
||||
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_ROW }}">
|
||||
<h2>Error:</h2>
|
||||
<div id="{{ model.ID_LABEL_ERROR }}"></div>
|
||||
</div>
|
||||
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_ROW }}">
|
||||
{% set block_id = 'button_cancel' %}
|
||||
{% include 'components/common/buttons/_buttons_save_cancel.html' %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var idOverlayError = "#{{ model.ID_OVERLAY_ERROR}}";
|
||||
function hookupOverlayError() {
|
||||
let overlay = document.querySelector(idOverlayError);
|
||||
let selectorButtonCancel = idOverlayError + ' button.' + flagCancel;
|
||||
|
||||
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>
|
||||
23
templates/components/common/temporary/template_overlay.html
Normal file
23
templates/components/common/temporary/template_overlay.html
Normal file
@@ -0,0 +1,23 @@
|
||||
|
||||
<!-- Overlay -->
|
||||
<!-- Requires
|
||||
string overlay_id
|
||||
string overlay_title
|
||||
-->
|
||||
|
||||
<div id="{{ overlay_id }}" class="overlay">
|
||||
<div class="{{ model.flag_card }}">
|
||||
<div class="{{ model.flag_container }} {{ model.flag_row }}">
|
||||
<div class="{{ model.flag_container }} {{ model.flag_column }}">
|
||||
<h2>{{ overlay_title }}</h2>
|
||||
</div>
|
||||
<div class="{{ model.flag_container }} {{ model.flag_column }}">
|
||||
<button class="{{ model.flag_btn_overlay_close }}">Close</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="{{ model.flag_container }} {{ model.flag_row }}">
|
||||
{% block overlay_body %}{% endblock %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user