use option on document type for showing text title in section

This commit is contained in:
Helmut Merz 2013-06-22 10:54:38 +02:00
parent f5accbb205
commit cdfd5824e1
3 changed files with 8 additions and 1 deletions

View file

@ -129,6 +129,10 @@ class Base(object):
if dt is not None:
return IOptions(adapted(dt))(name)
def getTitleForResource(self, r):
if self.getOptionsForResource(r, 'showtitle'):
return r.title
def getIconForResource(self, r):
icon = self.getOptionsForResource(r, 'icon')
if icon:

View file

@ -1,5 +1,5 @@
type(u'documenttype', u'Dokumentenart', options=u'qualifier:assign',
typeInterface='loops.interfaces.IOptions',
typeInterface=u'loops.interfaces.IOptions',
viewName=u'')
# book types

View file

@ -45,6 +45,9 @@
<div metal:define-macro="default_text"
tal:attributes="class python:
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"
tal:define="icon python:item.getIconForResource(related)"
tal:condition="icon"