From c38ca146c77481df2d70d234a6c12b82a94162a1 Mon Sep 17 00:00:00 2001 From: heart Date: Fri, 31 Oct 2014 02:10:40 -0400 Subject: [PATCH] Made hiding widgets for guests/registered sensible. --- src/controllers/admin.js | 2 +- src/widgets.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/controllers/admin.js b/src/controllers/admin.js index 4c0fe059ab..4d508ca70f 100644 --- a/src/controllers/admin.js +++ b/src/controllers/admin.js @@ -264,7 +264,7 @@ adminController.extend.widgets = function(req, res, next) { for (var w in widgetData.widgets) { if (widgetData.widgets.hasOwnProperty(w)) { // if this gets anymore complicated, it needs to be a template - widgetData.widgets[w].content += "

"; + widgetData.widgets[w].content += "

"; } } diff --git a/src/widgets.js b/src/widgets.js index 1755ab9cb5..0390b2d1f0 100644 --- a/src/widgets.js +++ b/src/widgets.js @@ -30,7 +30,7 @@ var async = require('async'), async.map(widgetsByLocation[location], function(widget, next) { - if (!widget || !widget.data || (!!widget.data['registered-only'] && uid === 0)) { + if (!widget || !widget.data || (!!widget.data['hide-registered'] && uid !== 0) || (!!widget.data['hide-guests'] && uid === 0)) { return next(); }