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