forked from UKSOURCE/cms.lams
Introduce a centralized system to manage all website form submissions and newsletter subscriptions. - Add `Submission` and `NewsletterSubscription` models with MongoDB schema validation - Implement `submissionController` and `newsletterSubscriptionController` for CRUD operations and filtering - Create a unified admin UI for reviewing submissions across different sources (home, request, contact, partnership, newsletter) - Add database migration scripts for creating collections and indexes - Refactor partnership inquiry forms to use a fixed field structure - Update admin navigation and server CORS settings to support PATCH requests
78 lines
2.8 KiB
Plaintext
78 lines
2.8 KiB
Plaintext
<div class="container">
|
|
<div class="d-flex justify-content-between align-items-center mt-4 mb-4">
|
|
<div>
|
|
<h1 class="h3 mb-0" style="color: var(--primary-dark)"><%= title %></h1>
|
|
<p class="text-muted mb-0"><%= subtitle %></p>
|
|
</div>
|
|
<div>
|
|
<a href="<%= previewUrl %>" class="btn btn-outline-primary" target="_blank">
|
|
<i class="fas fa-external-link-alt me-2"></i>View Page
|
|
</a>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row">
|
|
<div class="col-12">
|
|
<form action="/admin/partnerships/update" method="POST" id="cmsEditorForm" class="content-with-fixed-buttons" novalidate>
|
|
<input type="hidden" name="pageJson" id="pageJson" />
|
|
<input type="hidden" name="activeTab" id="activeTabInput" value="<%= activeTab %>" />
|
|
|
|
<div class="card shadow-sm border-0 mb-4">
|
|
<div class="card-header bg-white border-bottom">
|
|
<ul class="nav nav-tabs card-header-tabs" role="tablist">
|
|
<% editorConfig.tabs.forEach((tab) => { %>
|
|
<li class="nav-item">
|
|
<a class="nav-link <%= activeTab === tab.key ? 'active' : '' %>" data-bs-toggle="tab" href="#<%= tab.key %>" role="tab" data-tab-key="<%= tab.key %>">
|
|
<i class="<%= tab.icon %> me-2"></i><%= tab.label %>
|
|
</a>
|
|
</li>
|
|
<% }) %>
|
|
</ul>
|
|
</div>
|
|
|
|
<div class="tab-content">
|
|
<%- include("partials/hero-tab", { activeTab, data, backendUrl, editorUi }) %>
|
|
<%- include("partials/directory-tab", { activeTab, data, editorUi }) %>
|
|
<%- include("partials/cta-tab", { activeTab, data, editorUi }) %>
|
|
<%- include("partials/inquiry-form-tab", { activeTab, data, editorUi }) %>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="fixed-bottom-buttons">
|
|
<button type="button" class="btn btn-secondary" id="resetPartnershipsForm">
|
|
<i class="fas fa-undo"></i>
|
|
<span>Reset</span>
|
|
</button>
|
|
<button type="submit" class="btn btn-primary">
|
|
<i class="fas fa-save"></i>
|
|
<span>Save Changes</span>
|
|
</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<%- include("partials/templates", { editorUi }) %>
|
|
|
|
<script type="application/json" id="partnershipsPageBootstrapJson"><%- JSON.stringify({
|
|
data,
|
|
backendUrl,
|
|
editorConfig,
|
|
editorUi,
|
|
}) %></script>
|
|
<script>
|
|
const partnershipsPageBootstrap = JSON.parse(
|
|
document.getElementById("partnershipsPageBootstrapJson").textContent || "{}",
|
|
);
|
|
window.partnershipsPageData = partnershipsPageBootstrap.data;
|
|
window.partnershipsBackendUrl = partnershipsPageBootstrap.backendUrl;
|
|
window.partnershipsEditorConfig = partnershipsPageBootstrap.editorConfig;
|
|
window.partnershipsEditorUi = partnershipsPageBootstrap.editorUi;
|
|
</script>
|
|
<%- include("partials/editor-script") %>
|
|
|
|
|
|
|
|
|