From 8110a95111447413af0704e063f8dc8bd9bb1264 Mon Sep 17 00:00:00 2001 From: rafsanulhasan Date: Sat, 1 Sep 2018 15:01:40 +0600 Subject: [PATCH] 1. Added _CookieConseentPartial.cshtml Partial View 2. Used _CookieConseentPartial partial view in _Layout View 3. Added Privacy View Controller and View --- src/Web/WebMVC/Controllers/HomeController.cs | 16 + src/Web/WebMVC/Views/Home/Privacy.cshtml | 6 + .../Views/Shared/_CookieConsentPartial.cshtml | 41 +++ src/Web/WebMVC/Views/Shared/_Layout.cshtml | 274 +++++++++--------- 4 files changed, 201 insertions(+), 136 deletions(-) create mode 100644 src/Web/WebMVC/Controllers/HomeController.cs create mode 100644 src/Web/WebMVC/Views/Home/Privacy.cshtml create mode 100644 src/Web/WebMVC/Views/Shared/_CookieConsentPartial.cshtml diff --git a/src/Web/WebMVC/Controllers/HomeController.cs b/src/Web/WebMVC/Controllers/HomeController.cs new file mode 100644 index 000000000..24a6346ec --- /dev/null +++ b/src/Web/WebMVC/Controllers/HomeController.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; + +namespace WebMVC.Controllers +{ + public class HomeController : Controller + { + public IActionResult Privacy() + { + return View(); + } + } +} \ No newline at end of file diff --git a/src/Web/WebMVC/Views/Home/Privacy.cshtml b/src/Web/WebMVC/Views/Home/Privacy.cshtml new file mode 100644 index 000000000..7bd38619c --- /dev/null +++ b/src/Web/WebMVC/Views/Home/Privacy.cshtml @@ -0,0 +1,6 @@ +@{ + ViewData["Title"] = "Privacy Policy"; +} +

@ViewData["Title"]

+ +

Use this page to detail your site's privacy policy.

diff --git a/src/Web/WebMVC/Views/Shared/_CookieConsentPartial.cshtml b/src/Web/WebMVC/Views/Shared/_CookieConsentPartial.cshtml new file mode 100644 index 000000000..bbfbb09ac --- /dev/null +++ b/src/Web/WebMVC/Views/Shared/_CookieConsentPartial.cshtml @@ -0,0 +1,41 @@ +@using Microsoft.AspNetCore.Http.Features + +@{ + var consentFeature = Context.Features.Get(); + var showBanner = !consentFeature?.CanTrack ?? false; + var cookieString = consentFeature?.CreateConsentCookie(); +} + +@if (showBanner) +{ + + +} \ No newline at end of file diff --git a/src/Web/WebMVC/Views/Shared/_Layout.cshtml b/src/Web/WebMVC/Views/Shared/_Layout.cshtml index 5d616afaf..2d14e0f83 100644 --- a/src/Web/WebMVC/Views/Shared/_Layout.cshtml +++ b/src/Web/WebMVC/Views/Shared/_Layout.cshtml @@ -1,139 +1,141 @@  - - - - @ViewData["Title"] - Microsoft.eShopOnContainers.WebMVC - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @RenderBody() - - -
-
-
- -
- -
- -
- -
- -
-
-
- - - - - - - - - - - - - @RenderSection("scripts", required: false) - - - @using Microsoft.AspNetCore.Authentication; - @using Microsoft.Extensions.Options - @inject IOptions settings - - - + + + + @ViewData["Title"] - Microsoft.eShopOnContainers.WebMVC + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @RenderBody() + + +
+
+
+ +
+ +
+ +
+ +
+ +
+
+
+ + + + + + + + + + + + + @RenderSection("scripts", required: false) + + + @using Microsoft.AspNetCore.Authentication; + @using Microsoft.Extensions.Options + @inject IOptions settings + + +