Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added cookie consent box to indicate the cookies used by the platform. #166

Merged
merged 2 commits into from
Jan 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions platform/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<meta charset="utf-8">
<meta name="metro4:init" content="false">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/orestbida/[email protected]/dist/cookieconsent.css">
<link rel="stylesheet" href="css/metro-all.min.css" from="https://cdn.metroui.org.ua/v4.4.3/css/metro-all.min.css">
<link rel="stylesheet" href="css/custom.css">
<link rel="stylesheet" href="css/index.css">
Expand All @@ -14,6 +15,9 @@
</head>

<body class="h-100" onresize="fit()" onload="fit();updateGutterVisibility();">

<script type="module" src="js/cookieconsent-config.js"></script>

<div id="preloader"><img src="images/preloader.gif" width="100px"></div>

<div id="login" style="display:none">
Expand Down
64 changes: 64 additions & 0 deletions platform/public/js/cookieconsent-config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
import 'https://cdn.jsdelivr.net/gh/orestbida/[email protected]/dist/cookieconsent.umd.js';

CookieConsent.run({
categories: {
necessary: {
enabled: true, // this category is enabled by default
readOnly: true // this category cannot be disabled
}
},

language: {
default: 'en',
translations: {
en: {
consentModal: {
title: 'Cookies on this site',
description: 'We use cookies to enhance and personalise your experience. Accept all cookies below, or select “Manage cookies” to view our Cookie Policy and see details of the cookies we use.',
acceptAllBtn: 'Accept all',
showPreferencesBtn: 'Manage cookies'
},
preferencesModal: {
title: 'Manage cookie preferences',
acceptNecessaryBtn: 'Accept necessary cookies',
savePreferencesBtn: 'Accept current selection',
closeIconLabel: 'Close modal',
sections: [
{
description: 'When you visit any website, it may store or retrieve information on your browser, mostly in the form of cookies. This information might be about you, your preferences or your device and is mostly used to make the site work as you expect it to. The information does not usually directly identify you, but it can give you a more personalised web experience. Click on the different category headings to find out more about the cookies our site uses.'
},
{
title: 'Strictly Necessary cookies',
description: 'These cookies are essential for the proper functioning of the website and cannot be disabled.',

cookieTable: {
headers: {
name: 'Name',
description: 'Description',
host: 'host',
duration: 'Duration'
},
body: [
{
name: 'mdenetep-auth',
description: 'Used for user authentication purposes and enables the platform to save user progress to and read from private GitHub repositories that they choose.',
host: window.location.hostname,
duration: 'session'
},
{
name: 'JSESSIONID',
description: 'Random session ID used to access each generated Xtext editor.',
host: window.location.hostname,
duration: 'session'
}
]
},
//this field will generate a toggle linked to the 'necessary' category
linkedCategory: 'necessary'
},
]
}
}
}
}
});
Loading