platforms page using datatables Hazelnut
authorLoic Baron <loic.baron@lip6.fr>
Thu, 22 Aug 2013 15:39:41 +0000 (17:39 +0200)
committerLoic Baron <loic.baron@lip6.fr>
Thu, 22 Aug 2013 15:39:41 +0000 (17:39 +0200)
portal/templates/platforms.html [new file with mode: 0644]
portal/views.py

diff --git a/portal/templates/platforms.html b/portal/templates/platforms.html
new file mode 100644 (file)
index 0000000..33fb0b3
--- /dev/null
@@ -0,0 +1,11 @@
+{% extends "layout-unfold1.html" %}
+
+{% block head %}
+<link rel="stylesheet" type="text/css" href="{{STATIC_URL}}/css/dashboard.css" />
+{% endblock %}
+
+{% block unfold1_main %}
+
+<h1>Platforms</h1>
+{{networks}}
+{% endblock %}
index abbb36e..5b80016 100644 (file)
@@ -29,7 +29,7 @@ from django.views.generic.base   import TemplateView
 from django.shortcuts            import render
 
 from plugins.lists.simplelist    import SimpleList
-
+from plugins.hazelnut            import Hazelnut
 from plugins.pres_view           import PresView
 from portal.event import Event
 import json
@@ -486,18 +486,34 @@ class PlatformsView(TemplateView):
     def get_context_data(self, **kwargs):
         page = Page(self.request)
 
-        network_query  = Query().get('local:platform').select('platform')
+        network_query  = Query().get('local:platform').select('platform','platform_longname','gateway_type')
         page.enqueue_query(network_query)
 
         page.expose_js_metadata()
         page.expose_queries()
-
-        networklist = SimpleList(
-            title = None,
+        networklist = Hazelnut(
             page  = page,
-            key   = 'platform',
+            title = 'List',
+            domid = 'checkboxes',
+            # this is the query at the core of the slice list
             query = network_query,
+            query_all = network_query,
+            checkboxes = False,
+            datatables_options = {
+            # for now we turn off sorting on the checkboxes columns this way
+            # this of course should be automatic in hazelnut
+            'aoColumns'      : [None, None, None, None, {'bSortable': False}],
+            'iDisplayLength' : 25,
+            'bLengthChange'  : True,
+            },
         )
+#
+#        networklist = SimpleList(
+#            title = None,
+#            page  = page,
+#            key   = 'platform',
+#            query = network_query,
+#        )
 
         context = super(PlatformsView, self).get_context_data(**kwargs)
         context['person']   = self.request.user