use option on document type for showing text title in section
This commit is contained in:
parent
f5accbb205
commit
cdfd5824e1
3 changed files with 8 additions and 1 deletions
|
@ -129,6 +129,10 @@ class Base(object):
|
||||||
if dt is not None:
|
if dt is not None:
|
||||||
return IOptions(adapted(dt))(name)
|
return IOptions(adapted(dt))(name)
|
||||||
|
|
||||||
|
def getTitleForResource(self, r):
|
||||||
|
if self.getOptionsForResource(r, 'showtitle'):
|
||||||
|
return r.title
|
||||||
|
|
||||||
def getIconForResource(self, r):
|
def getIconForResource(self, r):
|
||||||
icon = self.getOptionsForResource(r, 'icon')
|
icon = self.getOptionsForResource(r, 'icon')
|
||||||
if icon:
|
if icon:
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
type(u'documenttype', u'Dokumentenart', options=u'qualifier:assign',
|
type(u'documenttype', u'Dokumentenart', options=u'qualifier:assign',
|
||||||
typeInterface='loops.interfaces.IOptions',
|
typeInterface=u'loops.interfaces.IOptions',
|
||||||
viewName=u'')
|
viewName=u'')
|
||||||
|
|
||||||
# book types
|
# book types
|
||||||
|
|
|
@ -45,6 +45,9 @@
|
||||||
<div metal:define-macro="default_text"
|
<div metal:define-macro="default_text"
|
||||||
tal:attributes="class python:
|
tal:attributes="class python:
|
||||||
item.getCssClassForResource(related)">
|
item.getCssClassForResource(related)">
|
||||||
|
<h3 tal:define="ttitle python:item.getTitleForResource(related)"
|
||||||
|
tal:condition="ttitle"
|
||||||
|
tal:content="ttitle" />
|
||||||
<img class="flow-left" style="padding-top: 5px"
|
<img class="flow-left" style="padding-top: 5px"
|
||||||
tal:define="icon python:item.getIconForResource(related)"
|
tal:define="icon python:item.getIconForResource(related)"
|
||||||
tal:condition="icon"
|
tal:condition="icon"
|
||||||
|
|
Loading…
Add table
Reference in a new issue