Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
ae9c6869
Commit
ae9c6869
authored
Feb 16, 2017
by
lidijarad
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cookie consent feature flag and popup banner
parent
19d6e21a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
54 additions
and
0 deletions
+54
-0
lms/envs/common.py
+4
-0
lms/templates/footer.html
+4
-0
lms/templates/widgets/cookie-consent.html
+46
-0
No files found.
lms/envs/common.py
View file @
ae9c6869
...
...
@@ -367,6 +367,10 @@ FEATURES = {
# Allow public account creation
'ALLOW_PUBLIC_ACCOUNT_CREATION'
:
True
,
# Enable footer banner for cookie consent.
# See https://cookieconsent.insites.com/ for more.
'ENABLE_COOKIE_CONSENT'
:
False
,
}
# Ignore static asset files on import which match this pattern
...
...
lms/templates/footer.html
View file @
ae9c6869
...
...
@@ -83,3 +83,7 @@
<link
rel=
"stylesheet"
type=
"text/css"
href=
"${url}"
></link>
% endfor
% endif
% if settings.FEATURES.get('ENABLE_COOKIE_CONSENT', False):
<
%
include
file=
"widgets/cookie-consent.html"
/>
% endif
lms/templates/widgets/cookie-consent.html
0 → 100644
View file @
ae9c6869
<!-- Cookie Consent -->
<
%
page
expression_filter=
"h"
/>
<
%!
from
django
.
utils
.
translation
import
ugettext
as
_
%
>
<
%
namespace
name=
'static'
file=
'../static_content.html'
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"//cdnjs.cloudflare.com/ajax/libs/cookieconsent2/3.0.1/cookieconsent.min.css"
/>
<script
src=
"//cdnjs.cloudflare.com/ajax/libs/cookieconsent2/3.0.1/cookieconsent.min.js"
></script>
<script>
window
.
addEventListener
(
"load"
,
function
(){
window
.
cookieconsent
.
initialise
({
window
:
'<div dir="${static.dir_rtl()}" role="dialog" tabindex="-1" id="cookiepopup" aria-label="cookieconsent" class="cc-window {{classes}}"><!--googleoff: all-->{{children}}<!--googleon: all--></div>'
,
palette
:{
popup
:
{
background
:
"#323538"
,
text
:
"#ffffff"
},
button
:
{
background
:
"#005379"
,
text
:
"#ffffff"
},
},
"content"
:
{
"message"
:
"${_('This website uses cookies to ensure you get the best experience on our website.')}"
,
"dismiss"
:
"${_('Got it!')}"
,
"link"
:
"${_('Learn more')}"
,
},
theme
:
"classic"
,
"elements"
:
{
"dismiss"
:
'<a aria-label="dismiss cookie message" id="dismiss" role=button tabindex="2" class="cc-btn cc-dismiss:focus">{{dismiss}}</a>'
,
},
"position"
:
"bottom"
,
"static"
:
"true"
},
function
(
popup
){
$
(
".cc-window"
).
on
(
'keydown'
,
function
(
event
)
{
if
(
event
.
keyCode
==
27
){
popup
.
close
();
}
});
$
(
"#dismiss"
).
on
(
'keydown'
,
function
(
event
)
{
if
(
event
.
keyCode
==
13
||
event
.
keyCode
==
32
)
{
popup
.
onButtonClick
(
event
);
}
});
});
});
</script>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment