feat: add Carbone tags help - view in-app modal and download as .docx
This commit is contained in:
@@ -149,4 +149,38 @@ async function deleteCarboneTemplate(templateId) {
|
||||
} catch (e) {
|
||||
toast('Delete failed: ' + e.message, 'error');
|
||||
}
|
||||
}
|
||||
|
||||
// ============================================================
|
||||
// TAGS HELP - View in app
|
||||
// ============================================================
|
||||
async function viewTagsHelp() {
|
||||
try {
|
||||
const resp = await fetch(CARBONE_API + '/help');
|
||||
const data = await resp.json();
|
||||
|
||||
let html = '<div style="max-height:600px;overflow-y:auto">';
|
||||
for (const section of data.sections) {
|
||||
html += `<h3 style="margin-top:20px;color:var(--accent)">${section.title}</h3>`;
|
||||
if (section.note) html += `<p class="text-muted text-sm" style="margin-bottom:8px">${section.note}</p>`;
|
||||
html += '<table><thead><tr><th>Tag</th><th>Description</th></tr></thead><tbody>';
|
||||
for (const t of section.tags) {
|
||||
html += `<tr><td style="font-family:monospace;color:var(--accent);white-space:nowrap">${escapeHtml(t.tag)}</td><td>${escapeHtml(t.desc)}</td></tr>`;
|
||||
}
|
||||
html += '</tbody></table>';
|
||||
}
|
||||
html += '</div>';
|
||||
html += '<div class="mt-16"><button class="btn btn-outline" onclick="downloadHelpDocx()">Download as .docx</button></div>';
|
||||
|
||||
showModal(html, 'Carbone Tags Reference');
|
||||
} catch (e) {
|
||||
toast('Failed to load help: ' + e.message, 'error');
|
||||
}
|
||||
}
|
||||
|
||||
// ============================================================
|
||||
// TAGS HELP - Download .docx
|
||||
// ============================================================
|
||||
function downloadHelpDocx() {
|
||||
window.open(CARBONE_API + '/help-docx', '_blank');
|
||||
}
|
||||
@@ -73,6 +73,8 @@
|
||||
4. Generate CVs by merging candidate data with your template -> PDF
|
||||
</div>
|
||||
<button class="btn mt-16" onclick="downloadMasterTemplate()">Download Master Template (.docx)</button>
|
||||
<button class="btn btn-outline mt-16" style="margin-left:8px" onclick="viewTagsHelp()">View Tags Help</button>
|
||||
<button class="btn btn-outline mt-16" style="margin-left:8px" onclick="downloadHelpDocx()">Download Help (.docx)</button>
|
||||
</div>
|
||||
<div class="card mb-16">
|
||||
<div class="card-header"><span class="card-title">Upload Custom Template</span></div>
|
||||
|
||||
Reference in New Issue
Block a user