From c450fd2a0b495d68a8afdde8031a4f4ce6596daa Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Thu, 2 Feb 2012 05:16:32 +0000 Subject: [PATCH] enabled/disabled places/events --- pandora/event/models.py | 4 +--- pandora/place/models.py | 1 - static/js/pandora.js | 10 ++++++++++ static/js/pandora/navigationView.js | 6 ++++-- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/pandora/event/models.py b/pandora/event/models.py index 406ce4590..dc43796d0 100644 --- a/pandora/event/models.py +++ b/pandora/event/models.py @@ -131,8 +131,7 @@ class Event(models.Model): def make_undefined(self): self.defined = False - self.start = '' - self.end = '' + self.start = self.end = '' self.durationTime = self.endTime = self.startTime = None def get_id(self): @@ -141,7 +140,6 @@ class Event(models.Model): def json(self, user=None): j = { 'id': self.get_id(), - 'defined': self.defined, 'editable': self.editable(user) } if self.user: diff --git a/pandora/place/models.py b/pandora/place/models.py index 75610229b..bb9da4232 100644 --- a/pandora/place/models.py +++ b/pandora/place/models.py @@ -83,7 +83,6 @@ class Place(models.Model): def json(self, keys=None, user=None): j = { 'id': self.get_id(), - 'defined': self.defined, 'editable': self.editable(user) } if self.user: diff --git a/static/js/pandora.js b/static/js/pandora.js index 9477fee8f..e3582c62f 100644 --- a/static/js/pandora.js +++ b/static/js/pandora.js @@ -227,6 +227,11 @@ appPanel }); Ox.extend(pandora.site, { + calendar: data.site.layers.some(function(layer) { + return layer.type == 'event' + }) ? 'manual' : data.site.layers.some(function(layer) { + return layer.hasEvents; + }) ? 'auto' : 'none', clipKeys: Ox.map(data.site.clipKeys, function(key) { return Ox.extend(key, { operator: pandora.getSortOperator(key.id) @@ -236,6 +241,11 @@ appPanel return key.find ? key : null; }), itemsSection: pandora.site.itemName.plural.toLowerCase(), + map: data.site.layers.some(function(layer) { + return layer.type == 'place' + }) ? 'manual' : data.site.layers.some(function(layer) { + return layer.hasPlaces; + }) ? 'auto' : 'none', sectionFolders: { items: [ {id: 'personal', title: 'Personal Lists'}, diff --git a/static/js/pandora/navigationView.js b/static/js/pandora/navigationView.js index a827165fd..2d6f3348f 100644 --- a/static/js/pandora/navigationView.js +++ b/static/js/pandora/navigationView.js @@ -154,7 +154,9 @@ pandora.ui.navigationView = function(type, videoRatio) { operator: '&' }, keys: ['id', 'name', 'start', 'end'], - query: {}, + query: { + conditions: [{key: 'start', value: '', operator: '!='}] + }, range: [0, 1000000] }, function(result) { that.replaceElement(0, @@ -239,4 +241,4 @@ pandora.ui.navigationView = function(type, videoRatio) { return that; -}; \ No newline at end of file +};