Skip to content

Commit 1c63651

Browse files
committed
Privacy policy consent, multiple about pages. **collectstatic**, **compilemessages**
- New initial flatpages fixture. - Privacy and cookie consent from users not logged in.
1 parent 7f9efaf commit 1c63651

File tree

9 files changed

+114
-44
lines changed

9 files changed

+114
-44
lines changed

locale/fi/LC_MESSAGES/django.po

Lines changed: 53 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgid ""
88
msgstr ""
99
"Project-Id-Version: PACKAGE VERSION\n"
1010
"Report-Msgid-Bugs-To: \n"
11-
"POT-Creation-Date: 2018-05-04 13:59+0300\n"
11+
"POT-Creation-Date: 2018-05-15 15:32+0300\n"
1212
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1313
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1414
"Language-Team: LANGUAGE <[email protected]>\n"
@@ -273,7 +273,7 @@ msgstr "Täytyy olla CSV-tiedosto .csv päätteellä."
273273

274274
#. Translators: Placeholder text in a search textfield
275275
#: signbank/dictionary/forms.py:259 signbank/dictionary/forms.py:260
276-
#: templates/menu.html:54
276+
#: templates/menu.html:68
277277
msgid "Search gloss"
278278
msgstr "Hae glossia"
279279

@@ -640,7 +640,7 @@ msgstr "Sisältää merkkijonon"
640640

641641
#: signbank/dictionary/templates/dictionary/admin_gloss_list.html:171
642642
#: signbank/dictionary/templates/dictionary/admin_glossrelation_list.html:102
643-
#: templates/menu.html:58
643+
#: templates/menu.html:72
644644
msgctxt "search-button"
645645
msgid "Search"
646646
msgstr "Hae"
@@ -1484,7 +1484,7 @@ msgstr "Glossien videot"
14841484
msgid "Upload Videos"
14851485
msgstr "Lähetä videoita"
14861486

1487-
#: signbank/video/templates/addvideos.html:27 templates/menu.html:36
1487+
#: signbank/video/templates/addvideos.html:27 templates/menu.html:50
14881488
msgid "Upload videos"
14891489
msgstr "Lähetä videoita"
14901490

@@ -1648,32 +1648,32 @@ msgstr ""
16481648
"Tapahtui virhe. Virheestä on tiedotettu ylläpidolle, ja se\n"
16491649
"pyritään korjaamaan mahdollisimman pian. Pahoittelemme tapahtunutta."
16501650

1651-
#: templates/baselayout.html:9 templates/baselayout.html:44
1652-
#: templates/baselayout.html:47
1651+
#: templates/baselayout.html:9 templates/baselayout.html:47
1652+
#: templates/baselayout.html:50
16531653
msgid "Finnish Signbank"
16541654
msgstr "Suomen Signbank"
16551655

1656-
#: templates/baselayout.html:58
1656+
#: templates/baselayout.html:61
16571657
msgid "(No content)"
16581658
msgstr "(Ei sisältöä)"
16591659

1660-
#: templates/baselayout.html:67
1660+
#: templates/baselayout.html:70
16611661
msgid "University of Jyväskylä"
16621662
msgstr "Jyväskylän yliopisto"
16631663

1664-
#: templates/baselayout.html:75
1664+
#: templates/baselayout.html:78
16651665
msgid "Finnish Association of the Deaf"
16661666
msgstr "Kuurojen liitto"
16671667

1668-
#: templates/baselayout.html:78
1668+
#: templates/baselayout.html:81
16691669
msgid "The Language Bank of Finland"
16701670
msgstr "Kielipankki"
16711671

1672-
#: templates/baselayout.html:81
1672+
#: templates/baselayout.html:84
16731673
msgid "CSC - IT center for science"
16741674
msgstr "CSC - Tieteen tietotekniikan keskus"
16751675

1676-
#: templates/comments/latest_comments.html:3 templates/menu.html:44
1676+
#: templates/comments/latest_comments.html:3 templates/menu.html:58
16771677
msgid "Latest comments"
16781678
msgstr "Uusimmat kommentit"
16791679

@@ -1702,7 +1702,7 @@ msgstr "Muokkaa kommenttia"
17021702
msgid "Search Comments"
17031703
msgstr "Etsi kommentteja"
17041704

1705-
#: templates/comments/search_comments.html:9 templates/menu.html:45
1705+
#: templates/comments/search_comments.html:9 templates/menu.html:59
17061706
msgid "Search comments"
17071707
msgstr "Etsi kommentteja"
17081708

@@ -1720,7 +1720,7 @@ msgstr "Muokkaa sivua"
17201720
msgid "Links and Statistics"
17211721
msgstr "Linkkejä ja tilastoja"
17221722

1723-
#: templates/infopage.html:12 templates/menu.html:42
1723+
#: templates/infopage.html:12 templates/menu.html:56
17241724
msgid "Links and statistics"
17251725
msgstr "Linkkejä ja tilastoja"
17261726

@@ -1811,40 +1811,48 @@ msgid "Create account"
18111811
msgstr "Luo tunnus"
18121812

18131813
#. Translators: Button to toggle navigation
1814-
#: templates/menu.html:9
1814+
#: templates/menu.html:8
18151815
msgid "Toggle navigation"
18161816
msgstr "Navigointi"
18171817

1818-
#: templates/menu.html:21
1818+
#: templates/menu.html:17
1819+
msgid "Home"
1820+
msgstr "Etusivu"
1821+
1822+
#: templates/menu.html:22 templates/menu.html:32
1823+
msgid "About"
1824+
msgstr "Tietoa"
1825+
1826+
#: templates/menu.html:35
18191827
msgid "Signs"
18201828
msgstr "Viittomat"
18211829

1822-
#: templates/menu.html:24
1830+
#: templates/menu.html:38
18231831
msgid "Wiki"
18241832
msgstr "Wiki"
18251833

1826-
#: templates/menu.html:26
1834+
#: templates/menu.html:40
18271835
msgctxt "menu-link"
18281836
msgid "Advanced search"
18291837
msgstr "Kehittynyt haku"
18301838

1831-
#: templates/menu.html:27
1839+
#: templates/menu.html:41
18321840
msgid "Search relations"
18331841
msgstr "Relaatiohaku"
18341842

1835-
#: templates/menu.html:32
1843+
#: templates/menu.html:46
18361844
msgid "Manage"
18371845
msgstr "Hallinta"
18381846

1839-
#: templates/menu.html:34
1847+
#: templates/menu.html:48
18401848
msgid "Create gloss"
18411849
msgstr "Luo glossi"
18421850

1843-
#: templates/menu.html:37
1851+
#: templates/menu.html:51
18441852
msgid "Manage uploaded videos"
18451853
msgstr "Lähetettyjen videoiden hallinta"
18461854

1847-
#: templates/menu.html:40
1855+
#: templates/menu.html:54
18481856
msgid "CSV import"
18491857
msgstr "Tuo CSV"
18501858

@@ -1860,6 +1868,28 @@ msgstr "Merkitse kaikki luetuiksi"
18601868
msgid "ago"
18611869
msgstr "sitten"
18621870

1871+
#. Translators: Privacy policy consent text.
1872+
#: templates/policyconsent.html:19
1873+
msgctxt "consent"
1874+
msgid ""
1875+
"This website tracks your usage of the site, and uses cookies to ensure you "
1876+
"get the best experience on our website."
1877+
msgstr ""
1878+
"Tämä verkkosivu seuraa käyttöäsi, sekä käyttää evästeitä parhaan "
1879+
"käyttökokemuksen takaamiseksi."
1880+
1881+
#. Translators: Privacy policy consent: I understand button.
1882+
#: templates/policyconsent.html:21
1883+
msgctxt "consent"
1884+
msgid "Got it!"
1885+
msgstr "Asia selvä!"
1886+
1887+
#. Translators: Privacy policy consent: Privacy policy link name.
1888+
#: templates/policyconsent.html:23
1889+
msgctxt "consent"
1890+
msgid "Privacy policy"
1891+
msgstr "Rekisteriseloste"
1892+
18631893
#: templates/registration/activate.html:4
18641894
msgid "Activation Failure"
18651895
msgstr "Aktivointi epäonnistui"

package-lock.json

Lines changed: 5 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"main": "index.js",
66
"scripts": {
77
"test": "echo \"Error: no test specified\" && exit 1",
8-
"collectjs": "cp -f ./node_modules/*/dist/*min.js ./signbank/static/js && cp -f ./node_modules/recordrtc/RecordRTC.min.js ./signbank/static/js && cp -f ./node_modules/at.js/dist/js/jquery.atwho.min.js ./signbank/static/js",
9-
"collectcss": "cp -f ./node_modules/at.js/dist/css/jquery.atwho.min.css ./signbank/static/css && cp -rf ./node_modules/bootstrap/dist/* ./signbank/static/bootstrap/"
8+
"collectjs": "cp -f ./node_modules/*/dist/*min.js ./signbank/static/js && cp -f ./node_modules/recordrtc/RecordRTC.min.js ./signbank/static/js && cp -f ./node_modules/at.js/dist/js/jquery.atwho.min.js ./signbank/static/js && cp -f ./node_modules/cookieconsent/build/cookieconsent.min.js ./signbank/static/js",
9+
"collectcss": "cp -f ./node_modules/at.js/dist/css/jquery.atwho.min.css ./signbank/static/css && cp -rf ./node_modules/bootstrap/dist/* ./signbank/static/bootstrap/ && cp -f ./node_modules/cookieconsent/build/cookieconsent.min.css ./signbank/static/css"
1010
},
1111
"repository": {
1212
"type": "git",
@@ -22,6 +22,7 @@
2222
},
2323
"homepage": "https://github.com/Signbank/FinSL-signbank#readme",
2424
"dependencies": {
25+
"cookieconsent": "^3.0.6",
2526
"dev": "^0.1.3"
2627
},
2728
"devDependencies": {

signbank/contentpages/fixtures/flatpages_initial_data.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

signbank/static/css/cookieconsent.min.css

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

signbank/static/js/cookieconsent.min.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

templates/baselayout.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@
3131
<meta name="msapplication-TileColor" content="#ffffff">
3232
<meta name="msapplication-TileImage" content="{% static 'favicon/ms-icon-144x144.png' %}">
3333
<meta name="theme-color" content="#ffffff">
34+
{% if not user.is_authenticated %}
35+
{% include "policyconsent.html" %}
36+
{% endif %}
3437
{% block extrahead %}{% endblock %}
3538
</head>
3639
<body>

templates/menu.html

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{% load i18n %}
22
{% load flatpages %}
3-
{% get_flatpages as flatpages %}
43
<nav id="navbar" class="navbar navbar-default">
54
<!-- Brand and toggle get grouped for better mobile display -->
65
<div class="navbar-header">
@@ -15,9 +14,22 @@
1514
<!-- Collect the nav links, forms, and other content for toggling -->
1615
<div class="collapse navbar-collapse" id="navbar-collapse-1">
1716
<ul class="nav navbar-nav">
18-
{% for page in flatpages %}
17+
<li><a href="/">{% blocktrans %}Home{% endblocktrans %}</a></li>
18+
{% get_flatpages '/about/' as about_pages %}
19+
{% if about_pages|length > 1 %}
20+
<li class="dropdown">
21+
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
22+
{% blocktrans %}About{% endblocktrans %} <span class="caret"></span></a>
23+
<ul class="dropdown-menu">
24+
{% for page in about_pages %}
1925
<li><a href="{{ page.url }}">{{ page.title }}</a></li>
20-
{% endfor %}
26+
{% endfor %}
27+
</ul>
28+
</li>
29+
{% else %}
30+
<li><a href="/about/">{% blocktrans %}About{% endblocktrans %}</a></li>
31+
{% endif %}
32+
2133
<li><a href="{% url "dictionary:public_gloss_list" %}">{% blocktrans %}Signs{% endblocktrans %}</a></li>
2234

2335
<li><a href="https://github.com/Signbank/FinSL-signbank/wiki" target="_blank">

templates/policyconsent.html

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{% load i18n %}
2+
{% load staticfiles %}
3+
<link rel="stylesheet" type="text/css" href="{% static 'css/cookieconsent.min.css' %}" />
4+
<script src="{% static 'js/cookieconsent.min.js' %}"></script>
5+
<script>
6+
window.addEventListener("load", function(){
7+
window.cookieconsent.initialise({
8+
"palette": {
9+
"popup": {
10+
"background": "#383b75"
11+
},
12+
"button": {
13+
"background": "#f1d600"
14+
}
15+
},
16+
"theme": "classic",
17+
"content": {
18+
{% comment %}Translators: Privacy policy consent text.{% endcomment %}
19+
"message": "{% blocktrans context 'consent' %}This website tracks your usage of the site, and uses cookies to ensure you get the best experience on our website.{% endblocktrans %}",
20+
{% comment %}Translators: Privacy policy consent: I understand button.{% endcomment %}
21+
"dismiss": "{% blocktrans context 'consent' %}Got it!{% endblocktrans %}",
22+
{% comment %}Translators: Privacy policy consent: Privacy policy link name.{% endcomment %}
23+
"link": "{% blocktrans context 'consent' %}Privacy policy{% endblocktrans %}",
24+
"href": "/about/privacy-policy/"
25+
}
26+
})});
27+
</script>

0 commit comments

Comments
 (0)