Clarify uploaded-file demo review flow
Browse files- index.html +40 -8
index.html
CHANGED
|
@@ -288,6 +288,12 @@
|
|
| 288 |
border-radius: 24px; box-shadow: 0 30px 60px rgba(0,0,0,0.5);
|
| 289 |
animation: modalPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
|
| 290 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 291 |
@keyframes modalPop { from { transform: scale(0.9) translateY(20px); opacity: 0; } to { transform: scale(1) translateY(0); opacity: 1; } }
|
| 292 |
|
| 293 |
@media (max-width: 900px) {
|
|
@@ -342,6 +348,9 @@
|
|
| 342 |
padding: 32px 24px;
|
| 343 |
border-radius: 16px;
|
| 344 |
}
|
|
|
|
|
|
|
|
|
|
| 345 |
}
|
| 346 |
</style>
|
| 347 |
</head>
|
|
@@ -513,16 +522,20 @@
|
|
| 513 |
};
|
| 514 |
document.getElementById('drop-zone').onclick = () => document.getElementById('f-input').click();
|
| 515 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 516 |
document.querySelectorAll('.sample-btn').forEach(sampleBtn => {
|
| 517 |
sampleBtn.onclick = (e) => {
|
| 518 |
e.stopPropagation();
|
| 519 |
if (btn.disabled) return;
|
| 520 |
-
|
| 521 |
-
const mimeType = sampleName.endsWith('.pdf') ? 'application/pdf' : 'image/png';
|
| 522 |
-
file = { name: sampleName, type: mimeType, demoSample: true };
|
| 523 |
-
showSelectedFile(sampleName, 'Built-in demo fixture selected.');
|
| 524 |
-
log(`SAMPLE LOADED: ${sampleName}`);
|
| 525 |
-
setTimeout(() => btn.click(), 80);
|
| 526 |
};
|
| 527 |
});
|
| 528 |
|
|
@@ -583,7 +596,7 @@
|
|
| 583 |
|
| 584 |
async function finish() {
|
| 585 |
let verdict = 'NEEDS_REVIEW';
|
| 586 |
-
let reason = '
|
| 587 |
let status_code = 'DEMO_ONLY';
|
| 588 |
let issuer = 'UNVERIFIED';
|
| 589 |
let ror_id = '--';
|
|
@@ -622,7 +635,7 @@
|
|
| 622 |
document.getElementById('m-issuer').innerText = issuer;
|
| 623 |
document.getElementById('m-status').innerText = status_code;
|
| 624 |
|
| 625 |
-
const verdictTitle = verdict === 'REJECTED' ? t.verdict_no : (verdict === 'APPROVED' ? 'DEMO VERIFIED' : '
|
| 626 |
const verdictColor = verdict === 'REJECTED' ? '#ff3366' : (verdict === 'APPROVED' ? '#00ffaa' : '#ffcc66');
|
| 627 |
|
| 628 |
const report = document.getElementById('rep-body');
|
|
@@ -648,6 +661,25 @@
|
|
| 648 |
details.innerText = `ROR ID: ${ror_id}\nAudit Trace: LOCAL-DEMO-NOT-SIGNED`;
|
| 649 |
report.appendChild(details);
|
| 650 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 651 |
const done = document.createElement('button');
|
| 652 |
done.className = 'btn-main';
|
| 653 |
done.style.width = '100%';
|
|
|
|
| 288 |
border-radius: 24px; box-shadow: 0 30px 60px rgba(0,0,0,0.5);
|
| 289 |
animation: modalPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
|
| 290 |
}
|
| 291 |
+
.modal-actions {
|
| 292 |
+
display: grid;
|
| 293 |
+
grid-template-columns: 1fr 1fr;
|
| 294 |
+
gap: 10px;
|
| 295 |
+
margin-bottom: 12px;
|
| 296 |
+
}
|
| 297 |
@keyframes modalPop { from { transform: scale(0.9) translateY(20px); opacity: 0; } to { transform: scale(1) translateY(0); opacity: 1; } }
|
| 298 |
|
| 299 |
@media (max-width: 900px) {
|
|
|
|
| 348 |
padding: 32px 24px;
|
| 349 |
border-radius: 16px;
|
| 350 |
}
|
| 351 |
+
.modal-actions {
|
| 352 |
+
grid-template-columns: 1fr;
|
| 353 |
+
}
|
| 354 |
}
|
| 355 |
</style>
|
| 356 |
</head>
|
|
|
|
| 522 |
};
|
| 523 |
document.getElementById('drop-zone').onclick = () => document.getElementById('f-input').click();
|
| 524 |
|
| 525 |
+
function runSampleAudit(sampleName) {
|
| 526 |
+
resetRunState();
|
| 527 |
+
const mimeType = sampleName.endsWith('.pdf') ? 'application/pdf' : 'image/png';
|
| 528 |
+
file = { name: sampleName, type: mimeType, demoSample: true };
|
| 529 |
+
showSelectedFile(sampleName, 'Built-in demo fixture selected.');
|
| 530 |
+
log(`SAMPLE LOADED: ${sampleName}`);
|
| 531 |
+
setTimeout(() => btn.click(), 80);
|
| 532 |
+
}
|
| 533 |
+
|
| 534 |
document.querySelectorAll('.sample-btn').forEach(sampleBtn => {
|
| 535 |
sampleBtn.onclick = (e) => {
|
| 536 |
e.stopPropagation();
|
| 537 |
if (btn.disabled) return;
|
| 538 |
+
runSampleAudit(sampleBtn.getAttribute('data-sample'));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 539 |
};
|
| 540 |
});
|
| 541 |
|
|
|
|
| 596 |
|
| 597 |
async function finish() {
|
| 598 |
let verdict = 'NEEDS_REVIEW';
|
| 599 |
+
let reason = 'This uploaded file is accepted by the demo intake, but this static browser page cannot read document contents or issue credential approval. Use the built-in samples to demonstrate verified and rejected outcomes, or connect a server-side audit API for real files.';
|
| 600 |
let status_code = 'DEMO_ONLY';
|
| 601 |
let issuer = 'UNVERIFIED';
|
| 602 |
let ror_id = '--';
|
|
|
|
| 635 |
document.getElementById('m-issuer').innerText = issuer;
|
| 636 |
document.getElementById('m-status').innerText = status_code;
|
| 637 |
|
| 638 |
+
const verdictTitle = verdict === 'REJECTED' ? t.verdict_no : (verdict === 'APPROVED' ? 'DEMO VERIFIED' : 'NEEDS REVIEW');
|
| 639 |
const verdictColor = verdict === 'REJECTED' ? '#ff3366' : (verdict === 'APPROVED' ? '#00ffaa' : '#ffcc66');
|
| 640 |
|
| 641 |
const report = document.getElementById('rep-body');
|
|
|
|
| 661 |
details.innerText = `ROR ID: ${ror_id}\nAudit Trace: LOCAL-DEMO-NOT-SIGNED`;
|
| 662 |
report.appendChild(details);
|
| 663 |
|
| 664 |
+
if (verdict === 'NEEDS_REVIEW') {
|
| 665 |
+
const sampleActions = document.createElement('div');
|
| 666 |
+
sampleActions.className = 'modal-actions';
|
| 667 |
+
|
| 668 |
+
const fraudSample = document.createElement('button');
|
| 669 |
+
fraudSample.className = 'btn-main';
|
| 670 |
+
fraudSample.innerText = 'RUN FRAUD SAMPLE';
|
| 671 |
+
fraudSample.onclick = () => runSampleAudit('fake_degree_sample.png');
|
| 672 |
+
sampleActions.appendChild(fraudSample);
|
| 673 |
+
|
| 674 |
+
const verifiedSample = document.createElement('button');
|
| 675 |
+
verifiedSample.className = 'btn-main';
|
| 676 |
+
verifiedSample.innerText = 'RUN VERIFIED SAMPLE';
|
| 677 |
+
verifiedSample.onclick = () => runSampleAudit('aclas_alumni_2025.png');
|
| 678 |
+
sampleActions.appendChild(verifiedSample);
|
| 679 |
+
|
| 680 |
+
report.appendChild(sampleActions);
|
| 681 |
+
}
|
| 682 |
+
|
| 683 |
const done = document.createElement('button');
|
| 684 |
done.className = 'btn-main';
|
| 685 |
done.style.width = '100%';
|