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

« back to all changes in this revision

Viewing changes to ivle/webapp/userservice/__init__.py

  • Committer: William Grant
  • Date: 2009-12-08 03:50:24 UTC
  • mfrom: (1294.2.143 ui-the-third)
  • Revision ID: grantw@unimelb.edu.au-20091208035024-wjx8zp54gth15ph8
Merge ui-the-third. This is another UI revamp.

The header is now thin! Thin! The yellow bar is gone. The tabs are gone.
Breadcrumbs are here. Routes is replaced (with an object publishing
mechanism). Views are less repetitive. etc.

Show diffs side-by-side

added added

removed removed

Lines of Context:
151
151
from ivle.webapp.base.views import BaseView
152
152
from ivle.webapp.base.plugins import ViewPlugin
153
153
from ivle.webapp.errors import NotFound, BadRequest, Unauthorized
 
154
from ivle.webapp import ApplicationRoot
154
155
 
155
156
# The user must send this declaration message to ensure they acknowledge the
156
157
# TOS
165
166
)
166
167
 
167
168
class UserServiceView(BaseView):
168
 
    def __init__(self, req, path):
169
 
        if len(path) > 0 and path[-1] == os.sep:
170
 
            self.path = path[:-1]
171
 
        else:
172
 
            self.path = path
 
169
    subpath_allowed = True
173
170
 
174
171
    def authorize(self, req):
175
172
        # XXX: activate_me isn't called by a valid user, so is special for now.
186
183
            raise NotFound()
187
184
        func(req, fields)
188
185
 
 
186
    @property
 
187
    def path(self):
 
188
        return os.path.join(*self.subpath) if self.subpath else ''
 
189
 
 
190
 
189
191
class Plugin(ViewPlugin):
190
 
    urls = [
191
 
        ('userservice/*path', UserServiceView)
192
 
    ]
 
192
    views = [(ApplicationRoot, 'userservice', UserServiceView)]
193
193
 
194
194
@require_method('POST')
195
195
def handle_activate_me(req, fields):