Move all samples to the root dir
Signed-off-by: Anca Iordache <anca.iordache@docker.com>
This commit is contained in:
		
							parent
							
								
									0c6fcde001
								
							
						
					
					
						commit
						f1e4cca535
					
				
					 262 changed files with 0 additions and 0 deletions
				
			
		
							
								
								
									
										41
									
								
								aspnet-mssql/app/aspnetapp/Views/Shared/_CookieConsentPartial.cshtml
									
										
									
									
									
										Executable file
									
								
							
							
						
						
									
										41
									
								
								aspnet-mssql/app/aspnetapp/Views/Shared/_CookieConsentPartial.cshtml
									
										
									
									
									
										Executable file
									
								
							|  | @ -0,0 +1,41 @@ | |||
| @using Microsoft.AspNetCore.Http.Features | ||||
| 
 | ||||
| @{ | ||||
|     var consentFeature = Context.Features.Get<ITrackingConsentFeature>(); | ||||
|     var showBanner = !consentFeature?.CanTrack ?? false; | ||||
|     var cookieString = consentFeature?.CreateConsentCookie(); | ||||
| } | ||||
| 
 | ||||
| @if (showBanner) | ||||
| { | ||||
|     <nav id="cookieConsent" class="navbar navbar-default navbar-fixed-top" role="alert"> | ||||
|         <div class="container"> | ||||
|             <div class="navbar-header"> | ||||
|                 <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#cookieConsent .navbar-collapse"> | ||||
|                     <span class="sr-only">Toggle cookie consent banner</span> | ||||
|                     <span class="icon-bar"></span> | ||||
|                     <span class="icon-bar"></span> | ||||
|                     <span class="icon-bar"></span> | ||||
|                 </button> | ||||
|                 <span class="navbar-brand"><span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span></span> | ||||
|             </div> | ||||
|             <div class="collapse navbar-collapse"> | ||||
|                 <p class="navbar-text"> | ||||
|                     Use this space to summarize your privacy and cookie use policy. | ||||
|                 </p> | ||||
|                 <div class="navbar-right"> | ||||
|                     <a asp-controller="Home" asp-action="Privacy" class="btn btn-info navbar-btn">Learn More</a> | ||||
|                     <button type="button" class="btn btn-default navbar-btn" data-cookie-string="@cookieString">Accept</button> | ||||
|                 </div> | ||||
|             </div> | ||||
|         </div> | ||||
|     </nav> | ||||
|     <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> | ||||
| } | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue