xref: /webtrees/resources/views/layouts/default.phtml (revision e5a6b4d4f6f6e7ff2fba7ae2cf27546ae68a79cc)
1<?php use Fisharebest\Webtrees\Auth; ?>
2<?php use Fisharebest\Webtrees\DebugBar; ?>
3<?php use Fisharebest\Webtrees\FlashMessages; ?>
4<?php use Fisharebest\Webtrees\I18N; ?>
5<?php use Fisharebest\Webtrees\Module\ModuleAnalyticsInterface; ?>
6<?php use Fisharebest\Webtrees\Module\ModuleFooterInterface; ?>
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
12<!DOCTYPE html>
13<html <?= I18N::htmlAttributes() ?>>
14    <head>
15        <meta charset="UTF-8">
16        <meta name="csrf" content="<?= e(csrf_token()) ?>">
17        <meta name="viewport" content="width=device-width, initial-scale=1">
18        <meta name="robots" content="<?= e($meta_robots ?? 'noindex') ?>">
19        <meta name="generator" content="<?= e(Webtrees::NAME) ?> <?= e(Webtrees::VERSION) ?>">
20        <?php if ($tree !== null) : ?>
21            <meta name="description" content="<?= e($tree->getPreference('META_DESCRIPTION')) ?>">
22        <?php endif ?>
23
24        <title>
25            <?= strip_tags($title) ?>
26            <?php if ($tree !== null && $tree->getPreference('META_TITLE') !== '') : ?>
27<?= e($tree->getPreference('META_TITLE')) ?>
28            <?php endif ?>
29        </title>
30
31        <link rel="icon" href="themes/_common/css-2.0.0/favicon.png" type="image/png">
32        <link rel="icon" type="image/png" href="themes/_common/css-2.0.0/favicon192.png" sizes="192x192">
33        <link rel="apple-touch-icon" sizes="180x180" href="themes/_common/css-2.0.0/favicon180.png">
34
35        <?php if (I18N::direction() === 'rtl') : ?>
36            <link rel="stylesheet" type="text/css" href="<?= e(Webtrees::ASSETS_PATH . 'css/vendor-rtl.css') ?>">
37        <?php else : ?>
38            <link rel="stylesheet" type="text/css" href="<?= e(Webtrees::ASSETS_PATH . 'css/vendor.css') ?>">
39        <?php endif ?>
40
41        <?php foreach (app()->make(ModuleThemeInterface::class)->stylesheets() as $stylesheet) : ?>
42            <link rel="stylesheet" type="text/css" href="<?=  $stylesheet ?>">
43        <?php endforeach ?>
44
45        <?= View::stack('styles') ?>
46
47        <?= app()->make(ModuleService::class)->findByInterface(ModuleAnalyticsInterface::class)->filter(function (ModuleAnalyticsInterface $module): bool { return $module->analyticsCanShow(); })->map(function (ModuleAnalyticsInterface $module): string { return $module->analyticsSnippet($module->analyticsParameters()); })->implode('') ?>
48
49        <?= DebugBar::renderHead() ?>
50    </head>
51
52    <body class="wt-global">
53        <header class="wt-header-wrapper d-print-none">
54            <div class="container wt-header-container">
55                <div class="row wt-header-content">
56                    <div class="wt-accessibility-links">
57                        <a class="sr-only sr-only-focusable btn btn-info btn-sm" href="#content">
58                            <?= /* I18N: Skip over the headers and menus, to the main content of the page */ I18N::translate('Skip to content') ?>
59                        </a>
60                    </div>
61                    <div class="col wt-site-logo"></div>
62
63                    <?php if ($tree !== null) : ?>
64                        <h1 class="col wt-site-title"><?= e($tree->title()) ?></h1>
65
66                        <div class="col wt-header-search">
67                            <form class="wt-header-search-form" role="search">
68                                <input type="hidden" name="route" value="search-quick">
69                                <input type="hidden" name="ged" value="<?= e($tree->name()) ?>">
70                                <div class="input-group">
71                                    <label class="sr-only" for="quick-search"><?= I18N::translate('Search') ?></label>
72                                    <input type="search" class="form-control wt-header-search-field" id="quick-search" name="query" size="15" placeholder="<?= I18N::translate('Search') ?>">
73                                    <span class="input-group-btn">
74                                        <button type="submit" class="btn btn-primary wt-header-search-button">
75                                            <?= view('icons/search') ?>
76                                        </button>
77                                    </span>
78                                </div>
79                            </form>
80                        </div>
81                    <?php endif ?>
82
83                    <div class="col wt-secondary-navigation">
84                        <ul class="nav wt-secondary-menu">
85                            <?php foreach (app()->make(ModuleThemeInterface::class)->secondaryMenu() as $menu) : ?>
86                                <?= $menu->bootstrap4() ?>
87                            <?php endforeach ?>
88                        </ul>
89                    </div>
90
91                    <?php if ($tree !== null) : ?>
92                    <nav class="col wt-primary-navigation">
93                        <ul class="nav wt-primary-menu">
94                            <?php foreach (app()->make(ModuleThemeInterface::class)->primaryMenu($individual ?? $tree->significantIndividual(Auth::user())) as $menu) : ?>
95                                <?= $menu->bootstrap4() ?>
96                            <?php endforeach ?>
97                        </ul>
98                    </nav>
99                    <?php endif ?>
100                </div>
101            </div>
102        </header>
103
104        <main id="content" class="wt-main-wrapper">
105            <div class="container wt-main-container">
106                <div class="flash-messages">
107                    <?php foreach (FlashMessages::getMessages() as $message) : ?>
108                        <div class="alert alert-<?= e($message->status) ?> alert-dismissible" role="alert">
109                            <button type="button" class="close" data-dismiss="alert" aria-label="<?= I18N::translate('close') ?>">
110                                <span aria-hidden="true">&times;</span>
111                            </button>
112                            <?= $message->text ?>
113                        </div>
114                    <?php endforeach ?>
115                </div>
116
117                <?= $content ?>
118            </div>
119        </main>
120
121        <footer class="wt-footer-container">
122            <div class="wt-footer-content container d-print-none">
123                <?= app()->make(ModuleService::class)->findByInterface(ModuleFooterInterface::class)->map(function (ModuleFooterInterface $module) use ($tree): string { return app()->dispatch($module, 'getFooter'); })->implode('') ?>
124            </div>
125        </footer>
126
127        <script src="<?= e(Webtrees::ASSETS_PATH . 'js/vendor.js') ?>?<?= filemtime(WT_ROOT . Webtrees::ASSETS_PATH . 'js/vendor.js') ?>"></script>
128        <script src="<?= e(Webtrees::ASSETS_PATH . 'js/webtrees.js') ?>?<?= filemtime(WT_ROOT . Webtrees::ASSETS_PATH . 'js/webtrees.js') ?>"></script>
129
130        <script>
131      activate_colorbox();
132      jQuery.extend(jQuery.colorbox.settings, {
133       width: "85%",
134       height: "85%",
135       transition: "none",
136       slideshowStart: "<?= I18N::translate('Play') ?>",
137       slideshowStop: "<?= I18N::translate('Stop') ?>",
138       title: function() { return this.dataset.title; }
139      });
140    </script>
141
142        <?= View::stack('javascript') ?>
143
144        <?= DebugBar::render() ?>
145    </body>
146</html>
147