Skip to content

Commit

Permalink
Merge pull request #1 from avency/feature/moveToGithub
Browse files Browse the repository at this point in the history
task: move code to github
  • Loading branch information
gerdemann authored Jun 22, 2020
2 parents 96d4378 + 9e4094d commit 1b87d75
Show file tree
Hide file tree
Showing 13 changed files with 166 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Configuration/NodeTypes.Content.CookieBot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
'Avency.Neos.CookieBot:Content.CookieBot':
superTypes:
'Neos.Neos:Content': true
options:
fusion:
prototypeGenerator: ~
ui:
group: 'modules-special'
label: i18n
icon: 'icon-question-circle'
position: 3090
11 changes: 11 additions & 0 deletions Configuration/NodeTypes.Mixin.CookieBotKey.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
'Avency.Neos.CookieBot:Mixin.CookieBotKey':
abstract: true
properties:
cookieBotKey:
type: string
defaultValue: ''
ui:
label: i18n
inspector:
group: 'document'
position: 'end'
16 changes: 16 additions & 0 deletions Configuration/Settings.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Enter CookieBot key here if you don't use the mixin
#
#Avency:
# Neos:
# CookieBot:
# key: ''
Neos:
Neos:
fusion:
autoInclude:
'Avency.Neos.CookieBot': true
userInterface:
translation:
autoInclude:
'Avency.Neos.CookieBot':
- 'NodeTypes/*'
21 changes: 21 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2020 avency GmbH <info@avency.de>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
37 changes: 37 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Avency.Neos.CookieBot

> A package to integrate [Cookiebot](https://www.cookiebot.com/) into Neos.
## Authors & Sponsors

Benjamin Kentsch - benjamin.kentsch@avency.de
Michael Gerdemann - michael.gerdemann@avency.de

The development and the public-releases of this package is generously sponsored by our employer https://www.avency.de.

## Installation

```
composer require avency/neos-cookiebot
```

## Configuration

Configure the key in Settings.yaml:

```
Avency:
Neos:
CookieBot:
key: ''
```

Or add the mixin to your root page:

```
superTypes:
'Avency.Neos.CookieBot:Mixin.CookieBotKey': true
```
## License

The MIT License (MIT). Please see [License File](./LICENSE.md) for more information.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
prototype(Avency.Neos.CookieBot:Component.Atom.CookieBot) < prototype(Neos.Fusion:Component) {
// API
scriptTag = ''

// Rendering
renderer = afx`
{props.scriptTag}
`
}
9 changes: 9 additions & 0 deletions Resources/Private/Fusion/Content/CookieBot.fusion
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
prototype(Avency.Neos.CookieBot:Content.CookieBot) < prototype(Neos.Neos:ContentComponent) {
// Rendering
renderer = Avency.Neos.CookieBot:Component.Atom.CookieBot {
key = ${!String.isBlank(q(site).property('cookieBotKey')) ? q(site).property('cookieBotKey') : Configuration.setting('Avency.Neos.CookieBot.key')}

scriptTag = ${'<script id="CookieDeclaration" src="//consent.cookiebot.com/' + this.key + '/cd.js" type="text/javascript" async></script>'}
scriptTag.@if.enable = ${!String.isBlank(this.key)}
}
}
9 changes: 9 additions & 0 deletions Resources/Private/Fusion/Override/Page.fusion
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
prototype(Neos.Neos:Page) {
cookieBot = Neos.Fusion:Value {
key = ${!String.isBlank(q(site).property('cookieBotKey')) ? q(site).property('cookieBotKey') : Configuration.setting('Avency.Neos.CookieBot.key')}
value = ${'<script id="Cookiebot" src="//consent.cookiebot.com/uc.js" data-cbid="' + this.key + '" data-blockingmode="auto" type="text/javascript"></script>'}
@if.enable = ${!String.isBlank(this.key)}
@if.notInBackend = ${!site.context.inBackend}
@position = 'before head'
}
}
1 change: 1 addition & 0 deletions Resources/Private/Fusion/Root.fusion
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include: **/*.fusion
11 changes: 11 additions & 0 deletions Resources/Private/Translations/de/NodeTypes/Content/CookieBot.xlf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2">
<file original="" product-name="Avency.Neos.CookieBot" source-language="en" datatype="plaintext" target-language="de">
<body>
<trans-unit id="ui.label" xml:space="preserve" approved="yes">
<source>Cookie declaration</source>
<target xml:lang="de">Cookie-Erklärung</target>
</trans-unit>
</body>
</file>
</xliff>
11 changes: 11 additions & 0 deletions Resources/Private/Translations/de/NodeTypes/Mixin/CookieBotKey.xlf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2">
<file original="" product-name="Avency.Neos.CookieBot" source-language="en" datatype="plaintext" target-language="de">
<body>
<trans-unit id="properties.cookieBotKey" xml:space="preserve" approved="yes">
<source>CookieBot Key</source>
<target xml:lang="de">CookieBot Key</target>
</trans-unit>
</body>
</file>
</xliff>
10 changes: 10 additions & 0 deletions Resources/Private/Translations/en/NodeTypes/Content/CookieBot.xlf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2">
<file original="" product-name="Avency.Neos.CookieBot" source-language="en" datatype="plaintext">
<body>
<trans-unit id="ui.label" xml:space="preserve" approved="yes">
<source>Cookie declaration</source>
</trans-unit>
</body>
</file>
</xliff>
10 changes: 10 additions & 0 deletions Resources/Private/Translations/en/NodeTypes/Mixin/CookieBotKey.xlf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2">
<file original="" product-name="Avency.Neos.CookieBot" source-language="en" datatype="plaintext">
<body>
<trans-unit id="properties.cookieBotKey" xml:space="preserve" approved="yes">
<source>CookieBot Key</source>
</trans-unit>
</body>
</file>
</xliff>

0 comments on commit 1b87d75

Please sign in to comment.