6 Commits

Author SHA1 Message Date
Silvio Leite
0d4488a0c5 chore(setup): Update version 2020-05-30 18:15:07 -03:00
Silvio Leite
8e39aebe17 feat(status_bar): Make status bar style configurable 2020-05-30 18:00:17 -03:00
Silvio Leite
43a8131e8e chore(version): new version on setup 2020-02-03 14:20:55 -03:00
Silvio Luis
61cdbf6727 Merge pull request #35 from Natureshadow/patch-1
Fix URL inclusion
2020-02-03 14:12:03 -03:00
Dominik George
67cf917a08 Fix URL inclusion
Closes #34.
2020-01-26 20:49:26 +01:00
Silvio Leite
63139af3f3 feat(version): Update the version on setup 2020-01-23 07:38:48 -03:00
7 changed files with 13 additions and 6 deletions

View File

@@ -54,6 +54,7 @@ PWA_APP_DISPLAY = 'standalone'
PWA_APP_SCOPE = '/'
PWA_APP_ORIENTATION = 'any'
PWA_APP_START_URL = '/'
PWA_APP_STATUS_BAR_COLOR = 'default'
PWA_APP_ICONS = [
{
'src': '/static/images/my_app_icon.png',

View File

@@ -2,8 +2,12 @@
from django.conf import settings
from django.shortcuts import resolve_url
from django.urls import get_script_prefix
from django.utils.functional import lazy
import os
# Lazy-evaluate URLs so including pwa.urls in root urlconf works
resolve_url = lazy(resolve_url, str)
# Get script prefix for apps not mounted under /
_PWA_SCRIPT_PREFIX = get_script_prefix()
@@ -23,6 +27,7 @@ PWA_APP_DEBUG_MODE = getattr(settings, 'PWA_APP_DEBUG_MODE', True)
PWA_APP_ORIENTATION = getattr(settings, 'PWA_APP_ORIENTATION', 'any')
PWA_APP_START_URL = resolve_url(getattr(settings, 'PWA_APP_START_URL', _PWA_SCRIPT_PREFIX))
PWA_APP_FETCH_URL = resolve_url(getattr(settings, 'PWA_APP_FETCH_URL', _PWA_SCRIPT_PREFIX))
PWA_APP_STATUS_BAR_COLOR = getattr(settings, 'PWA_APP_STATUS_BAR_COLOR', 'default')
PWA_APP_ICONS = getattr(settings, 'PWA_APP_ICONS', [
{
'src': '/static/images/icons/icon-72x72.png',
@@ -102,5 +107,3 @@ PWA_APP_SPLASH_SCREEN = getattr(settings, 'PWA_APP_SPLASH_SCREEN', [
])
PWA_APP_DIR = getattr(settings, 'PWA_APP_DIR', 'auto')
PWA_APP_LANG = getattr(settings, 'PWA_APP_LANG', 'en-US')

View File

@@ -9,6 +9,7 @@
"orientation": {{ PWA_APP_ORIENTATION|js }},
"background_color": {{ PWA_APP_BACKGROUND_COLOR|js }},
"theme_color": {{ PWA_APP_THEME_COLOR|js }},
"status_bar": {{ PWA_APP_STATUS_BAR_COLOR|js }},
"icons": {{ PWA_APP_ICONS|js }},
"dir": {{ PWA_APP_DIR|js }},
"lang": {{ PWA_APP_LANG|js }}

View File

@@ -12,7 +12,7 @@
<!-- Add to homescreen for Safari on iOS -->
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-title" content="{{ PWA_APP_NAME }}">
<meta name="apple-mobile-web-app-status-bar-style" content="default">
<meta name="apple-mobile-web-app-status-bar-style" content="{{ PWA_APP_STATUS_BAR_COLOR }}">
{% if PWA_APP_ICONS_APPLE %}
{% for icon in PWA_APP_ICONS_APPLE %}

View File

@@ -22,7 +22,7 @@ install_requirements = [
setup(
name='django-pwa',
version='1.0.6',
version='1.0.9',
packages=find_packages(),
install_requires=install_requirements,
include_package_data=True,

View File

@@ -19,7 +19,8 @@ class AppSettingsTest(TestCase):
'PWA_APP_FETCH_URL',
'PWA_APP_ICONS',
'PWA_APP_DIR',
'PWA_APP_LANG'
'PWA_APP_LANG',
'PWA_APP_STATUS_BAR_COLOR'
]
for attr in attributes:
with self.subTest():

View File

@@ -37,7 +37,8 @@ class ManifestTest(TestCase):
'"orientation":',
'"icons":',
'"dir":',
'"lang":'
'"lang":',
'"status_bar":'
]
for expected in contents:
with self.subTest():