~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-10 21:47:53 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:169
Added global common css file (media/common/ivle.css).
dispatch.request: Added 2 new attributes: scripts and styles, which let apps
    specify arbitrary numbers of custom CSS and JavaScript files.
dispatch.html: Added media/common/ivle.css to the HTML header.
               Prints out all request custom CSS and JS files in the header.
apps.dummy: Test use of scripts and styles.

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
<html xmlns="http://www.w3.org/1999/xhtml">
44
44
<head>
45
45
  <title>IVLE%s</title>
46
 
  <meta http-equiv="Content-Type"
47
 
    content="%s; charset=utf-8" />
48
 
</head>
49
 
 
50
 
""" % (titlepart, req.content_type))
 
46
  <meta http-equiv="Content-Type" content="%s; charset=utf-8" />
 
47
  <link rel="stylesheet" type="text/css" href="%s" />
 
48
""" % (titlepart, req.content_type, util.make_path('media/common/ivle.css')))
 
49
 
 
50
    # Write any app-specific style and script links
 
51
    for style in req.styles:
 
52
        req.write('  <link rel="stylesheet" type="text/css" href="%s" />\n'
 
53
            % util.make_path(style))
 
54
    for script in req.scripts:
 
55
        req.write('  <script type="text/javascript" src="%s" />\n'
 
56
            % util.make_path(script))
 
57
 
 
58
    req.write("</head>\n\n")
51
59
 
52
60
    # Open the body element and write a bunch of stuff there (the header)
53
61
    req.write("""<body>