From f4ad1ac2dcd7ab051ba46e9fec9c29e04cf5a7ab Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Wed, 19 Feb 2014 18:14:15 -0500 Subject: [PATCH 01/15] moving active users list to bottom of admin index --- public/templates/admin/index.tpl | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/public/templates/admin/index.tpl b/public/templates/admin/index.tpl index 0ff8383dc3..fdc304b50a 100644 --- a/public/templates/admin/index.tpl +++ b/public/templates/admin/index.tpl @@ -12,14 +12,6 @@ -
-
-
Active Users socket connections
-
-
-
-
-
Updates
@@ -33,4 +25,12 @@
+
+
+
Active Users socket connections
+
+
+
+
+
\ No newline at end of file From 37bd88d1b28410f23f1dbf4ece1845bb1b277cde Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Wed, 19 Feb 2014 18:15:55 -0500 Subject: [PATCH 02/15] faux masonry lol --- public/templates/admin/index.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/templates/admin/index.tpl b/public/templates/admin/index.tpl index fdc304b50a..a6b8db55be 100644 --- a/public/templates/admin/index.tpl +++ b/public/templates/admin/index.tpl @@ -12,7 +12,7 @@ -
+
Updates
From fdd2dc322b0e8dc03728a29db12baec1acb5a5c8 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Wed, 19 Feb 2014 18:44:31 -0500 Subject: [PATCH 03/15] first pass #992 --- public/templates/admin/groups.tpl | 4 ++-- src/groups.js | 2 +- src/routes/admin.js | 18 +++++++++++++++--- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/public/templates/admin/groups.tpl b/public/templates/admin/groups.tpl index bd21db2b9f..39967ad648 100644 --- a/public/templates/admin/groups.tpl +++ b/public/templates/admin/groups.tpl @@ -10,12 +10,12 @@

{groups.name}

{groups.description}

+
- -
+
    diff --git a/src/groups.js b/src/groups.js index 8d9b50067c..9b32cc7839 100644 --- a/src/groups.js +++ b/src/groups.js @@ -70,7 +70,7 @@ results.base.count = results.users.length; results.base.members = results.users; - results.base.deletable = parseInt(results.base.gid, 10) !== 1; + results.base.deletable = results.base.hidden !== '1'; callback(err, results.base); }); diff --git a/src/routes/admin.js b/src/routes/admin.js index 57c27519f2..af1f534f13 100644 --- a/src/routes/admin.js +++ b/src/routes/admin.js @@ -2,6 +2,7 @@ var nconf = require('nconf'), fs = require('fs'), path = require('path'), winston = require('winston'), + async = require('async'), db = require('./../database'), user = require('./../user'), @@ -421,9 +422,20 @@ var nconf = require('nconf'), }); app.get('/groups', function (req, res) { - groups.list({ - expand: true - }, function (err, groups) { + async.parallel([ + function(next) { + groups.list({ + expand: true + }, next); + }, + function(next) { + groups.listSystemGroups({ + expand: true + }, next); + } + ], function(err, data) { + var groups = data[0].concat(data[1]); + res.json(200, { groups: groups, yourid: req.user.uid From 7937ecb6b4b2fc9a63d35843f220eeed6a60d344 Mon Sep 17 00:00:00 2001 From: Jason Nall Date: Wed, 19 Feb 2014 20:22:42 -0500 Subject: [PATCH 04/15] Moved CSS above scripts to ensure CSS files are downloaded in parallel. This can improve page load speed in some browsers. --- public/templates/header.tpl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/public/templates/header.tpl b/public/templates/header.tpl index aad9c657ab..f3c6292617 100644 --- a/public/templates/header.tpl +++ b/public/templates/header.tpl @@ -14,6 +14,12 @@ + + + + + + @@ -31,12 +37,6 @@ } }); - - - - - - From 813ff951466b19c06d35904ae5af390476c8d160 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Wed, 19 Feb 2014 21:32:05 -0500 Subject: [PATCH 05/15] removing useless jqueryUI CSS --- public/templates/header.tpl | 2 -- 1 file changed, 2 deletions(-) diff --git a/public/templates/header.tpl b/public/templates/header.tpl index f3c6292617..c84294f8e5 100644 --- a/public/templates/header.tpl +++ b/public/templates/header.tpl @@ -14,8 +14,6 @@ - - From bc10080c4954c0a0c6418fa08aff10018a6b5e0a Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Wed, 19 Feb 2014 21:47:26 -0500 Subject: [PATCH 06/15] close #1041 --- src/webserver.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/webserver.js b/src/webserver.js index 687280bf14..f8cd31fe83 100644 --- a/src/webserver.js +++ b/src/webserver.js @@ -88,10 +88,10 @@ module.exports.server = server; property: 'keywords', content: meta.config.keywords || '' }], - defaultLinkTags = [/*{ + defaultLinkTags = [{ rel: 'apple-touch-icon', - href: meta.config['brand:logo'] || nconf.get('relative_path') + '/logo.png' - }*/], + href: '/apple-touch-icon' + }], templateValues = { bootswatchCSS: meta.config['theme:src'], pluginCSS: plugins.cssFiles.map(function(file) { return { path: nconf.get('relative_path') + file.replace(/\\/g, '/') }; }), @@ -203,7 +203,13 @@ module.exports.server = server; logger.init(app); + // favicon & apple-touch-icon middleware app.use(express.favicon(path.join(__dirname, '../', 'public', meta.config['brand:favicon'] ? meta.config['brand:favicon'] : 'favicon.ico'))); + app.use('/apple-touch-icon', function(req, res) { + return res.sendfile(path.join(__dirname, '../public', meta.config['brand:logo'] || nconf.get('relative_path') + '/logo.png'), { + maxAge: app.enabled('cache') ? 5184000000 : 0 + }); + }); app.use(require('less-middleware')({ src: path.join(__dirname, '../', 'public'), From 86556989f404a5ddf0880fae2bc7eb499c781e47 Mon Sep 17 00:00:00 2001 From: Baris Soner Usakli Date: Thu, 20 Feb 2014 12:56:35 -0500 Subject: [PATCH 07/15] closes #1068 --- public/language/en_GB/pages.json | 1 + src/meta.js | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/public/language/en_GB/pages.json b/public/language/en_GB/pages.json index 9fc75d3d2b..10a7ef070b 100644 --- a/public/language/en_GB/pages.json +++ b/public/language/en_GB/pages.json @@ -8,6 +8,7 @@ "user.edit": "Editing \"%1\"", "user.following": "People %1 Follows", "user.followers": "People who Follow %1", + "user.posts": "Posts made by %1", "user.favourites": "%1's Favourite Posts", "user.settings": "User Settings" } \ No newline at end of file diff --git a/src/meta.js b/src/meta.js index bd77781b17..d95614b082 100644 --- a/src/meta.js +++ b/src/meta.js @@ -171,8 +171,6 @@ var fs = require('fs'), var user = require('./user'); Meta.title.parseFragment(decodeURIComponent(urlFragment), function(err, title) { - var title; - if (err) { title = Meta.config.browserTitle || 'NodeBB'; } else { From 34bf8397517696b55345d813f6c3e552f4ee61d5 Mon Sep 17 00:00:00 2001 From: Baris Soner Usakli Date: Thu, 20 Feb 2014 13:23:29 -0500 Subject: [PATCH 08/15] closes #1067 --- public/src/app.js | 17 ++++++++++++----- public/templates/category.tpl | 4 ++-- public/templates/topic.tpl | 4 ++-- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/public/src/app.js b/public/src/app.js index 836748641f..f7734ab588 100644 --- a/public/src/app.js +++ b/public/src/app.js @@ -15,6 +15,9 @@ var socket, url: RELATIVE_PATH + '/api/config', success: function (data) { config = data; + + exposeConfigToTemplates(); + if(socket) { socket.disconnect(); setTimeout(function() { @@ -591,13 +594,17 @@ var socket, }); createHeaderTooltips(); - - templates.setGlobal('relative_path', RELATIVE_PATH); - templates.setGlobal('usePagination', config.usePagination); - templates.setGlobal('topicsPerPage', config.topicsPerPage); - templates.setGlobal('postsPerPage', config.postsPerPage); }); + function exposeConfigToTemplates() { + $(document).ready(function() { + templates.setGlobal('relative_path', RELATIVE_PATH); + for(var key in config) { + templates.setGlobal('config.' + key, config[key]); + } + }); + } + function createHeaderTooltips() { $('#header-menu li i[title]').each(function() { $(this).parents('a').tooltip({ diff --git a/public/templates/category.tpl b/public/templates/category.tpl index 440cf48a09..48971a5265 100644 --- a/public/templates/category.tpl +++ b/public/templates/category.tpl @@ -86,14 +86,14 @@
- + - +
diff --git a/public/templates/topic.tpl b/public/templates/topic.tpl index c6eeaeb2df..4666bc639e 100644 --- a/public/templates/topic.tpl +++ b/public/templates/topic.tpl @@ -214,14 +214,14 @@
- + - +