40 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			40 lines
		
	
	
		
			1.1 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/apple-touch-icon-180.png'),
 | |
|                 'sizes': '180x180',
 | |
|                 '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)
 |