73
73
req.write(' <link rel="stylesheet" type="text/css" href="%s" />\n'
74
74
% cgi.escape(util.make_path(style)))
75
75
for script in req.scripts:
76
req.write(' <script type="text/javascript" src="%s" />\n'
76
req.write(' <script type="text/javascript" src="%s"></script>\n'
77
77
% cgi.escape(util.make_path(script)))
79
79
req.write("</head>\n\n")
81
81
# Open the body element and write a bunch of stuff there (the header)
82
82
req.write("""<body>
83
<div id="ivleheader"></div>
84
<div id="ivleheader_text">
85
86
<h2>Informatics Virtual Learning Environment</h2>
89
req.write(' <p class="userhello">Welcome, <span '
90
'class="username">%s</span> |\n'
90
# Get the user's nickname from the request session
91
nickname = req.get_session()['nick']
92
req.write(' <p class="userhello">%s (<span '
93
'class="username">%s</span>) |\n'
91
94
' <a href="%s">Help</a> |\n'
92
95
' <a href="%s">Logout</a>\n'
94
(cgi.escape(req.username),
97
(cgi.escape(nickname), cgi.escape(req.username),
95
98
cgi.escape(get_help_url(req)),
96
99
cgi.escape(util.make_path('logout'))))
98
101
req.write(' <p class="userhello">Not logged in.</p>')
103
# ivleheader_tabs is a separate div, so it can be positioned absolutely
104
req.write('</div>\n<div id="ivleheader_tabs">\n')
100
106
# If the "debuginfo" app is installed, display a warning to the admin to
101
107
# make sure it is removed in production.
102
108
if "debuginfo" in conf.apps.app_url: