1
0
Fork 0
mirror of https://github.com/yweber/lodel2.git synced 2026-11-17 16:41:38 +01:00
lodel2_mirror/plugins/webui/interface/controllers.py

26 lines
754 B
Python

# -*- coding: utf-8 -*-
import os.path
from werkzeug.wrappers import Response
from .template.loader import TemplateLoader
# This module contains the web UI controllers that will be called from the web ui class
def get_response(tpl, mimetype = 'text/html', status_code = 200):
loader = TemplateLoader()
response = Response( loader.render_to_response(tpl),
mimetype = 'text/html')
response.status_code = status_code
return response
def admin(request):
return get_response('admin/admin.html')
def index(request):
return get_response('index/index.html')
def not_found(request):
return get_response('errors/404.html', status_code = 404)
def test(request):
return get_response('test.html')