forked from UKSOURCE/cms.lams
Refactor: remove unused APIs, controllers, models and data files. Update: icon picker all system, Dashboard, Main UI more respone, Change: Logo, favicon.
This commit is contained in:
+37
-11
@@ -1,16 +1,23 @@
|
||||
<div class="container">
|
||||
<div class="d-flex justify-content-between align-items-center mt-4 mb-4">
|
||||
<div class="d-flex justify-content-between align-items-center mt-4 mb-4 flex-wrap gap-2">
|
||||
<div>
|
||||
<h1 class="h3 mb-0" style="color: var(--primary-dark);">
|
||||
<%= title %>
|
||||
</h1>
|
||||
<p class="text-muted mb-0">Edit content displayed on the About page</p>
|
||||
</div>
|
||||
<div class="d-flex gap-2">
|
||||
<% if (frontendUrl) { %>
|
||||
<a href="<%= frontendUrl %>/about" class="btn btn-outline-primary" target="_blank" rel="noopener">
|
||||
<i class="fas fa-external-link-alt me-2"></i>View About Page
|
||||
</a>
|
||||
<% } %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<form method="POST" id="aboutForm" action="/admin/about-us/update">
|
||||
<form method="POST" id="aboutForm" action="/admin/about/update">
|
||||
<!-- Hidden JSON inputs -->
|
||||
<input type="hidden" name="hero" id="heroJson">
|
||||
<input type="hidden" name="leadership" id="leadershipJson">
|
||||
@@ -366,7 +373,7 @@
|
||||
let originalFormData = null;
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
originalFormData = <%- JSON.stringify(data) %>;
|
||||
originalFormData = <% - JSON.stringify(data) %>;
|
||||
populateAll(originalFormData);
|
||||
|
||||
document.getElementById('aboutForm').addEventListener('submit', function (e) {
|
||||
@@ -595,22 +602,31 @@
|
||||
c.insertAdjacentHTML('beforeend', `
|
||||
<div class="card mb-2 lf-feature-item" data-mode="${mode}">
|
||||
<div class="card-body p-2">
|
||||
<div class="row g-2">
|
||||
<div class="row g-2 align-items-center">
|
||||
<div class="col-md-3">
|
||||
<input type="text" class="form-control form-control-sm" data-field="icon" value="${esc(item.icon)}" placeholder="fa-play">
|
||||
<div class="input-group input-group-sm">
|
||||
<span class="input-group-text icon-preview-cell" style="min-width:32px">
|
||||
${item.icon ? `<i class="${esc(item.icon)}"></i>` : ''}
|
||||
</span>
|
||||
<input type="text" class="form-control form-control-sm" data-field="icon"
|
||||
value="${esc(item.icon)}" placeholder="Click to pick..." readonly
|
||||
style="cursor:pointer;background:#fff"
|
||||
onclick="IconPicker.open(this)">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<input type="text" class="form-control form-control-sm" data-field="title" value="${esc(item.title)}" placeholder="Title">
|
||||
</div>
|
||||
<div class="col-md-5">
|
||||
<div class="col-md-4">
|
||||
<input type="text" class="form-control form-control-sm" data-field="desc" value="${esc(item.desc)}" placeholder="Description">
|
||||
</div>
|
||||
<div class="col-md-1 d-flex justify-content-center">
|
||||
<button type="button" class="btn btn-link text-danger btn-sm p-0" onclick="this.closest('.lf-feature-item').remove()"><i class="fas fa-trash"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
<button type="button" class="btn btn-link text-danger btn-sm p-0 mt-1" onclick="this.closest('.lf-feature-item').remove()"><i class="fas fa-trash me-1"></i>Remove</button>
|
||||
</div>
|
||||
</div>`);
|
||||
}
|
||||
|
||||
function populateLearningFeatures(mode, features) {
|
||||
document.getElementById(mode + 'FeaturesContainer').innerHTML = '';
|
||||
features.forEach(f => addLearningFeature(mode, f));
|
||||
@@ -632,16 +648,26 @@
|
||||
<div class="card-body p-2">
|
||||
<div class="row g-2">
|
||||
<div class="col-md-3">
|
||||
<input type="text" class="form-control form-control-sm" data-field="icon" value="${esc(item.icon)}" placeholder="fa-award">
|
||||
<div class="input-group input-group-sm">
|
||||
<span class="input-group-text icon-preview-cell" style="min-width:32px">
|
||||
${item.icon ? `<i class="${esc(item.icon)}"></i>` : ''}
|
||||
</span>
|
||||
<input type="text" class="form-control form-control-sm" data-field="icon"
|
||||
value="${esc(item.icon)}" placeholder="Click to pick..." readonly
|
||||
style="cursor:pointer;background:#fff"
|
||||
onclick="IconPicker.open(this)">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<input type="text" class="form-control form-control-sm" data-field="title" value="${esc(item.title)}" placeholder="Title">
|
||||
</div>
|
||||
<div class="col-md-5">
|
||||
<div class="col-md-4">
|
||||
<input type="text" class="form-control form-control-sm" data-field="desc" value="${esc(item.desc)}" placeholder="Description">
|
||||
</div>
|
||||
<div class="col-md-1 d-flex justify-content-center">
|
||||
<button type="button" class="btn btn-link text-danger btn-sm p-0 mt-1" onclick="this.closest('.acc-badge-item').remove()"><i class="fas fa-trash me-1"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
<button type="button" class="btn btn-link text-danger btn-sm p-0 mt-1" onclick="this.closest('.acc-badge-item').remove()"><i class="fas fa-trash me-1"></i>Remove</button>
|
||||
</div>
|
||||
</div>`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user