feat(reports): add pdf_url and embed in entry
This commit is contained in:
parent
27181988b0
commit
c5fe9408cc
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ export interface ReportsTable {
|
|||
title: string
|
||||
details: string
|
||||
date: Date
|
||||
pdf_url?: string | null
|
||||
}
|
||||
|
||||
export type Report = Selectable<ReportsTable>
|
||||
|
|
|
|||
Loading…
Reference in New Issue