|
@@ -5,21 +5,31 @@ from .template.loader import TemplateLoader
|
5
|
5
|
|
6
|
6
|
# This module contains the web UI controllers that will be called from the web ui class
|
7
|
7
|
|
8
|
|
-def get_response(tpl, mimetype = 'text/html', status_code = 200):
|
|
8
|
+
|
|
9
|
+def get_response(tpl, mimetype='text/html', status_code=200):
|
9
|
10
|
loader = TemplateLoader()
|
10
|
|
- response = Response( loader.render_to_response(tpl),
|
11
|
|
- mimetype = 'text/html')
|
|
11
|
+ response = Response(loader.render_to_response(tpl), mimetype=mimetype)
|
12
|
12
|
response.status_code = status_code
|
13
|
13
|
return response
|
14
|
14
|
|
|
15
|
+
|
15
|
16
|
def admin(request):
|
16
|
17
|
return get_response('admin/admin.html')
|
17
|
18
|
|
|
19
|
+
|
18
|
20
|
def index(request):
|
19
|
21
|
return get_response('index/index.html')
|
20
|
22
|
|
|
23
|
+
|
21
|
24
|
def not_found(request):
|
22
|
|
- return get_response('errors/404.html', status_code = 404)
|
|
25
|
+ return get_response('errors/404.html', status_code=404)
|
|
26
|
+
|
23
|
27
|
|
24
|
28
|
def test(request):
|
25
|
29
|
return get_response('test.html')
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+def list_classes(request):
|
|
33
|
+ # TODO Add the method to get the classes list
|
|
34
|
+
|
|
35
|
+ return get_response('list_classes.html')
|