feat(reports): add pdf_url and embed in entry

This commit is contained in:
localhost 2026-08-20 22:56:10 +02:00
parent 27181988b0
commit c5fe9408cc
3 changed files with 12 additions and 0 deletions

View File

@ -46,6 +46,7 @@ app.get('/transparency/:id', async ({ params: { id }, set, error }) => {
t_title: json.title,
date: json.date.toISOString(),
details: json.details,
pdf_url: json.pdf_url,
}))
await redis.set(`transparency:${id}:html`, html, 'EX', 3600)

View File

@ -6,6 +6,9 @@
<div class="date"><%= it.date %></div>
</div>
<pre class="details"><%= it.details %></pre>
<% if (it.pdf_url) { %>
<embed class="pdf-embed" src="<%= it.pdf_url %>" type="application/pdf" />
<% } %>
</div>
<style>
@ -43,4 +46,11 @@
border: 1px solid #ccc;
padding: 8px;
}
.pdf-embed {
margin-top: 15px;
width: 100%;
height: 600px;
border: 1px solid #ccc;
}
</style>

View File

@ -40,6 +40,7 @@ export interface ReportsTable {
title: string
details: string
date: Date
pdf_url?: string | null
}
export type Report = Selectable<ReportsTable>