No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

controllers.py 825B

1234567891011121314151617181920212223242526272829303132333435
  1. # -*- coding: utf-8 -*-
  2. from werkzeug.wrappers import Response
  3. from .template.loader import TemplateLoader
  4. # This module contains the web UI controllers that will be called from the web ui class
  5. def get_response(tpl, mimetype='text/html', status_code=200):
  6. loader = TemplateLoader()
  7. response = Response(loader.render_to_response(tpl), mimetype=mimetype)
  8. response.status_code = status_code
  9. return response
  10. def admin(request):
  11. return get_response('admin/admin.html')
  12. def index(request):
  13. return get_response('index/index.html')
  14. def not_found(request):
  15. return get_response('errors/404.html', status_code=404)
  16. def test(request):
  17. return get_response('test.html')
  18. def list_classes(request):
  19. # TODO Add the method to get the classes list
  20. return get_response('list_classes.html')