diff --git a/README.md b/README.md index b45429cdf8..90f3dcd600 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,5 @@ # NodeBB [![Dependency Status](https://david-dm.org/designcreateplay/nodebb.png)](https://david-dm.org/designcreateplay/nodebb) -[![Code Climate](https://codeclimate.com/github/designcreateplay/NodeBB.png)](https://codeclimate.com/github/designcreateplay/NodeBB) **NodeBB Forum Software** is powered by Node.js and built on a Redis database. It utilizes web sockets for instant interactions and real-time notifications. NodeBB is compatible down to IE8 and has many modern features out of the box such as social network integration and streaming discussions. diff --git a/app.js b/app.js index 3f7d3aaf7b..097734cd25 100644 --- a/app.js +++ b/app.js @@ -141,7 +141,8 @@ function start() { webserver.init(); }); - notifications.init(); + // Temporarily removed until ncb000gt/node-cron/issues/81 and ncb000gt/node-cron/issues/83 are fixed + // notifications.init(); process.on('SIGTERM', shutdown); process.on('SIGINT', shutdown); diff --git a/public/src/app.js b/public/src/app.js index b749e7778a..554a6ad4f3 100644 --- a/public/src/app.js +++ b/public/src/app.js @@ -28,7 +28,8 @@ var socket, var reconnection_delay = 200; socket = io.connect('', { 'max reconnection attempts': max_reconnection_attemps, - 'reconnection delay': reconnection_delay + 'reconnection delay': reconnection_delay, + resource: RELATIVE_PATH.length ? RELATIVE_PATH.slice(1) + '/socket.io' : 'socket.io' }); var reconnecting = false, diff --git a/public/src/forum/footer.js b/public/src/forum/footer.js index e866b70cf9..f93277a4b5 100644 --- a/public/src/forum/footer.js +++ b/public/src/forum/footer.js @@ -8,13 +8,11 @@ define(['notifications', 'chat'], function(Notifications, Chat) { Chat.prepareDOM(); translator.prepareDOM(); - function updateUnreadCount(err, tids) { - var count = 0, unreadEl = $('#unread-count'); + function updateUnreadCount(err, count) { + var unreadEl = $('#unread-count'); if (err) { console.warn('Error updating unread count', err); - } else if(tids && tids.length) { - count = tids.length; } unreadEl diff --git a/public/templates/category.tpl b/public/templates/category.tpl new file mode 100644 index 0000000000..d4d9bca105 --- /dev/null +++ b/public/templates/category.tpl @@ -0,0 +1,117 @@ + + + + + + + + +
+ + + + +
+   +   +   +
+ +
+ +
+ + +
+ [[category:no_topics]] +
+ + +
+
+ + + + +
+ + +
+ + {widgets.html} + +
+ +
+ diff --git a/public/templates/popular.tpl b/public/templates/popular.tpl new file mode 100644 index 0000000000..912d2ea6e7 --- /dev/null +++ b/public/templates/popular.tpl @@ -0,0 +1,79 @@ + + + + +
+ + +
+
+ + +
+ There are no popular topics. +
+ + +
+
+ +
+
diff --git a/public/templates/recent.tpl b/public/templates/recent.tpl new file mode 100644 index 0000000000..a3b9ebde6b --- /dev/null +++ b/public/templates/recent.tpl @@ -0,0 +1,78 @@ + + + + +
+ + +
+
+ + +
+ [[recent:no_recent_topics]] +
+ + +
+
+ +
+
diff --git a/public/templates/unread.tpl b/public/templates/unread.tpl new file mode 100644 index 0000000000..201cf76f14 --- /dev/null +++ b/public/templates/unread.tpl @@ -0,0 +1,73 @@ +
+ + + +
+ [[unread:no_unread_topics]] +
+ + + + +
+
+ +
+
+ + +
+
+
diff --git a/src/database/mongo.js b/src/database/mongo.js index a9cc09c2d4..78b3914cc2 100644 --- a/src/database/mongo.js +++ b/src/database/mongo.js @@ -82,18 +82,6 @@ // // helper functions // - function removeHiddenFields(item) { - if(item) { - if(item._id) { - delete item._id; - } - if(item._key) { - delete item._key; - } - } - return item; - } - function findItem(data, key) { if(!data) { return null; @@ -261,11 +249,7 @@ }; module.getObject = function(key, callback) { - db.collection('objects').findOne({_key:key}, function(err, item) { - removeHiddenFields(item); - - callback(err, item); - }); + db.collection('objects').findOne({_key:key}, {_id:0, _key:0}, callback); }; module.getObjects = function(keys, callback) { @@ -302,7 +286,9 @@ module.getObjectFields = function(key, fields, callback) { - var _fields = {}; + var _fields = { + _id: 0 + }; for(var i=0; i