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,
|
t_title: json.title,
|
||||||
date: json.date.toISOString(),
|
date: json.date.toISOString(),
|
||||||
details: json.details,
|
details: json.details,
|
||||||
|
pdf_url: json.pdf_url,
|
||||||
}))
|
}))
|
||||||
await redis.set(`transparency:${id}:html`, html, 'EX', 3600)
|
await redis.set(`transparency:${id}:html`, html, 'EX', 3600)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,9 @@
|
||||||
<div class="date"><%= it.date %></div>
|
<div class="date"><%= it.date %></div>
|
||||||
</div>
|
</div>
|
||||||
<pre class="details"><%= it.details %></pre>
|
<pre class="details"><%= it.details %></pre>
|
||||||
|
<% if (it.pdf_url) { %>
|
||||||
|
<embed class="pdf-embed" src="<%= it.pdf_url %>" type="application/pdf" />
|
||||||
|
<% } %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|
@ -43,4 +46,11 @@
|
||||||
border: 1px solid #ccc;
|
border: 1px solid #ccc;
|
||||||
padding: 8px;
|
padding: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.pdf-embed {
|
||||||
|
margin-top: 15px;
|
||||||
|
width: 100%;
|
||||||
|
height: 600px;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,7 @@ export interface ReportsTable {
|
||||||
title: string
|
title: string
|
||||||
details: string
|
details: string
|
||||||
date: Date
|
date: Date
|
||||||
|
pdf_url?: string | null
|
||||||
}
|
}
|
||||||
|
|
||||||
export type Report = Selectable<ReportsTable>
|
export type Report = Selectable<ReportsTable>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue