88 lines
5.3 KiB
HTML
88 lines
5.3 KiB
HTML
<!DOCTYPE html>
|
||
<html lang="en">
|
||
<head>
|
||
<meta charset="utf-8">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||
<title>Your application — Shkor Labs</title>
|
||
<meta name="robots" content="noindex">
|
||
<meta name="referrer" content="no-referrer">
|
||
<meta name="theme-color" content="#050506">
|
||
<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'><rect width='64' height='64' rx='14' fill='%23050506'/><circle cx='32' cy='32' r='20' fill='none' stroke='%23c6ff4d' stroke-width='3' stroke-dasharray='4 6'/><circle cx='32' cy='32' r='7' fill='%23c6ff4d'/></svg>">
|
||
<link rel="stylesheet" href="../../styles.css">
|
||
<link rel="stylesheet" href="../apply.css">
|
||
</head>
|
||
<body>
|
||
<header class="nav">
|
||
<div class="wrap nav-in">
|
||
<a class="brand" href="../../" aria-label="Shkor Labs — home">
|
||
<svg viewBox="0 0 32 32" aria-hidden="true"><circle cx="16" cy="16" r="12" fill="none" stroke="currentColor" stroke-width="2" stroke-dasharray="3 4"/><circle cx="16" cy="16" r="4.5" fill="currentColor"/></svg>
|
||
<span>Shkor<b>Labs</b></span>
|
||
</a>
|
||
</div>
|
||
</header>
|
||
|
||
<main id="main" class="apply">
|
||
<div class="grid-bg" aria-hidden="true"></div>
|
||
<div class="wrap status-in">
|
||
<p class="kicker">Your application</p>
|
||
<h1 id="title">Loading…</h1>
|
||
<p class="lead" id="sub"></p>
|
||
|
||
<ol class="timeline" id="tl" aria-live="polite"></ol>
|
||
|
||
<div class="bookmark">
|
||
<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M6 3h12v18l-6-4-6 4V3Z" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linejoin="round"/></svg>
|
||
<p><b>Bookmark this page.</b> It's your private link to this application — you can come back any time to finish verification or check the status.</p>
|
||
</div>
|
||
</div>
|
||
</main>
|
||
|
||
<script>
|
||
(function () {
|
||
var t = new URLSearchParams(location.search).get('t') || '';
|
||
var fresh = new URLSearchParams(location.search).get('new');
|
||
var tl = document.getElementById('tl'), title = document.getElementById('title'), sub = document.getElementById('sub');
|
||
var LABEL = {
|
||
'Not Started': ['todo', 'Not started'], 'In Progress': ['wip', 'In progress'], 'Awaiting User': ['wip', 'Waiting for the people behind the company'],
|
||
'In Review': ['wip', 'Under review'], 'Approved': ['ok', 'Verified'], 'Declined': ['bad', 'Not approved'],
|
||
'Abandoned': ['bad', 'Abandoned — start again below'], 'Expired': ['bad', 'Link expired'],
|
||
'Not Enabled': ['wip', 'We’ll email you a link'], 'Error': ['bad', 'Couldn’t start — we’ll email you a link']
|
||
};
|
||
function esc(s) { return String(s || '').replace(/[&<>"]/g, function (c) { return { '&': '&', '<': '<', '>': '>', '"': '"' }[c]; }); }
|
||
function item(state, head, body, action) {
|
||
return '<li class="tl ' + state + '"><span class="tl-dot" aria-hidden="true"></span><div><b>' + head + '</b><p>' + body + '</p>' + (action || '') + '</div></li>';
|
||
}
|
||
function check(name, c, what) {
|
||
var l = LABEL[c.status] || ['wip', c.status], go = '';
|
||
if (c.url && l[0] !== 'ok') go = '<a class="btn" href="' + esc(c.url) + '"><span>' + (c.status === 'Not Started' ? 'Verify ' + what + ' now' : 'Continue verification') + '</span><svg viewBox="0 0 20 20" aria-hidden="true"><path d="M4 10h11M11 5l5 5-5 5" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg></a>';
|
||
return item(l[0], name + ' <span class="pill ' + l[0] + '">' + esc(l[1]) + '</span>',
|
||
what === 'identity' ? 'Government ID and a quick selfie, handled by Didit. About 2 minutes.'
|
||
: 'Registry lookup, sanctions screening and the people behind the company. Each key person gets their own short link.', go);
|
||
}
|
||
function render(d) {
|
||
var a = d.app, k = d.checks || {}, all = Object.keys(k).every(function (x) { return k[x].status === 'Approved'; });
|
||
title.innerHTML = esc(a.project_name) + ' <span class="hl">#' + esc(a.id) + '</span>';
|
||
sub.textContent = all ? 'All set, ' + a.name.split(' ')[0] + '. Your verified application is with the board — we’ll be in touch by email.'
|
||
: (fresh ? 'Application received, ' + a.name.split(' ')[0] + '. One more step: verify your identity so the board can review it right away.'
|
||
: 'Here’s where your application stands.');
|
||
var h = item('ok', 'Application received', 'Submitted ' + esc(a.created_at) + ' UTC. It’s in the cooperative’s queue.');
|
||
if (k.kyc) h += check('Identity verification (KYC)', k.kyc, 'identity');
|
||
if (k.kyb) h += check('Company verification (KYB) · ' + esc(a.company_name), k.kyb, 'company');
|
||
h += item(all ? 'wip' : 'todo', 'Board review', all ? 'Verified applications are reviewed first. Usually within a few days.' : 'Starts as soon as verification is complete.');
|
||
tl.innerHTML = h;
|
||
}
|
||
function load() {
|
||
fetch('/api/lab/status?t=' + encodeURIComponent(t), { cache: 'no-store' })
|
||
.then(function (r) { return r.json().then(function (j) { return { ok: r.ok, j: j }; }); })
|
||
.then(function (res) {
|
||
if (!res.ok) { title.textContent = 'Application not found'; sub.textContent = res.j.error || 'Check the link from your email.'; return; }
|
||
render(res.j);
|
||
})
|
||
.catch(function () { title.textContent = 'Can’t load right now'; sub.textContent = 'Please refresh in a moment.'; });
|
||
}
|
||
load();
|
||
setInterval(function () { if (!document.hidden) load(); }, 20000);
|
||
})();
|
||
</script>
|
||
</body>
|
||
</html>
|