xref: /webtrees/resources/views/modules/privacy-policy/footer.phtml (revision 2ebcf907ed34213f816592af04e6c160335d6311)
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="btn-close" data-bs-dismiss="alert" aria-label="<?= I18N::translate('close') ?>">
24            </button>
25        </div>
26
27        <?php View::push('javascript') ?>
28            <script>
29                if (localStorage.getItem("cookie-warning") !== "ok") {
30                    document.getElementById("cookie-warning").classList.add("show");
31                }
32                document.getElementById("cookie-warning-button").addEventListener("click", function () {
33                    localStorage.setItem("cookie-warning", "ok");
34                });
35            </script>
36        <?php View::endpush() ?>
37    <?php endif ?>
38</div>
39
40
41