Add image type breakdown to setup wizard summary
This commit is contained in:
parent
1a7c342ac9
commit
f882e84704
1 changed files with 25 additions and 0 deletions
|
|
@ -890,6 +890,10 @@
|
||||||
<span class="summary-stat-label">Menu Items</span>
|
<span class="summary-stat-label">Menu Items</span>
|
||||||
<span class="summary-stat-value" id="summaryItems">0</span>
|
<span class="summary-stat-value" id="summaryItems">0</span>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="summary-stat" id="summaryImagesRow">
|
||||||
|
<span class="summary-stat-label">Images</span>
|
||||||
|
<span class="summary-stat-value" id="summaryImages" style="font-size: 13px; text-align: right;"></span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
@ -2610,6 +2614,24 @@
|
||||||
document.getElementById('summaryModifiers').textContent = modifiers.length;
|
document.getElementById('summaryModifiers').textContent = modifiers.length;
|
||||||
document.getElementById('summaryItems').textContent = items.length;
|
document.getElementById('summaryItems').textContent = items.length;
|
||||||
|
|
||||||
|
// Count images by type
|
||||||
|
const itemsWithImageUrl = items.filter(item => item.imageUrl).length;
|
||||||
|
const manuallyMatchedImages = Object.keys(config.itemImages || {}).length;
|
||||||
|
const hasHeaderImage = config.headerImageFile != null;
|
||||||
|
|
||||||
|
const imageParts = [];
|
||||||
|
if (itemsWithImageUrl > 0) imageParts.push(`${itemsWithImageUrl} item`);
|
||||||
|
if (manuallyMatchedImages > 0) imageParts.push(`${manuallyMatchedImages} matched`);
|
||||||
|
if (hasHeaderImage) imageParts.push('1 header');
|
||||||
|
|
||||||
|
const imagesRow = document.getElementById('summaryImagesRow');
|
||||||
|
if (imageParts.length > 0) {
|
||||||
|
document.getElementById('summaryImages').textContent = imageParts.join(', ');
|
||||||
|
imagesRow.style.display = '';
|
||||||
|
} else {
|
||||||
|
imagesRow.style.display = 'none';
|
||||||
|
}
|
||||||
|
|
||||||
// In add-menu mode, hide menu name/hours/community meal (already set during menu creation)
|
// In add-menu mode, hide menu name/hours/community meal (already set during menu creation)
|
||||||
if (config.menuId) {
|
if (config.menuId) {
|
||||||
document.getElementById('menuNameInput').parentElement.style.display = 'none';
|
document.getElementById('menuNameInput').parentElement.style.display = 'none';
|
||||||
|
|
@ -2630,6 +2652,8 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const imagesSummary = imageParts.length > 0 ? `<li>${imageParts.join(', ')} images</li>` : '';
|
||||||
|
|
||||||
addMessage('ai', `
|
addMessage('ai', `
|
||||||
<p>Your menu is ready to save!</p>
|
<p>Your menu is ready to save!</p>
|
||||||
${config.menuId && config.menuName
|
${config.menuId && config.menuName
|
||||||
|
|
@ -2639,6 +2663,7 @@
|
||||||
<li>${categories.length} categories</li>
|
<li>${categories.length} categories</li>
|
||||||
<li>${modifiers.length} modifier templates</li>
|
<li>${modifiers.length} modifier templates</li>
|
||||||
<li>${items.length} menu items</li>
|
<li>${items.length} menu items</li>
|
||||||
|
${imagesSummary}
|
||||||
</ul>
|
</ul>
|
||||||
<p>Click "Save Menu" below to add everything to your Payfrit account.</p>
|
<p>Click "Save Menu" below to add everything to your Payfrit account.</p>
|
||||||
`);
|
`);
|
||||||
|
|
|
||||||
Reference in a new issue