]> git.ipfire.org Git - ipfire.org.git/blob - www/webapp/handlers_stasy.py
Import of new website.
[ipfire.org.git] / www / webapp / handlers_stasy.py
1 #!/usr/bin/python
2
3 import tornado.web
4
5 from handlers_base import *
6
7 class StasyBaseHandler(BaseHandler):
8 @property
9 def stasy(self):
10 return backend.Stasy()
11
12
13 class StasyIndexHandler(StasyBaseHandler):
14 def get(self):
15 profiles = self.stasy.get_profiles()
16
17 self.render("stasy-index.html", profiles=profiles)
18
19
20 class StasyProfileHandler(StasyBaseHandler):
21 def get(self, profile_id):
22 profile = self.stasy.get_profile(profile_id)
23 if not profile:
24 raise tornado.web.HTTPError(404, "Profile not found: %s" % profile_id)
25
26 self.render("stasy-profile.html", profile=profile)