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:
@@ -137,19 +137,25 @@
|
||||
<div class="row g-2">
|
||||
<div class="col-md-4">
|
||||
<label class="form-label small">Icon</label>
|
||||
<select class="form-select svc-icon-select">
|
||||
<% iconOptions.forEach(function(opt) { %>
|
||||
<option value="<%= opt.value %>" <%= (svc.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 (svc.icon) { %><i class="<%= svc.icon %>"></i><% } %>
|
||||
</span>
|
||||
<input type="text" class="form-control ch-icon"
|
||||
value="<%= svc.icon || '' %>" placeholder="Click to pick..." readonly
|
||||
style="cursor:pointer;background:#fff" onclick="IconPicker.open(this)">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label class="form-label small">Hours icon</label>
|
||||
<select class="form-select svc-hours-icon-select">
|
||||
<% iconOptions.forEach(function(opt) { %>
|
||||
<option value="<%= opt.value %>" <%= (svc.hoursIcon === opt.value) ? 'selected' : '' %>><%= opt.label %></option>
|
||||
<% }); %>
|
||||
</select>
|
||||
<div class="input-group">
|
||||
<span class="input-group-text icon-preview-cell" style="min-width:38px">
|
||||
<% if (svc.hoursIcon) { %><i class="<%= svc.hoursIcon %>"></i><% } %>
|
||||
</span>
|
||||
<input type="text" class="form-control ch-icon"
|
||||
value="<%= svc.hoursIcon || '' %>" placeholder="Click to pick..." readonly
|
||||
style="cursor:pointer;background:#fff" onclick="IconPicker.open(this)">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4 d-flex align-items-end justify-content-end">
|
||||
<button type="button" class="btn btn-outline-danger btn-sm remove-service"><i class="fas fa-trash"></i></button>
|
||||
@@ -205,11 +211,14 @@
|
||||
<div class="row g-2 align-items-end">
|
||||
<div class="col-md-3">
|
||||
<label class="form-label small">Icon</label>
|
||||
<select class="form-select ch-icon-select">
|
||||
<% iconOptions.forEach(function(opt) { %>
|
||||
<option value="<%= opt.value %>" <%= (ch.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 (ch.icon) { %><i class="<%= ch.icon %>"></i><% } %>
|
||||
</span>
|
||||
<input type="text" class="form-control ch-icon"
|
||||
value="<%= ch.icon || '' %>" placeholder="Click to pick..." readonly
|
||||
style="cursor:pointer;background:#fff" onclick="IconPicker.open(this)">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label class="form-label small">Title</label>
|
||||
@@ -314,7 +323,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
window.STUDENT_SUPPORT_ICON_OPTIONS = <%- JSON.stringify(iconOptions) %>;
|
||||
// window.STUDENT_SUPPORT_ICON_OPTIONS = <%- JSON.stringify(iconOptions) %>;
|
||||
|
||||
function escapeHtml(s) {
|
||||
return String(s || '')
|
||||
@@ -324,16 +333,16 @@
|
||||
.replace(/"/g, '"');
|
||||
}
|
||||
|
||||
function iconOptionsHtml(selected) {
|
||||
var opts = window.STUDENT_SUPPORT_ICON_OPTIONS || [];
|
||||
var html = '';
|
||||
for (var i = 0; i < opts.length; i++) {
|
||||
var o = opts[i];
|
||||
var sel = (o.value === selected) ? ' selected' : '';
|
||||
html += '<option value="' + escapeHtml(o.value) + '"' + sel + '>' + escapeHtml(o.label) + '</option>';
|
||||
}
|
||||
return html;
|
||||
}
|
||||
// function iconOptionsHtml(selected) {
|
||||
// var opts = window.STUDENT_SUPPORT_ICON_OPTIONS || [];
|
||||
// var html = '';
|
||||
// for (var i = 0; i < opts.length; i++) {
|
||||
// var o = opts[i];
|
||||
// var sel = (o.value === selected) ? ' selected' : '';
|
||||
// html += '<option value="' + escapeHtml(o.value) + '"' + sel + '>' + escapeHtml(o.label) + '</option>';
|
||||
// }
|
||||
// return html;
|
||||
// }
|
||||
|
||||
function buildServiceRow(svc) {
|
||||
svc = svc || {};
|
||||
@@ -343,8 +352,8 @@
|
||||
'<div class="card service-row border">' +
|
||||
'<div class="card-body">' +
|
||||
'<div class="row g-2">' +
|
||||
'<div class="col-md-4"><label class="form-label small">Icon</label>' + iconSel + '</div>' +
|
||||
'<div class="col-md-4"><label class="form-label small">Hours icon</label>' + hoursIconSel + '</div>' +
|
||||
'<div class="col-md-4"><label class="form-label small">Icon</label>' + iconPickerInput('svc-icon-select', svc.icon) + '</div>' +
|
||||
'<div class="col-md-4"><label class="form-label small">Hours icon</label>' + iconPickerInput('svc-hours-icon-select', svc.hoursIcon) + '</div>' +
|
||||
'<div class="col-md-4 d-flex align-items-end justify-content-end">' +
|
||||
'<button type="button" class="btn btn-outline-danger btn-sm remove-service"><i class="fas fa-trash"></i></button>' +
|
||||
'</div>' +
|
||||
@@ -364,11 +373,10 @@
|
||||
|
||||
function buildChannelRow(ch) {
|
||||
ch = ch || {};
|
||||
var iconSel = '<select class="form-select ch-icon-select">' + iconOptionsHtml(ch.icon) + '</select>';
|
||||
return (
|
||||
'<div class="card channel-row border"><div class="card-body py-2">' +
|
||||
'<div class="row g-2 align-items-end">' +
|
||||
'<div class="col-md-3"><label class="form-label small">Icon</label>' + iconSel + '</div>' +
|
||||
'<div class="col-md-3"><label class="form-label small">Icon</label>' + iconPickerInput('ch-icon-select', ch.icon) + '</div>' +
|
||||
'<div class="col-md-3"><label class="form-label small">Title</label>' +
|
||||
'<input type="text" class="form-control ch-title" value="' + escapeHtml(ch.title) + '"></div>' +
|
||||
'<div class="col-md-5"><label class="form-label small">Detail</label>' +
|
||||
|
||||
Reference in New Issue
Block a user