diff --git a/README.md b/README.md index a32494f9..30c1e12f 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ Several solutions exist to handle offline mobile data collection. While this typ **Dokomo strives to simplify the process by integrating the elements of a data collection effort into a unified system, from creation of mobile-ready surveys to quick analysis and visualization of the collected data.** -The latest install script is here: https://raw.githubusercontent.com/SEL-Columbia/dokomoforms/v0.2.7/installer.sh +The latest install script is here: https://raw.githubusercontent.com/SEL-Columbia/dokomoforms/v0.2.8/installer.sh ## Features diff --git a/docker-compose.yml b/docker-compose.yml index 98ad5f91..f976fdb4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -10,7 +10,7 @@ nginx: - /etc/letsencrypt:/etc/letsencrypt - /tmp:/tmp webapp: - image: "selcolumbia/dokomoforms:0.2.7" + image: "selcolumbia/dokomoforms:0.2.8" command: bash -c "./docker-wait-for-postgres.sh db && head -c 24 /dev/urandom > cookie_secret && python webapp.py" links: - "db:db" diff --git a/dokomoforms/handlers/util.py b/dokomoforms/handlers/util.py index 2b8b9d90..c959fde1 100644 --- a/dokomoforms/handlers/util.py +++ b/dokomoforms/handlers/util.py @@ -85,10 +85,13 @@ def user_survey_language(self, survey): """Return the logged-in User's selected language for the given survey, or None if they do not have one.""" user = self.current_user_model - if (user - and survey.id in user.preferences - and 'display_language' in user.preferences[survey.id]): + if user is None: + return None + try: return user.preferences[survey.id]['display_language'] + except KeyError: + # preference has not been set + pass return None def set_default_headers(self): @@ -107,6 +110,7 @@ def set_default_headers(self): " cdn.leafletjs.com code.highcharts.com" " momentjs.com cdn.datatables.net https://login.persona.org; " "child-src login.persona.org; " + "frame-src login.persona.org; " "style-src 'self' 'unsafe-inline'" " fonts.googleapis.com cdn.leafletjs.com *.cloudfront.net;" "font-src 'self' fonts.googleapis.com fonts.gstatic.com;" diff --git a/dokomoforms/static/manifest.json b/dokomoforms/static/manifest.json new file mode 100644 index 00000000..ffd58b69 --- /dev/null +++ b/dokomoforms/static/manifest.json @@ -0,0 +1,15 @@ +{ + "name": "Dokomo Forms", + "short_name": "Dokomo Forms", + "start_url": "/enumerate/", + "scope": "/enumerate/", + "display": "standalone", + "icons": [ + { + "src": "/static/dist/admin/img/favicon.png", + "sizes": "196x196", + "type": "image/png" + } + ], + "lang": "en-US" +} diff --git a/dokomoforms/static/src/admin/js/account-overview.js b/dokomoforms/static/src/admin/js/account-overview.js index cd297f67..dc890fdf 100644 --- a/dokomoforms/static/src/admin/js/account-overview.js +++ b/dokomoforms/static/src/admin/js/account-overview.js @@ -88,7 +88,7 @@ var AccountOverview = (function() { zoom: 14, attributionControl: false }); - L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {}).addTo(map); + L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {}).addTo(map); var markers = []; _.each(submissions, function(submission) { console.log(submission); diff --git a/dokomoforms/static/src/common/js/service-worker.js b/dokomoforms/static/src/common/js/service-worker.js new file mode 100644 index 00000000..3b5481af --- /dev/null +++ b/dokomoforms/static/src/common/js/service-worker.js @@ -0,0 +1 @@ +// Nothing to see here diff --git a/dokomoforms/templates/base.html b/dokomoforms/templates/base.html index e201c0dc..ed7e7db8 100644 --- a/dokomoforms/templates/base.html +++ b/dokomoforms/templates/base.html @@ -16,6 +16,7 @@ +