mirror of
https://github.com/Matewoo/pdf-writer.git
synced 2026-11-18 18:42:50 +01:00
new digital signage for tablet
This commit is contained in:
@@ -254,6 +254,10 @@ app.get('/digitalSignage/weeklyFeed', (req, res) => {
|
|||||||
res.sendFile(path.join(__dirname, '../frontend/public/digitalSignage', 'weeklyFeed.html'));
|
res.sendFile(path.join(__dirname, '../frontend/public/digitalSignage', 'weeklyFeed.html'));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
app.get('/digitalSignage/tabletFeed', (req, res) => {
|
||||||
|
res.sendFile(path.join(__dirname, '../frontend/public/digitalSignage', 'tabletFeed.html'));
|
||||||
|
});
|
||||||
|
|
||||||
// Geschützte Routen
|
// Geschützte Routen
|
||||||
app.get('/edit/menu', requireLogin, (req, res) => {
|
app.get('/edit/menu', requireLogin, (req, res) => {
|
||||||
res.sendFile(path.join(__dirname, '../frontend/public/edit', 'menu.html'));
|
res.sendFile(path.join(__dirname, '../frontend/public/edit', 'menu.html'));
|
||||||
|
|||||||
@@ -0,0 +1,94 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="de">
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<link href="https://fonts.googleapis.com/css2?family=Fira+Sans:wght@400;500;700&display=swap" rel="stylesheet">
|
||||||
|
<title>tabletFeed</title>
|
||||||
|
<style>
|
||||||
|
body {
|
||||||
|
font-family: 'Fira Sans', sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
h1 {
|
||||||
|
color: #a81411;
|
||||||
|
font-size: 85px;
|
||||||
|
font-weight: 300;
|
||||||
|
font-style: italic;
|
||||||
|
margin-top: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
h2 {
|
||||||
|
color: #a81411;
|
||||||
|
font-weight: bold;
|
||||||
|
margin-bottom: 0;
|
||||||
|
font-size: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.category {
|
||||||
|
color: rgb(72, 163, 238);
|
||||||
|
font-weight: 600;
|
||||||
|
margin-top: 0;
|
||||||
|
margin-bottom: 0;
|
||||||
|
font-size: 28px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.veggie {
|
||||||
|
color: rgb(10, 194, 87);
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.halal {
|
||||||
|
color: rgb(10, 194, 87);
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.main {
|
||||||
|
font-weight: 600;
|
||||||
|
margin-top: 5px;
|
||||||
|
margin-bottom: 0;
|
||||||
|
font-size: 37px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.side {
|
||||||
|
margin-top: 0;
|
||||||
|
margin-bottom: 0;
|
||||||
|
font-size: 37px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.price {
|
||||||
|
font-style: italic;
|
||||||
|
font-size: 25px;
|
||||||
|
margin-top: 5px;
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
hr {
|
||||||
|
border: 0;
|
||||||
|
border-top: 0.5px solid #ffffff;
|
||||||
|
width: 80%;
|
||||||
|
margin-left: 0;
|
||||||
|
margin-top: 4px;
|
||||||
|
margin-bottom: 4px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<h1>Was gibt's heute?</h1>
|
||||||
|
<h2></h2>
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
|
||||||
|
<script>
|
||||||
|
setInterval(() => {
|
||||||
|
window.location.reload();
|
||||||
|
}, 600000);
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script src="../src/tabletFeed.js"></script>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,79 @@
|
|||||||
|
function loadDay(day) {
|
||||||
|
Promise.all([
|
||||||
|
fetch(`/load-day-menu?date=${encodeURIComponent(day)}`).then(response => response.json()),
|
||||||
|
fetch(`/load-day-daily?date=${encodeURIComponent(day)}`).then(response => response.json())
|
||||||
|
])
|
||||||
|
.then(([menuData, dailyData]) => {
|
||||||
|
|
||||||
|
document.querySelector('h2').textContent = menuData.date_title.toUpperCase();
|
||||||
|
|
||||||
|
const defaultData = {
|
||||||
|
dailyMain: ' ',
|
||||||
|
dailySide: ' ',
|
||||||
|
dailyPrice: '6,00 € / 4,20 €',
|
||||||
|
dailySoup: ' ',
|
||||||
|
dailySoupPrice: 'Großer Teller 4,00 € / Kleiner Teller 2,00 €',
|
||||||
|
};
|
||||||
|
|
||||||
|
const categories = {
|
||||||
|
meat: {
|
||||||
|
category: 'Fleisch und Meer',
|
||||||
|
main: menuData.meat_main,
|
||||||
|
side: menuData.meat_side,
|
||||||
|
price: menuData.meat_price,
|
||||||
|
halal: menuData.halal ? '„HALAL“' : ''
|
||||||
|
},
|
||||||
|
veggi: {
|
||||||
|
category: 'Frisch und lecker',
|
||||||
|
main: menuData.veggi_main,
|
||||||
|
side: menuData.veggi_side,
|
||||||
|
price: menuData.veggi_price,
|
||||||
|
veggi: '„veggi“'
|
||||||
|
},
|
||||||
|
daily: {
|
||||||
|
category: 'Tagesempfehlung',
|
||||||
|
main: dailyData.daily_main || defaultData.dailyMain,
|
||||||
|
side: dailyData.daily_side || defaultData.dailySide,
|
||||||
|
price: dailyData.daily_price || defaultData.dailyPrice,
|
||||||
|
special: dailyData.daily_halal ? '„HALAL“' : (dailyData.daily_veggi ? '„veggi“' : '')
|
||||||
|
},
|
||||||
|
soup: {
|
||||||
|
category: 'Tagessuppe',
|
||||||
|
main: dailyData.daily_soup || defaultData.dailySoup,
|
||||||
|
side: '',
|
||||||
|
price: dailyData.daily_soup_price || defaultData.dailySoupPrice,
|
||||||
|
special: dailyData.soup_halal ? '„HALAL“' : (dailyData.soup_veggi ? '„veggi“' : '')
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const container = document.querySelector('body');
|
||||||
|
container.innerHTML = `
|
||||||
|
<h1>Was gibt's heute?</h1>
|
||||||
|
<h2>${menuData.date_title.toUpperCase()}</h2>
|
||||||
|
<hr>
|
||||||
|
${Object.values(categories).map(item => `
|
||||||
|
<p class="category">— ${item.category} <span class="halal">${item.halal || item.veggi || item.special || ''}</span></p>
|
||||||
|
<p class="main">${item.main}</p>
|
||||||
|
<p class="side">${item.side}</p>
|
||||||
|
<p class="price">${item.price}</p>
|
||||||
|
<hr>
|
||||||
|
`).join('')}
|
||||||
|
|
||||||
|
<p class="category">— Frisch und knackig</p>
|
||||||
|
<p class="main">Tagessalat</p>
|
||||||
|
<p class="side">mit verschiedenen Toppings und Baguette</p>
|
||||||
|
<p class="price">7,00 € / 4,90 €</p>
|
||||||
|
|
||||||
|
<p class="main">Salatbuffet</p>
|
||||||
|
<p class="side">mit verschiedenen Dressings</p>
|
||||||
|
<p class="price">Mittlerer Teller 3,50 € / Kleiner Teller 2,50 €</p>
|
||||||
|
`;
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
console.error('Error loading day:', error);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// Load today's menu on page load
|
||||||
|
const today = new Date().toISOString().split('T')[0];
|
||||||
|
loadDay(today);
|
||||||
Reference in New Issue
Block a user