big restructure
This commit is contained in:
@@ -5,36 +5,25 @@ use MintyPHP\Buffer;
|
||||
$defaultTitle = appTitle();
|
||||
$user = $_SESSION['user'] ?? [];
|
||||
$isLoggedIn = !empty($user['id']);
|
||||
$theme = appDefaultTheme();
|
||||
$userTheme = strtolower(trim((string) ($user['theme'] ?? '')));
|
||||
$themes = appThemes();
|
||||
$theme = currentTheme();
|
||||
$primaryVars = appPrimaryCssVars();
|
||||
if (allowUserTheme() && in_array($userTheme, ['light', 'dark'], true)) {
|
||||
$theme = $userTheme;
|
||||
$pageTitle = $defaultTitle;
|
||||
ob_start();
|
||||
Buffer::get('title');
|
||||
$bufferTitle = trim((string) ob_get_clean());
|
||||
if ($bufferTitle !== '') {
|
||||
$pageTitle = $bufferTitle . ' - ' . $defaultTitle;
|
||||
}
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html data-theme="<?php e($theme); ?>" class="no-js" <?php if ($primaryVars !== ''): ?>style="<?php e($primaryVars); ?>"<?php endif; ?>>
|
||||
<html data-theme="<?php e($theme); ?>" data-contrast="normal" data-asset-base="<?php e(asset('')); ?>" class="no-js" <?php if ($primaryVars !== ''): ?>style="<?php e($primaryVars); ?>"<?php endif; ?>>
|
||||
|
||||
<head>
|
||||
<script>
|
||||
(function () {
|
||||
var root = document.documentElement;
|
||||
root.classList.remove('no-js');
|
||||
root.classList.add('js');
|
||||
window.APP_ASSET_BASE = "<?php e(asset('')); ?>";
|
||||
try {
|
||||
if (window.localStorage.getItem('app-sidebar-collapsed') === '1') {
|
||||
root.classList.add('sidebar-collapsed');
|
||||
}
|
||||
} catch (e) {
|
||||
console.warn('app: sidebar state not available', e);
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
<script src="<?php e(asset('js/app-boot.js')); ?>"></script>
|
||||
<base href="<?php e(localeBase()); ?>">
|
||||
<title><?php e($defaultTitle); ?> <?php if (Buffer::get('title'))
|
||||
; ?></title>
|
||||
<title><?php e($pageTitle); ?></title>
|
||||
<meta property="og:site_name" content="<?php e($defaultTitle); ?>">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
@@ -42,7 +31,9 @@ if (allowUserTheme() && in_array($userTheme, ['light', 'dark'], true)) {
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="<?php e(appFaviconUrl('favicon-16x16.png')); ?>">
|
||||
<link rel="apple-touch-icon" href="<?php e(appFaviconUrl('apple-touch-icon.png')); ?>">
|
||||
<link rel="manifest" href="<?php e(asset('favicon/site.webmanifest')); ?>">
|
||||
<link href="<?php e(asset('css/base/variables.css')); ?>" rel="stylesheet">
|
||||
<link href="<?php e(asset('css/base/variables.base.css')); ?>" rel="stylesheet">
|
||||
<link href="<?php e(asset('css/base/variables.theme-dark-green.css')); ?>" rel="stylesheet">
|
||||
<link href="<?php e(asset('css/base/variables.contrast.css')); ?>" rel="stylesheet">
|
||||
<link href="<?php e(asset('vendor/gridjs/mermaid.min.css')); ?>" rel="stylesheet">
|
||||
<link href="<?php e(asset('vendor/multi-select/MultiSelect.css')); ?>" rel="stylesheet">
|
||||
<link href="<?php e(asset('css/components/vendor-multi-select.css')); ?>" rel="stylesheet">
|
||||
@@ -97,8 +88,7 @@ if (allowUserTheme() && in_array($userTheme, ['light', 'dark'], true)) {
|
||||
</div>
|
||||
|
||||
<script src="<?php e(asset('vendor/fslightbox/fslightbox.js')); ?>"></script>
|
||||
<?php $appInitVersion = @filemtime('web/js/app-init.js') ?: time(); ?>
|
||||
<script type="module" src="<?php e(asset('js/app-init.js?v=' . $appInitVersion)); ?>"></script>
|
||||
<script type="module" src="<?php e(assetVersion('js/app-init.js')); ?>"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user