diff --git a/app.js b/app.js index 9358a48..d3f9d6c 100644 --- a/app.js +++ b/app.js @@ -124,6 +124,10 @@ router.on('/orders/:id', async (args) => { const photos = await api.listOrderPhotos(args.id).catch(() => ({ photos: [] })); title(data.order.ref); + // Nur Bilder in der Foto-Grid zeigen; alles andere (PDFs etc.) unten auflisten + const imagePhotos = photos.photos.filter(p => (p.mime || '').startsWith('image/')); + const otherDocs = photos.photos.filter(p => !(p.mime || '').startsWith('image/')); + main().innerHTML = `

Kunde

@@ -145,11 +149,16 @@ router.on('/orders/:id', async (args) => {
-

Hochgeladene Fotos (${photos.photos.length})

+

Hochgeladene Fotos (${imagePhotos.length})

- ${photos.photos.map(p => `
`).join('')} + ${imagePhotos.map(p => `
`).join('')}
+ ${otherDocs.length ? ` +
+

Weitere Dokumente (${otherDocs.length})

+ ${otherDocs.map(p => `

📄 ${escapeHtml(p.filename)}

`).join('')} +
` : ''} `; loadThumbs(); @@ -166,8 +175,9 @@ router.on('/orders/:id', async (args) => { // Reload Photo-Liste try { const np = await api.listOrderPhotos(args.id); + const imgs = np.photos.filter(p => (p.mime || '').startsWith('image/')); document.getElementById('photo-grid').innerHTML = - np.photos.map(p => `
`).join(''); + imgs.map(p => `
`).join(''); loadThumbs(); } catch (e) {} }