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