Merge branch 'master' into bbmaster
This commit is contained in:
commit
ca8267306a
4 changed files with 25 additions and 17 deletions
|
@ -290,7 +290,7 @@ class ConceptView(BaseView):
|
|||
r.order = pos
|
||||
|
||||
def getChildren(self, topLevelOnly=True, sort=True, noDuplicates=True,
|
||||
useFilter=True):
|
||||
useFilter=True, predicates=None):
|
||||
form = self.request.form
|
||||
#if form.get('loops.viewName') == 'index.html' and self.editable:
|
||||
if self.editable:
|
||||
|
@ -307,7 +307,8 @@ class ConceptView(BaseView):
|
|||
criteria['types'] = [cm.get(name) for name in params['types']]
|
||||
standard = cm.getDefaultPredicate()
|
||||
rels = (self.childViewFactory(r, self.request, contextIsSecond=True)
|
||||
for r in self.context.getChildRelations(sort=None))
|
||||
for r in self.context.getChildRelations(
|
||||
predicates=predicates, sort=None))
|
||||
if sort:
|
||||
rels = sorted(rels, key=lambda r: (r.order, r.title.lower()))
|
||||
from loops.organize.personal.browser.filter import FilterView
|
||||
|
@ -344,9 +345,10 @@ class ConceptView(BaseView):
|
|||
# Override in subclass to control what is displayd in listings:
|
||||
children = getChildren
|
||||
|
||||
def childrenAlphaGroups(self):
|
||||
def childrenAlphaGroups(self, predicates=None):
|
||||
result = Jeep()
|
||||
rels = self.getChildren(topLevelOnly=False, sort=False)
|
||||
rels = self.getChildren(predicates=predicates or [self.defaultPredicate],
|
||||
topLevelOnly=False, sort=False)
|
||||
rels = sorted(rels, key=lambda r: r.title.lower())
|
||||
for letter, group in groupby(rels, lambda r: r.title.lower()[0]):
|
||||
letter = letter.upper()
|
||||
|
|
|
@ -199,7 +199,7 @@ class Grid3(BasePart):
|
|||
macroName = 'grid'
|
||||
imageSize = 'small'
|
||||
height = 'auto; padding-bottom: 10px'
|
||||
gridPattern = ['span-2', 'span-2', 'span-2 last']
|
||||
gridPattern = ['span-2 clear', 'span-2', 'span-2 last']
|
||||
|
||||
|
||||
class List1(BasePart):
|
||||
|
@ -253,7 +253,7 @@ class ImageGrid3(BasePart):
|
|||
macroName = 'imagegrid'
|
||||
imageSize = 'small'
|
||||
height = 'auto; padding-bottom: 10px'
|
||||
gridPattern = ['span-2', 'span-2', 'span-2 last']
|
||||
gridPattern = ['span-2 clear', 'span-2', 'span-2 last']
|
||||
|
||||
|
||||
# relation views, used for cells (components) of lists and grids
|
||||
|
|
|
@ -3,8 +3,7 @@
|
|||
|
||||
|
||||
<div metal:define-macro="main"
|
||||
tal:define="data item/data"
|
||||
class="microart">
|
||||
tal:define="data item/data">
|
||||
<metal:block use-macro="view/concept_macros/concepttitle_only" />
|
||||
<div class="description"
|
||||
tal:define="description description|item/renderedDescription"
|
||||
|
@ -12,14 +11,18 @@
|
|||
<span tal:content="structure description">Description</span>
|
||||
</div>
|
||||
<div class="text">
|
||||
<div class="span-6 last"
|
||||
tal:content="structure item/story" />
|
||||
<div class="span-2"
|
||||
tal:content="structure item/insight" />
|
||||
<div class="span-2"
|
||||
tal:content="structure item/consequences" />
|
||||
<div class="span-2 last"
|
||||
tal:content="structure item/followUps" /></div><br clear="both" />
|
||||
<div class="span-6 last micropart">
|
||||
<h4 i18n:translate="">Story</h4>
|
||||
<div tal:content="structure item/story" /></div>
|
||||
<div class="span-6 last micropart">
|
||||
<h4 i18n:translate="">Insight</h4>
|
||||
<div tal:content="structure item/insight" /></div>
|
||||
<div class="span-6 last micropart">
|
||||
<h4 i18n:translate="">Consequences</h4>
|
||||
<div tal:content="structure item/consequences" /></div>
|
||||
<div class="span-6 last micropart">
|
||||
<h4 i18n:translate="">Follow-up Questions</h4>
|
||||
<div tal:content="structure item/followUps" /></div><br clear="both" /></div>
|
||||
<metal:block use-macro="view/comment_macros/comments" />
|
||||
</div>
|
||||
|
||||
|
|
|
@ -43,7 +43,10 @@
|
|||
|
||||
|
||||
<metal:block define-macro="glossaryitem">
|
||||
<metal:title use-macro="item/conceptMacros/concepttitle" />
|
||||
<metal:title use-macro="item/conceptMacros/concepttitle_only" />
|
||||
<p tal:define="description item/renderedDescription"
|
||||
tal:condition="description">
|
||||
<tal:text content="structure description" /></p>
|
||||
<p tal:define="translations item/adapted/translations|python:[]"
|
||||
tal:condition="translations">
|
||||
<span i18n:translate="">Translations</span>:
|
||||
|
|
Loading…
Add table
Reference in a new issue