Skip to content

Commit 16f9b00

Browse files
AdmanTomiBelan
authored andcommitted
anketa popup: reading cookie stuff from settings (#141)
* fixes #140 Signed-off-by: Adrian Matejov <[email protected]>
1 parent 8da95c3 commit 16f9b00

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

votrfront/default_settings.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515

1616
ua_code = None
1717

18+
anketa_cookie_name = 'anketaKolacik2019Leto'
19+
anketa_cookie_hide_date = '02 July 2019'
20+
1821
servers = [
1922
dict(
2023
title='ais2.uniba.sk + REST',

votrfront/front.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ def static_url(filename):
6565
def app_response(request, **my_data):
6666
my_data['url_root'] = request.url_root
6767
my_data['instance_name'] = request.app.settings.instance_name
68+
my_data['anketa_cookie_name'] = request.app.settings.anketa_cookie_name
69+
my_data['anketa_cookie_hide_date'] = request.app.settings.anketa_cookie_hide_date
6870
if 'csrf_token' not in my_data:
6971
my_data['servers'] = request.app.settings.servers
7072

votrfront/js/AnketaPopup.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import { CacheRequester, Loading } from './ajax';
55
var dropCookie = true; // false disables the Cookie, allowing you to style the banner
66
var cookieDurationClose = 3;
77
var cookieDurationVote = 60;
8-
var cookieName = 'anketaKolacik2019Leto'; // Name of our cookie
8+
var cookieName = Votr.settings.anketa_cookie_name; // Name of our cookie
99
var cookieValue = 'on'; // Value of cookie
10-
var cookieHideDate = Date.parse('02 July 2019'); // Starting this day the cookie won't be visible
10+
var cookieHideDate = Date.parse(Votr.settings.anketa_cookie_hide_date); // Starting this day the cookie won't be visible
1111

1212

1313
export class AnketaPopup extends React.Component {

0 commit comments

Comments
 (0)