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

« back to all changes in this revision

Viewing changes to ivle/webapp/base/xhtml.py

  • Committer: William Grant
  • Date: 2009-02-25 23:04:11 UTC
  • Revision ID: grantw@unimelb.edu.au-20090225230411-lbdyl32ir0m3d59b
Make all of the services executable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
from ivle.webapp.base.views import BaseView
29
29
from ivle.webapp.base.plugins import ViewPlugin, OverlayPlugin
30
30
from ivle.webapp.errors import HTTPError, Unauthorized
 
31
import ivle.conf
31
32
import ivle.util
32
33
 
33
34
class XHTMLView(BaseView):
47
48
        for key in kwargs:
48
49
            setattr(self, key, kwargs[key])
49
50
 
50
 
    def filter(self, stream, ctx):
51
 
        return stream
52
 
 
53
51
    def render(self, req):
54
52
        req.content_type = 'text/html' # TODO: Detect application/xhtml+xml
55
53
 
63
61
                        inspect.getmodule(self).__file__), self.template) 
64
62
        loader = genshi.template.TemplateLoader(".", auto_reload=True)
65
63
        tmpl = loader.load(app_template)
66
 
        app = self.filter(tmpl.generate(viewctx), viewctx)
 
64
        app = tmpl.generate(viewctx)
67
65
 
68
66
        for plugin in self.plugin_scripts:
69
67
            for path in self.plugin_scripts[plugin]:
83
81
 
84
82
        ctx['scripts'] = [media_url(req, CorePlugin, path) for path in
85
83
                           ('util.js', 'json2.js', 'md5.js')]
86
 
        ctx['scripts'].append(media_url(req, '+external/jquery', 'jquery.js'))
87
84
        ctx['scripts'] += req.scripts
88
85
 
89
86
        ctx['scripts_init'] = req.scripts_init
100
97
 
101
98
    def populate_headings(self, req, ctx):
102
99
        ctx['favicon'] = None
103
 
        ctx['root_dir'] = req.config['urls']['root']
104
 
        ctx['public_host'] = req.config['urls']['public_host']
105
 
        ctx['svn_base'] = req.config['urls']['svn_addr']
 
100
        ctx['root_dir'] = ivle.conf.root_dir
 
101
        ctx['public_host'] = ivle.conf.public_host
106
102
        ctx['write_javascript_settings'] = req.write_javascript_settings
107
103
        if req.user:
108
104
            ctx['login'] = req.user.login