diff --git a/Web/pwa-app b/Web/pwa-app new file mode 160000 index 0000000..da45c25 --- /dev/null +++ b/Web/pwa-app @@ -0,0 +1 @@ +Subproject commit da45c250396ca827471e0cd92ed5d192fb2171ec diff --git a/Web/static/img/icon-192.png b/Web/static/img/icon-192.png new file mode 100644 index 0000000..a4fc96b Binary files /dev/null and b/Web/static/img/icon-192.png differ diff --git a/Web/static/img/icon-512.png b/Web/static/img/icon-512.png new file mode 100644 index 0000000..7e00b42 Binary files /dev/null and b/Web/static/img/icon-512.png differ diff --git a/Web/static/manifest.json b/Web/static/manifest.json index 0326ed4..fe49129 100644 --- a/Web/static/manifest.json +++ b/Web/static/manifest.json @@ -1,134 +1,23 @@ { - "name": "Inventarsystem", - "short_name": "Inventar", - "description": "Verwaltungssystem für Schulinventare mit Ausleihmanagement", + "name": "Ausleihsystem", + "short_name": "Ausleihe", + "description": "System zur Verwaltung von Ausleihen", "start_url": "/", - "scope": "/", "display": "standalone", - "orientation": "portrait-primary", "background_color": "#ffffff", - "theme_color": "#007bff", - "dir": "ltr", - "lang": "de-DE", - "prefer_related_applications": false, - "related_applications": [], + "theme_color": "#1f2937", "icons": [ { - "src": "/static/img/logo-72x72.png", - "sizes": "72x72", + "src": "/static/img/icon-192.png", "type": "image/png", - "purpose": "any" - }, - { - "src": "/static/img/logo-96x96.png", - "sizes": "96x96", - "type": "image/png", - "purpose": "any" - }, - { - "src": "/static/img/logo-128x128.png", - "sizes": "128x128", - "type": "image/png", - "purpose": "any" - }, - { - "src": "/static/img/logo-144x144.png", - "sizes": "144x144", - "type": "image/png", - "purpose": "any" - }, - { - "src": "/static/img/logo-152x152.png", - "sizes": "152x152", - "type": "image/png", - "purpose": "any" - }, - { - "src": "/static/img/logo-192x192.png", "sizes": "192x192", - "type": "image/png", - "purpose": "any" + "purpose": "any maskable" }, { - "src": "/static/img/logo-384x384.png", - "sizes": "384x384", + "src": "/static/img/icon-512.png", "type": "image/png", - "purpose": "any" - }, - { - "src": "/static/img/logo-512x512.png", "sizes": "512x512", - "type": "image/png", - "purpose": "any" - }, - { - "src": "/static/img/logo-192x192-maskable.png", - "sizes": "192x192", - "type": "image/png", - "purpose": "maskable" - }, - { - "src": "/static/img/logo-512x512-maskable.png", - "sizes": "512x512", - "type": "image/png", - "purpose": "maskable" + "purpose": "any maskable" } - ], - "screenshots": [ - { - "src": "/static/img/screenshot-540x720.png", - "sizes": "540x720", - "type": "image/png", - "form_factor": "narrow" - }, - { - "src": "/static/img/screenshot-1280x720.png", - "sizes": "1280x720", - "type": "image/png", - "form_factor": "wide" - } - ], - "categories": ["education", "productivity"], - "shortcuts": [ - { - "name": "Meine Ausleihungen", - "short_name": "Ausleihungen", - "description": "Zeige meine aktuellen Ausleihungen", - "url": "/my_borrowed_items", - "icons": [ - { - "src": "/static/img/shortcut-96x96.png", - "sizes": "96x96" - } - ] - }, - { - "name": "Kalender", - "short_name": "Kalender", - "description": "Kalender für Ausleihplanungen", - "url": "/terminplan", - "icons": [ - { - "src": "/static/img/shortcut-96x96.png", - "sizes": "96x96" - } - ] - } - ], - "share_target": { - "action": "/share", - "method": "POST", - "enctype": "multipart/form-data", - "params": { - "title": "title", - "text": "text", - "url": "url", - "files": [ - { - "name": "media", - "accept": ["image/*", "video/*"] - } - ] - } - } + ] } diff --git a/Web/static/sw.js b/Web/static/sw.js new file mode 100644 index 0000000..e0e9100 --- /dev/null +++ b/Web/static/sw.js @@ -0,0 +1,18 @@ +const CACHE_NAME = 'ausleihe-cache-v1'; + +self.addEventListener('install', (event) => { + self.skipWaiting(); +}); + +self.addEventListener('activate', (event) => { + event.waitUntil(clients.claim()); +}); + +self.addEventListener('fetch', (event) => { + // Einfacher Fallback aufs Netzwerk (Offline-Seite könnte hier ergänzt werden) + event.respondWith( + fetch(event.request).catch(() => { + return caches.match(event.request); + }) + ); +}); diff --git a/Web/templates/base.html b/Web/templates/base.html index 631ba9e..04ca0ee 100755 --- a/Web/templates/base.html +++ b/Web/templates/base.html @@ -14,6 +14,7 @@ +