<?php

use Jet\MVC;
use Jet\Tr;
use Jet\SysConf_URI;

require_once 'parts/init_libs.php';
?>
<!DOCTYPE html>
<html>
<head>
	<title><?= $this->getString( 'page_title', 'JetApplication admin' ) ?></title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>

	<jet_layout_meta_tags/>
	<jet_layout_css/>
	<jet_layout_javascripts/>

	<link rel="icon" href="<?= SysConf_URI::getImages() ?>favicon.png" type="image/png">
</head>
<body>
<script type="text/javascript">
	$(document).ready(function () {
		const main_toolbar = document.getElementById("main-toolbar");
		if (!main_toolbar) {
			return;
		}
		const main_col = document.getElementById("main-col");
		const main_toolbar_initial_offset = main_toolbar.offsetTop;
		const main_toolbar_height = main_toolbar.offsetHeight;
		const main_col_initial_padding_top = main_col.style.paddingTop;

		window.onscroll = function () {
			if (window.scrollY > main_toolbar_initial_offset) {
				main_toolbar.classList.add("main-toolbar-sticky");
				main_col.style.paddingTop = main_toolbar_height + 'px';
			} else {
				main_toolbar.classList.remove("main-toolbar-sticky");
				main_col.style.paddingTop = main_col_initial_padding_top;
			}
		};
	});
</script>



<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
	<a href="<?= MVC::getHomePage()->getURLPath() ?>"><img src="https://php-jet.net/images/logo-st.svg" style="width: 140px;height: auto"></a>
	<a class="navbar-brand" href="<?= MVC::getHomePage()->getURLPath() ?>">Example Admin</a>

	<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#mainNavBar"
	        aria-controls="mainNavBar" aria-expanded="false" aria-label="">
		<span class="navbar-toggler-icon"></span>
	</button>

	<div class="collapse navbar-collapse" id="mainNavBar">
		<ul class="nav navbar-nav">
			<jet_module module="Admin.UI" action="main_menu"/>
		</ul>

		<ul class="navbar-nav ml-auto">
			<jet_module module="Admin.UI" action="select_locale"/>
			<jet_module module="Admin.Auth.Login" action="current_user_bar"/>
		</ul>
	</div>
</nav>


<jet_module module="Admin.UI" action="breadcrumb_navigation"/>

<div class="container-fluid">
	<div class="row">
		<div class="col-md-12" id="system-messages-area">
			<jet_module module="Admin.UI" action="messages"/>
		</div>
	</div>

	<jet_layout_main_position/>
</div>


<div id="__progress__">

	<div class="loading text-center">
		<div id="__progress_prc__"></div>
		<i class="fa fa-spinner fa-spin fa-3x fa-fw"></i>
		<span class="sr-only"><?= Tr::_( 'Loading ...' ); ?></span>
	</div>
</div>

</body>
</html>