return some ui settings for logged in users

This commit is contained in:
j 2010-09-05 23:07:41 +02:00
parent 2988346864
commit 3cdd52912e

View file

@ -37,8 +37,30 @@ def getUserJSON(user):
elif user.has_perm('0x.vip'): #FIXME: permissions elif user.has_perm('0x.vip'): #FIXME: permissions
json['group'] = 'vip' json['group'] = 'vip'
json['preferences'] = getPreferences(user) json['preferences'] = getPreferences(user)
json['ui'] = getUI(user)
return json return json
def getUI(user):
return {
"columns": ["id", "title", "director", "country", "year", "language", "genre"],
"findQuery": {"conditions": [{"key": "", "value": "", "operator": ""}], "operator": ""},
"groupsQuery": {"conditions": [], "operator": "|"},
"groupsSize": 128,
"itemView": "info",
"listQuery": {"conditions": [], "operator": ""},
"listsSize": 192,
"listView": "list",
"sections": ["history", "lists", "public", "featured"],
"showGroups": True,
"showInfo": True,
"showLists": True,
"showMovies": True,
"sort": [
{"key": "director", "operator": ""}
],
"theme": "classic"
}
def getPreferences(user): def getPreferences(user):
prefs = {} prefs = {}
for p in Preference.objects.filter(user=user): for p in Preference.objects.filter(user=user):