design changes

pull/16/head
ClaraCrazy 2024-09-28 01:49:06 +02:00
parent 73ee254ef7
commit 4087fe13a8
2 changed files with 45 additions and 8 deletions

View File

@ -36,7 +36,7 @@ router.get(
// Emails are immutable, cache if found // Emails are immutable, cache if found
res.set('Cache-Control', 'private, max-age=600') res.set('Cache-Control', 'private, max-age=600')
res.render('mail', { res.render('mail', {
title: req.params.address, title: mail.subject + " | " + req.params.address,
address: req.params.address, address: req.params.address,
mail, mail,
uid: req.params.uid, uid: req.params.uid,
@ -62,7 +62,7 @@ router.get(
) )
router.get( router.get(
'^/:address/:uid([0-9]+$)/delete', '^/:address/:uid/delete',
sanitizeAddress, sanitizeAddress,
async (req, res, next) => { async (req, res, next) => {
try { try {
@ -76,4 +76,40 @@ router.get(
} }
) )
router.get(
'^/:address/:uid/raw',
sanitizeAddress,
async (req, res, next) => {
try {
const mailProcessingService = req.app.get('mailProcessingService')
const mail = await mailProcessingService.getOneFullMail(
req.params.address,
req.params.uid
)
if (mail && mail != "womp womp") {
// Emails are immutable, cache if found
res.set('Cache-Control', 'private, max-age=600')
res.render('raw', {
title: mail.subject + " | raw | " + req.params.address,
mail
})
} else {
res.render(
'error',
{
address: req.params.address,
message: 'This mail could not be found. It either does not exist or has been deleted from our servers!',
madeby: config.http.branding[1],
madebysite: config.http.branding[2],
}
)
}
} catch (error) {
console.error('error while fetching one email', error)
next(error)
}
}
)
module.exports = router module.exports = router

View File

@ -13,8 +13,13 @@
Logout</a> Logout</a>
</div> </div>
<hr> <hr>
<div style="text-align: center;"> <div class="mail_body" style="padding-left:10%;">
<h1>{{ mail.subject }}</h1> <h1 style="text-align:left;">
{{ mail.subject }}
<span style="float:right; padding-right:10vw;" >
From: {{ mail.from.text }} at {{ mail.date| date }}
</span>
</p>
</div> </div>
{% if mail.html %} {% if mail.html %}
<div> <div>
@ -48,8 +53,4 @@
</div> </div>
{% endif %} {% endif %}
<h3 style="text-align: center;display: block;">{{ mail.from.text }} | {{ mail.date| date }}</h3>
{% endblock %} {% endblock %}