forked from UKSOURCE/cms.lams
fix
This commit is contained in:
@@ -78,12 +78,33 @@
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label class="form-label fw-medium" for="fieldLevel">Level</label>
|
||||
<input type="text" class="form-control" id="fieldLevel" name="level" value="<%= programme.level || '' %>" placeholder="Bachelor's Degree, Master's…">
|
||||
<select class="form-select" id="fieldLevel" name="level">
|
||||
<option value="">-- Select level --</option>
|
||||
<% (levelOptions || []).forEach(function(level) { %>
|
||||
<option value="<%= level %>" <%= programme.level === level ? 'selected' : '' %>><%= level %></option>
|
||||
<% }) %>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label class="form-label fw-medium" for="fieldShortName">Short Name</label>
|
||||
<input type="text" class="form-control" id="fieldShortName" name="shortName" value="<%= programme.shortName || '' %>" placeholder="MBA, B.S., Cert…">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label class="form-label fw-medium" for="fieldFieldOfStudy">Field of Study</label>
|
||||
<select class="form-select" id="fieldFieldOfStudy" name="fieldOfStudy">
|
||||
<option value="">-- Select field --</option>
|
||||
<option value="Computer Science" <%= programme.fieldOfStudy === 'Computer Science' ? 'selected' : '' %>>Computer Science</option>
|
||||
<option value="Data Analytics" <%= programme.fieldOfStudy === 'Data Analytics' ? 'selected' : '' %>>Data Analytics</option>
|
||||
<option value="Business & Admin" <%= programme.fieldOfStudy === 'Business & Admin' ? 'selected' : '' %>>Business & Admin</option>
|
||||
<option value="Healthcare" <%= programme.fieldOfStudy === 'Healthcare' ? 'selected' : '' %>>Healthcare</option>
|
||||
<option value="Finance & Accounting" <%= programme.fieldOfStudy === 'Finance & Accounting' ? 'selected' : '' %>>Finance & Accounting</option>
|
||||
<option value="Marketing" <%= programme.fieldOfStudy === 'Marketing' ? 'selected' : '' %>>Marketing</option>
|
||||
<option value="Education" <%= programme.fieldOfStudy === 'Education' ? 'selected' : '' %>>Education</option>
|
||||
<option value="Engineering" <%= programme.fieldOfStudy === 'Engineering' ? 'selected' : '' %>>Engineering</option>
|
||||
<option value="Psychology" <%= programme.fieldOfStudy === 'Psychology' ? 'selected' : '' %>>Psychology</option>
|
||||
<option value="Cybersecurity" <%= programme.fieldOfStudy === 'Cybersecurity' ? 'selected' : '' %>>Cybersecurity</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<label class="form-label fw-medium" for="fieldTitle">Title <span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="fieldTitle" name="title" value="<%= programme.title || '' %>" required>
|
||||
@@ -93,8 +114,27 @@
|
||||
<textarea class="form-control" id="fieldDescription" name="description" rows="3"><%= programme.description || '' %></textarea>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label class="form-label fw-medium" for="fieldDuration">Duration</label>
|
||||
<input type="text" class="form-control" id="fieldDuration" name="duration" value="<%= programme.duration || '' %>" placeholder="4 Years (Flexible)">
|
||||
<label class="form-label fw-medium" for="fieldDuration">Duration (Display)</label>
|
||||
<input
|
||||
type="text"
|
||||
class="form-control"
|
||||
id="fieldDuration"
|
||||
name="duration"
|
||||
value="<%= programme.duration || '' %>"
|
||||
placeholder="4 Years (Flexible)"
|
||||
list="durationSuggestions"
|
||||
>
|
||||
<datalist id="durationSuggestions">
|
||||
<% (durationOptions || []).forEach(function(duration) { %>
|
||||
<option value="<%= duration %>"></option>
|
||||
<% }) %>
|
||||
</datalist>
|
||||
<div class="form-text">Text hiển thị trên chương trình.</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label class="form-label fw-medium" for="fieldDurationInMonths">Duration (months)</label>
|
||||
<input type="number" class="form-control" id="fieldDurationInMonths" name="durationInMonths" value="<%= programme.durationInMonths || 0 %>" min="0" placeholder="48">
|
||||
<div class="form-text">Dùng để match vào Duration filter.</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label class="form-label fw-medium" for="fieldFormat">Format</label>
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
<div class="container">
|
||||
<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);">Programme Filters</h1>
|
||||
<p class="text-muted mb-0">Manage centralized filter options used by frontend programme page.</p>
|
||||
</div>
|
||||
<div class="d-flex gap-2">
|
||||
<% if (frontendUrl) { %>
|
||||
<a href="<%= frontendUrl %>/programmes" class="btn btn-outline-primary" target="_blank" rel="noopener">
|
||||
<i class="fas fa-external-link-alt me-2"></i>View Programmes Page
|
||||
</a>
|
||||
<% } %>
|
||||
<a href="/admin/programme" class="btn btn-outline-secondary">
|
||||
<i class="fas fa-arrow-left me-2"></i>Back to programmes
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<form action="/admin/programme/filters" method="POST" class="card shadow-sm border-0">
|
||||
<div class="card-body">
|
||||
<div class="row g-4">
|
||||
<div class="col-md-4">
|
||||
<label class="form-label fw-medium" for="levelsInput">Degree level options</label>
|
||||
<textarea
|
||||
id="levelsInput"
|
||||
name="levels"
|
||||
class="form-control"
|
||||
rows="14"
|
||||
placeholder="One option per line"
|
||||
><%= (filters.levels || []).join('\n') %></textarea>
|
||||
<div class="form-text">Use one line per option. Example: Bachelor's, Master's.</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label class="form-label fw-medium" for="fieldsInput">Field of Study options</label>
|
||||
<textarea
|
||||
id="fieldsInput"
|
||||
name="fields"
|
||||
class="form-control"
|
||||
rows="14"
|
||||
placeholder="One option per line"
|
||||
><%= (filters.fields || []).join('\n') %></textarea>
|
||||
<div class="form-text">Use one line per option. These appear as checkboxes in frontend filters.</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label class="form-label fw-medium" for="durationsInput">Duration range options</label>
|
||||
<textarea
|
||||
id="durationsInput"
|
||||
name="durations"
|
||||
class="form-control"
|
||||
rows="14"
|
||||
placeholder="One option per line"
|
||||
><%= (filters.durations || []).join('\n') %></textarea>
|
||||
<div class="form-text">Use one line per option. Example: < 6 months, 12-24 months, 48+ months.</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-footer bg-white border-top d-flex justify-content-end gap-2">
|
||||
<a href="/admin/programme" class="btn btn-secondary">Cancel</a>
|
||||
<button type="submit" class="btn btn-primary">
|
||||
<i class="fas fa-save me-2"></i>Save Filters
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -10,6 +10,9 @@
|
||||
<i class="fas fa-external-link-alt me-2"></i>View Programmes Page
|
||||
</a>
|
||||
<% } %>
|
||||
<a href="/admin/programme/filters" class="btn btn-outline-secondary">
|
||||
<i class="fas fa-filter me-2"></i>Manage Filters
|
||||
</a>
|
||||
<a href="/admin/programme/edit/new" class="btn btn-primary shadow-sm">
|
||||
<i class="fas fa-plus me-2"></i>Add New Programme
|
||||
</a>
|
||||
@@ -25,6 +28,8 @@
|
||||
<th class="ps-4" style="width:110px;">ID / Code</th>
|
||||
<th>Title</th>
|
||||
<th>Level</th>
|
||||
<th>Field</th>
|
||||
<th class="text-center" style="width:90px;">Months</th>
|
||||
<th>Format</th>
|
||||
<th>Cost</th>
|
||||
<th class="text-center" style="width:80px;">Courses</th>
|
||||
@@ -48,6 +53,8 @@
|
||||
<td>
|
||||
<span class="badge bg-light text-dark border"><%= item.level || '—' %></span>
|
||||
</td>
|
||||
<td class="text-muted small"><%= item.fieldOfStudy || '—' %></td>
|
||||
<td class="text-center text-muted small"><%= item.durationInMonths || '—' %></td>
|
||||
<td class="text-muted small"><%= item.format || '—' %></td>
|
||||
<td class="text-muted small"><%= item.monthlyCost || item.cost || '—' %></td>
|
||||
<td class="text-center">
|
||||
@@ -75,7 +82,7 @@
|
||||
<% }); %>
|
||||
<% } else { %>
|
||||
<tr>
|
||||
<td colspan="8" class="text-center text-muted py-5">
|
||||
<td colspan="10" class="text-center text-muted py-5">
|
||||
<i class="fas fa-graduation-cap fa-2x mb-3 d-block opacity-25"></i>
|
||||
No programmes found.
|
||||
<a href="/admin/programme/edit/new" class="d-block mt-2">Add your first programme →</a>
|
||||
|
||||
Reference in New Issue
Block a user