fix: change help download from .docx to .pdf
This commit is contained in:
@@ -473,11 +473,11 @@ router.get('/master-template', async (req, res) => {
|
||||
}
|
||||
});
|
||||
|
||||
// GET /api/carbone/help-docx - Download tags reference as .docx
|
||||
router.get('/help-docx', (req, res) => {
|
||||
const helpPath = path.join(TEMPLATES_DIR, 'HELP_TAGS_REFERENCE.docx');
|
||||
// GET /api/carbone/help-pdf - Download tags reference as .pdf
|
||||
router.get('/help-pdf', (req, res) => {
|
||||
const helpPath = path.join(TEMPLATES_DIR, 'HELP_TAGS_REFERENCE.pdf');
|
||||
if (fs.existsSync(helpPath)) {
|
||||
res.download(helpPath, 'Carbone_Tags_Reference.docx');
|
||||
res.download(helpPath, 'Carbone_Tags_Reference.pdf');
|
||||
} else {
|
||||
res.status(404).json({ error: 'Help file not found' });
|
||||
}
|
||||
|
||||
@@ -170,7 +170,7 @@ async function viewTagsHelp() {
|
||||
html += '</tbody></table>';
|
||||
}
|
||||
html += '</div>';
|
||||
html += '<div class="mt-16"><button class="btn btn-outline" onclick="downloadHelpDocx()">Download as .docx</button></div>';
|
||||
html += '<div class="mt-16"><button class="btn btn-outline" onclick="downloadHelpPdf()">Download as .pdf</button></div>';
|
||||
|
||||
showModal(html, 'Carbone Tags Reference');
|
||||
} catch (e) {
|
||||
@@ -179,8 +179,8 @@ async function viewTagsHelp() {
|
||||
}
|
||||
|
||||
// ============================================================
|
||||
// TAGS HELP - Download .docx
|
||||
// TAGS HELP - Download .pdf
|
||||
// ============================================================
|
||||
function downloadHelpDocx() {
|
||||
window.open(CARBONE_API + '/help-docx', '_blank');
|
||||
function downloadHelpPdf() {
|
||||
window.open(CARBONE_API + '/help-pdf', '_blank');
|
||||
}
|
||||
@@ -74,7 +74,7 @@
|
||||
</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>
|
||||
<button class="btn btn-outline mt-16" style="margin-left:8px" onclick="downloadHelpPdf()">Download Help (.pdf)</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