2014-01-20 13:13:10 +00:00
|
|
|
# HG changeset patch
|
2014-02-05 14:54:50 +00:00
|
|
|
# Parent a615de71be483d88acca032ad5d35072c87999c0
|
2014-01-20 13:13:10 +00:00
|
|
|
|
2014-02-05 14:54:50 +00:00
|
|
|
diff --git a/controllers/my_controller.py b/controllers/my_controller.py
|
|
|
|
--- a/controllers/my_controller.py
|
|
|
|
+++ b/controllers/my_controller.py
|
|
|
|
@@ -3,9 +3,22 @@
|
2014-01-20 13:13:10 +00:00
|
|
|
from openerp import http
|
|
|
|
from openerp.addons.web.controllers import main
|
|
|
|
|
|
|
|
+teaching_assistants = [
|
|
|
|
+ {'name': "Diana Padilla"},
|
|
|
|
+ {'name': "Jody Carroll"},
|
|
|
|
+ {'name': "Lester Vaughn"},
|
|
|
|
+ {'name': "Paul Jimenez"},
|
|
|
|
+ {'name': "Tanya Harris"},
|
|
|
|
+]
|
|
|
|
+
|
2014-02-05 14:54:50 +00:00
|
|
|
class my_controller(main.Home):
|
2014-01-20 13:13:10 +00:00
|
|
|
@http.route('/', auth='none')
|
|
|
|
def index(self):
|
|
|
|
+ tas = [
|
|
|
|
+ '<li><a href="/tas/?id=%d">%s</a></li>' % (i, ta['name'])
|
|
|
|
+ for i, ta in enumerate(teaching_assistants)
|
|
|
|
+ ]
|
|
|
|
+
|
|
|
|
return """<!doctype html>
|
|
|
|
<html>
|
|
|
|
<head>
|
2014-02-05 14:54:50 +00:00
|
|
|
@@ -16,6 +29,26 @@ class my_controller(main.Home):
|
|
|
|
<h1>Introduction to a thing</h1>
|
|
|
|
<h2>Course description</h2>
|
|
|
|
<p>Course introduction</p>
|
2014-01-20 13:13:10 +00:00
|
|
|
+ <h2>Teaching Assistants</h2>
|
|
|
|
+ <ul>
|
|
|
|
+ %(tas)s
|
|
|
|
+ </ul>
|
|
|
|
</body>
|
|
|
|
</html>
|
|
|
|
-"""
|
|
|
|
+""" % {
|
|
|
|
+ 'tas': '\n'.join(tas)
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @http.route('/tas', auth='none')
|
|
|
|
+ def ta(self, id):
|
|
|
|
+ return """<!doctype html>
|
|
|
|
+<html>
|
|
|
|
+ <head>
|
|
|
|
+ <title>AcademyAcademy TA %(name)s</title>
|
|
|
|
+ <link href="//netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet">
|
|
|
|
+ </head>
|
|
|
|
+ <body class="container">
|
|
|
|
+ <h1>%(name)s</h1>
|
|
|
|
+ </body>
|
|
|
|
+</html>
|
|
|
|
+""" % teaching_assistants[int(id)]
|