Skip to content

Commit

Permalink
Merge pull request #232 from SEL-Columbia/web-app-manifest-merge-2
Browse files Browse the repository at this point in the history
Web app manifest merge
  • Loading branch information
vr2262 committed Jan 13, 2016
2 parents 4026638 + 839cfca commit 21d1aa4
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 11 deletions.
15 changes: 15 additions & 0 deletions dokomoforms/static/manifest.json
Original file line number Diff line number Diff line change
@@ -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"
}
1 change: 1 addition & 0 deletions dokomoforms/static/src/common/js/service-worker.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// Nothing to see here
1 change: 1 addition & 0 deletions dokomoforms/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<link href="/static/dist/admin/css/admin.css" rel="stylesheet" type="text/css">

<link rel="icon" href="/static/dist/admin/img/favicon.png">
<link rel="manifest" href="/static/manifest.json">

<title>{{ options.organization }} Surveys -- Powered by DokomoData</title>
</head>
Expand Down
15 changes: 15 additions & 0 deletions dokomoforms/templates/view_enumerate.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,21 @@

<link href='https://fonts.googleapis.com/css?family=Roboto:400,300,500,700,100' rel='stylesheet' type='text/css'>
<link rel="icon" href="/static/dist/survey/img/favicon.png">
<link rel="manifest" href="/static/manifest.json">
<script>
// From https://github.com/GoogleChrome/samples/blob/cbc8098c3ebda4dda0ff894673d3847eae31648f/app-install-banner/basic-banner/index.html
window.addEventListener('load', function() {
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('/static/src/common/js/service-worker.js', { scope: '/static/src/common/js/' })
.then(function(r) {
console.log('registered service worker');
})
.catch(function(error) {
console.error(error);
});
};
});
</script>
</head>

<body>
Expand Down
3 changes: 2 additions & 1 deletion tests/python/test_selenium.py
Original file line number Diff line number Diff line change
Expand Up @@ -4082,7 +4082,8 @@ def test_add_new_facility(self):
self.sleep()
self.wait_for_element(
'.btn-add-facility',
by=By.CSS_SELECTOR
by=By.CSS_SELECTOR,
timeout=10,
)
# click add button
self.click(
Expand Down
20 changes: 10 additions & 10 deletions webapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,16 @@ def __init__(self, session=None, options=options):

sur = SurveyResource

settings = {
'template_path': os.path.join(_pwd, 'dokomoforms', 'templates'),
'static_path': os.path.join(_pwd, 'dokomoforms', 'static'),
'default_handler_class': handlers.NotFound,
'xsrf_cookies': True,
'cookie_secret': get_cookie_secret(),
'login_url': '/',
'debug': options.debug,
}

urls = [
# Administrative
url(r'/', handlers.Index, name='index'),
Expand Down Expand Up @@ -252,16 +262,6 @@ def __init__(self, session=None, options=options):
),
]

settings = {
'template_path': os.path.join(_pwd, 'dokomoforms/templates'),
'static_path': os.path.join(_pwd, 'dokomoforms/static'),
'default_handler_class': handlers.NotFound,
'xsrf_cookies': True,
'cookie_secret': get_cookie_secret(),
'login_url': '/',
'debug': options.debug,
}

# HTTPS
if options.https:
settings['xsrf_cookie_kwargs'] = {'secure': True}
Expand Down

0 comments on commit 21d1aa4

Please sign in to comment.