private/personal

This commit is contained in:
j 2011-06-04 18:42:07 +02:00
parent 3afd8a0e0b
commit 60ac4805c5
2 changed files with 6 additions and 5 deletions

View file

@ -22,8 +22,8 @@ class List(models.Model):
modified = models.DateTimeField(auto_now=True) modified = models.DateTimeField(auto_now=True)
user = models.ForeignKey(User, related_name='lists') user = models.ForeignKey(User, related_name='lists')
name = models.CharField(max_length=255) name = models.CharField(max_length=255)
status = models.CharField(max_length=20, default='personal') status = models.CharField(max_length=20, default='private')
_status = ['personal', 'public', 'featured'] _status = ['private', 'public', 'featured']
query = DictField(default={"static": True}) query = DictField(default={"static": True})
type= models.CharField(max_length=255, default='static') type= models.CharField(max_length=255, default='static')
description = models.TextField(default='') description = models.TextField(default='')

View file

@ -124,13 +124,14 @@ pandora.reloadList = function() {
}); });
app.$ui.list.bindEvent({ app.$ui.list.bindEvent({
init: function(event, data) { init: function(event, data) {
app.$ui.folderList[listData.status] var folder = listData.status == 'private' ? 'personal' : listData.status;
.value(listData.id, 'items', data.items); app.$ui.folderList[folder].value(listData.id, 'items', data.items);
} }
}) })
.bindEventOnce({ .bindEventOnce({
load: function(event, data) { load: function(event, data) {
app.$ui.list.gainFocus().options({selected: [data.items]}); app.$ui.list.gainFocus();
if (data) app.$ui.list.options({selected: [data.items]});
} }
}) })
.reloadList(); .reloadList();