45 lines
1.3 KiB
Python
45 lines
1.3 KiB
Python
# -*- coding: utf-8 -*-
|
|
from __future__ import annotations
|
|
|
|
from django.http import HttpRequest, JsonResponse
|
|
from django.templatetags.static import static
|
|
from django.urls import reverse
|
|
|
|
from hotpocket_backend.apps.core.conf import settings
|
|
|
|
|
|
def manifest_json(request: HttpRequest) -> JsonResponse:
|
|
result = {
|
|
'name': settings.SITE_TITLE,
|
|
'short_name': settings.SITE_SHORT_TITLE,
|
|
'start_url': reverse('ui.associations.browse'),
|
|
'display': 'standalone',
|
|
'background_color': '#212529',
|
|
'theme_color': '#2b3035',
|
|
'icons': [
|
|
{
|
|
'src': static('ui/img/icon-192.png'),
|
|
'sizes': '192x192',
|
|
'type': 'image/png',
|
|
},
|
|
{
|
|
'src': static('ui/img/icon-512.png'),
|
|
'sizes': '512x512',
|
|
'type': 'image/png',
|
|
},
|
|
],
|
|
'share_target': {
|
|
'action': reverse('ui.integrations.android.share_sheet'),
|
|
'method': 'POST',
|
|
'enctype': 'multipart/form-data',
|
|
'params': {
|
|
'title': 'title',
|
|
'text': 'text',
|
|
'url': 'url',
|
|
'files': [],
|
|
},
|
|
},
|
|
}
|
|
|
|
return JsonResponse(result)
|