~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:
74
74
        # Global template
75
75
        ctx = genshi.template.Context()
76
76
        # XXX: Leave this here!! (Before req.styles is read)
77
 
        ctx['overlays'] = self.render_overlays(req)
 
77
        ctx['overlays'] = self.render_overlays(req) if req.user else []
78
78
 
79
79
        ctx['styles'] = [media_url(req, CorePlugin, 'ivle.css')]
80
80
        ctx['styles'] += req.styles
85
85
 
86
86
        ctx['scripts_init'] = req.scripts_init
87
87
        ctx['app_template'] = app
 
88
        ctx['title_img'] = media_url(req, CorePlugin,
 
89
                                     "images/chrome/title.png")
88
90
        self.populate_headings(req, ctx)
89
91
        tmpl = loader.load(os.path.join(os.path.dirname(__file__), 
90
92
                                                        'ivle-headings.html'))
117
119
            for tab in plugin.tabs:
118
120
                # tab is a tuple: name, title, desc, icon, path
119
121
                new_app = {}
120
 
                new_app['this_app'] = hasattr(self, 'appname') \
121
 
                                      and tab[0] == self.appname
 
122
                new_app['this_app'] = hasattr(self, 'tab') \
 
123
                                      and tab[0] == self.tab
122
124
 
123
125
                # Icon name
124
126
                if tab[3] is not None:
191
193
 
192
194
        if req.user is None:
193
195
            # Not logged in. Redirect to login page.
194
 
            req.throw_redirect('/+login?' + 
195
 
                               urllib.urlencode([('url', req.uri)]))
 
196
            if req.uri == '/':
 
197
                query_string = ''
 
198
            else:
 
199
                query_string = '?url=' + urllib.quote(req.uri, safe="/~")
 
200
            req.throw_redirect('/+login' + query_string)
196
201
 
197
202
        req.status = 403