summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSerghei Mihai <smihai@entrouvert.com>2019-04-16 10:05:12 (GMT)
committerSerghei Mihai <smihai@entrouvert.com>2019-04-16 10:10:48 (GMT)
commit4f9a057353b1bae47ba0ceea8f99835cc29bdf2c (patch)
tree0be3b327ef56a120306db1fe55c6597e1d2ad2c9
parent2bd06c348bee608123b9026c092c9c09f61dc773 (diff)
downloadcombo-wip/32371-custom-pwa-title.zip
combo-wip/32371-custom-pwa-title.tar.gz
combo-wip/32371-custom-pwa-title.tar.bz2
pwa: allow custom title (#32371)wip/32371-custom-pwa-title
-rw-r--r--combo/apps/pwa/templates/combo/manifest.json4
-rw-r--r--tests/test_pwa.py3
2 files changed, 5 insertions, 2 deletions
diff --git a/combo/apps/pwa/templates/combo/manifest.json b/combo/apps/pwa/templates/combo/manifest.json
index bbb71d3..49fc134 100644
--- a/combo/apps/pwa/templates/combo/manifest.json
+++ b/combo/apps/pwa/templates/combo/manifest.json
@@ -1,6 +1,6 @@
{% load static thumbnail %}{
- "name": "{% firstof global_title "Compte Citoyen" %}",
- "short_name": "{% firstof global_title "Compte Citoyen" %}",
+ "name": "{% firstof pwa_title global_title "Compte Citoyen" %}",
+ "short_name": "{% firstof pwa_title global_title "Compte Citoyen" %}",
"start_url": "{% firstof pwa_start_url "/" %}",
{% if theme_color %}
"background_color": "{{ theme_color }}",
diff --git a/tests/test_pwa.py b/tests/test_pwa.py
index c375377..cf2ec6f 100644
--- a/tests/test_pwa.py
+++ b/tests/test_pwa.py
@@ -32,6 +32,9 @@ def test_manifest_json(app):
with override_settings(TEMPLATE_VARS={'global_title': 'FooBar'}):
assert app.get('/manifest.json', status=200).json['name'] == 'FooBar'
+ with override_settings(TEMPLATE_VARS={'pwa_title': 'CustomTitle', 'global_title': 'FooBar'}):
+ assert app.get('/manifest.json', status=200).json['name'] == 'CustomTitle'
+
def test_service_worker(app):
app.get('/service-worker.js', status=200)
app.get('/service-worker-registration.js', status=200)