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

« back to all changes in this revision

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

Only load tos.js on /+tos.

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
import ivle.util
25
25
import ivle.dispatch.login
26
26
from ivle.webapp.base.xhtml import XHTMLView
27
 
from ivle.webapp.base.plugins import ViewPlugin
 
27
from ivle.webapp.base.plugins import ViewPlugin, MediaPlugin
28
28
 
29
29
class TermsOfServiceView(XHTMLView):
30
30
    """View of the Terms of Service, allowing acceptance.
55
55
        ctx['text'] = ivle.util.get_terms_of_service()
56
56
 
57
57
        if self.mode == 'accept':
 
58
            self.plugin_scripts[Plugin] = ['tos.js']
58
59
            ctx['user'] = self.user
59
60
 
60
 
class Plugin(ViewPlugin):
 
61
class Plugin(ViewPlugin, MediaPlugin):
61
62
    """Registration for the Terms of Service plugin."""
62
63
    urls = [
63
64
        ('+tos', TermsOfServiceView),
64
65
    ]
 
66
 
 
67
    media = 'media'