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

« back to all changes in this revision

Viewing changes to ivle/webapp/admin/user.py

ivle.webapp.console.service: Port www/apps/consoleservice to new framework.
    consoleservice now lives under /console/service, and actions are taken
    in the "ivle.op" query argument, not as the last segment of the path.
    Otherwise the interface is identical.
www/apps/console/console.js: Update to new consoleservice interface.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 
18
18
# Author: Matt Giuca, Will Grant
19
19
 
20
 
from ivle.webapp.base.rest import JSONRESTView
21
 
from ivle.webapp.base.xhtml import XHTMLView
 
20
from ivle.webapp.base.views import JSONRESTView
22
21
from ivle.webapp.base.plugins import BasePlugin
23
22
import ivle.database
24
23
import ivle.util
64
63
            except KeyError:
65
64
                continue
66
65
 
67
 
class UserSettingsView(XHTMLView):
68
 
    template = 'user-settings.html'
69
 
    appname = 'settings'
70
 
 
71
 
    def __init__(self, req, login):
72
 
        self.context = ivle.database.User.get_by_login(req.store, login)
73
 
 
74
 
    def populate(self, req, ctx):
75
 
        if not self.context:
76
 
            raise NotFound()
77
 
 
78
 
        req.scripts = [
79
 
            "/media/settings/settings.js",
80
 
            "/media/common/json2.js",
81
 
            "/media/common/util.js",
82
 
        ]
83
 
        req.scripts_init = [
84
 
            "revert_settings"
85
 
        ]
86
 
        ctx['login'] = self.context.login
87
 
 
88
66
class Plugin(BasePlugin):
89
67
    """
90
68
    The Plugin class for the user plugin.
94
72
    # (regex str, handler class, kwargs dict)
95
73
    # The kwargs dict is passed to the __init__ of the view object
96
74
    urls = [
97
 
        ('users/:login/+settings', UserSettingsView),
98
 
        ('api/users/:login', UserRESTView),
 
75
        ('api/users/:login', UserRESTView)
99
76
    ]