Skip to content

Node.js based forum software built for the modern web

tjs 0.1.19 for undefined key cleanups

psychobunnyecad9d54edf5
diff --git a/package.json b/package.json
index b2fbd45acf..8cf75017d9 100644
--- a/package.json
+++ b/package.json
@@ -63,7 +63,7 @@
"socket.io-redis": "^0.1.3",
"socketio-wildcard": "~0.1.1",
"string": "^3.0.0",
- "templates.js": "^0.1.18",
+ "templates.js": "^0.1.19",
"uglify-js": "git+https://github.com/julianlam/UglifyJS2.git",
"underscore": "~1.7.0",
"validator": "^3.30.0",
diff --git a/public/src/modules/helpers.js b/public/src/modules/helpers.js
index 059e4445ab..8842defb9c 100644
--- a/public/src/modules/helpers.js
+++ b/public/src/modules/helpers.js
@@ -16,9 +16,10 @@
helpers.displayMenuItem = function(data, index) {
var properties = data.navigation[index].properties;
- if (properties.loggedIn && !ldata.oggedIn ||
+ if (properties.loggedIn && !data.loggedIn ||
properties.adminOnly && !data.isAdmin ||
- properties.installed && properties.installed.search && !data.searchEnabled) {
+ properties.installed && properties.installed.search && !data.searchEnabled ||
+ properties.hideIfPrivate && data.privateUserInfo) {
return false;
}
diff --git a/src/middleware/middleware.js b/src/middleware/middleware.js
index 349a227215..cc59c458d1 100644
--- a/src/middleware/middleware.js
+++ b/src/middleware/middleware.js
@@ -217,7 +217,108 @@ middleware.renderHeader = function(req, res, callback) {
var custom_header = {
uid: uid,
- 'navigation': []
+ 'navigation': [
+ {
+ id: "unread-count",
+ class: "",
+ route: "/unread",
+ title: "[[global:header.unread]]",
+ iconClass: "fa-inbox",
+ textClass: "visible-xs-inline",
+ text: "[[global:header.unread]]",
+ properties: {
+ loggedIn: true
+ }
+ },
+ {
+ id: "",
+ class: "",
+ route: "/recent",
+ title: "[[global:header.recent]]",
+ iconClass: "fa-clock-o",
+ textClass: "visible-xs-inline",
+ text: "[[global:]]",
+ properties: {
+
+ }
+ },
+ {
+ id: "",
+ class: "",
+ route: "/tags",
+ title: "[[global:header.tags]]",
+ iconClass: "fa-tags",
+ textClass: "visible-xs-inline",
+ text: "[[global:header.tags]]",
+ properties: {
+
+ }
+ },
+ {
+ id: "",
+ class: "",
+ route: "/popular",
+ title: "[[global:header.popular]]",
+ iconClass: "fa-fire",
+ textClass: "visible-xs-inline",
+ text: "[[global:header.popular]]",
+ properties: {
+
+ }
+ },
+ {
+ id: "",
+ class: "",
+ route: "/users",
+ title: "[[global:header.users]]",
+ iconClass: "fa-user",
+ textClass: "visible-xs-inline",
+ text: "[[global:header.users]]",
+ properties: {
+ loggedIn: true,
+ hideIfPrivate: true
+ }
+ },
+ {
+ id: "",
+ class: "",
+ route: "/groups",
+ title: "[[global:header.groups]]",
+ iconClass: "fa-group",
+ textClass: "visible-xs-inline",
+ text: "[[global:header.groups]]",
+ properties: {
+
+ }
+ },
+ {
+ id: "",
+ class: "",
+ route: "/admin",
+ target: "_top",
+ title: "[[global:header.admin]]",
+ iconClass: "fa-cogs",
+ textClass: "visible-xs-inline",
+ text: "[[global:header.admin]]",
+ properties: {
+ adminOnly: true
+ }
+ },
+ {
+ id: "",
+ class: "",
+ route: "/search",
+ title: "[[global:header.search]]",
+ iconClass: "fa-search",
+ textClass: "visible-xs-inline",
+ text: "[[global:header.search]]",
+ properties: {
+ installed: {
+ search: true
+ }
+ }
+ }
+ ]
};
plugins.fireHook('filter:header.build', custom_header, function(err, custom_header) {