git://git.onelab.eu
/
unfold.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
a first working mechanism based on Prelude class and requirements()
[unfold.git]
/
plugins
/
verticallayout.py
diff --git
a/plugins/verticallayout.py
b/plugins/verticallayout.py
index
61f6cab
..
eeb134d
100644
(file)
--- a/
plugins/verticallayout.py
+++ b/
plugins/verticallayout.py
@@
-1,18
+1,13
@@
from django.template.loader import render_to_string
from django.template.loader import render_to_string
-from engine.
plugin import Plugin
+from engine.
composite import Composite
-class VerticalLayout (
Plugin
) :
+class VerticalLayout (
Composite
) :
- def __init__ (self, sons=[], *args, **kwds):
- self.sons=sons
- Plugin.__init__ (self, *args, **kwds)
-
- def insert (self, plugin):
- self.sons.append(plugin)
-
def title (self) : return "VLayout title"
def title (self) : return "VLayout title"
+ def template (self): return "verticallayout.html"
+
def render_env (self, request):
env = {}
sons_rendered = [ son.render(request) for son in self.sons ]
def render_env (self, request):
env = {}
sons_rendered = [ son.render(request) for son in self.sons ]
@@
-23,11
+18,4
@@
class VerticalLayout (Plugin) :
for id,rendered,title in zip (ids, sons_rendered, sons_titles) ]
env['sons']=sons
return env
for id,rendered,title in zip (ids, sons_rendered, sons_titles) ]
env['sons']=sons
return env
-
-
- def template (self): return "verticallayout.html"
-
- def media_js (): return [ 'js/simplelist.js' ]
-
- def media_css (): return { 'all': ('css/simplelist.css'), }