mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2026-02-04 09:14:30 +00:00
Split up some code for sanity #3
This commit is contained in:
14
server/handlers/pagetemplate.py
Normal file
14
server/handlers/pagetemplate.py
Normal file
@@ -0,0 +1,14 @@
|
||||
import tornado
|
||||
|
||||
from core.config import ALLOW_SPOTTING
|
||||
from core.constants import SOFTWARE_VERSION
|
||||
|
||||
|
||||
# Handler for all HTML pages generated from templates
|
||||
class PageTemplateHandler(tornado.web.RequestHandler):
|
||||
def initialize(self, template_name):
|
||||
self.template_name = template_name
|
||||
|
||||
def get(self):
|
||||
# Load named template, and provide variables used in templates
|
||||
self.render(self.template_name + ".html", software_version=SOFTWARE_VERSION, allow_spotting=ALLOW_SPOTTING)
|
||||
Reference in New Issue
Block a user