<!DOCTYPE html>
<html
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:th="http://www.thymeleaf.org"
	xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
	xmlns:ezy="http://www.ezyplatform.com/thymeleaf/layout">

<head th:remove="tag">
	<th:block th:if="${commonFragments == null || commonFragments.get('styles') == null || commonFragments.get('styles').content == 'styles'}">
		<link rel="stylesheet" type="text/css" ezy:vhref="/css/main.css" />
	</th:block>
	<th:block th:if="${commonFragments != null && commonFragments.get('styles') != null && commonFragments.get('styles').content != 'styles'}">
		<ezy:block ezy:utext="${commonFragments.get('styles').content}" />
	</th:block>
	<th:block th:if="${commonFragments != null && commonFragments.get('header') != null && !#strings.isEmpty(commonFragments.get('header').additionalHead)}">
		<ezy:block ezy:utext="${commonFragments.get('header').additionalHead}" />
	</th:block>
	<th:block th:if="${pageFragments != null && pageFragments.get('container') != null && !#strings.isEmpty(pageFragments.get('container').additionalHead)}">
		<ezy:block ezy:utext="${pageFragments.get('container').additionalHead}" />
	</th:block>
	<th:block th:if="${commonFragments != null && commonFragments.get('footer') != null && !#strings.isEmpty(commonFragments.get('footer').additionalHead)}">
		<ezy:block ezy:utext="${commonFragments.get('footer').additionalHead}" />
	</th:block>
	<style th:inline="css">
		.custom-file-label::after {
			content: "[[#{browse}]]" !important;
		}
	</style>
</head>
<body th:remove="tag">
<div class="wrapper">
	<th:block th:if="${commonFragments != null && commonFragments.get('header') != null && commonFragments.get('header').content != 'header'}">
		<ezy:block ezy:utext="${commonFragments.get('header').content}" />
	</th:block>
	<th:block th:if="${commonFragments == null || commonFragments.get('header') == null || commonFragments.get('header').content == 'header'}">
		<header class="header">
			<th:block th:replace="~{fragments/header :: header}" />
		</header>
	</th:block>
	<th:block th:if="${pageFragments != null && pageFragments.get('container') != null && pageFragments.get('container').content != 'container'}">
		<ezy:block ezy:utext="${pageFragments.get('container').content}" />
	</th:block>
	<th:block th:if="${pageFragments == null || pageFragments.get('container') == null || pageFragments.get('container').content == 'container'}">
		<main class="main-content">
			<div layout:fragment="content"></div>
		</main>
	</th:block>
	<th:block th:if="${commonFragments != null && commonFragments.get('footer') != null && commonFragments.get('footer').content != 'footer'}">
		<ezy:block ezy:utext="${commonFragments.get('footer').content}" />
	</th:block>
	<th:block th:if="${commonFragments == null || commonFragments.get('footer') == null || commonFragments.get('footer').content == 'footer'}">
		<th:block th:replace="~{fragments/footer :: footer}" />
	</th:block>
</div>

<th:block th:replace="~{ezycommon/loading :: content}" />

<th:block layout:fragment="modals" />

<th:block th:if="${commonFragments == null || commonFragments.get('scripts') == null || commonFragments.get('scripts').content == 'scripts'}">
	<!-- REQUIRED SCRIPTS -->
	<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.4/jquery.min.js" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
	<script ezy:vsrc="/js/main.js" type="text/javascript"></script>
</th:block>

<th:block th:if="${commonFragments != null && commonFragments.get('scripts') != null && commonFragments.get('scripts').content != 'scripts'}">
	<ezy:block ezy:utext="${commonFragments.get('scripts').content}" />
</th:block>

<!-- OPTIONAL SCRIPTS -->
<th:block layout:fragment="import-scripts" />
<th:block layout:fragment="pre-main-scripts" />
<th:block layout:fragment="scripts" />
<th:block layout:fragment="post-scripts" />
<th:block layout:fragment="final-scripts" />
<script>
$( document ).ready(function() {
	ezyweb.formatDateStringElements();
	ezyweb.formatDateTimeStringElements();
	ezyweb.formatDateTimeMinuteStringElements();
	ezyweb.formatStatusTextElements();
	ezyweb.formatNumberWithCommasElements();
	if (ezyweb.lang) {
		ezyweb.appendLangParameterToLinks(ezyweb.lang);
	}
});
</script>

<th:block th:replace="~{fragments/header :: scripts}" />

<th:block th:if="${commonFragments != null && commonFragments.get('header') != null && !#strings.isEmpty(commonFragments.get('header').additionalFoot)}">
	<ezy:block ezy:utext="${commonFragments.get('header').additionalFoot}" />
</th:block>
<th:block th:if="${pageFragments != null && pageFragments.get('container') != null && !#strings.isEmpty(pageFragments.get('container').additionalFoot)}">
	<ezy:block ezy:utext="${pageFragments.get('container').additionalFoot}" />
</th:block>
<th:block th:if="${commonFragments != null && commonFragments.get('footer') != null && !#strings.isEmpty(commonFragments.get('footer').additionalFoot)}">
	<ezy:block ezy:utext="${commonFragments.get('footer').additionalFoot}" />
</th:block>
</body>
</html>
