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