added message to admin panel if no themes are found

v1.18.x
Julian Lam 12 years ago
parent 45c10d75f3
commit dd6c9e03cb

@ -85,6 +85,10 @@
&:hover { &:hover {
background-color: rgba(128, 128, 128, 0.2); background-color: rgba(128, 128, 128, 0.2);
} }
&.no-themes {
font-style: italic;
}
} }
} }

@ -86,23 +86,30 @@ var nodebb_admin = (function(nodebb_admin) {
themeFrag = document.createDocumentFragment(), themeFrag = document.createDocumentFragment(),
liEl = document.createElement('li'); liEl = document.createElement('li');
for(var x=0,numThemes=themes.length;x<numThemes;x++) { if (themes.length > 0) {
liEl.setAttribute('data-theme', themes[x].id); for(var x=0,numThemes=themes.length;x<numThemes;x++) {
liEl.setAttribute('data-css', themes[x].src); liEl.setAttribute('data-theme', themes[x].id);
liEl.innerHTML = '<img src="' + themes[x].screenshot + '" />' + liEl.setAttribute('data-css', themes[x].src);
'<div>' + liEl.innerHTML = '<img src="' + themes[x].screenshot + '" />' +
'<div class="pull-right">' + '<div>' +
'<button class="btn btn-primary" data-action="use">Use</button> ' + '<div class="pull-right">' +
'<button class="btn" data-action="preview">Preview</button>' + '<button class="btn btn-primary" data-action="use">Use</button> ' +
'<button class="btn" data-action="preview">Preview</button>' +
'</div>' +
'<h4>' + themes[x].name + '</h4>' +
'<p>' +
themes[x].description +
(themes[x].url ? ' (<a href="' + themes[x].url + '">Homepage</a>)' : '') +
'</p>' +
'</div>' + '</div>' +
'<h4>' + themes[x].name + '</h4>' + '<div class="clear">';
'<p>' + themeFrag.appendChild(liEl.cloneNode(true));
themes[x].description + }
(themes[x].url ? ' (<a href="' + themes[x].url + '">Homepage</a>)' : '') + } else {
'</p>' + // No themes found
'</div>' + liEl.className = 'no-themes';
'<div class="clear">'; liEl.innerHTML = 'No installed themes found';
themeFrag.appendChild(liEl.cloneNode(true)); themeFrag.appendChild(liEl);
} }
instListEl.innerHTML = ''; instListEl.innerHTML = '';

Loading…
Cancel
Save