xref: /webtrees/resources/views/layouts/administration.phtml (revision abafa13c257ec871f1fb1a1926f33c2748685c38)
1dd6b2bfcSGreg Roach<?php use Fisharebest\Webtrees\DebugBar; ?>
2dd6b2bfcSGreg Roach<?php use Fisharebest\Webtrees\FlashMessages; ?>
3dd6b2bfcSGreg Roach<?php use Fisharebest\Webtrees\I18N; ?>
4*abafa13cSGreg Roach<?php use Fisharebest\Webtrees\Module\ModuleCustomInterface;
5*abafa13cSGreg Roachuse Fisharebest\Webtrees\Module\ModuleGlobalInterface;
6*abafa13cSGreg Roachuse Fisharebest\Webtrees\Services\ModuleService;
7*abafa13cSGreg Roachuse Fisharebest\Webtrees\View; ?>
84e73f0bdSGreg Roach<?php use Symfony\Component\HttpFoundation\Request; ?>
98d0ebef0SGreg Roach
10dd6b2bfcSGreg Roach<!DOCTYPE html>
11e837ff07SGreg Roach<html dir="<?= I18N::direction() ?>" lang="<?= WT_LOCALE ?>">
12dd6b2bfcSGreg Roach    <head>
13dd6b2bfcSGreg Roach        <meta charset="UTF-8">
14dd6b2bfcSGreg Roach        <meta name="viewport" content="width=device-width, initial-scale=1">
15dd6b2bfcSGreg Roach        <meta name="csrf" content="<?= e(csrf_token()) ?>">
16dd6b2bfcSGreg Roach
17dd6b2bfcSGreg Roach        <title><?= $title ?></title>
18dd6b2bfcSGreg Roach
19b08e6999SGreg Roach        <link rel="icon" href="<?= e(asset('favicon.ico')) ?>" type="image/x-icon">
20dd6b2bfcSGreg Roach
21e837ff07SGreg Roach        <link rel="stylesheet" href="<?= e(asset('css/vendor.min.css')) ?>">
22e837ff07SGreg Roach        <link rel="stylesheet" href="<?= e(asset('css/administration.min.css')) ?>">
23dd6b2bfcSGreg Roach
24dd6b2bfcSGreg Roach        <?= View::stack('styles') ?>
25dd6b2bfcSGreg Roach
26*abafa13cSGreg Roach        <?= app(ModuleService::class)->findByInterface(ModuleGlobalInterface::class)->map(function (ModuleGlobalInterface $module): string { return $module instanceof ModuleCustomInterface ? '' : $module->headContent(); })->implode('') ?>
27*abafa13cSGreg Roach
28dd6b2bfcSGreg Roach        <?= DebugBar::renderHead() ?>
29dd6b2bfcSGreg Roach    </head>
304e73f0bdSGreg Roach    <body class="container wt-global wt-route-<?= e(app(Request::class)->get('route')) ?>">
31dd6b2bfcSGreg Roach        <header>
3297c22350SGreg Roach            <div class="wt-accessibility-links position-fixed">
33dd6b2bfcSGreg Roach                <a class="sr-only sr-only-focusable btn btn-info btn-sm" href="#content">
34dd6b2bfcSGreg Roach                    <?= /* I18N: Skip over the headers and menus, to the main content of the page */ I18N::translate('Skip to content') ?>
35dd6b2bfcSGreg Roach                </a>
36dd6b2bfcSGreg Roach            </div>
37dd6b2bfcSGreg Roach
38dd6b2bfcSGreg Roach            <ul class="nav small d-flex justify-content-end">
39dd6b2bfcSGreg Roach                <li class="nav-item menu-mypage">
40dd6b2bfcSGreg Roach                    <a class="nav-link active" href="<?= e(route('user-page')) ?>"><?= I18N::translate('My page') ?></a>
41dd6b2bfcSGreg Roach                </li>
42dd6b2bfcSGreg Roach                <li class="nav-item dropdown menu-language">
43dd6b2bfcSGreg Roach                    <a class="nav-link dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">
44dd6b2bfcSGreg Roach                        <?= I18N::translate('Language') ?>
45dd6b2bfcSGreg Roach                    </a>
46dd6b2bfcSGreg Roach                    <div class="dropdown-menu">
47dd6b2bfcSGreg Roach                        <?php foreach (I18N::activeLocales() as $locale) : ?>
48dd6b2bfcSGreg Roach                            <a class="dropdown-item menu-language-<?= $locale->languageTag() ?> <?= WT_LOCALE === $locale->languageTag() ? ' active' : ''?>" data-language="<?= $locale->languageTag() ?>" href="#"><?= $locale->endonym() ?></a>
49dd6b2bfcSGreg Roach                        <?php endforeach ?>
50dd6b2bfcSGreg Roach                    </div>
51dd6b2bfcSGreg Roach                </li>
52dd6b2bfcSGreg Roach                <li class="nav-item menu-logout">
53dd6b2bfcSGreg Roach                    <a class="nav-link" href="<?= e(route('logout')) ?>"><?= I18N::translate('Sign out') ?></a>
54dd6b2bfcSGreg Roach                </li>
55dd6b2bfcSGreg Roach            </ul>
56dd6b2bfcSGreg Roach        </header>
57dd6b2bfcSGreg Roach
58dd6b2bfcSGreg Roach        <div id="content"></div>
59dd6b2bfcSGreg Roach
60dd6b2bfcSGreg Roach        <?php foreach (FlashMessages::getMessages() as $message) : ?>
61dd6b2bfcSGreg Roach            <div class="alert alert-<?= $message->status ?> alert-dismissible" role="alert">
62dd6b2bfcSGreg Roach                <button type="button" class="close" data-dismiss="alert" aria-label="<?= I18N::translate('close') ?>">
63dd6b2bfcSGreg Roach                    <span aria-hidden="true">&times;</span>
64dd6b2bfcSGreg Roach                </button>
65dd6b2bfcSGreg Roach                <?= $message->text ?>
66dd6b2bfcSGreg Roach            </div>
67dd6b2bfcSGreg Roach        <?php endforeach ?>
68dd6b2bfcSGreg Roach
69dd6b2bfcSGreg Roach        <?= $content ?>
70dd6b2bfcSGreg Roach
71ad727080SGreg Roach        <script src="<?= e(asset('js/vendor.min.js')) ?>"></script>
72ad727080SGreg Roach        <script src="<?= e(asset('js/webtrees.min.js')) ?>"></script>
73dd6b2bfcSGreg Roach
74dd6b2bfcSGreg Roach        <?= View::stack('javascript') ?>
75dd6b2bfcSGreg Roach
76*abafa13cSGreg Roach        <?= app(ModuleService::class)->findByInterface(ModuleGlobalInterface::class)->map(function (ModuleGlobalInterface $module): string { return $module instanceof ModuleCustomInterface ? '' : $module->bodyContent(); })->implode('') ?>
77*abafa13cSGreg Roach
78dd6b2bfcSGreg Roach        <?= DebugBar::render() ?>
79dd6b2bfcSGreg Roach    </body>
80dd6b2bfcSGreg Roach</html>
81