From 2f63fd7af50701357f72e0507e5709ae6adbd505 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 9 Dec 2012 14:16:20 -0500 Subject: Directory page --- frontend/templates/directory.html | 284 ++++++++++++++++++++++++++++++++++++++ frontend/urls.py | 1 + frontend/views.py | 18 +++ 3 files changed, 303 insertions(+) create mode 100644 frontend/templates/directory.html (limited to 'frontend') diff --git a/frontend/templates/directory.html b/frontend/templates/directory.html new file mode 100644 index 0000000..4aae068 --- /dev/null +++ b/frontend/templates/directory.html @@ -0,0 +1,284 @@ +{% load static %} +{% get_static_prefix as STATIC_PREFIX %} + + + +SCANNERJAMMER DIRECTORY + + + + +
+
+ +
+
+ +
+
+
+
+
+
+
+ + + + diff --git a/frontend/urls.py b/frontend/urls.py index 7a438c9..0506968 100644 --- a/frontend/urls.py +++ b/frontend/urls.py @@ -4,4 +4,5 @@ from django.conf.urls import patterns, include, url urlpatterns = patterns('frontend.views', # API url(r'^backgrounds/$', 'backgrounds'), + url(r'^directory/$', 'directory'), ) diff --git a/frontend/views.py b/frontend/views.py index 9eb8de6..e156d1b 100644 --- a/frontend/views.py +++ b/frontend/views.py @@ -96,3 +96,21 @@ def topvideos(request): ) response['Pragma'] = 'no-cache' return response + +def directory(request): + """ Directory view + """ + r = [] + for u in SJUserProfile.objects.filter(score__gt=0).order_by('-score'): + r.append({ 'id': u.id, 'name': u.nickname, 'score': u.score }) + + response = render_to_response( + 'directory.html', + { + 'SERVER_HOST': settings.SERVER_HOST, + 'SERVER_PORT': settings.SERVER_PORT, + 'directory': json.dumps(r), + } + ) + response['Pragma'] = 'no-cache' + return response -- cgit v1.2.3-70-g09d2