forked from UKSOURCE/cms.lams
Refactor the CMS page content system to use a more modular configuration-driven approach. This replaces the monolithic `pageContentConfig.js` with individual configuration files for each page and introduces a shared field utility to standardize editor components. Key changes: - Implement a generic `_renderSingletonPageView` helper to reduce duplication across controllers. - Enhance `_createPageContentController` with `normalizeForEditor`, `normalizeForApi`, and `preparePayload` hooks for custom data transformation. - Create dedicated configuration and view structures for Partnerships, History, Accreditation, Admissions, and Policies pages. - Add a specialized section editor for Policies to manage complex nested content. - Improve the frontend `page-content-editor.js` with support for visibility logic, auto-sequencing for arrays, and URL synchronization for active tabs. - Update data JSON files to align with the new schema.
53 lines
2.3 KiB
Plaintext
53 lines
2.3 KiB
Plaintext
<div class="tab-pane fade <%= activeTab === 'directory' ? 'show active' : '' %>" id="directory" role="tabpanel">
|
|
<div class="card border shadow-sm">
|
|
<div class="card-header bg-white">
|
|
<h6 class="mb-0"><i class="fas fa-handshake me-2"></i>Partner Directory</h6>
|
|
</div>
|
|
<div class="card-body p-4">
|
|
<div class="row g-3 mb-4">
|
|
<div class="col-md-8">
|
|
<label class="form-label fw-semibold">Section heading</label>
|
|
<input class="form-control" id="directoryHeading" maxlength="70" value="<%= data.directory?.heading || '' %>">
|
|
</div>
|
|
<div class="col-md-4">
|
|
<label class="form-label fw-semibold">Load more button label</label>
|
|
<input class="form-control" id="directoryLoadMoreLabel" maxlength="40" value="<%= data.directory?.loadMoreLabel || '' %>">
|
|
</div>
|
|
<div class="col-12">
|
|
<label class="form-label fw-semibold">Section description</label>
|
|
<textarea class="form-control" id="directoryDescription" rows="3" maxlength="180"><%= data.directory?.description || '' %></textarea>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="border rounded-3 bg-light-subtle p-3 mb-4">
|
|
<div class="d-flex justify-content-between align-items-center mb-3">
|
|
<div>
|
|
<label class="form-label fw-semibold mb-1">Category tabs</label>
|
|
<div class="form-text mt-0">The frontend shows up to 3 direct tabs. Additional tabs move into a More dropdown.</div>
|
|
</div>
|
|
<button type="button" class="btn btn-outline-primary btn-sm" id="addDirectoryTabBtn">
|
|
<i class="fas fa-plus me-1"></i>Add Tab
|
|
</button>
|
|
</div>
|
|
<div id="directoryTabsList"></div>
|
|
</div>
|
|
|
|
<div class="border rounded-3 bg-light-subtle p-3">
|
|
<div class="d-flex justify-content-between align-items-center mb-3">
|
|
<div>
|
|
<label class="form-label fw-semibold mb-1">Partners</label>
|
|
<div class="form-text mt-0">Use a short unique partner key so card state stays stable.</div>
|
|
</div>
|
|
<button type="button" class="btn btn-outline-primary btn-sm" id="addPartnerBtn">
|
|
<i class="fas fa-plus me-1"></i>Add Partner
|
|
</button>
|
|
</div>
|
|
<div id="partnersList"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|