diff --git a/nodebb b/nodebb index b318989623..3733935784 100755 --- a/nodebb +++ b/nodebb @@ -1,4 +1,6 @@ #!/bin/bash clear -echo "Launching NodeBB in \"development\" mode" +echo "Launching NodeBB in \"development\" mode." +echo "To run the production build of NodeBB, please use \"forever\"." +echo "More Information: https://github.com/designcreateplay/NodeBB/wiki/How-to-run-NodeBB" NODE_ENV=development supervisor --extensions 'node|js|tpl' -- app $1 \ No newline at end of file diff --git a/public/css/admin.less b/public/css/admin.less index c56eeb74ce..9cb477f08e 100644 --- a/public/css/admin.less +++ b/public/css/admin.less @@ -85,6 +85,10 @@ &:hover { background-color: rgba(128, 128, 128, 0.2); } + + &.no-themes { + font-style: italic; + } } } diff --git a/public/src/forum/admin/themes.js b/public/src/forum/admin/themes.js index 66b04a9de2..762924cd4f 100644 --- a/public/src/forum/admin/themes.js +++ b/public/src/forum/admin/themes.js @@ -39,7 +39,7 @@ var nodebb_admin = (function(nodebb_admin) { (function() { var scriptEl = document.createElement('script'); - scriptEl.src = 'http://api.bootswatch.com?callback=nodebb_admin.themes.render'; + scriptEl.src = 'http://api.bootswatch.com/2/?callback=nodebb_admin.themes.render'; document.body.appendChild(scriptEl); var bootstrapThemeContainer = document.querySelector('#bootstrap_themes'), @@ -81,32 +81,38 @@ var nodebb_admin = (function(nodebb_admin) { }, false); // Installed Themes - socket.once('api:admin:themes.getInstalled', function(themes) { + socket.emit('api:admin.themes.getInstalled', function(themes) { var instListEl = document.getElementById('installed_themes'), themeFrag = document.createDocumentFragment(), liEl = document.createElement('li'); - for(var x=0,numThemes=themes.length;x' + - '
' + - '
' + - ' ' + - '' + + if (themes.length > 0) { + for(var x=0,numThemes=themes.length;x' + + '
' + + '
' + + ' ' + + '' + + '
' + + '

' + themes[x].name + '

' + + '

' + + themes[x].description + + (themes[x].url ? ' (Homepage)' : '') + + '

' + '
' + - '

' + themes[x].name + '

' + - '

' + - themes[x].description + - (themes[x].url ? ' (Homepage)' : '') + - '

' + - '
' + - '
'; - themeFrag.appendChild(liEl.cloneNode(true)); + '
'; + themeFrag.appendChild(liEl.cloneNode(true)); + } + } else { + // No themes found + liEl.className = 'no-themes'; + liEl.innerHTML = 'No installed themes found'; + themeFrag.appendChild(liEl); } instListEl.innerHTML = ''; instListEl.appendChild(themeFrag); }); - socket.emit('api:admin:themes.getInstalled'); })(); \ No newline at end of file diff --git a/public/src/forum/admin/topics.js b/public/src/forum/admin/topics.js index ba4ae12ea3..d0c6608fef 100644 --- a/public/src/forum/admin/topics.js +++ b/public/src/forum/admin/topics.js @@ -32,6 +32,23 @@ $(document).ready(function() { socket.emit('api:admin.topics.getMore', { limit: 10, after: lastTid + }, function(topics) { + var btnEl = document.getElementById('topics_loadmore'); + + topics = JSON.parse(topics); + if (topics.length > 0) { + var html = templates.prepare(templates['admin/topics'].blocks['topics']).parse({ + topics: topics + }), + topicsListEl = document.querySelector('.topics'); + + topicsListEl.innerHTML += html; + btnEl.innerHTML = 'Load More Topics'; + } else { + // Exhausted all topics + btnEl.className += ' disabled'; + btnEl.innerHTML = 'No more topics'; + } }); } }, false); @@ -40,9 +57,9 @@ $(document).ready(function() { var topicEls = topicsListEl.querySelectorAll('li'), numTopics = topicEls.length; for(var x=0;x 0) { - var html = templates.prepare(templates['admin/topics'].blocks['topics']).parse({ - topics: topics - }), - topicsListEl = document.querySelector('.topics'); - - topicsListEl.innerHTML += html; - btnEl.innerHTML = 'Load More Topics'; - } else { - // Exhausted all topics - btnEl.className += ' disabled'; - btnEl.innerHTML = 'No more topics'; - } }); \ No newline at end of file diff --git a/src/meta.js b/src/meta.js index 47ea895c4e..3ea054e314 100644 --- a/src/meta.js +++ b/src/meta.js @@ -49,7 +49,7 @@ var utils = require('./../public/src/utils.js'), themeArr.push(conf); next(); }); - } + } else next(); }); } else next(); }); @@ -57,9 +57,6 @@ var utils = require('./../public/src/utils.js'), callback(err, themeArr); }); }); - }, - saveViaGithub: function(repo_url, callback) { - // ... } } diff --git a/src/websockets.js b/src/websockets.js index 57b6e1973f..096d483176 100644 --- a/src/websockets.js +++ b/src/websockets.js @@ -663,9 +663,9 @@ var SocketIO = require('socket.io').listen(global.server, { log:false }), }); }); - socket.on('api:admin.topics.getMore', function(data) { + socket.on('api:admin.topics.getMore', function(data, callback) { topics.getAllTopics(data.limit, data.after, function(topics) { - socket.emit('api:admin.topics.getMore', JSON.stringify(topics)); + callback(JSON.stringify(topics)); }); }); @@ -701,9 +701,9 @@ var SocketIO = require('socket.io').listen(global.server, { log:false }), socket.emit('api:admin.user.search', null); }); - socket.on('api:admin:themes.getInstalled', function() { + socket.on('api:admin.themes.getInstalled', function(callback) { meta.themes.get(function(err, themeArr) { - socket.emit('api:admin:themes.getInstalled', themeArr); + callback(themeArr); }); });