From d685d0cd62cae3d61b49aac84b2437b8950b8373 Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Tue, 19 Mar 2013 17:24:32 +0100 Subject: [PATCH] renamed verticallayout into stack --- plugins/lists/simplelist.py | 1 + plugins/lists/staticlist.py | 2 + plugins/{verticallayout => stack}/__init__.py | 0 .../verticallayout.html => stack/stack.html} | 0 plugins/stack/stack.py | 7 ++ plugins/verticallayout/verticallayout.py | 7 -- trash/dashboard.py | 4 +- trash/pluginview.py | 68 +++++++++---------- unfold/css/plugin.css | 5 +- unfold/plugin.py | 4 +- 10 files changed, 52 insertions(+), 46 deletions(-) rename plugins/{verticallayout => stack}/__init__.py (100%) rename plugins/{verticallayout/verticallayout.html => stack/stack.html} (100%) create mode 100644 plugins/stack/stack.py delete mode 100644 plugins/verticallayout/verticallayout.py diff --git a/plugins/lists/simplelist.py b/plugins/lists/simplelist.py index b5a4faf8..bf0120c9 100644 --- a/plugins/lists/simplelist.py +++ b/plugins/lists/simplelist.py @@ -14,6 +14,7 @@ class SimpleList (Plugin) : def template_env (self, request): env={} + # would need some cleaner means to set a header here header=getattr(self,'header',None) if header: env['header']=header env['with_datatables']= "yes" if self.with_datatables else "" diff --git a/plugins/lists/staticlist.py b/plugins/lists/staticlist.py index 4655578a..c5a254ac 100644 --- a/plugins/lists/staticlist.py +++ b/plugins/lists/staticlist.py @@ -14,9 +14,11 @@ class StaticList (Plugin) : def template_env (self, request): env={} + # would need some cleaner means to set a header here header=getattr(self,'header',None) if header: env['header']=header env['list']=self.list + env['with_datatables']= "yes" if self.with_datatables else "" return env def requirements (self): diff --git a/plugins/verticallayout/__init__.py b/plugins/stack/__init__.py similarity index 100% rename from plugins/verticallayout/__init__.py rename to plugins/stack/__init__.py diff --git a/plugins/verticallayout/verticallayout.html b/plugins/stack/stack.html similarity index 100% rename from plugins/verticallayout/verticallayout.html rename to plugins/stack/stack.html diff --git a/plugins/stack/stack.py b/plugins/stack/stack.py new file mode 100644 index 00000000..3ccfa54f --- /dev/null +++ b/plugins/stack/stack.py @@ -0,0 +1,7 @@ +from django.template.loader import render_to_string + +from unfold.composite import Composite + +class Stack (Composite) : + + def template_file (self): return "stack.html" diff --git a/plugins/verticallayout/verticallayout.py b/plugins/verticallayout/verticallayout.py deleted file mode 100644 index fe6ff458..00000000 --- a/plugins/verticallayout/verticallayout.py +++ /dev/null @@ -1,7 +0,0 @@ -from django.template.loader import render_to_string - -from unfold.composite import Composite - -class VerticalLayout (Composite) : - - def template_file (self): return "verticallayout.html" diff --git a/trash/dashboard.py b/trash/dashboard.py index bf04ab4b..969149c7 100644 --- a/trash/dashboard.py +++ b/trash/dashboard.py @@ -10,7 +10,7 @@ from django.contrib.auth.decorators import login_required from unfold.page import Page from manifold.manifoldquery import ManifoldQuery -from plugins.verticallayout.verticallayout import VerticalLayout +from plugins.stack.stack import Stack from plugins.lists.slicelist import SliceList from plugins.querycode.querycode import QueryCode from plugins.quickfilter.quickfilter import QuickFilter @@ -36,7 +36,7 @@ def dashboard_view (request): sort='slice_hrn',) page.enqueue_query (slices_query) - main_plugin = VerticalLayout ( + main_plugin = Stack ( page=page, title="Putting stuff together", sons=[ diff --git a/trash/pluginview.py b/trash/pluginview.py index 214acffb..5c996f83 100644 --- a/trash/pluginview.py +++ b/trash/pluginview.py @@ -9,7 +9,7 @@ from django.contrib.auth.decorators import login_required from unfold.page import Page -from plugins.verticallayout.verticallayout import VerticalLayout +from plugins.stack.stack import Stack from plugins.tabs.tabs import Tabs from plugins.lists.staticlist import StaticList from plugins.quickfilter.quickfilter import QuickFilter @@ -27,39 +27,39 @@ def test_plugin_view (request): template_env = {} main_plugin = \ - VerticalLayout ( page=page, - title='title for the vertical layout', - sons = [ StaticList (page=page, - title='StaticList - with datatables - starts toggled off', - list=hard_wired_list, - header='Hard wired header', - foo='the value for foo', - with_datatables=True, - toggled=False), - Tabs (page=page, - title='Sample Tabs', - # *** we select this one to be the active tab *** - active='raw2', - sons = [ Raw (page=page, - title='a raw plugin',domid='raw1', - togglable=False, - html= 3*lorem_p), - StaticList(page=page, - title='a slice list', - togglable=False, - header="static list but not togglable", - list=hard_wired_slice_names), - Raw (page=page, - title='raw title',domid='raw2', - togglable=False,html=lorem) ]), - StaticList (page=page, - title='SimpleList with slice names', - list=hard_wired_slice_names, - ), - QuickFilter (page=page, - title='QuickFilter in main content', - criterias=quickfilter_criterias, - ) ] ) + Stack ( page=page, + title='title for the vertical layout', + sons = [ StaticList (page=page, + title='StaticList - with datatables - starts toggled off', + list=hard_wired_list, + header='Hard wired header', + foo='the value for foo', + with_datatables=True, + toggled=False), + Tabs (page=page, + title='Sample Tabs', + # *** we select this one to be the active tab *** + active='raw2', + sons = [ Raw (page=page, + title='a raw plugin',domid='raw1', + togglable=False, + html= 3*lorem_p), + StaticList(page=page, + title='a slice list', + togglable=False, + header="static list but not togglable", + list=hard_wired_slice_names), + Raw (page=page, + title='raw title',domid='raw2', + togglable=False,html=lorem) ]), + StaticList (page=page, + title='SimpleList with slice names', + list=hard_wired_slice_names, + ), + QuickFilter (page=page, + title='QuickFilter in main content', + criterias=quickfilter_criterias, + ) ] ) # define 'content_main' to the template engine template_env [ 'content_main' ] = main_plugin.render(request) diff --git a/unfold/css/plugin.css b/unfold/css/plugin.css index 0c7aaa29..886ceb95 100644 --- a/unfold/css/plugin.css +++ b/unfold/css/plugin.css @@ -1,5 +1,5 @@ div.plugin-toggle { - padding: 10px; + padding: 4px; border-style: dotted; border-width: 1px; } @@ -9,3 +9,6 @@ p.plugin-show { p.plugin-hide { cursor: n-resize; } +p.plugin-show,i.icon-hand-right, p.plugin-hide,i.icon-hand-down { + padding-right: 4px; +} diff --git a/unfold/plugin.py b/unfold/plugin.py index c2bca297..7ae4745f 100644 --- a/unfold/plugin.py +++ b/unfold/plugin.py @@ -16,8 +16,8 @@ from unfold.prelude import Prelude # . True : to debug all plugin DEBUG= False -#DEBUG= [ 'SliceList' ] -#DEBUG=True +DEBUG= [ 'SimpleList' ] +DEBUG=True # decorator to deflect calls on Plugin to its Prelude through self.page.prelude def to_prelude (method): -- 2.43.0