Commit fbfbadf1 authored by Johannes Winter's avatar Johannes Winter

consent banner on about & home

review tracker setting button
parent cdd8d5b0
......@@ -2375,7 +2375,7 @@
},
"minimist": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
"resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
"integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=",
"dev": true
},
......@@ -3151,7 +3151,7 @@
},
"chalk": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
"resolved": "http://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
"integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=",
"dev": true,
"requires": {
......@@ -3255,7 +3255,7 @@
},
"babel-plugin-syntax-object-rest-spread": {
"version": "6.13.0",
"resolved": "https://registry.npmjs.org/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz",
"resolved": "http://registry.npmjs.org/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz",
"integrity": "sha1-/WU28rzhODb/o6VFjEkDpZe7O/U=",
"dev": true
},
......@@ -5715,7 +5715,7 @@
},
"eslint": {
"version": "4.19.1",
"resolved": "https://registry.npmjs.org/eslint/-/eslint-4.19.1.tgz",
"resolved": "http://registry.npmjs.org/eslint/-/eslint-4.19.1.tgz",
"integrity": "sha512-bT3/1x1EbZB7phzYu7vCr1v3ONuzDtX8WjuM9c0iYxe+cq+pwcKEoQjl7zd3RpC6YOLgnSy3cTN58M2jcoPDIQ==",
"dev": true,
"optional": true,
......@@ -6148,7 +6148,7 @@
},
"external-editor": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/external-editor/-/external-editor-2.2.0.tgz",
"resolved": "http://registry.npmjs.org/external-editor/-/external-editor-2.2.0.tgz",
"integrity": "sha512-bSn6gvGxKt+b7+6TKEv1ZycHleA7aHhRHyAqJyp5pbUFuYYNIzpZnQDk7AsYckyWdEnTeAnay0aCy2aV6iTk9A==",
"dev": true,
"optional": true,
......@@ -7672,7 +7672,7 @@
},
"html-webpack-plugin": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/html-webpack-plugin/-/html-webpack-plugin-3.2.0.tgz",
"resolved": "http://registry.npmjs.org/html-webpack-plugin/-/html-webpack-plugin-3.2.0.tgz",
"integrity": "sha1-sBq71yOsqqeze2r0SS69oD2d03s=",
"dev": true,
"requires": {
......@@ -9096,7 +9096,7 @@
"dependencies": {
"minimist": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
"resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
"integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=",
"dev": true
}
......@@ -9589,7 +9589,7 @@
},
"chalk": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
"resolved": "http://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
"integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=",
"dev": true,
"requires": {
......@@ -12017,7 +12017,7 @@
},
"os-locale": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz",
"resolved": "http://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz",
"integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=",
"dev": true,
"requires": {
......@@ -13602,6 +13602,11 @@
"integrity": "sha1-QFQRqOfmM5/mTbmiNN4R3DHgK9Q=",
"dev": true
},
"tiny-cookie": {
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/tiny-cookie/-/tiny-cookie-2.3.1.tgz",
"integrity": "sha512-C4x1e8dHfKf03ewuN9aIZzzOfN2a6QKhYlnHdzJxmmjMTLqcskI20F+EplszjODQ4SHmIGFJrvUUnBMS/bJbOA=="
},
"tiny-emitter": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/tiny-emitter/-/tiny-emitter-2.1.0.tgz",
......@@ -14191,6 +14196,14 @@
"clipboard": "^2.0.0"
}
},
"vue-cookie-accept-decline": {
"version": "5.3.1",
"resolved": "https://registry.npmjs.org/vue-cookie-accept-decline/-/vue-cookie-accept-decline-5.3.1.tgz",
"integrity": "sha512-jM7FplHH+CgLS+bcezH3kwl0dCwHO1FZBE/8tfSn/YwgohqhOauv9+Wo3Ee7rj+Z68FGoOVRGvA1Bn0Rj2MfsA==",
"requires": {
"tiny-cookie": "^2.1.2"
}
},
"vue-eslint-parser": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/vue-eslint-parser/-/vue-eslint-parser-2.0.3.tgz",
......
......@@ -18,7 +18,8 @@
<script type="text/javascript">
var _paq = _paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(["setCookieDomain", "*.app.solidbase.info"]);
_paq.push(["setCookieDomain", "*.solidbase.info"]);
_paq.push(['requireConsent']);
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
......
<template>
<consent-banner
:ref="'cnsntbnnr'"
:elementId="'cnsntbnnr'"
:debug="false"
:position="'bottom'"
:type="'bar'"
:disableDecline="false"
:transitionName="'slideFromBottom'"
:showPostponeButton="true"
@status="checkState"
@clicked-accept="accept"
@clicked-decline="decline">
<!-- Optional -->
<div slot="postponeContent">
&times;
</div>
<!-- Optional -->
<div slot="message">
This site uses the free software <a target="_blank" href="https://matomo.org">Matomo</a> to analyze traffic and help us to improve your user experience.<br>We process your email address and IP address and cookies are stored on your browser for 13 months. This data is only processed by us and our web hosting platform.<br>
For further information, please review our <a target="_blank" href="https://solidbase.info/legal/imprint/">imprint</a>.
By clicking Accept, you agree to our use of Matomo.
</div>
<!-- Optional -->
<div slot="declineContent">
Don't count me!
</div>
<!-- Optional -->
<div slot="acceptContent">
Accept!
</div>
</consent-banner>
</template>
<script>
/* eslint-disable no-console */
import ConsentBanner from 'vue-cookie-accept-decline'
export default {
name: 'matomo-consent-banner',
components: { ConsentBanner },
data() {
return {
'cookieDuration': 14, // Number of days before the cookie expires, and the banner reappears
}
},
mounted () {
if (this.createCookieWhenBannerIsShown) {
this.createAcceptCookie();
}
},
methods: {
'checkCookie': function(name) {
var nameEQ = name + "=";
var ca = document.cookie.split(';');
for(var i=0;i < ca.length;i++) {
var c = ca[i];
while (c.charAt(0)==' ') c = c.substring(1,c.length);
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
}
return null;
},
'accept': function() {
_paq.push(['rememberConsentGiven', this.cookieDuration*24]);
},
'decline': function() {
_paq.push(['forgetConsentGiven']);
},
'consent': function () {
return this.checkCookie('mtm_consent') != null
},
'checkState': function (state) {
switch (state) {
case 'accept' : {
if (! this.consent()) {
this.$refs.cnsntbnnr.removeCookie()
this.$refs.cnsntbnnr.init()
}
}
break
case 'decline': {
if (this.consent()) {
this.$refs.cnsntbnnr.removeCookie()
this.$refs.cnsntbnnr.init()
}
}
break
case 'postpone': {
}
break
default: {
}
}
}
}
}
</script>
<style>
@import '../../node_modules/vue-cookie-accept-decline/dist/vue-cookie-accept-decline.css';
</style>
Subproject commit 60dbd1993c2354dab9d3065ef1879e877bc7c50d
Subproject commit 2dfb9b24c00dfc08d6a3ffc1aa86b38ca8b058d9
......@@ -30,6 +30,10 @@
</template>
</b-table>
<p class="blocktext" v-html="$t('about-data-3')" />
<b-button type="is-primary" @click="removeCookie" style="margin:5px">{{ $t('review-tracker-settings') }}</b-button>
<h2><br><br>{{$t('translation')}}</h2>
<p v-html="$t('about-translation-p1')" />
<p v-html="$t('about-translation-p2')" />
......@@ -54,17 +58,23 @@
style="margin:auto;" />
<p v-html="$t('about-funding')" />
</div>
<mtmConsent ref="mtmcnsnt"/>
</div>
</template>
<script>
import locale2 from 'locale2'
import mtmConsent from '@/components/matomo-consent-banner.vue'
import {
version
} from '../../package.json'
export default {
name: 'About',
components: {
mtmConsent
},
data() {
return {
idps: [
......@@ -82,7 +92,7 @@ export default {
{
provider: {
displayName: "solid.community",
url: "https://forum.solidproject.org/t/support-proposals-for-solid-community-pod-server/2666?u=yova"
url: "https://forum.solidproject.org/t/support-proposals-for-solid-community-pod-server/2666"
},
terms: {
displayName: "None yet",
......@@ -93,7 +103,7 @@ export default {
{
provider: {
displayName: "SolidBase Development",
url: "https://forum.solidproject.org/t/support-proposals-for-solid-community-pod-server/2666?u=yova"
url: "https://lab.allmende.io/solidbase/solidbase/"
},
terms: {
displayName: "solidbase.info",
......@@ -133,6 +143,13 @@ export default {
mounted() {
this.$locale = locale2.substr(0, 2)
this.$store.state.locale = this.$locale
},
methods: {
removeCookie() {
_paq.push(['forgetConsentGiven']);
this.$refs.mtmcnsnt.$refs.cnsntbnnr.removeCookie()
this.$refs.mtmcnsnt.$refs.cnsntbnnr.init()
},
}
}
</script>
......@@ -18,14 +18,19 @@
<p v-html="$t('home-usage-p4')"/>
<p v-html="$t('home-usage-p5')"/>
</div>
<mtmConsent />
</div>
</template>
<script>
import locale2 from 'locale2'
import mtmConsent from '@/components/matomo-consent-banner.vue'
export default {
name: 'home',
components: {
mtmConsent
},
mounted () {
this.$locale = locale2.substr(0,2)
this.$store.state.locale = this.$locale
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment