Skip to content

Commit

Permalink
Merge pull request #766 from zirreal/robonomics-wiki-test
Browse files Browse the repository at this point in the history
updated privacy policy
  • Loading branch information
zirreal authored Nov 30, 2023
2 parents fc9aa4d + 492e548 commit 41da5f0
Show file tree
Hide file tree
Showing 23 changed files with 727 additions and 18,781 deletions.
1 change: 0 additions & 1 deletion gridsome.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ module.exports = {
options: {
host: 'https://matomo.robonomics.network/',
siteId: 4,
requireConsent: true
}
},
{
Expand Down
18,748 changes: 19 additions & 18,729 deletions package-lock.json

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
"prismjs": "^1.27.0",
"remark-autolink-headings": "^5.2.2",
"remark-highlight.js": "^5.2.0",
"vue-client-actions-tracker-component": "^1.0.2",
"vue-cookies": "^1.7.4",
"vue-meta": "^2.4.0",
"vue-recaptcha": "^1.3.0",
Expand Down
4 changes: 0 additions & 4 deletions src/assets/style/utils.css
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,4 @@
vertical-align: middle;
vertical-align: -moz-middle-with-baseline;
vertical-align: -webkit-baseline-middle;
}

.my-tracker .user-tracker__form {
padding-left: 0;
}
5 changes: 5 additions & 0 deletions src/components/Footer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@
{{ $t('How to edit Wiki') }}
</g-link>
</li>
<li class="footer__item">
<g-link class="footer__link" to="/privacy-policy/">
{{ $t('Privacy Policy') }}
</g-link>
</li>
</ul>

<div class="footer-text" v-if="$locale != 'en'">
Expand Down
81 changes: 81 additions & 0 deletions src/components/MatomoOptOutForm.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
<template>
<div class="optout-form">
<p>{{optDescr}}</p>
<p>{{ optChoice }}</p>
<label class="custom-checkbox">
<input @change="check($event)" type="checkbox" v-model="optOut" name="optout" value="optout" class="custom-checkbox__field">
<span class="custom-checkbox__content"></span>
<strong>{{ optText }}</strong>
</label>
</div>
</template>

<script>
export default {
data() {
return {
optOut: false,
optText: 'You are currently opted out. Click here to opt in',
optDescr: "You may choose not to have a unique web analytics cookie identification number assigned to your computer to avoid the aggregation and analysis of data collected on this website.",
optChoice: "To make that choice, please click below to receive an opt-out cookie"
}
},
methods: {
setOptOutText() {
if(this.$matomo) {
if(this.$matomo && this.$matomo.isUserOptedOut()) {
this.optText = this.$t('You are currently opted out. Click here to opt in.')
this.optDescr = this.$t("Opt-out complete; your visits to this website will not be recorded by the Web Analytics tool. Note that if you clear your cookies, delete the opt-out cookie, or if you change computers or Web browsers, you will need to perform the opt-out procedure again.")
this.optChoice = this.$t("Please click below to opt in:")
} else {
this.optText = this.$t('You are currently opted in. Click here to opt out.')
this.optDescr = this.$t("You may choose not to have a unique web analytics cookie identification number assigned to your computer to avoid the aggregation and analysis of data collected on this website.")
this.optChoice = this.$t("To make that choice, please click below to receive an opt-out cookie")
}
}
},
check() {
if(this.$matomo && this.$matomo.isUserOptedOut()) {
this.$matomo && this.$matomo.forgetUserOptOut();
} else {
this.$matomo && this.$matomo.optUserOut();
}
this.setOptOutText();
}
},
async mounted() {
setTimeout(async () => {
console.log(this.$matomo && this.$matomo.isUserOptedOut())
this.optOut = await this.$matomo && !this.$matomo.isUserOptedOut()
this.setOptOutText();
}, 300)
}
}
</script>

<style scoped>
.optout-form {
padding:calc(var(--space) * 0.5);
min-height: 220px;
border: 2px solid var(--color-dark);
}
.custom-checkbox strong {
padding-left: 40px;
font-size: var(--base-font-size);
}
.custom-checkbox__field:checked + .custom-checkbox__content::before {
background-color: var(--color-blue);
}
</style>
4 changes: 4 additions & 0 deletions src/data/locales/routes.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
- path: '/'
component: './src/pages/Index.vue'
typename: 'page'

- path: '/privacy-policy'
component: './src/pages/privacy-policy.vue'
typename: 'page'
19 changes: 5 additions & 14 deletions src/layouts/Default.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,6 @@
<Footer/>
</div>

<client-only>

<userTracker
classCustom="my-tracker"
@activateTracker="activateTracker"
/>

</client-only>

</div>

</template>
Expand Down Expand Up @@ -65,11 +56,8 @@ export default {
},
activateTracker() {
if(this.$matomo) {
this.$matomo && this.$matomo.setConsentGiven();
this.$matomo && this.$matomo.enableLinkTracking();
this.$matomo && this.$matomo.trackPageView();
}
this.$matomo && this.$matomo.disableCookies();
this.$matomo && this.$matomo.trackPageView();
}
},
Expand All @@ -86,8 +74,11 @@ export default {
document.querySelectorAll('.all-content ').forEach(item => {
item.removeEventListener('scroll', this.activateScrollbar)
})
this.activateTracker();
}
}
</script>

Expand Down
20 changes: 6 additions & 14 deletions src/layouts/Sidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,6 @@
<Footer/>
</div>

<client-only>

<userTracker
classCustom="my-tracker"
@activateTracker="activateTracker"
/>

</client-only>

</div>
</template>

Expand Down Expand Up @@ -176,11 +167,8 @@ export default {
},
activateTracker() {
if(this.$matomo) {
this.$matomo && this.$matomo.setConsentGiven();
this.$matomo && this.$matomo.enableLinkTracking();
this.$matomo && this.$matomo.trackPageView();
}
this.$matomo && this.$matomo.disableCookies();
this.$matomo && this.$matomo.trackPageView();
}
},
Expand Down Expand Up @@ -227,6 +215,10 @@ export default {
});
},
mounted() {
this.activateTracker();
}
}
</script>
6 changes: 0 additions & 6 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ import '~/assets/style/fonts.css'

// import 'gridsome-remark-katex/node_modules/katex/dist/katex.min.css'

// tracker component
import userTracker from 'vue-client-actions-tracker-component'
import '../node_modules/vue-client-actions-tracker-component/dist/vue-client-actions-tracker-component.css'

import DefaultLayout from '~/layouts/Default.vue'
import SidebarLayout from '~/layouts/Sidebar.vue'
import RoboWikiButton from '~/components/RoboWikiButton.vue';
Expand Down Expand Up @@ -119,8 +115,6 @@ export default function (Vue, { router, head, isClient, appOptions }) {
window.scrollTo(0, 0);
head.htmlAttrs = { 'lang' : appOptions.store.state.locale }
})

Vue.use(userTracker);
}

// for translations
Expand Down
Loading

0 comments on commit 41da5f0

Please sign in to comment.