diff mbox

[Branch,~linaro-validation/lava-dashboard/trunk] Rev 253: Add dashboard_globals to context processor

Message ID 20110819041613.15284.78412.launchpad@ackee.canonical.com
State Accepted
Headers show

Commit Message

Zygmunt Krynicki Aug. 19, 2011, 4:16 a.m. UTC
------------------------------------------------------------
revno: 253
committer: Zygmunt Krynicki <zygmunt.krynicki@linaro.org>
branch nick: pristine
timestamp: Thu 2011-08-18 17:03:44 +0200
message:
  Add dashboard_globals to context processor
modified:
  dashboard_app/context_processors.py
  dashboard_app/extension.py


--
lp:lava-dashboard
https://code.launchpad.net/~linaro-validation/lava-dashboard/trunk

You are subscribed to branch lp:lava-dashboard.
To unsubscribe from this branch go to https://code.launchpad.net/~linaro-validation/lava-dashboard/trunk/+edit-subscription
diff mbox

Patch

=== modified file 'dashboard_app/context_processors.py'
--- dashboard_app/context_processors.py	2010-12-20 12:31:26 +0000
+++ dashboard_app/context_processors.py	2011-08-18 15:03:44 +0000
@@ -1,3 +1,24 @@ 
-def project_version(request):
-    from dashboard_app import __version__
-    return {'project_version': __version__}
+from dashboard_app.models import ImageHealth
+
+
+def dashboard_globals(request):
+    return {
+        "dashboard": {
+            "interesting_images": [
+                ImageHealth('nano', 'panda'),
+                ImageHealth('nano', 'omap3'),
+                ImageHealth('nano', 'lt-panda'),
+                ImageHealth('developer', 'panda'),
+                ImageHealth('developer', 'omap3'),
+                ImageHealth('developer', 'lt-panda'),
+                ImageHealth('alip', 'panda'),
+                ImageHealth('alip', 'omap3'),
+                ImageHealth('alip', 'lt-panda'),
+                ImageHealth('alip', 'lt-panda-x11-base-natty'),
+                ImageHealth('ubuntu-desktop', 'panda'),
+                ImageHealth('ubuntu-desktop', 'omap3'),
+                ImageHealth('ubuntu-desktop', 'lt-panda'),
+                ImageHealth('ubuntu-desktop', 'lt-panda-x11-base-natty'),
+            ]
+        }
+    }

=== modified file 'dashboard_app/extension.py'
--- dashboard_app/extension.py	2011-07-12 03:06:00 +0000
+++ dashboard_app/extension.py	2011-08-18 15:03:44 +0000
@@ -65,6 +65,9 @@ 
         settings_module['DATAREPORT_DIRS'] = [
             os.path.join(root_dir, 'examples/reports'),
             os.path.join(root_dir, 'production/reports')]
+        settings_module['TEMPLATE_CONTEXT_PROCESSORS'].append(
+            'dashboard_app.context_processors.dashboard_globals'
+        )
 
     def contribute_to_settings_ex(self, settings_module, settings_object):
         settings_module['DATAVIEW_DIRS'] = settings_object._settings.get(