xref: /webtrees/resources/views/layouts/default.phtml (revision 9e6181127b6320ca605623bf22bb45fd1daffa71)
1<?php use Fisharebest\Webtrees\DebugBar; ?>
2<?php use Fisharebest\Webtrees\FlashMessages; ?>
3<?php use Fisharebest\Webtrees\I18N; ?>
4<?php use Fisharebest\Webtrees\Module\ModuleAnalyticsInterface; ?>
5<?php use Fisharebest\Webtrees\Module\ModuleFooterInterface; ?>
6<?php use Fisharebest\Webtrees\Module\ModuleGlobalInterface; ?>
7<?php use Fisharebest\Webtrees\Module\ModuleThemeInterface; ?>
8<?php use Fisharebest\Webtrees\Services\ModuleService; ?>
9<?php use Fisharebest\Webtrees\View; ?>
10<?php use Fisharebest\Webtrees\Webtrees; ?>
11<?php use Symfony\Component\HttpFoundation\Request; ?>
12
13<!DOCTYPE html>
14<html dir="<?= I18N::direction() ?>" lang="<?= WT_LOCALE ?>">
15    <head>
16        <meta charset="UTF-8">
17        <meta name="csrf" content="<?= e(csrf_token()) ?>">
18        <meta name="viewport" content="width=device-width, initial-scale=1">
19        <meta name="robots" content="<?= e($meta_robots ?? 'noindex') ?>">
20        <meta name="generator" content="<?= e(Webtrees::NAME) ?> <?= e(Webtrees::VERSION) ?>">
21        <?php if ($tree !== null) : ?>
22            <meta name="description" content="<?= e($tree->getPreference('META_DESCRIPTION')) ?>">
23        <?php endif ?>
24
25        <title>
26            <?= strip_tags($title) ?>
27            <?php if ($tree !== null && $tree->getPreference('META_TITLE') !== '') : ?>
28<?= e($tree->getPreference('META_TITLE')) ?>
29            <?php endif ?>
30        </title>
31
32        <!--Generic favicons-->
33        <link rel="icon" sizes="32x32" href="<?= e(asset('favicon-32.png')) ?>">
34        <link rel="icon" sizes="57x57" href="<?= e(asset('favicon-57.png')) ?>">
35        <link rel="icon" sizes="76x76" href="<?= e(asset('favicon-76.png')) ?>">
36        <link rel="icon" sizes="96x96" href="<?= e(asset('favicon-96.png')) ?>">
37        <link rel="icon" sizes="128x128" href="<?= e(asset('favicon-128.png')) ?>">
38        <link rel="icon" sizes="192x192" href="<?= e(asset('favicon-192.png')) ?>">
39        <!--Android-->
40        <link rel="shortcut icon" sizes="196x196" href="<?= e(asset('favicon-196.png')) ?>">
41        <!--iOS-->
42        <link rel="apple-touch-icon" sizes="120x120" href="<?= e(asset('favicon-120.png')) ?>">
43        <link rel="apple-touch-icon" sizes="152x152" href="<?= e(asset('favicon-152.png')) ?>">
44        <link rel="apple-touch-icon" sizes="180x180" href="<?= e(asset('favicon-180.png')) ?>">
45        <!--Windows 8 IE 10-->
46        <meta name="msapplication-TileColor" content="#FFFFFF">
47        <meta name="msapplication-TileImage" content="<?= e(asset('favicon-144.png')) ?>">
48        <!--Windows 8.1 + IE11 and above-->
49        <meta name="msapplication-config" content="<?= e(asset('browserconfig.xml')) ?>">
50
51        <link rel="stylesheet" href="<?= e(asset('css/vendor.min.css')) ?>">
52        <?php foreach (app(ModuleThemeInterface::class)->stylesheets() as $stylesheet) : ?>
53            <link rel="stylesheet" href="<?=  e($stylesheet) ?>">
54        <?php endforeach ?>
55
56        <?= View::stack('styles') ?>
57
58        <?= app(ModuleService::class)->findByInterface(ModuleGlobalInterface::class)->map(function (ModuleGlobalInterface $module): string { return $module->headContent(); })->implode('') ?>
59
60        <?= DebugBar::renderHead() ?>
61    </head>
62
63    <body class="wt-global wt-theme-<?= e(app(ModuleThemeInterface::class)->name()) ?> wt-route-<?= e(app(Request::class)->get('route')) ?>">
64        <header class="wt-header-wrapper d-print-none">
65            <div class="container wt-header-container">
66                <div class="row wt-header-content">
67                    <div class="wt-accessibility-links position-fixed">
68                        <a class="sr-only sr-only-focusable btn btn-info btn-sm" href="#content">
69                            <?= /* I18N: Skip over the headers and menus, to the main content of the page */ I18N::translate('Skip to content') ?>
70                        </a>
71                    </div>
72                    <div class="col wt-site-logo"></div>
73
74                    <?php if ($tree !== null) : ?>
75                        <h1 class="col wt-site-title"><?= e($tree->title()) ?></h1>
76
77                        <div class="col wt-header-search">
78                            <form class="wt-header-search-form" role="search">
79                                <input type="hidden" name="route" value="search-quick">
80                                <input type="hidden" name="ged" value="<?= e($tree->name()) ?>">
81                                <div class="input-group">
82                                    <label class="sr-only" for="quick-search"><?= I18N::translate('Search') ?></label>
83                                    <input type="search" class="form-control wt-header-search-field" id="quick-search" name="query" size="15" placeholder="<?= I18N::translate('Search') ?>">
84                                    <span class="input-group-btn">
85                                        <button type="submit" class="btn btn-primary wt-header-search-button">
86                                            <?= view('icons/search') ?>
87                                        </button>
88                                    </span>
89                                </div>
90                            </form>
91                        </div>
92                    <?php endif ?>
93
94                    <div class="col wt-secondary-navigation">
95                        <ul class="nav wt-user-menu">
96                            <?php foreach (app(ModuleThemeInterface::class)->userMenu($tree) as $menu) : ?>
97                                <?= $menu->bootstrap4() ?>
98                            <?php endforeach ?>
99                        </ul>
100                    </div>
101
102                    <?php if ($tree !== null) : ?>
103                    <nav class="col wt-primary-navigation">
104                        <ul class="nav wt-genealogy-menu">
105                            <?php foreach (app(ModuleThemeInterface::class)->genealogyMenu($tree) as $menu) : ?>
106                                <?= $menu->bootstrap4() ?>
107                            <?php endforeach ?>
108                        </ul>
109                    </nav>
110                    <?php endif ?>
111                </div>
112            </div>
113        </header>
114
115        <main id="content" class="wt-main-wrapper">
116            <div class="container wt-main-container">
117                <div class="flash-messages">
118                    <?php foreach (FlashMessages::getMessages() as $message) : ?>
119                        <div class="alert alert-<?= e($message->status) ?> alert-dismissible" role="alert">
120                            <button type="button" class="close" data-dismiss="alert" aria-label="<?= I18N::translate('close') ?>">
121                                <span aria-hidden="true">&times;</span>
122                            </button>
123                            <?= $message->text ?>
124                        </div>
125                    <?php endforeach ?>
126                </div>
127
128                <?= $content ?>
129            </div>
130        </main>
131
132        <footer class="wt-footers container d-print-none">
133            <?= app(ModuleService::class)->findByInterface(ModuleFooterInterface::class)->map(function (ModuleFooterInterface $module) use ($tree): string { return $module->getFooter($tree); })->implode('') ?>
134        </footer>
135
136        <script src="<?= e(asset('js/vendor.min.js')) ?>"></script>
137        <script src="<?= e(asset('js/webtrees.min.js')) ?>"></script>
138
139        <script>
140      activate_colorbox();
141      jQuery.extend(jQuery.colorbox.settings, {
142       width: "85%",
143       height: "85%",
144       transition: "none",
145       slideshowStart: "<?= I18N::translate('Play') ?>",
146       slideshowStop: "<?= I18N::translate('Stop') ?>",
147       title: function() { return this.dataset.title; }
148      });
149    </script>
150
151        <?= View::stack('javascript') ?>
152
153        <?= app(ModuleService::class)->findByInterface(ModuleGlobalInterface::class)->map(function (ModuleGlobalInterface $module): string { return $module->bodyContent(); })->implode('') ?>
154
155        <?= DebugBar::render() ?>
156    </body>
157</html>
158