Skip to content
This repository has been archived by the owner on Jul 27, 2019. It is now read-only.

Cookie banner enhancement #4

Open
tang2087 opened this issue Aug 19, 2018 · 0 comments
Open

Cookie banner enhancement #4

tang2087 opened this issue Aug 19, 2018 · 0 comments
Labels
enhancement New feature or request ui UI related changes

Comments

@tang2087
Copy link
Contributor

Change cookie banner to follow the new asp.net core 2.x standard:

`@using Microsoft.AspNetCore.Http.Features

@{
var consentFeature = Context.Features.Get();
var showBanner = !consentFeature?.CanTrack ?? false;
var cookieString = consentFeature?.CreateConsentCookie();
}

@if (showBanner)
{





Toggle cookie consent banner








Use this space to summarize your privacy and cookie use policy.



Learn More
Accept




<script>
(function () {
document.querySelector("#cookieConsent button[data-cookie-string]").addEventListener("click", function (el) {
document.cookie = el.target.dataset.cookieString;
document.querySelector("#cookieConsent").classList.add("hidden");
}, false);
})();
</script>
}`

@tang2087 tang2087 added enhancement New feature or request ui UI related changes labels Aug 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request ui UI related changes
Projects
None yet
Development

No branches or pull requests

1 participant