PWA per provider basis
This commit is contained in:
parent
2ef27ba37e
commit
3b32e2eeb1
@ -24,4 +24,12 @@ class MainController extends Controller
|
|||||||
{
|
{
|
||||||
return $this->render('app.html.twig', ['provider' => $provider]);
|
return $this->render('app.html.twig', ['provider' => $provider]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Route("/{provider}/manifest.json", name="webapp_manifest")
|
||||||
|
*/
|
||||||
|
public function manifest(Provider $provider)
|
||||||
|
{
|
||||||
|
return $this->render('manifest.json.twig', ['provider' => $provider]);
|
||||||
|
}
|
||||||
}
|
}
|
@ -42,6 +42,11 @@ class DummyProvider implements Provider
|
|||||||
return "Dummy data for debugging";
|
return "Dummy data for debugging";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getShortName()
|
||||||
|
{
|
||||||
|
return "dummy";
|
||||||
|
}
|
||||||
|
|
||||||
public function getIdentifier()
|
public function getIdentifier()
|
||||||
{
|
{
|
||||||
return "dummy";
|
return "dummy";
|
||||||
|
@ -11,5 +11,6 @@ interface Provider
|
|||||||
public function getTrackRepository(): TrackRepository;
|
public function getTrackRepository(): TrackRepository;
|
||||||
|
|
||||||
public function getName();
|
public function getName();
|
||||||
|
public function getShortName();
|
||||||
public function getIdentifier();
|
public function getIdentifier();
|
||||||
}
|
}
|
@ -30,6 +30,11 @@ class ZtmGdanskProvider implements Provider
|
|||||||
return 'MZKZG - Trójmiasto';
|
return 'MZKZG - Trójmiasto';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getShortName()
|
||||||
|
{
|
||||||
|
return 'Trójmiasto';
|
||||||
|
}
|
||||||
|
|
||||||
public function getIdentifier()
|
public function getIdentifier()
|
||||||
{
|
{
|
||||||
return 'trojmiasto';
|
return 'trojmiasto';
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
{% extends 'base.html.twig' %}
|
{% extends 'base.html.twig' %}
|
||||||
{% block title "#{parent()} - #{provider.name}" %}
|
{% block title "#{parent()} - #{provider.name}" %}
|
||||||
|
{% block manifest path('webapp_manifest', { provider: provider.identifier }) %}
|
||||||
|
|
||||||
{% block body %}
|
{% block body %}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
<meta charset="UTF-8"/>
|
<meta charset="UTF-8"/>
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||||
<link rel="stylesheet" href="{{ asset('main.css') }}" />
|
<link rel="stylesheet" href="{{ asset('main.css') }}" />
|
||||||
<link rel="manifest" href="manifest.json" />
|
<link rel="manifest" href="{% block manifest 'manifest.json' %}" />
|
||||||
|
|
||||||
<!-- icons -->
|
<!-- icons -->
|
||||||
<link rel="icon" href="images/favicon.png" sizes="16x16" />
|
<link rel="icon" href="images/favicon.png" sizes="16x16" />
|
||||||
|
30
templates/manifest.json.twig
Normal file
30
templates/manifest.json.twig
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
{
|
||||||
|
"name": "Czy Dojadę? - {{ provider.shortName }}",
|
||||||
|
"short_name": "Czy Dojadę? - {{ provider.shortName }}",
|
||||||
|
"orientation": "portrait",
|
||||||
|
"lang": "pl_PL",
|
||||||
|
"start_url": "{{ path('app', { provider: provider.identifier }) }}",
|
||||||
|
"display": "standalone",
|
||||||
|
"background_color": "white",
|
||||||
|
"theme_color": "#005ea8",
|
||||||
|
"description": "Odpowiedź na odwieczne pytanie ludzkości - czy tramwaje jeżdżą?",
|
||||||
|
"icons": [{
|
||||||
|
"src": "{{ asset('images/icon-256.png') }}",
|
||||||
|
"sizes": "256x256"
|
||||||
|
},{
|
||||||
|
"src": "{{ asset('images/icon-512.png') }}",
|
||||||
|
"sizes": "512x512"
|
||||||
|
},{
|
||||||
|
"src": "{{ asset('images/icon-64.png') }}",
|
||||||
|
"sizes": "64x64"
|
||||||
|
},{
|
||||||
|
"src": "{{ asset('images/icon-128.png') }}",
|
||||||
|
"sizes": "128x128"
|
||||||
|
},{
|
||||||
|
"src": "{{ asset('images/icon-192.png') }}",
|
||||||
|
"sizes": "192x192"
|
||||||
|
},{
|
||||||
|
"src": "{{ asset('images/icon-96.png') }}",
|
||||||
|
"sizes": "96x96"
|
||||||
|
}]
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user