forked from UKSOURCE/cms.hailearning.edu.vn
drawer menu view edit
drawermenu: 1. contact info: address,phone,location 2. working hours 3. description 4. social links
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
<div class="content-with-fixed-buttons">
|
||||
<!-- Hidden inputs for JSON data -->
|
||||
<input type="hidden" name="topbarJson" id="topbarJson" />
|
||||
<input type="hidden" name="offcanvasJson" id="offcanvasJson" />
|
||||
<input type="hidden" name="logo" id="logoInput" />
|
||||
<input type="hidden" name="activeTab" id="activeTabInput" value="topbar" />
|
||||
<input type="hidden" name="menuUpdates" id="menuUpdates" />
|
||||
@@ -99,6 +100,25 @@
|
||||
placeholder="69 Street, 5th Avenue LA, United States"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label class="form-label fw-medium">Working Hours <small class="text-muted fw-normal">(Drawer Menu)</small></label>
|
||||
<input
|
||||
type="text"
|
||||
class="form-control"
|
||||
id="offcanvasWorkingHours"
|
||||
value="<%= (data.header && data.header.offcanvas && data.header.offcanvas.contactInfo && data.header.offcanvas.contactInfo.workingHours) ? data.header.offcanvas.contactInfo.workingHours : '' %>"
|
||||
placeholder="Mon-Friday, 09am - 05pm"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<label class="form-label fw-medium">Offcanvas Description <small class="text-muted fw-normal">(Drawer Menu)</small></label>
|
||||
<textarea
|
||||
class="form-control"
|
||||
id="offcanvasDescription"
|
||||
rows="3"
|
||||
placeholder="Short description displayed in the offcanvas sidebar..."
|
||||
><%= (data.header && data.header.offcanvas && data.header.offcanvas.description) ? data.header.offcanvas.description : '' %></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -179,6 +199,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Menu Structure Tab -->
|
||||
<div class="tab-pane fade <%= activeTab === 'menu' ? 'show active' : '' %>" id="menu" role="tabpanel">
|
||||
<%- include('menu') %>
|
||||
@@ -349,6 +370,7 @@
|
||||
// 1. Collect and Save Topbar & Logo
|
||||
const headerData = {
|
||||
topbarJson: document.getElementById('topbarJson').value,
|
||||
offcanvasJson: document.getElementById('offcanvasJson').value,
|
||||
logo: document.getElementById('logoInput').value,
|
||||
activeTab: document.getElementById('activeTabInput').value
|
||||
};
|
||||
@@ -421,6 +443,18 @@
|
||||
document.getElementById('topbarJson').value = JSON.stringify(topbarData);
|
||||
document.getElementById('logoInput').value = document.getElementById('logoImage').value || '';
|
||||
|
||||
// Collect offcanvas data — phone/email/address shared from topbar
|
||||
const offcanvasData = {
|
||||
description: document.getElementById('offcanvasDescription').value || '',
|
||||
contactInfo: {
|
||||
phone: document.getElementById('contactPhone').value || '',
|
||||
email: document.getElementById('contactEmail').value || '',
|
||||
address: document.getElementById('contactLocation').value || '',
|
||||
workingHours: document.getElementById('offcanvasWorkingHours').value || ''
|
||||
}
|
||||
};
|
||||
document.getElementById('offcanvasJson').value = JSON.stringify(offcanvasData);
|
||||
|
||||
try {
|
||||
const menuUpdates = collectMenuUpdates();
|
||||
document.getElementById('menuUpdates').value = JSON.stringify(menuUpdates);
|
||||
|
||||
Reference in New Issue
Block a user