enabled/disabled places/events

This commit is contained in:
j 2012-02-02 05:16:32 +00:00
parent 99b3c7ed38
commit c450fd2a0b
4 changed files with 15 additions and 6 deletions

View file

@ -131,8 +131,7 @@ class Event(models.Model):
def make_undefined(self): def make_undefined(self):
self.defined = False self.defined = False
self.start = '' self.start = self.end = ''
self.end = ''
self.durationTime = self.endTime = self.startTime = None self.durationTime = self.endTime = self.startTime = None
def get_id(self): def get_id(self):
@ -141,7 +140,6 @@ class Event(models.Model):
def json(self, user=None): def json(self, user=None):
j = { j = {
'id': self.get_id(), 'id': self.get_id(),
'defined': self.defined,
'editable': self.editable(user) 'editable': self.editable(user)
} }
if self.user: if self.user:

View file

@ -83,7 +83,6 @@ class Place(models.Model):
def json(self, keys=None, user=None): def json(self, keys=None, user=None):
j = { j = {
'id': self.get_id(), 'id': self.get_id(),
'defined': self.defined,
'editable': self.editable(user) 'editable': self.editable(user)
} }
if self.user: if self.user:

View file

@ -227,6 +227,11 @@ appPanel
}); });
Ox.extend(pandora.site, { 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) { clipKeys: Ox.map(data.site.clipKeys, function(key) {
return Ox.extend(key, { return Ox.extend(key, {
operator: pandora.getSortOperator(key.id) operator: pandora.getSortOperator(key.id)
@ -236,6 +241,11 @@ appPanel
return key.find ? key : null; return key.find ? key : null;
}), }),
itemsSection: pandora.site.itemName.plural.toLowerCase(), 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: { sectionFolders: {
items: [ items: [
{id: 'personal', title: 'Personal Lists'}, {id: 'personal', title: 'Personal Lists'},

View file

@ -154,7 +154,9 @@ pandora.ui.navigationView = function(type, videoRatio) {
operator: '&' operator: '&'
}, },
keys: ['id', 'name', 'start', 'end'], keys: ['id', 'name', 'start', 'end'],
query: {}, query: {
conditions: [{key: 'start', value: '', operator: '!='}]
},
range: [0, 1000000] range: [0, 1000000]
}, function(result) { }, function(result) {
that.replaceElement(0, that.replaceElement(0,