~ubuntu-branches/ubuntu/raring/maas/raring-updates

« back to all changes in this revision

Viewing changes to src/maasserver/context_processors.py

  • Committer: Package Import Robot
  • Author(s): Andres Rodriguez
  • Date: 2012-07-03 17:42:37 UTC
  • mfrom: (1.1.13)
  • Revision ID: package-import@ubuntu.com-20120703174237-p8l0keuuznfg721k
Tags: 0.1+bzr709+dfsg-0ubuntu1
* New Upstream release
* debian/control:
  - Depends on python-celery, python-tempita, libjs-yui3-{full,min},
    libjs-raphael
* debian/maas.install:
  - Install apiclient, celeryconfig.py, maas-import-pxe-files, preseeds_v2.
  - Update to install various files from chroot, rather tha manually copy
    them from the source.
* debian/maas.links: symlink celeryconfig.py
* debian/maas.maas-celery.upstart: Add job.
* debian/rules:
  - Install celery upstart job.
  - Do not install jslibs as packages are now used.
  - Drop copying of maas_local_settings_sample.py as source now ships
    a maas_local_settings.py
* debian/patches:
  - 04-maas-http-fix.patch: Drop. Merged upstream.
  - 01-fix-database-settings.patch: Refreshed.
  - 99_enums_js.patch: Added until creation of enum.js / build process
    is fixed.
* debian/maas.postinst: Update bzr version to correctly handle upgrades.

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
 
12
12
__metaclass__ = type
13
13
__all__ = [
 
14
    "global_options",
 
15
    "static_resources",
14
16
    "yui",
15
17
    ]
16
18
 
17
19
from django.conf import settings
18
20
from maasserver.components import get_persistent_errors
19
 
from maasserver.forms import NodeForm
 
21
from maasserver.forms import get_node_edit_form
20
22
from maasserver.models import Config
 
23
from maasserver.power_parameters import POWER_TYPE_PARAMETERS
 
24
from provisioningserver.enum import POWER_TYPE
21
25
 
22
26
 
23
27
def yui(context):
24
28
    return {
25
29
        'YUI_DEBUG': settings.YUI_DEBUG,
26
 
        'YUI_VERSION': settings.YUI_VERSION,
27
 
        'YUI_COMBO_URL': settings.YUI_COMBO_URL,
28
 
        'FORCE_SCRIPT_NAME': settings.FORCE_SCRIPT_NAME,
 
30
    }
 
31
 
 
32
 
 
33
def static_resources(context):
 
34
    return {
 
35
        'CSS_LIST': [
 
36
            'css/base.css',
 
37
            'css/typography.css',
 
38
            'css/forms.css',
 
39
            'css/layout.css',
 
40
            'css/modifiers.css',
 
41
            'css/components/flash_messages.css',
 
42
            'css/components/pagination.css',
 
43
            'css/components/table_list.css',
 
44
            'css/components/title_form.css',
 
45
            'css/components/blocks.css',
 
46
            'css/components/yui_panel.css',
 
47
            'css/components/yui_overlay.css',
 
48
            'css/components/yui_node_add.css',
 
49
            'css/components/data_list.css',
 
50
            'css/components/search_box.css',
 
51
            'css/ubuntu-webfonts.css',
 
52
        ],
 
53
        'JS_LIST': [
 
54
            'js/morph.js',
 
55
            'js/user_panel.js',
 
56
            'js/node_add.js',
 
57
            'js/node.js',
 
58
            'js/prefs.js',
 
59
            'js/utils.js',
 
60
            'js/node_views.js',
 
61
            'js/longpoll.js',
 
62
            'js/enums.js',
 
63
            'js/power_parameters.js',
 
64
            'js/nodes_chart.js',
 
65
        ],
29
66
    }
30
67
 
31
68
 
32
69
def global_options(context):
33
70
    return {
34
71
        'persistent_errors': get_persistent_errors(),
35
 
        'node_form': NodeForm(),
 
72
        'node_form': get_node_edit_form(context.user)(),
 
73
        'POWER_TYPE_PARAMETERS_FIELDS':
 
74
            [(power_type, field.widget.render('power_parameters', []))
 
75
                for power_type, field in POWER_TYPE_PARAMETERS.items()
 
76
                if power_type is not POWER_TYPE.DEFAULT],
36
77
        'global_options': {
37
78
            'site_name': Config.objects.get_config('maas_name'),
38
79
        }