~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-23 23:02:35 UTC
  • mto: (1100.1.8 new-ui)
  • mto: This revision was merged to the branch mainline in revision 1119.
  • Revision ID: grantw@unimelb.edu.au-20090223230235-w6n1q408qnbz4is6
Shave off the corners of some worksheet boxes (notes, exercises).

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
        for key in kwargs:
49
49
            setattr(self, key, kwargs[key])
50
50
 
51
 
    def filter(self, stream, ctx):
52
 
        return stream
53
 
 
54
51
    def render(self, req):
55
52
        req.content_type = 'text/html' # TODO: Detect application/xhtml+xml
56
53
 
64
61
                        inspect.getmodule(self).__file__), self.template) 
65
62
        loader = genshi.template.TemplateLoader(".", auto_reload=True)
66
63
        tmpl = loader.load(app_template)
67
 
        app = self.filter(tmpl.generate(viewctx), viewctx)
 
64
        app = tmpl.generate(viewctx)
68
65
 
69
66
        for plugin in self.plugin_scripts:
70
67
            for path in self.plugin_scripts[plugin]:
84
81
 
85
82
        ctx['scripts'] = [media_url(req, CorePlugin, path) for path in
86
83
                           ('util.js', 'json2.js', 'md5.js')]
87
 
        ctx['scripts'].append(media_url(req, '+external/jquery', 'jquery.js'))
88
84
        ctx['scripts'] += req.scripts
89
85
 
90
86
        ctx['scripts_init'] = req.scripts_init
91
87
        ctx['app_template'] = app
92
 
        ctx['title_img'] = media_url(req, CorePlugin,
93
 
                                     "images/chrome/title.png")
94
88
        self.populate_headings(req, ctx)
95
89
        tmpl = loader.load(os.path.join(os.path.dirname(__file__), 
96
90
                                                        'ivle-headings.html'))
103
97
        ctx['favicon'] = None
104
98
        ctx['root_dir'] = ivle.conf.root_dir
105
99
        ctx['public_host'] = ivle.conf.public_host
106
 
        ctx['svn_base'] = ivle.conf.svn_addr
107
100
        ctx['write_javascript_settings'] = req.write_javascript_settings
108
101
        if req.user:
109
102
            ctx['login'] = req.user.login
124
117
            for tab in plugin.tabs:
125
118
                # tab is a tuple: name, title, desc, icon, path
126
119
                new_app = {}
127
 
                new_app['this_app'] = hasattr(self, 'tab') \
128
 
                                      and tab[0] == self.tab
 
120
                new_app['this_app'] = hasattr(self, 'appname') \
 
121
                                      and tab[0] == self.appname
129
122
 
130
123
                # Icon name
131
124
                if tab[3] is not None: