nav - added enabled/disabled

v1.18.x
psychobunny 10 years ago
parent 6c77adfd3c
commit 307204fc38

@ -3,6 +3,7 @@
"id": "unread-count",
"route": "/unread",
"title": "[[global:header.unread]]",
"enabled": true,
"iconClass": "fa-inbox",
"textClass": "visible-xs-inline",
"text": "[[global:header.unread]]",
@ -13,6 +14,7 @@
{
"route": "/recent",
"title": "[[global:header.recent]]",
"enabled": true,
"iconClass": "fa-clock-o",
"textClass": "visible-xs-inline",
"text": "[[global:]]"
@ -20,6 +22,7 @@
{
"route": "/tags",
"title": "[[global:header.tags]]",
"enabled": true,
"iconClass": "fa-tags",
"textClass": "visible-xs-inline",
"text": "[[global:header.tags]]"
@ -27,6 +30,7 @@
{
"route": "/popular",
"title": "[[global:header.popular]]",
"enabled": true,
"iconClass": "fa-fire",
"textClass": "visible-xs-inline",
"text": "[[global:header.popular]]"
@ -34,6 +38,7 @@
{
"route": "/users",
"title": "[[global:header.users]]",
"enabled": true,
"iconClass": "fa-user",
"textClass": "visible-xs-inline",
"text": "[[global:header.users]]",
@ -45,6 +50,7 @@
{
"route": "/groups",
"title": "[[global:header.groups]]",
"enabled": true,
"iconClass": "fa-group",
"textClass": "visible-xs-inline",
"text": "[[global:header.groups]]"
@ -53,6 +59,7 @@
"route": "/admin",
"target": "_top",
"title": "[[global:header.admin]]",
"enabled": true,
"iconClass": "fa-cogs",
"textClass": "visible-xs-inline",
"text": "[[global:header.admin]]",
@ -63,6 +70,7 @@
{
"route": "/search",
"title": "[[global:header.search]]",
"enabled": true,
"iconClass": "fa-search",
"textClass": "visible-xs-inline",
"text": "[[global:header.search]]",

@ -8,9 +8,14 @@ var navigation = {},
navigation.get = function(callback) {
db.getSortedSetRange('navigation:enabled', 0, -1, function(err, data) {
data = data.map(function(item) {
return JSON.parse(item);
});
data = data
.filter(function(item) {
return item.enabled;
})
.map(function(item) {
return JSON.parse(item);
});
callback(err, data);
})

@ -21,7 +21,7 @@ var db = require('./database'),
schemaDate, thisSchemaDate,
// IMPORTANT: REMEMBER TO UPDATE VALUE OF latestSchema
latestSchema = Date.UTC(2015, 1, 25);
latestSchema = Date.UTC(2015, 1, 25, 1);
Upgrade.check = function(callback) {
db.get('schemaDate', function(err, value) {
@ -943,7 +943,7 @@ Upgrade.upgrade = function(callback) {
}
},
function(next) {
thisSchemaDate = Date.UTC(2015, 1, 25);
thisSchemaDate = Date.UTC(2015, 1, 25, 1);
if (schemaDate < thisSchemaDate) {
updatesMade = true;
winston.info('[2015/02/25] Upgrading menu items to dynamic navigation system');

Loading…
Cancel
Save