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:
@@ -201,12 +201,15 @@
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label class="form-label small">Icon</label>
|
||||
<select class="form-select course-icon-select">
|
||||
<option value="">— No icon —</option>
|
||||
<% iconOptions.forEach(function(opt) { %>
|
||||
<option value="<%= opt.value %>" <%= (course.icon === opt.value) ? 'selected' : '' %>><%= opt.label %></option>
|
||||
<% }); %>
|
||||
</select>
|
||||
<div class="input-group">
|
||||
<span class="input-group-text icon-preview-cell" style="min-width:38px">
|
||||
<% if (course.icon) { %><i class="<%= course.icon %>"></i><% } %>
|
||||
</span>
|
||||
<input type="text" class="form-control course-icon-select"
|
||||
value="<%= course.icon || '' %>" placeholder="Click to pick..." readonly
|
||||
style="cursor:pointer;background:#fff"
|
||||
onclick="IconPicker.open(this)">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2 d-flex align-items-end justify-content-end">
|
||||
<button type="button" class="btn btn-outline-danger btn-sm remove-course">
|
||||
@@ -269,12 +272,15 @@
|
||||
</div>
|
||||
<div class="col-md-5">
|
||||
<label class="form-label small">Icon</label>
|
||||
<select class="form-select outcome-icon-select">
|
||||
<option value="">— No icon —</option>
|
||||
<% iconOptions.forEach(function(opt) { %>
|
||||
<option value="<%= opt.value %>" <%= (outcome.icon === opt.value) ? 'selected' : '' %>><%= opt.label %></option>
|
||||
<% }); %>
|
||||
</select>
|
||||
<div class="input-group">
|
||||
<span class="input-group-text icon-preview-cell" style="min-width:38px">
|
||||
<% if (outcome.icon) { %><i class="<%= outcome.icon %>"></i><% } %>
|
||||
</span>
|
||||
<input type="text" class="form-control outcome-icon-select"
|
||||
value="<%= outcome.icon || '' %>" placeholder="Click to pick..." readonly
|
||||
style="cursor:pointer;background:#fff"
|
||||
onclick="IconPicker.open(this)">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-1 d-flex align-items-end justify-content-end">
|
||||
<button type="button" class="btn btn-outline-danger btn-sm remove-outcome"><i class="fas fa-trash"></i></button>
|
||||
@@ -358,23 +364,23 @@
|
||||
</div>
|
||||
|
||||
<script>
|
||||
window.PROGRAMME_ICON_OPTIONS = <%- JSON.stringify(iconOptions || []) %>;
|
||||
// window.PROGRAMME_ICON_OPTIONS = <%- JSON.stringify(iconOptions || []) %>;
|
||||
|
||||
function escHtml(s) {
|
||||
return String(s || '')
|
||||
.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"');
|
||||
}
|
||||
|
||||
function iconOptionsHtml(selected) {
|
||||
var opts = window.PROGRAMME_ICON_OPTIONS;
|
||||
var html = '<option value="">— No icon —</option>';
|
||||
for (var i = 0; i < opts.length; i++) {
|
||||
var o = opts[i];
|
||||
var sel = (o.value === selected) ? ' selected' : '';
|
||||
html += '<option value="' + escHtml(o.value) + '"' + sel + '>' + escHtml(o.label) + '</option>';
|
||||
}
|
||||
return html;
|
||||
}
|
||||
// function iconOptionsHtml(selected) {
|
||||
// var opts = window.PROGRAMME_ICON_OPTIONS;
|
||||
// var html = '<option value="">— No icon —</option>';
|
||||
// for (var i = 0; i < opts.length; i++) {
|
||||
// var o = opts[i];
|
||||
// var sel = (o.value === selected) ? ' selected' : '';
|
||||
// html += '<option value="' + escHtml(o.value) + '"' + sel + '>' + escHtml(o.label) + '</option>';
|
||||
// }
|
||||
// return html;
|
||||
// }
|
||||
|
||||
function buildCourseRow(c) {
|
||||
c = c || {};
|
||||
@@ -387,7 +393,13 @@
|
||||
'<div class="col-md-4"><label class="form-label small">Title</label>' +
|
||||
'<input type="text" class="form-control course-title" value="' + escHtml(c.title) + '"></div>' +
|
||||
'<div class="col-md-4"><label class="form-label small">Icon</label>' +
|
||||
'<select class="form-select course-icon-select"><' + 'option value="">— No icon —</' + 'option>' + iconOptionsHtml(c.icon) + '</select></div>' +
|
||||
'<div class="input-group">' +
|
||||
'<span class="input-group-text icon-preview-cell" style="min-width:38px">' +
|
||||
(c.icon ? '<i class="' + escHtml(c.icon) + '"></i>' : '') +
|
||||
'</span>' +
|
||||
'<input type="text" class="form-control course-icon-select" value="' + escHtml(c.icon) + '" placeholder="Click to pick..." readonly ' +
|
||||
'style="cursor:pointer;background:#fff" onclick="IconPicker.open(this)">' +
|
||||
'</div></div>' +
|
||||
'<div class="col-md-2 d-flex align-items-end justify-content-end">' +
|
||||
'<button type="button" class="btn btn-outline-danger btn-sm remove-course"><i class="fas fa-trash"></i></button></div>' +
|
||||
'<div class="col-md-12"><label class="form-label small">Description</label>' +
|
||||
@@ -407,7 +419,13 @@
|
||||
'<div class="col-md-6"><label class="form-label small">Title</label>' +
|
||||
'<input type="text" class="form-control outcome-title" value="' + escHtml(o.title) + '"></div>' +
|
||||
'<div class="col-md-5"><label class="form-label small">Icon</label>' +
|
||||
'<select class="form-select outcome-icon-select"><option value="">— No icon —</option>' + iconOptionsHtml(o.icon) + '</select></div>' +
|
||||
'<div class="input-group">' +
|
||||
'<span class="input-group-text icon-preview-cell" style="min-width:38px">' +
|
||||
(o.icon ? '<i class="' + escHtml(o.icon) + '"></i>' : '') +
|
||||
'</span>' +
|
||||
'<input type="text" class="form-control outcome-icon-select" value="' + escHtml(o.icon) + '" placeholder="Click to pick..." readonly ' +
|
||||
'style="cursor:pointer;background:#fff" onclick="IconPicker.open(this)">' +
|
||||
'</div></div>' +
|
||||
'<div class="col-md-1 d-flex align-items-end justify-content-end">' +
|
||||
'<button type="button" class="btn btn-outline-danger btn-sm remove-outcome"><i class="fas fa-trash"></i></button></div>' +
|
||||
'<div class="col-md-12"><label class="form-label small">Description</label>' +
|
||||
|
||||
Reference in New Issue
Block a user