add some flexibility to resources listing and Lobo Layout
This commit is contained in:
parent
a415e83468
commit
364a0c8c58
2 changed files with 5 additions and 3 deletions
|
@ -182,7 +182,7 @@
|
||||||
<metal:resources define-macro="conceptresources">
|
<metal:resources define-macro="conceptresources">
|
||||||
<div tal:attributes="class string:content-$level;
|
<div tal:attributes="class string:content-$level;
|
||||||
ondblclick python: item.openEditWindow('resources.html')"
|
ondblclick python: item.openEditWindow('resources.html')"
|
||||||
tal:define="resources python: list(item.resources())"
|
tal:define="resources resources|python:list(item.resources())"
|
||||||
tal:condition="resources">
|
tal:condition="resources">
|
||||||
<h2 i18n:translate="">Resources</h2>
|
<h2 i18n:translate="">Resources</h2>
|
||||||
<form method="post"
|
<form method="post"
|
||||||
|
|
|
@ -153,13 +153,15 @@ class Layout(Base, ConceptView):
|
||||||
macroName = 'layout'
|
macroName = 'layout'
|
||||||
|
|
||||||
def getParts(self):
|
def getParts(self):
|
||||||
result = []
|
|
||||||
parts = (self.params.get('parts') or [''])[0].split(',') # obsolete
|
parts = (self.params.get('parts') or [''])[0].split(',') # obsolete
|
||||||
if not parts or not parts[0]:
|
if not parts or not parts[0]:
|
||||||
parts = (self.options('parts') or
|
parts = (self.options('parts') or
|
||||||
self.typeOptions('parts') or
|
self.typeOptions('parts') or
|
||||||
['h1', 'g3'])
|
['h1', 'g3'])
|
||||||
#ti = adapted(self.context.conceptType).typeInterface
|
return self.getPartViews(parts)
|
||||||
|
|
||||||
|
def getPartViews(self, parts):
|
||||||
|
result = []
|
||||||
for p in parts:
|
for p in parts:
|
||||||
viewName = 'lobo_' + p
|
viewName = 'lobo_' + p
|
||||||
view = component.queryMultiAdapter((self.context, self.request),
|
view = component.queryMultiAdapter((self.context, self.request),
|
||||||
|
|
Loading…
Add table
Reference in a new issue