INIT frontend
This commit is contained in:
@@ -0,0 +1,81 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1" />
|
||||
<title>Job Info — Vanilla JS</title>
|
||||
<style>
|
||||
/* Integrated CSS for layout, cards, notes, impersonation banner as in your working version */
|
||||
body { font-family: sans-serif; margin:0; background:#f3f4f6; }
|
||||
#impersonationBanner { display:none; position:fixed; top:0; left:0; right:0; background:#ffcc00; color:#000; padding:10px; font-weight:bold; text-align:center; z-index:9999; }
|
||||
#impersonationBanner button { margin-left:10px; padding:4px 8px; cursor:pointer; }
|
||||
/* other CSS omitted for brevity, keep integrated as in your working file */
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="impersonationBanner">
|
||||
⚠️ Impersonation Mode Active — All actions are logged as the impersonated user
|
||||
<button id="exitImpersonation">Return to Admin</button>
|
||||
</div>
|
||||
|
||||
<div class="wrap">
|
||||
<h1>Job Info</h1>
|
||||
<div class="progress-wrap"><div id="progressBar" class="progress-bar"></div></div>
|
||||
<input id="searchBox" placeholder="Search jobs">
|
||||
<button id="filterToggle">Show Filters</button>
|
||||
<div id="filtersPanel">
|
||||
<!-- Filters as in working version -->
|
||||
</div>
|
||||
<div id="results"></div>
|
||||
</div>
|
||||
|
||||
<div id="detailModal" role="dialog" aria-modal="true">
|
||||
<div id="detailBox">
|
||||
<h2 style="margin-top:0;color:#0d6efd">Job Detail</h2>
|
||||
<table class="detail-table" id="detailTable"></table>
|
||||
<div id="jobFolderLink"><strong>Job Folder Link</strong><div><span id="jobFolderAnchor">No Link Available</span></div></div>
|
||||
<h3>Notes</h3>
|
||||
<div id="jobNotes"></div>
|
||||
<div class="toolbar" id="toolbar">
|
||||
<!-- Toolbar buttons -->
|
||||
</div>
|
||||
<div id="newNote" contenteditable="true" aria-label="New note"></div>
|
||||
<div class="modal-actions">
|
||||
<button class="btn green" id="btnSubmit">Submit</button>
|
||||
<button class="btn gray" id="btnClearNote">Clear</button>
|
||||
<button class="btn red" id="btnClose">Close</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
(async function() {
|
||||
// --- Tokens & impersonation ---
|
||||
const impersonationToken = localStorage.getItem('pb_token');
|
||||
const originalToken = localStorage.getItem('pb_original_token');
|
||||
const banner = document.getElementById('impersonationBanner');
|
||||
|
||||
if (impersonationToken) {
|
||||
if (window.pb) window.pb.authStore.save(impersonationToken, null);
|
||||
banner.style.display = 'block';
|
||||
}
|
||||
|
||||
document.getElementById('exitImpersonation')?.addEventListener('click', () => {
|
||||
if (originalToken) {
|
||||
localStorage.setItem('pb_token', originalToken);
|
||||
localStorage.removeItem('pb_original_token');
|
||||
} else {
|
||||
localStorage.removeItem('pb_token');
|
||||
}
|
||||
banner.style.display = 'none';
|
||||
location.reload();
|
||||
});
|
||||
|
||||
// --- Fetch jobs, render, filters, notes, toolbar logic ---
|
||||
// Use the same logic from your working index.html
|
||||
})();
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user