appypod-rattail/gen/plone25/skin/widgets/computed.pt
2011-09-18 15:00:05 +02:00

38 lines
1.6 KiB
XML

<tal:comment replace="nothing">View macro for a Computed.</tal:comment>
<metal:view define-macro="view">
<tal:sync condition="sync">
<span tal:condition="widget/plainText" tal:replace="value"/>
<span tal:condition="not: widget/plainText" tal:replace="structure value"/>
</tal:sync>
<tal:async condition="not: sync">
<div tal:define= "ajaxHookId python: contextObj.UID() + name"
tal:attributes = "id ajaxHookId">
<script language="javascript"
tal:content="python: 'askComputedField(\'%s\',\'%s\',\'%s\')' % (ajaxHookId, contextObj.absolute_url(), name)">
</script>
</div>
</tal:async>
</metal:view>
<tal:comment replace="nothing">Ajax-called view content of a non sync Computed field.</tal:comment>
<metal:view define-macro="viewContent"
tal:define="name request/fieldName;
widget python: contextObj.getAppyType(name, asDict=True);
value python: contextObj.getFieldValue(name);
sync python:True">
<metal:call use-macro="app/skyn/widgets/computed/macros/view"/>
</metal:view>
<tal:comment replace="nothing">Edit macro for a Computed.</tal:comment>
<metal:edit define-macro="edit">
<metal:call use-macro="app/skyn/widgets/computed/macros/view"/>
</metal:edit>
<tal:comment replace="nothing">Cell macro for a Computed.</tal:comment>
<metal:cell define-macro="cell">
<metal:call use-macro="app/skyn/widgets/computed/macros/view"/>
</metal:cell>
<tal:comment replace="nothing">Search macro for a Computed.</tal:comment>
<metal:search define-macro="search"></metal:search>