@inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel>
@using Dynamicweb.Frontend
@{
    @* 
    WARNING: All this code that prints out ugly things is in here so you do not accidently include this custom code to the solution.

	This razor file is an example of how custom code can be injected to the <head> section
	If this file is chosen on the website settings "Custom <head> include", it is injected with RenderPartial so that the current instance of the PageViewModel is available in this template.
	Use this file to inject custom js, css and other things in the head section.
	This file is called on all pages, so think about performance. *@

    @*Include custom or external js*@
    AddScript("/Files/Templates/Designs/Swift-v2/Custom/custom.js", true, false);

    @*Include custom or external css*@
    AddStylesheet("/Files/Templates/Designs/Swift-v2/Custom/custom.css", "all");

	//Check if cookies are accepted in Dynamicweb Cookie dialog and check the level that has been accepted. Scripts that sets cookies should respect these settings.
	//Scripts that does not set cookies, should just be included without any checks
	@* bool allowCookies = (Dynamicweb.Environment.CookieManager.CookieOptInLevelExists && Dynamicweb.Environment.CookieManager.GetCookieOptInLevel() != Dynamicweb.Environment.CookieOptInLevel.None);
	if (allowCookies)
	{
		var cookieLevel = Dynamicweb.Environment.CookieManager.GetCookieOptInLevel();
		if (cookieLevel == Dynamicweb.Environment.CookieOptInLevel.Functional)
		{
			//This is including a script containing only feature related cookies
            AddScript("https://fancy-feature.com/feature-script.min.js", true);

		}
		if (cookieLevel == Dynamicweb.Environment.CookieOptInLevel.All)
		{
			//This is including a script that sets tracking or marketing cookies
            AddScript("https://fancy-feature.com/feature-script.min.js", true);
		}
	} *@
}