From: Scott Baker Date: Mon, 3 Nov 2014 22:35:58 +0000 (-0800) Subject: ability to display wholepage dashboard X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=fd936ad3c440fb51d38bbe93f213e3cf2807c845;p=plstackapi.git ability to display wholepage dashboard --- diff --git a/planetstack/core/dashboard/views/home.py b/planetstack/core/dashboard/views/home.py index ff6c445..ac52b0b 100644 --- a/planetstack/core/dashboard/views/home.py +++ b/planetstack/core/dashboard/views/home.py @@ -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, **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( + request = request, + template = t, + context = context, + **response_kwargs) + diff --git a/planetstack/templates/admin/wholePage.html b/planetstack/templates/admin/wholePage.html new file mode 100644 index 0000000..1c7423f --- /dev/null +++ b/planetstack/templates/admin/wholePage.html @@ -0,0 +1,4 @@ + +{% block extrahead %}{% endblock %} +{% block content %}{% endblock %} +