use standard title macro for media asset title
git-svn-id: svn://svn.cy55.de/Zope3/src/loops/trunk@2955 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
parent
279c000145
commit
20276442c2
4 changed files with 9 additions and 13 deletions
|
@ -122,6 +122,10 @@ class BaseView(GenericView, I18NView):
|
|||
except ForbiddenAttribute: # ignore when testing
|
||||
pass
|
||||
|
||||
@Lazy
|
||||
def conceptMacros(self):
|
||||
return concept_macros.macros
|
||||
|
||||
@Lazy
|
||||
def name(self):
|
||||
return getName(self.context)
|
||||
|
|
|
@ -49,7 +49,7 @@ from cybertools.composer.interfaces import IInstance
|
|||
from cybertools.composer.schema.interfaces import ISchemaFactory
|
||||
from cybertools.typology.interfaces import IType, ITypeManager
|
||||
from cybertools.util.jeep import Jeep
|
||||
from loops.browser.common import EditForm, BaseView, LoopsTerms, conceptMacrosTemplate
|
||||
from loops.browser.common import EditForm, BaseView, LoopsTerms, concept_macros
|
||||
from loops.common import adapted
|
||||
from loops.concept import Concept, ConceptTypeSourceList, PredicateSourceList
|
||||
from loops.i18n.browser import I18NView
|
||||
|
@ -187,17 +187,13 @@ class ConceptRelationView(BaseView):
|
|||
|
||||
class ConceptView(BaseView):
|
||||
|
||||
template = ViewPageTemplateFile('concept_macros.pt')
|
||||
template = concept_macros
|
||||
childViewFactory = ConceptRelationView
|
||||
|
||||
@Lazy
|
||||
def macro(self):
|
||||
return self.template.macros['conceptdata']
|
||||
|
||||
@Lazy
|
||||
def conceptMacros(self):
|
||||
return conceptMacrosTemplate.macros
|
||||
|
||||
def __init__(self, context, request):
|
||||
super(ConceptView, self).__init__(context, request)
|
||||
cont = self.controller
|
||||
|
|
|
@ -1,16 +1,13 @@
|
|||
<!-- ZPT macros for demo view -->
|
||||
|
||||
<metal:block define-macro="asset">
|
||||
<h1 tal:content="item/adapted/title">Title</h1>
|
||||
<div tal:define="descr item/adapted/description" tal:condition="descr">
|
||||
<h2>Description</h2>
|
||||
<p tal:content="item/adapted/description">Description</p>
|
||||
</div>
|
||||
|
||||
<div tal:attributes="class string:content-$level;">
|
||||
<metal:title use-macro="item/conceptMacros/concepttitle" />
|
||||
<p tal:define="url python: view.getUrlForTarget(item)">
|
||||
<a href="#"
|
||||
tal:attributes="href string:${url}/view"><img
|
||||
tal:attributes="src string:${url}/@@mediaasset.html?v=medium" /></a>
|
||||
</p>
|
||||
</div>
|
||||
</metal:block>
|
||||
|
||||
|
|
|
@ -27,7 +27,6 @@ from zope.component import adapter
|
|||
from zope.interface import implementer
|
||||
from zope.traversing.api import getName
|
||||
|
||||
from cybertools.stateful.definition import registerStatesDefinition
|
||||
from cybertools.stateful.definition import StatesDefinition
|
||||
from cybertools.stateful.definition import State, Transition
|
||||
from cybertools.stateful.interfaces import IStatesDefinition, IStateful
|
||||
|
|
Loading…
Add table
Reference in a new issue