From ef749adeaa13c8b648b99833a0680d906ad35579 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Sun, 10 Jun 2018 10:09:15 +0200 Subject: [PATCH] grandlyon-gnm: switch manifest.json to tmeplate (#24400) --- static/grandlyon-gnm/manifest.json | 35 --------------------- templates/combo/manifest.json | 23 ++++++++++++++ templates/variants/grandlyon-gnm/theme.html | 2 +- themes.json | 4 ++- 4 files changed, 27 insertions(+), 37 deletions(-) delete mode 100644 static/grandlyon-gnm/manifest.json create mode 100644 templates/combo/manifest.json diff --git a/static/grandlyon-gnm/manifest.json b/static/grandlyon-gnm/manifest.json deleted file mode 100644 index b45ebfc..0000000 --- a/static/grandlyon-gnm/manifest.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "Toodego - Grand Lyon", - "short_name": "Toodego", - "display": "standalone", - "icons": [ - { - "sizes": "48x48", - "src": "/static/grandlyon-gnm/img/launcher-icon-48px.png", - "type": "image/png" - }, - { - "sizes": "96x96", - "src": "/static/grandlyon-gnm/img/launcher-icon-96px.png", - "type": "image/png" - }, - { - "sizes": "192x192", - "src": "/static/grandlyon-gnm/img/launcher-icon-192px.png", - "type": "image/png" - }, - { - "sizes": "256x256", - "src": "/static/grandlyon-gnm/img/launcher-icon-256px.png", - "type": "image/png" - }, - { - "sizes": "512x512", - "src": "/static/grandlyon-gnm/img/launcher-icon-512px.png", - "type": "image/png" - } - ], - "start_url": "/", - "background_color": "#E30613", - "theme_color": "#E30613" -} diff --git a/templates/combo/manifest.json b/templates/combo/manifest.json new file mode 100644 index 0000000..0bcb509 --- /dev/null +++ b/templates/combo/manifest.json @@ -0,0 +1,23 @@ +{% load static %}{ + "name": "{% firstof global_title "Compte Citoyen" %}", + "short_name": "{% firstof global_title "Compte Citoyen" %}", + "start_url": "{% firstof pwa_start_url "/" %}", + {% if theme_color %} + "background_color": "{{ theme_color }}", + "theme_color": "{{ theme_color }}", + {% endif %} + {% block icons %} + "icons": [ + {% for icon_size in icon_sizes %} + { + "sizes": "{{ icon_size }}x{{ icon_size }}", + "src": "{{ site_base }}{% static "" %}{{ css_variant }}/{{ icon_prefix }}{{ icon_size }}px.png", + "type": "image/png" + }{% if not forloop.last %},{% endif %} + {% endfor %} + ], + {% endblock %} + {% block extra %} + {% endblock %} + "display": "{% firstof pwa_display "standalone" %}" +} diff --git a/templates/variants/grandlyon-gnm/theme.html b/templates/variants/grandlyon-gnm/theme.html index 8b3ae36..76f2c85 100644 --- a/templates/variants/grandlyon-gnm/theme.html +++ b/templates/variants/grandlyon-gnm/theme.html @@ -2,7 +2,7 @@ {% load static gnm %} {% block extra_top_head %} - + diff --git a/themes.json b/themes.json index e519c4d..71a759b 100644 --- a/themes.json +++ b/themes.json @@ -124,7 +124,9 @@ "variables": { "css_variant": "grandlyon-gnm", "no_extra_js": false, - "theme_color": "#DA0D02" + "theme_color": "#DA0D02", + "icon_sizes": ["48", "96", "192", "256", "512"], + "icon_prefix": "img/launcher-icon-" } }, {"id": "grandlyon-sau", -- 2.17.1