forked from 0x2620/pandora
return some ui settings for logged in users
This commit is contained in:
parent
2988346864
commit
3cdd52912e
1 changed files with 22 additions and 0 deletions
|
@ -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):
|
||||||
|
|
Loading…
Reference in a new issue