summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorroot <root@lalalizard.com>2012-12-12 13:36:29 -0500
committerroot <root@lalalizard.com>2012-12-12 13:36:29 -0500
commit6e1a9c9dfd83caca61cb0fa12f381900166c10d1 (patch)
treef9310fc022739de104b6f77429f9c322d870fd17
parent3e0af3308fe3fcb6039a1e16f7497f1c3b6b688c (diff)
fix profile.js to load settings in new format
-rw-r--r--frontend/static/js/profile.js18
-rw-r--r--frontend/views.py2
2 files changed, 7 insertions, 13 deletions
diff --git a/frontend/static/js/profile.js b/frontend/static/js/profile.js
index cf20985..addce07 100644
--- a/frontend/static/js/profile.js
+++ b/frontend/static/js/profile.js
@@ -246,20 +246,14 @@ var Settings =
{
Settings.bio = userProfile[6]
}
+ Settings.data = Settings.defaults
if (userProfile[7]) // settings
- {
- var lines = userProfile[7].split("\n")
- for (i in lines)
- {
- var pair = lines[i].split("\t")
- Settings.data[pair[0]] = pair[1]
- }
- }
- for (i in Settings.defaults)
- {
- if (! (i in Settings.data))
- Settings.data[i] = Settings.defaults[i]
+ {
+ var s = userProfile[7]
+ for(i in s){
+ Settings.data[i] = s[i]
}
+ }
Settings.load()
}
}
diff --git a/frontend/views.py b/frontend/views.py
index a391c0a..73b8d30 100644
--- a/frontend/views.py
+++ b/frontend/views.py
@@ -150,7 +150,7 @@ def profile(request, username):
topz = SJContent.objects.filter(user__id=userprofile.user.id, content_type='video').annotate(likes=Count('sjlike')).order_by('-likes')[:50]
likez = SJContent.objects.filter(user__id=userprofile.user.id, content_type='video', sjlike__isnull = False ).order_by('-datetime')[:50]
vidz = SJContent.objects.filter(user__id=userprofile.user.id, content_type='video').order_by('-datetime')[:50]
- profile = [ userprofile.id, userprofile.nickname, userprofile.score, 3, 4, 5, userprofile.bio, 7 ]
+ profile = [ userprofile.id, userprofile.nickname, userprofile.score, 3, 4, 5, userprofile.bio, json.loads(userprofile.settings_text) ]
response = render_to_response(
'profile.html',