provide h0 layout part (without image); allow for image display in navigatin menu
This commit is contained in:
parent
39d75e67ce
commit
7c1f7af4a4
5 changed files with 44 additions and 15 deletions
|
@ -350,6 +350,11 @@ class ConceptView(BaseView):
|
|||
#IOptions(adapted(pr.predicate))('hide_parents_for', [])):
|
||||
IOptions(pr.predicate)('hide_parents_for', [])):
|
||||
return True
|
||||
hideRoles = None
|
||||
options = component.queryAdapter(adapted(pr.first), IOptions)
|
||||
if options is not None:
|
||||
hideRoles = options('hide_for', None)
|
||||
if not hideRoles:
|
||||
hideRoles = IOptions(adapted(pr.first.conceptType))('hide_for', None)
|
||||
if hideRoles is not None:
|
||||
principal = self.request.principal
|
||||
|
@ -398,10 +403,16 @@ class ConceptView(BaseView):
|
|||
if fv.check(r.first):
|
||||
yield ResourceRelationView(r, self.request, contextIsSecond=True)
|
||||
|
||||
@Lazy
|
||||
def resourcesList(self):
|
||||
from loops.browser.resource import ResourceRelationView
|
||||
return [ResourceRelationView(r, self.request, contextIsSecond=True)
|
||||
for r in self.context.getResourceRelations()]
|
||||
|
||||
@Lazy
|
||||
def resourcesByType(self):
|
||||
result = dict(texts=[], images=[], files=[])
|
||||
for rv in self.resources():
|
||||
for rv in self.resourcesList:
|
||||
r = rv.context
|
||||
if r.contentType.startswith('text/'):
|
||||
result['texts'].append(r)
|
||||
|
|
|
@ -39,6 +39,14 @@
|
|||
factory="loops.browser.lobo.standard.List2"
|
||||
permission="zope.View" />
|
||||
|
||||
<zope:adapter
|
||||
name="lobo_h0"
|
||||
for="loops.interfaces.IConcept
|
||||
loops.browser.skin.Lobo"
|
||||
provides="zope.interface.Interface"
|
||||
factory="loops.browser.lobo.standard.Header0"
|
||||
permission="zope.View" />
|
||||
|
||||
<zope:adapter
|
||||
name="lobo_h1"
|
||||
for="loops.interfaces.IConcept
|
||||
|
|
|
@ -46,6 +46,7 @@
|
|||
<metal:block define-macro="header">
|
||||
<div tal:define="cell part/getView">
|
||||
<metal:headline use-macro="item/macros/headline" />
|
||||
<tal:image condition="part/showImage">
|
||||
<div tal:define="showImageLink python:True"
|
||||
tal:attributes="class python:part.cssClass[0]">
|
||||
<metal:image use-macro="item/macros/image" />
|
||||
|
@ -58,6 +59,7 @@
|
|||
string:${controller/resourceBase}/cybertools.icons/info.png" />
|
||||
</a></span>
|
||||
</div>
|
||||
</tal:image>
|
||||
<div tal:attributes="class python:part.cssClass[1]">
|
||||
<span tal:content="structure cell/renderedTextDescription" />
|
||||
</div>
|
||||
|
|
|
@ -157,6 +157,7 @@ class BasePart(Base):
|
|||
imageCssClass = ''
|
||||
height = 260
|
||||
gridPattern = []
|
||||
showImage = True
|
||||
|
||||
def getChildren(self):
|
||||
subtypeNames = (self.params.get('subtypes') or [''])[0].split(',')
|
||||
|
@ -206,6 +207,13 @@ class List2(BasePart):
|
|||
gridPattern = [['span-4 clear', 'span-2 last']]
|
||||
|
||||
|
||||
class Header0(BasePart):
|
||||
|
||||
macroName = 'header'
|
||||
cssClass = ['span-6 last', 'clear']
|
||||
showImage = False
|
||||
|
||||
|
||||
class Header1(BasePart):
|
||||
|
||||
macroName = 'header'
|
||||
|
|
|
@ -443,7 +443,7 @@ img.notselected {
|
|||
/* lobo layout-specific classes */
|
||||
|
||||
.legend {
|
||||
margin-top: 3px;
|
||||
margin-top: 1px;
|
||||
}
|
||||
|
||||
/* comments */
|
||||
|
|
Loading…
Add table
Reference in a new issue