1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-21 17:01:33 +02:00

Merge pull request #4332 from beganovich/v5-client-portal-cookies

(v5) Cookie consent in client portal
This commit is contained in:
Benjamin Beganović 2020-11-19 13:43:03 +01:00 committed by GitHub
commit a4b49bb596
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 54 additions and 1 deletions

View File

@ -70,13 +70,15 @@
@if((bool) \App\Utils\Ninja::isSelfHost())
{!! $client->getSetting('portal_custom_head') !!}
@endif
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/cookieconsent@3/build/cookieconsent.min.css" />
</head>
@include('portal.ninja2020.components.primary-color')
<body class="antialiased">
@if(session()->has('message'))
<div class="bg-primary text-sm py-1 text-white text-center disposable-alert">
<div class="py-1 text-sm text-center text-white bg-primary disposable-alert">
{{ session('message') }}
</div>
@endif
@ -86,6 +88,31 @@
@endcomponent
@livewireScripts
<script src="https://cdn.jsdelivr.net/npm/cookieconsent@3/build/cookieconsent.min.js" data-cfasync="false"></script>
<script>
window.addEventListener("load", function(){
if (! window.cookieconsent) {
return;
}
window.cookieconsent.initialise({
"palette": {
"popup": {
"background": "#000"
},
"button": {
"background": "#f1d600"
},
},
"content": {
"href": "https://www.invoiceninja.com/privacy-policy/",
"message": "This website uses cookies to ensure you get the best experience on our website.",
"dismiss": "Got it!",
"link": "Learn more",
}
})}
);
</script>
</body>
<footer>

View File

@ -59,10 +59,36 @@
{{-- Feel free to push anything to header using @push('header') --}}
@stack('head')
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/cookieconsent@3/build/cookieconsent.min.css" />
</head>
<body class="antialiased {{ $custom_body_class ?? '' }}">
@yield('body')
<script src="https://cdn.jsdelivr.net/npm/cookieconsent@3/build/cookieconsent.min.js" data-cfasync="false"></script>
<script>
window.addEventListener("load", function(){
if (! window.cookieconsent) {
return;
}
window.cookieconsent.initialise({
"palette": {
"popup": {
"background": "#000"
},
"button": {
"background": "#f1d600"
},
},
"content": {
"href": "https://www.invoiceninja.com/privacy-policy/",
"message": "This website uses cookies to ensure you get the best experience on our website.",
"dismiss": "Got it!",
"link": "Learn more",
}
})}
);
</script>
</body>
<footer>