~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to www/apps/tutorial/__init__.py

  • Committer: mattgiuca
  • Date: 2008-01-25 03:00:17 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:303
dispatch/html: Do a CGI escape on all text being rendered into the HTML.
tutorial: Set HTML title to the relevant subject/worksheet.

Show diffs side-by-side

added added

removed removed

Lines of Context:
69
69
 
70
70
    # Set request attributes
71
71
    req.content_type = "text/html"
 
72
    req.scripts = [
 
73
        "media/common/util.js",
 
74
        "media/common/json2.js",
 
75
        "media/tutorial/tutorial.js",
 
76
    ]
72
77
    req.styles = [
73
78
        "media/tutorial/tutorial.css",
74
79
    ]
147
152
            worksheets.append(worksheet)
148
153
 
149
154
    # Now all the errors are out the way, we can begin writing
 
155
    req.title = "Tutorial - %s" % subject
150
156
    req.write_html_head_foot = True
151
157
    req.write("<h1>IVLE Tutorials - %s</h1>\n" % cgi.escape(subject))
152
158
    req.write("<h2>Worksheets</h2>\n<ul>\n")
182
188
            elements.append(elem)
183
189
 
184
190
    # Now all the errors are out the way, we can begin writing
 
191
    req.title = "Tutorial - %s" % worksheetname
185
192
    req.write_html_head_foot = True
186
193
    req.write("<h1>IVLE Tutorials - %s</h1>\n<h2>%s</h2>\n"
187
194
        % (cgi.escape(subject), cgi.escape(worksheetname)))