Skip to content

Commit 960b0f8

Browse files
committed
Cookiebot integration draft
1 parent 8c39ffc commit 960b0f8

File tree

5 files changed

+94
-0
lines changed

5 files changed

+94
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+

2+
namespace Umbraco.Cms.Integrations.Script.Cookiebot
3+
{
4+
public class Constants
5+
{
6+
public const string SettingsPath = "Umbraco:Cms:Integrations:Script:Cookiebot:Settings";
7+
}
8+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net6.0</TargetFramework>
5+
<ImplicitUsings>enable</ImplicitUsings>
6+
<Nullable>enable</Nullable>
7+
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
8+
</PropertyGroup>
9+
10+
<ItemGroup>
11+
<PackageReference Include="Umbraco.Cms.Web.Website" version="[10.3.0,12)" />
12+
<PackageReference Include="Umbraco.Cms.Web.BackOffice" version="[10.3.0,12)" />
13+
</ItemGroup>
14+
15+
<ItemGroup>
16+
<Content Include="Views\Partials\UmbracoCms.Integrations\Scripts\Cookiebot\**\*.*">
17+
<Pack>true</Pack>
18+
<PackagePath>Views\Partials\UmbracoCms.Integrations\Scripts\Cookiebot\</PackagePath>
19+
</Content>
20+
<None Include="build\**\*.*">
21+
<Pack>True</Pack>
22+
<PackagePath>buildTransitive</PackagePath>
23+
</None>
24+
</ItemGroup>
25+
26+
<ItemGroup>
27+
<Content Remove="Views\Partials\UmbracoCms.Integrations\Scripts\Cookiebot\Cookiebot.cshtml~RF11f2acff.TMP" />
28+
</ItemGroup>
29+
30+
<ItemGroup>
31+
<None Remove="Views\Partials\UmbracoCms.Integrations\Scripts\Cookiebot\Cookiebot.cshtml~RF11f2acff.TMP" />
32+
</ItemGroup>
33+
34+
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage
2+
3+
@inject Microsoft.Extensions.Configuration.IConfiguration Configuration
4+
5+
@using Umbraco.Cms.Integrations.Script.Cookiebot
6+
7+
@{
8+
var scriptSrc = "https://consent.cookiebot.com/" + Configuration[$"{Constants.SettingsPath}:Id"] + "/cd.js";
9+
}
10+
11+
<script id="CookieDeclaration"
12+
src="@scriptSrc"
13+
type="text/javascript" async></script>
14+
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2+
<PropertyGroup>
3+
<CookiebotPropertyEditorFilesPath>
4+
$(MSBuildThisFileDirectory)..\Views\Partials\UmbracoCms.Integrations\Scripts\Cookiebot\**\*.*
5+
</CookiebotPropertyEditorFilesPath>
6+
</PropertyGroup>
7+
<Target Name="CopyCookiebotPropertyEditorAssets" BeforeTargets="Build">
8+
<ItemGroup>
9+
<CookiebotPropertyEditorFiles Include="$(CookiebotPropertyEditorFilesPath)" />
10+
</ItemGroup>
11+
<Message
12+
Text="Copying Cookiebot Property Editor files: $(CookiebotPropertyEditorFilesPath) - #@(CookiebotPropertyEditorFiles->Count()) files"
13+
Importance="high" />
14+
<Copy SourceFiles="@(CookiebotPropertyEditorFiles)"
15+
DestinationFiles="@(CookiebotPropertyEditorFiles->'$(MSBuildProjectDirectory)\Views\Partials\UmbracoCms.Integrations\Scripts\Cookiebot\%(RecursiveDir)%(Filename)%(Extension)')"
16+
SkipUnchangedFiles="true" />
17+
18+
</Target>
19+
20+
<Target Name="ClearCookiebotPropertyEditorAssets" BeforeTargets="Clean">
21+
<ItemGroup>
22+
<CookiebotPropertyEditorDir
23+
Include="$(MSBuildProjectDirectory)\Views\Partials\UmbracoCms.Integrations\Scripts\Cookiebot\" />
24+
</ItemGroup>
25+
<Message Text="Clear old Cookiebot Property Editor data" Importance="high" />
26+
<RemoveDir Directories="@(CookiebotPropertyEditorDir)" />
27+
</Target>
28+
29+
</Project>

src/Umbraco.Cms.Integrations.sln

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Umbraco.Cms.Integrations.PI
7777
EndProject
7878
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Umbraco.Cms.Integrations.Crm.ActiveCampaign.Core", "Umbraco.Cms.Integrations.Crm.ActiveCampaign.Core\Umbraco.Cms.Integrations.Crm.ActiveCampaign.Core.csproj", "{14303AD9-B64B-4DE1-AB4E-B0979277EAC2}"
7979
EndProject
80+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "General", "General", "{54684516-D990-41C7-885E-96A064A55BB1}"
81+
EndProject
82+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Umbraco.Cms.Integrations.Script.Cookiebot", "Umbraco.Cms.Integrations.Script.Cookiebot\Umbraco.Cms.Integrations.Script.Cookiebot.csproj", "{B6830012-7233-41D5-8CD5-E67635388806}"
83+
EndProject
8084
Global
8185
GlobalSection(SolutionConfigurationPlatforms) = preSolution
8286
Debug|Any CPU = Debug|Any CPU
@@ -151,6 +155,10 @@ Global
151155
{14303AD9-B64B-4DE1-AB4E-B0979277EAC2}.Debug|Any CPU.Build.0 = Debug|Any CPU
152156
{14303AD9-B64B-4DE1-AB4E-B0979277EAC2}.Release|Any CPU.ActiveCfg = Release|Any CPU
153157
{14303AD9-B64B-4DE1-AB4E-B0979277EAC2}.Release|Any CPU.Build.0 = Release|Any CPU
158+
{B6830012-7233-41D5-8CD5-E67635388806}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
159+
{B6830012-7233-41D5-8CD5-E67635388806}.Debug|Any CPU.Build.0 = Debug|Any CPU
160+
{B6830012-7233-41D5-8CD5-E67635388806}.Release|Any CPU.ActiveCfg = Release|Any CPU
161+
{B6830012-7233-41D5-8CD5-E67635388806}.Release|Any CPU.Build.0 = Release|Any CPU
154162
EndGlobalSection
155163
GlobalSection(SolutionProperties) = preSolution
156164
HideSolutionNode = FALSE
@@ -178,6 +186,7 @@ Global
178186
{54A624E5-5321-4CC8-B74B-11ABF3605242} = {F2CAA1F7-9BED-4EB6-8875-D176B92D393A}
179187
{904B3CF6-1015-465E-8244-70FC90466F22} = {B5D14B4B-0E39-4C01-9021-D9A75F358DE1}
180188
{14303AD9-B64B-4DE1-AB4E-B0979277EAC2} = {1A4D3D38-F5B2-4528-92A1-318A7D09949D}
189+
{B6830012-7233-41D5-8CD5-E67635388806} = {54684516-D990-41C7-885E-96A064A55BB1}
181190
EndGlobalSection
182191
GlobalSection(ExtensibilityGlobals) = postSolution
183192
SolutionGuid = {2FB51E08-A3C8-4DFF-B3CB-E99C2ED021D5}

0 commit comments

Comments
 (0)