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

« back to all changes in this revision

Viewing changes to www/dispatch/html.py

  • Committer: mattgiuca
  • Date: 2008-01-11 03:12:16 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:175
dispatch.html: HTML headers for all pages now include a JavaScript
declarations section where variables are defined with server-config values.
Included is root_dir, needed by the client to create URLs relative to IVLE.
util: Added path_join and make_path functions.

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
    write to."""
35
35
 
36
36
    # Write the XHTML opening and head element
 
37
    # Note the inline JavaScript, which provides the client with constants
 
38
    # derived from the server configuration.
37
39
    if req.title != None:
38
40
        titlepart = ' - ' + req.title
39
41
    else:
44
46
<head>
45
47
  <title>IVLE%s</title>
46
48
  <meta http-equiv="Content-Type" content="%s; charset=utf-8" />
 
49
  <script type="text/javascript">
 
50
    root_dir = "%s";
 
51
  </script>
47
52
  <link rel="stylesheet" type="text/css" href="%s" />
48
 
""" % (titlepart, req.content_type, util.make_path('media/common/ivle.css')))
 
53
""" % (titlepart, req.content_type,
 
54
        repr(conf.root_dir)[1:-1],
 
55
        util.make_path('media/common/ivle.css')))
49
56
 
50
57
    # Write any app-specific style and script links
51
58
    for style in req.styles: