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

« back to all changes in this revision

Viewing changes to src/dispatch/html.py

  • Committer: mattgiuca
  • Date: 2007-12-12 14:59:56 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:47
dispatch: HTML now writes proper XHTML headers including title element based
on req.title.
    Sets default req.title properly.

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
 
33
33
    req: An IVLE request object. Reads attributes such as title. Also used to
34
34
    write to."""
35
 
    # TODO: Full header
36
 
    req.write("<html>\n<body>\n")
 
35
 
 
36
    # Write the XHTML opening and head element
 
37
    req.write("""<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
 
38
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 
39
<html xmlns="http://www.w3.org/1999/xhtml">
 
40
<head>
 
41
  <title>IVLE""")
 
42
    if req.title != None:
 
43
        req.write(' - ' + req.title)
 
44
    req.write("""</title>
 
45
  <meta http-equiv="Content-Type"
 
46
    content=""" + '"' + req.content_type + """; charset=utf-8" />
 
47
</head>
 
48
 
 
49
""")
 
50
 
 
51
    # Open the body element and write a bunch of stuff there (the header)
 
52
    req.write("""<body>
 
53
<h1>IVLE - Informatics Virtual Learning Environment</h1>
 
54
""")
37
55
    print_apps_list(req)
38
56
 
39
57
def write_html_foot(req):