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

« back to all changes in this revision

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

Convince the main XHTML template to use versioned styles/scripts, and move the
core styles and scripts to the new framework (in ivle.webapp.core).

www/media is dead!

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
import genshi.template
24
24
 
25
25
from ivle.webapp.media import media_url
 
26
from ivle.webapp.core import Plugin as CorePlugin
26
27
from ivle.webapp.base.views import BaseView
27
28
from ivle.webapp.base.plugins import OverlayPlugin
28
29
from ivle.webapp.errors import HTTPError, Unauthorized
73
74
        ctx = genshi.template.Context()
74
75
        # XXX: Leave this here!! (Before req.styles is read)
75
76
        ctx['overlays'] = self.render_overlays(req)
76
 
        ctx['app_styles'] = req.styles
77
 
        ctx['scripts'] = req.scripts
 
77
 
 
78
        ctx['styles'] = [media_url(req, CorePlugin, 'ivle.css')]
 
79
        ctx['styles'] += req.styles
 
80
 
 
81
        ctx['scripts'] = [media_url(req, CorePlugin, path) for path in
 
82
                           ('util.js', 'json2.js', 'md5.js', 'tos.js')]
 
83
        ctx['scripts'] += req.scripts
 
84
 
78
85
        ctx['scripts_init'] = req.scripts_init
79
86
        ctx['app_template'] = app
80
87
        self.populate_headings(req, ctx)