mirror of
https://github.com/flarum/framework.git
synced 2024-12-01 14:20:47 +08:00
feffe53a86
Closes #268. Not going to bother with a preview SVG or anything fancy for now – we can think about that as part of #746. Right now it's just good to finally get this functionality in! Also need to think about apple-touch-icon, msTile stuff, and social sharing image. Not sure if this is all too much for core, but it's definitely too much for the current Appearance page layout. Again, something to think about as part of #746. Code is a bit rough around the edges, but figured there's not much point in using the command bus properly since #870.
68 lines
1.8 KiB
PHP
68 lines
1.8 KiB
PHP
<!doctype html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>{{ $title }}</title>
|
|
<meta name="description" content="{{ $description }}">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1">
|
|
<meta name="theme-color" content="{{ array_get($forum, 'attributes.themePrimaryColor') }}">
|
|
|
|
@foreach ($cssUrls as $url)
|
|
<link rel="stylesheet" href="{{ $url }}">
|
|
@endforeach
|
|
|
|
@if ($faviconUrl = array_get($forum, 'attributes.faviconUrl'))
|
|
<link href="{{ $faviconUrl }}" rel="shortcut icon">
|
|
@endif
|
|
|
|
{!! $head !!}
|
|
</head>
|
|
|
|
<body>
|
|
{!! array_get($forum, 'attributes.headerHtml') !!}
|
|
|
|
{!! $layout !!}
|
|
|
|
<div id="modal"></div>
|
|
<div id="alerts"></div>
|
|
|
|
@if ($allowJs)
|
|
<script>
|
|
document.getElementById('flarum-loading').style.display = 'block';
|
|
</script>
|
|
|
|
@foreach ($jsUrls as $url)
|
|
<script src="{{ $url }}"></script>
|
|
@endforeach
|
|
|
|
<script>
|
|
document.getElementById('flarum-loading').style.display = 'none';
|
|
@if (! $debug)
|
|
try {
|
|
@endif
|
|
var app = System.get('flarum/app').default;
|
|
var modules = {!! json_encode($modules) !!};
|
|
|
|
for (var i in modules) {
|
|
var module = System.get(modules[i]);
|
|
if (module.default) module.default(app);
|
|
}
|
|
|
|
app.boot({!! json_encode($payload) !!});
|
|
@if (! $debug)
|
|
} catch (e) {
|
|
window.location += (window.location.search ? '&' : '?') + 'nojs=1';
|
|
throw e;
|
|
}
|
|
@endif
|
|
</script>
|
|
@else
|
|
<script>
|
|
window.history.replaceState(null, null, window.location.toString().replace(/([&?]nojs=1$|nojs=1&)/, ''));
|
|
</script>
|
|
@endif
|
|
|
|
{!! $foot !!}
|
|
</body>
|
|
</html>
|