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