xref: /webtrees/resources/views/modules/privacy-policy/footer.phtml (revision c9c6f2ec6e88594e58f14a6418e0de5aaa1484bd)
1<?php
2
3use Fisharebest\Webtrees\I18N;
4use Fisharebest\Webtrees\Tree;
5use Fisharebest\Webtrees\View;
6
7/**
8 * @var Tree $tree
9 * @var bool $uses_analytics
10 */
11
12?>
13
14<div class="wt-footer wt-footer-privacy-policy text-center py-2">
15    <a href="<?= e(route('module', ['module' => 'privacy-policy', 'action' => 'Page', 'tree' => $tree->name()])) ?>">
16        <?= I18N::translate('Privacy policy') ?>
17    </a>
18
19    <?php if ($uses_analytics) : ?>
20        <div class="alert alert-info alert-dismissible fade" id="cookie-warning">
21            <?= I18N::translate('This website uses cookies to learn about visitor behavior.') ?>
22
23            <button type="button" id="cookie-warning-button" class="close" data-dismiss="alert" aria-label="<?= I18N::translate('close') ?>">
24                <span aria-hidden="true">&times;</span>
25            </button>
26        </div>
27
28        <?php View::push('javascript') ?>
29            <script>
30                if (localStorage.getItem("cookie-warning") !== "ok") {
31                    document.getElementById("cookie-warning").classList.add("show");
32                }
33                document.getElementById("cookie-warning-button").addEventListener("click", function () {
34                    localStorage.setItem("cookie-warning", "ok");
35                });
36            </script>
37        <?php View::endpush() ?>
38    <?php endif ?>
39</div>
40
41
42