Commit 7ff1c2fb by Dányi Bence

store: ajax toplist method added

parent a66fb652
...@@ -50,6 +50,8 @@ urlpatterns = patterns('', ...@@ -50,6 +50,8 @@ urlpatterns = patterns('',
url(r'^store/$', 'store.views.index', name='store_index'), url(r'^store/$', 'store.views.index', name='store_index'),
url(r'^store/gui/$', 'store.views.gui', name='store_gui'), url(r'^store/gui/$', 'store.views.gui', name='store_gui'),
url(r'^store/top/$', 'store.views.toplist', name='store_top'), url(r'^store/top/$', 'store.views.toplist', name='store_top'),
url(r'^ajax/store/top/$', 'store.views.ajax_toplist',
name='axat_store_top'),
url(r'^ajax/templateWizard$', 'one.views.ajax_template_wizard', url(r'^ajax/templateWizard$', 'one.views.ajax_template_wizard',
name='ajax_template_wizard'), name='ajax_template_wizard'),
url(r'^ajax/share/(?P<id>\d+)/$', 'one.views.ajax_share_wizard', url(r'^ajax/share/(?P<id>\d+)/$', 'one.views.ajax_share_wizard',
......
...@@ -169,6 +169,13 @@ def toplist(request): ...@@ -169,6 +169,13 @@ def toplist(request):
return render_to_response('store/list.html', RequestContext(request, {'file_list': file_list, 'path' : path, 'backpath' : backpath, 'username' : user})) return render_to_response('store/list.html', RequestContext(request, {'file_list': file_list, 'path' : path, 'backpath' : backpath, 'username' : user}))
@login_required @login_required
def ajax_toplist(request):
user = request.user.username
path = backpath = '/'
file_list = StoreApi.toplist(user)
return HttpResponse(json.dumps(file_list))
@login_required
def gui(request): def gui(request):
user = request.user.username user = request.user.username
if request.method == 'GET': if request.method == 'GET':
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment