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

« back to all changes in this revision

Viewing changes to ivle/webapp/console/__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:
2
2
from ivle.webapp.console.service import ConsoleServiceRESTView
3
3
from ivle.webapp.console.overlay import ConsoleOverlay
4
4
from ivle.webapp.base.xhtml import XHTMLView
 
5
from ivle.webapp import ApplicationRoot
5
6
 
6
7
 
7
8
class ConsoleView(XHTMLView):
8
9
    tab = 'console'
9
10
    help = 'Console'
10
 
 
11
 
    plugin_scripts = {'ivle.webapp.console': ['console.js']}
12
 
    plugin_styles  = {'ivle.webapp.console': ['console.css']}
13
 
    plugin_scripts_init = ['console_init']
14
 
 
15
 
    # Don't load the console overlay when we already have a console.
16
 
    overlay_blacklist = [ConsoleOverlay]
 
11
    breadcrumb_text = 'Console'
 
12
 
 
13
    # Overide the the standard constructor view
 
14
    def __init__(self, *args, **kwargs):
 
15
        super(ConsoleView, self).__init__(*args, **kwargs)
 
16
 
 
17
        self.plugin_scripts = {'ivle.webapp.console': ['console.js']}
 
18
        self.plugin_styles  = {'ivle.webapp.console': ['console.css']}
 
19
        self.plugin_scripts_init = ['console_init']
 
20
 
 
21
        # Don't load the console overlay when we already have a console.
 
22
        self.overlay_blacklist = [ConsoleOverlay]
17
23
 
18
24
    def authorize(self, req):
19
25
        return req.user is not None
23
29
        ctx['start_body_attrs'] = {}
24
30
 
25
31
class Plugin(ViewPlugin, OverlayPlugin, MediaPlugin):
26
 
    urls = [
27
 
        ('console/service', ConsoleServiceRESTView),
28
 
        ('console', ConsoleView),
29
 
    ]
 
32
    views = [(ApplicationRoot, ('console', '+index'), ConsoleView),
 
33
             (ApplicationRoot, ('console', 'service'), ConsoleServiceRESTView),
 
34
             ]
 
35
 
30
36
    tabs = [
31
37
        ('console', 'Console', 'Try out your code in a Python console',
32
38
         'console.png', 'console', 3)
33
39
    ]
 
40
 
34
41
    overlays = [
35
42
        ConsoleOverlay,
36
43
    ]
 
44
 
37
45
    media = 'media'
38
46
    help = {'Console': 'help.html'}