ability to display wholepage dashboard
authorScott Baker <smbaker@gmail.com>
Mon, 3 Nov 2014 22:35:58 +0000 (14:35 -0800)
committerScott Baker <smbaker@gmail.com>
Mon, 3 Nov 2014 22:35:58 +0000 (14:35 -0800)
planetstack/core/dashboard/views/home.py
planetstack/templates/admin/wholePage.html [new file with mode: 0644]

index ff6c445..ac52b0b 100644 (file)
@@ -14,6 +14,11 @@ class DashboardDynamicView(TemplateView):
        {% block content %}
     """
 
+    head_wholePage_template = r"""{% extends "admin/wholePage.html" %}
+       {% load admin_static %}
+       {% block content %}
+    """
+
     tail_template = r"{% endblock %}"
 
     def get(self, request, name="root", *args, **kwargs):
@@ -22,6 +27,8 @@ class DashboardDynamicView(TemplateView):
 
         if name=="root":
             return self.multiDashboardView(request, context)
+        elif request.GET.get("wholePage",None):
+            return self.singleFullView(request, name, context)
         else:
             return self.singleDashboardView(request, name, context)
 
@@ -104,3 +111,17 @@ class DashboardDynamicView(TemplateView):
             context = context,\r
             **response_kwargs)
 
+    def singleFullView(self, request, name, context):
+        head_template = self.head_wholePage_template
+        tail_template = self.tail_template
+
+        t = template.Template(head_template + self.readTemplate(name) + self.tail_template)
+
+        response_kwargs = {}
+        response_kwargs.setdefault('content_type', self.content_type)
+        return self.response_class(\r
+            request = request,\r
+            template = t,\r
+            context = context,\r
+            **response_kwargs)
+
diff --git a/planetstack/templates/admin/wholePage.html b/planetstack/templates/admin/wholePage.html
new file mode 100644 (file)
index 0000000..1c7423f
--- /dev/null
@@ -0,0 +1,4 @@
+<html>
+<head>{% block extrahead %}{% endblock %}</head>
+<body>{% block content %}{% endblock %}</body>            
+</html>