Files
cms.techvanguard.vn/views/admin/partnerships/partials/cta-tab.ejs
T
Tống Thành Đạt a39c336dd4 feat(cms): enhance content editors with dynamic UI configs and validation
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.
2026-04-22 18:06:03 +07:00

28 lines
1.3 KiB
Plaintext

<div class="tab-pane fade <%= activeTab === 'cta' ? 'show active' : '' %>" id="cta" role="tabpanel">
<% const ctaUi = editorUi.cta || {}; %>
<div class="card border shadow-sm">
<div class="card-header bg-white">
<h6 class="mb-0"><i class="fas fa-bullhorn me-2"></i>Call To Action</h6>
</div>
<div class="card-body p-4">
<div class="row g-3">
<div class="col-12">
<label class="form-label fw-semibold"><%= ctaUi.heading?.label || "Headline" %></label>
<input class="form-control" id="ctaHeading" maxlength="<%= ctaUi.heading?.maxLength || 80 %>" value="<%= data.cta?.heading || '' %>">
</div>
<div class="col-12">
<label class="form-label fw-semibold"><%= ctaUi.description?.label || "Supporting text" %></label>
<textarea class="form-control" id="ctaDescription" rows="<%= ctaUi.description?.rows || 4 %>" maxlength="<%= ctaUi.description?.maxLength || 220 %>"><%= data.cta?.description || '' %></textarea>
</div>
<div class="col-md-6">
<label class="form-label fw-semibold"><%= ctaUi.buttonLabel?.label || "Button label" %></label>
<input class="form-control" id="ctaButtonLabel" maxlength="<%= ctaUi.buttonLabel?.maxLength || 40 %>" value="<%= data.cta?.buttonLabel || '' %>">
</div>
</div>
</div>
</div>
</div>