updated layout

This commit is contained in:
2019-01-24 22:30:24 +01:00
parent 20f0b767e8
commit 6920d410b5
3 changed files with 15 additions and 32 deletions

View File

@@ -1,25 +0,0 @@
@using Microsoft.AspNetCore.Http.Features
@{
var consentFeature = Context.Features.Get<ITrackingConsentFeature>();
var showBanner = !consentFeature?.CanTrack ?? false;
var cookieString = consentFeature?.CreateConsentCookie();
}
@if (showBanner)
{
<div id="cookieConsent" class="alert alert-info alert-dismissible fade show" role="alert">
Use this space to summarize your privacy and cookie use policy.
<button type="button" class="accept-policy close" data-dismiss="alert" aria-label="Close" data-cookie-string="@cookieString">
<span aria-hidden="true">Accept</span>
</button>
</div>
<script>
(function () {
var button = document.querySelector("#cookieConsent button[data-cookie-string]");
button.addEventListener("click", function (event) {
document.cookie = button.dataset.cookieString;
}, false);
})();
</script>
}

View File

@@ -31,9 +31,10 @@
</div>
</div>
</nav>
</header>
<div class="container">
<partial name="_CookieConsentPartial"/>
<main role="main" class="pb-3">
@RenderBody()
</main>