provide h0 layout part (without image); allow for image display in navigatin menu

This commit is contained in:
Helmut Merz 2011-10-13 09:59:23 +02:00
parent 39d75e67ce
commit 7c1f7af4a4
5 changed files with 44 additions and 15 deletions

View file

@ -350,7 +350,12 @@ class ConceptView(BaseView):
#IOptions(adapted(pr.predicate))('hide_parents_for', [])): #IOptions(adapted(pr.predicate))('hide_parents_for', [])):
IOptions(pr.predicate)('hide_parents_for', [])): IOptions(pr.predicate)('hide_parents_for', [])):
return True return True
hideRoles = IOptions(adapted(pr.first.conceptType))('hide_for', None) 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: if hideRoles is not None:
principal = self.request.principal principal = self.request.principal
if (IUnauthenticatedPrincipal.providedBy(principal) and if (IUnauthenticatedPrincipal.providedBy(principal) and
@ -398,10 +403,16 @@ class ConceptView(BaseView):
if fv.check(r.first): if fv.check(r.first):
yield ResourceRelationView(r, self.request, contextIsSecond=True) 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 @Lazy
def resourcesByType(self): def resourcesByType(self):
result = dict(texts=[], images=[], files=[]) result = dict(texts=[], images=[], files=[])
for rv in self.resources(): for rv in self.resourcesList:
r = rv.context r = rv.context
if r.contentType.startswith('text/'): if r.contentType.startswith('text/'):
result['texts'].append(r) result['texts'].append(r)

View file

@ -39,6 +39,14 @@
factory="loops.browser.lobo.standard.List2" factory="loops.browser.lobo.standard.List2"
permission="zope.View" /> 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 <zope:adapter
name="lobo_h1" name="lobo_h1"
for="loops.interfaces.IConcept for="loops.interfaces.IConcept

View file

@ -46,18 +46,20 @@
<metal:block define-macro="header"> <metal:block define-macro="header">
<div tal:define="cell part/getView"> <div tal:define="cell part/getView">
<metal:headline use-macro="item/macros/headline" /> <metal:headline use-macro="item/macros/headline" />
<div tal:define="showImageLink python:True" <tal:image condition="part/showImage">
tal:attributes="class python:part.cssClass[0]"> <div tal:define="showImageLink python:True"
<metal:image use-macro="item/macros/image" /> tal:attributes="class python:part.cssClass[0]">
<span tal:condition="cell/img/showInfo|nothing"> <metal:image use-macro="item/macros/image" />
<a tal:define="url string:${cell/img/url}/meta_info.html" <span tal:condition="cell/img/showInfo|nothing">
tal:attributes="href url; <a tal:define="url string:${cell/img/url}/meta_info.html"
onclick string:objectDialog('', '$url');; tal:attributes="href url;
return false"> onclick string:objectDialog('', '$url');;
<img tal:attributes="src return false">
string:${controller/resourceBase}/cybertools.icons/info.png" /> <img tal:attributes="src
</a></span> string:${controller/resourceBase}/cybertools.icons/info.png" />
</div> </a></span>
</div>
</tal:image>
<div tal:attributes="class python:part.cssClass[1]"> <div tal:attributes="class python:part.cssClass[1]">
<span tal:content="structure cell/renderedTextDescription" /> <span tal:content="structure cell/renderedTextDescription" />
</div> </div>

View file

@ -157,6 +157,7 @@ class BasePart(Base):
imageCssClass = '' imageCssClass = ''
height = 260 height = 260
gridPattern = [] gridPattern = []
showImage = True
def getChildren(self): def getChildren(self):
subtypeNames = (self.params.get('subtypes') or [''])[0].split(',') subtypeNames = (self.params.get('subtypes') or [''])[0].split(',')
@ -206,6 +207,13 @@ class List2(BasePart):
gridPattern = [['span-4 clear', 'span-2 last']] gridPattern = [['span-4 clear', 'span-2 last']]
class Header0(BasePart):
macroName = 'header'
cssClass = ['span-6 last', 'clear']
showImage = False
class Header1(BasePart): class Header1(BasePart):
macroName = 'header' macroName = 'header'

View file

@ -443,7 +443,7 @@ img.notselected {
/* lobo layout-specific classes */ /* lobo layout-specific classes */
.legend { .legend {
margin-top: 3px; margin-top: 1px;
} }
/* comments */ /* comments */