From d66d76c9f9275ac90bcb4db0fefac5dedcb3e346 Mon Sep 17 00:00:00 2001 From: ClaraCrazy Date: Wed, 2 Oct 2024 14:50:40 +0200 Subject: [PATCH] Even better.. twig can handle lists --- infrastructure/web/routes/inbox.js | 21 ++++++--------------- infrastructure/web/routes/login.js | 9 ++------- infrastructure/web/views/layout.twig | 2 +- 3 files changed, 9 insertions(+), 23 deletions(-) diff --git a/infrastructure/web/routes/inbox.js b/infrastructure/web/routes/inbox.js index fc0667d..c344ecf 100644 --- a/infrastructure/web/routes/inbox.js +++ b/infrastructure/web/routes/inbox.js @@ -17,9 +17,7 @@ router.get('^/:address([^@/]+@[^@/]+)', sanitizeAddress, (req, res, _next) => { title: `${config.http.branding[0]} | ` + req.params.address, address: req.params.address, mailSummaries: mailProcessingService.getMailSummaries(req.params.address), - servicename: config.http.branding[0], - madeby: config.http.branding[1], - madebysite: config.http.branding[2] + branding: config.http.branding, }) }) @@ -46,9 +44,7 @@ router.get( address: req.params.address, mail, uid: req.params.uid, - servicename: config.http.branding[0], - madeby: config.http.branding[1], - madebysite: config.http.branding[2] + branding: config.http.branding, }) } else { res.render( @@ -56,9 +52,8 @@ router.get( { address: req.params.address, message: 'This mail could not be found. It either does not exist or has been deleted from our servers!', - servicename: config.http.branding[0], - madeby: config.http.branding[1], - madebysite: config.http.branding[2], + branding: config.http.branding + } ) } @@ -131,9 +126,7 @@ router.get( { address: req.params.address, message: 'This attachment could not be found. It either does not exist or has been deleted from our servers!', - servicename: config.http.branding[0], - madeby: config.http.branding[1], - madebysite: config.http.branding[2], + branding: config.http.branding, } ) } @@ -172,9 +165,7 @@ router.get( { address: req.params.address, message: 'This mail could not be found. It either does not exist or has been deleted from our servers!', - servicename: config.http.branding[0], - madeby: config.http.branding[1], - madebysite: config.http.branding[2], + branding: config.http.branding, } ) } diff --git a/infrastructure/web/routes/login.js b/infrastructure/web/routes/login.js index d2607b6..ab5c1b8 100644 --- a/infrastructure/web/routes/login.js +++ b/infrastructure/web/routes/login.js @@ -10,9 +10,7 @@ router.get('/', (req, res, _next) => { title: `${config.http.branding[0]} | Your temporary Inbox`, username: randomWord(), domains: config.email.domains, - servicename: config.http.branding[0], - madeby: config.http.branding[1], - madebysite: config.http.branding[2] + branding: config.http.branding, }) }) @@ -42,10 +40,7 @@ router.post( userInputError: true, title: `${config.http.branding[0]} | Your temporary Inbox`, username: randomWord(), - domains: config.email.domains, - servicename: config.http.branding[0], - madeby: config.http.branding[1], - madebysite: config.http.branding[2] + branding: config.http.branding, }) } diff --git a/infrastructure/web/views/layout.twig b/infrastructure/web/views/layout.twig index 7470b83..2dcac94 100644 --- a/infrastructure/web/views/layout.twig +++ b/infrastructure/web/views/layout.twig @@ -28,7 +28,7 @@ {% block footer %} {% endblock %}