diff mbox

[Branch,~linaro-validation/lava-dashboard/trunk] Rev 278: Remove the context processor, use front page data feeder and start using application menu (yuck, ...

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

Commit Message

Zygmunt Krynicki Nov. 9, 2011, 12:11 a.m. UTC
------------------------------------------------------------
revno: 278
committer: Zygmunt Krynicki <zygmunt.krynicki@linaro.org>
branch nick: lava-dashboard
timestamp: Wed 2011-11-09 00:59:49 +0100
message:
  Remove the context processor, use front page data feeder and start using application menu (yuck, bzr has no patch splitter)
removed:
  dashboard_app/context_processors.py
  dashboard_app/templates/dashboard_app/_extension_navigation.html
modified:
  dashboard_app/extension.py
  dashboard_app/templates/dashboard_app/_content.html
  dashboard_app/templates/dashboard_app/_content_with_sidebar.html


--
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

=== removed file 'dashboard_app/context_processors.py'
--- dashboard_app/context_processors.py	2011-08-18 15:03:44 +0000
+++ dashboard_app/context_processors.py	1970-01-01 00:00:00 +0000
@@ -1,24 +0,0 @@ 
-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-10-13 11:56:10 +0000
+++ dashboard_app/extension.py	2011-11-08 23:59:49 +0000
@@ -18,7 +18,7 @@ 
 
 import os
 
-from lava_server.extension import LavaServerExtension
+from lava_server.extension import LavaServerExtension, Menu
 
 
 class DashboardExtension(LavaServerExtension):
@@ -35,14 +35,43 @@ 
     def main_view_name(self):
         return "dashboard_app.views.index"
 
+    def get_menu(self):
+        from django.core.urlresolvers import reverse
+        menu = super(DashboardExtension, self).get_menu()
+        menu.sub_menu = [
+            Menu("About", reverse(self.main_view_name)),
+            Menu("Image Status", reverse("dashboard_app.views.image_status_list")),
+            Menu("Testing Efforts", reverse("dashboard_app.views.testing_effort_list")),
+            Menu("Bundle Streams", reverse("dashboard_app.views.bundle_stream_list")),
+            Menu("Tests", reverse("dashboard_app.views.test_list")),
+            Menu("Data Views", reverse("dashboard_app.views.data_view_list")),
+            Menu("Reports", reverse("dashboard_app.views.report_list"))]
+        return menu
+
     @property
     def front_page_template(self):
         return "dashboard_app/front_page_snippet.html"
 
     def get_front_page_context(self):
-        from dashboard_app.models import DataReport
+        from dashboard_app.models import (DataReport, ImageHealth)
         return {
-            'report_list': DataReport.repository.filter(front_page=True)
+            'report_list': DataReport.repository.filter(front_page=True),
+            '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'),
+            ]
         }
 
     @property
@@ -72,9 +101,6 @@ 
         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(

=== modified file 'dashboard_app/templates/dashboard_app/_content.html'
--- dashboard_app/templates/dashboard_app/_content.html	2011-07-25 23:19:44 +0000
+++ dashboard_app/templates/dashboard_app/_content.html	2011-11-08 23:59:49 +0000
@@ -15,8 +15,3 @@ 
 {% block breadcrumbs %}
 {% include "dashboard_app/_breadcrumbs.html" %}
 {% endblock %}
-
-
-{% block navigation %}
-{% include "dashboard_app/_extension_navigation.html" %}
-{% endblock %}

=== modified file 'dashboard_app/templates/dashboard_app/_content_with_sidebar.html'
--- dashboard_app/templates/dashboard_app/_content_with_sidebar.html	2011-07-25 23:19:44 +0000
+++ dashboard_app/templates/dashboard_app/_content_with_sidebar.html	2011-11-08 23:59:49 +0000
@@ -15,8 +15,3 @@ 
 {% block breadcrumbs %}
 {% include "dashboard_app/_breadcrumbs.html" %}
 {% endblock %}
-
-
-{% block navigation %}
-{% include "dashboard_app/_extension_navigation.html" %}
-{% endblock %}

=== removed file 'dashboard_app/templates/dashboard_app/_extension_navigation.html'
--- dashboard_app/templates/dashboard_app/_extension_navigation.html	2011-09-28 00:35:41 +0000
+++ dashboard_app/templates/dashboard_app/_extension_navigation.html	1970-01-01 00:00:00 +0000
@@ -1,19 +0,0 @@ 
-{% load i18n %}
-<div id="lava-server-extension-navigation">
-  <ul>
-    <li><a class="lava-back" href="{% url lava.home %}"
-      >{% trans "Back to LAVA" %}</a></li>
-    <li><a href="{% url dashboard_app.views.image_status_list %}"
-      >{% trans "Image Status" %}</a></li>
-    <li><a href="{% url dashboard_app.views.testing_effort_list %}"
-      >{% trans "Testing efforts" %}</a></li>
-    <li><a href="{% url dashboard_app.views.bundle_stream_list %}"
-      >{% trans "Bundle Streams" %}</a></li>
-    <li><a href="{% url dashboard_app.views.test_list %}"
-      >{% trans "Tests" %}</a></li>
-    <li><a href="{% url dashboard_app.views.data_view_list %}"
-      >{% trans "Data Views" %}</a></li>
-    <li><a href="{% url dashboard_app.views.report_list %}"
-      >{% trans "Reports" %}</a></li>
-  </ul>
-</div>