v_2.3
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Legislation · Infosec</title>
|
||||
<link rel="stylesheet" href="/css/style.css">
|
||||
</head>
|
||||
<body>
|
||||
<script src="/js/app.js"></script>
|
||||
<script>
|
||||
(async () => {
|
||||
const shell = await buildShell('legislation'); if (!shell) return;
|
||||
const { isAdmin, content } = shell;
|
||||
|
||||
function entryHtml(e) {
|
||||
return `
|
||||
<div class="ver-item">
|
||||
<div class="ver-head">
|
||||
${e.reference ? `<span class="ver-tag">${esc(e.reference)}</span>` : ''}
|
||||
<span class="ver-title">${esc(e.title)}</span>
|
||||
${e.effective_date ? `<span class="ver-date">In force: ${esc(fmtDate(e.effective_date))}</span>` : ''}
|
||||
</div>
|
||||
${e.summary ? `<div class="ver-notes">${esc(e.summary)}</div>` : ''}
|
||||
${e.link_url ? `<div style="margin-top:10px">
|
||||
<a class="btn btn-sm" href="${esc(e.link_url)}" target="_blank" rel="noopener noreferrer">
|
||||
Read the full text</a></div>` : ''}
|
||||
</div>`;
|
||||
}
|
||||
|
||||
async function load() {
|
||||
let entries = [];
|
||||
try { entries = (await api('/api/legislation')).entries; }
|
||||
catch (e) { toast(e.message, 'err'); }
|
||||
|
||||
content.innerHTML = `
|
||||
<div class="page-head">
|
||||
<h1>Legislation</h1>
|
||||
<p>Laws, regulations and internal rules governing the handling of this data.${
|
||||
isAdmin ? ' Entries are managed in Data Management → Legislation.' : ''}</p>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
${entries.length
|
||||
? `<div class="ver-list">${entries.map(entryHtml).join('')}</div>`
|
||||
: `<div class="empty">${ICON.legislation}<div>No legislation has been published yet.</div></div>`}
|
||||
</div>
|
||||
</div>`;
|
||||
}
|
||||
|
||||
load();
|
||||
})();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user