forked from UKSOURCE/cms.lams
Implement a more flexible, configuration-driven approach for CMS editors across accreditation, admissions, and partnerships modules. - Move UI labels, help texts, and field limits from hardcoded views to `editorUi` configurations in config files. - Add server-side and client-side validation to prevent duplicate category tabs in accreditation and partnerships editors. - Refactor partnership and admission views to dynamically render tabs and fields based on the provided configuration. - Update field length constraints and default values across multiple content editors to better align with frontend requirements. - Improve the admissions calculator editor with dynamic field configurations and default value fallbacks.
50 lines
2.3 KiB
Plaintext
50 lines
2.3 KiB
Plaintext
<div class="tab-pane fade <%= activeTab === 'directory' ? 'show active' : '' %>" id="directory" role="tabpanel">
|
|
<% const directoryUi = editorUi.directory || {}; %>
|
|
<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-12">
|
|
<label class="form-label fw-semibold"><%= directoryUi.heading?.label || "Section heading" %></label>
|
|
<input class="form-control" id="directoryHeading" maxlength="<%= directoryUi.heading?.maxLength || 70 %>" value="<%= data.directory?.heading || '' %>">
|
|
</div>
|
|
<div class="col-12">
|
|
<label class="form-label fw-semibold"><%= directoryUi.description?.label || "Section description" %></label>
|
|
<textarea class="form-control" id="directoryDescription" rows="<%= directoryUi.description?.rows || 3 %>" maxlength="<%= directoryUi.description?.maxLength || 180 %>"><%= data.directory?.description || '' %></textarea>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="cms-editor-group mb-4">
|
|
<div class="mb-3">
|
|
<div>
|
|
<label class="form-label fw-semibold mb-1"><%= directoryUi.tabs?.label || "Category tabs" %></label>
|
|
<div class="form-text mt-0"><%= directoryUi.tabsFrontendHint || directoryUi.tabs?.helpText || "" %></div>
|
|
</div>
|
|
</div>
|
|
<div id="directoryTabsList"></div>
|
|
<button type="button" class="cms-add-button mt-3" id="addDirectoryTabBtn">
|
|
<i class="fas fa-plus me-2"></i><%= directoryUi.tabs?.addLabel || "Add Tab" %>
|
|
</button>
|
|
</div>
|
|
|
|
<div class="cms-editor-group">
|
|
<div class="mb-3">
|
|
<div>
|
|
<label class="form-label fw-semibold mb-1"><%= directoryUi.partners?.label || "Partners" %></label>
|
|
<div class="form-text mt-0"><%= directoryUi.partnersHelpText || directoryUi.partners?.helpText || "" %></div>
|
|
</div>
|
|
</div>
|
|
<div id="partnersList"></div>
|
|
<button type="button" class="cms-add-button mt-3" id="addPartnerBtn">
|
|
<i class="fas fa-plus me-2"></i><%= directoryUi.partners?.addLabel || "Add Partner" %>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|