1 # -*- encoding: utf-8 -*-
3 __author__= "Łukasz Rekucki"
4 __date__ = "$2009-09-25 15:55:33$"
5 __doc__ = "Module documentation."
7 from django.views.generic.simple import direct_to_template
8 from piston.handler import BaseHandler
9 from piston.utils import rc
15 class ToolbarHandler(BaseHandler):
16 allowed_methods = ('GET',)
18 def read(self, request):
19 groups = toolbar.models.ButtonGroup.objects.all()
20 return [g.to_dict(with_buttons=True) for g in groups]
22 class ScriptletsHandler(BaseHandler):
23 allowed_methods = ('GET',)
25 def read(self, request):
26 scriptlets = toolbar.models.Scriptlet.objects.all()
28 return direct_to_template(request, 'toolbar_api/scriptlets.js',
29 extra_context = {'scriptlets': scriptlets },
30 mimetype='text/javascript' )