]> git.ipfire.org Git - ipfire.org.git/blob - src/web/location.py
location: Redesign index page
[ipfire.org.git] / src / web / location.py
1
2 #!/usr/bin/python
3
4 import logging
5 import tornado.web
6
7 from .. import util
8
9 from . import auth
10 from . import base
11
12 class IndexHandler(auth.CacheMixin, base.BaseHandler):
13 def get(self):
14 self.render("location/index.html", address=self.current_address)
15
16
17 class LookupHandler(base.BaseHandler):
18 async def get(self, address):
19 # Lookup address
20 address = util.Address(self.backend, address)
21
22 self.render("location/lookup.html", address=address)
23
24
25 class BlacklistsHandler(base.BaseHandler):
26 async def get(self, address):
27 # Lookup address
28 address = util.Address(self.backend, address)
29
30 # Lookup blacklists
31 blacklists = await address.get_blacklists()
32
33 self.render("location/blacklists.html",
34 address=address, blacklists=blacklists)