2010-08-05 11:23:17 -05:00
|
|
|
<tal:comment replace="nothing">View macro for a Computed.</tal:comment>
|
|
|
|
<metal:view define-macro="view">
|
2010-09-17 02:27:14 -05:00
|
|
|
<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">
|
2011-11-25 11:01:20 -06:00
|
|
|
<metal:call use-macro="app/ui/widgets/computed/macros/view"/>
|
2010-08-05 11:23:17 -05:00
|
|
|
</metal:view>
|
|
|
|
|
|
|
|
<tal:comment replace="nothing">Edit macro for a Computed.</tal:comment>
|
|
|
|
<metal:edit define-macro="edit">
|
2011-11-25 11:01:20 -06:00
|
|
|
<metal:call use-macro="app/ui/widgets/computed/macros/view"/>
|
2010-08-05 11:23:17 -05:00
|
|
|
</metal:edit>
|
|
|
|
|
|
|
|
<tal:comment replace="nothing">Cell macro for a Computed.</tal:comment>
|
|
|
|
<metal:cell define-macro="cell">
|
2011-11-25 11:01:20 -06:00
|
|
|
<metal:call use-macro="app/ui/widgets/computed/macros/view"/>
|
2010-08-05 11:23:17 -05:00
|
|
|
</metal:cell>
|
|
|
|
|
|
|
|
<tal:comment replace="nothing">Search macro for a Computed.</tal:comment>
|
2012-07-18 14:58:11 -05:00
|
|
|
<metal:search define-macro="search">
|
|
|
|
<label tal:attributes="for widgetName" tal:content="python: _(widget['labelId'])"></label><br>
|
|
|
|
<input type="text" tal:define="maxChars python: test(widget['maxChars'], widget['maxChars'], '')"
|
|
|
|
tal:attributes="name python: '%s*string' % widgetName;
|
2012-12-14 02:23:33 -06:00
|
|
|
maxlength maxChars; size widget/width;
|
|
|
|
value widget/sdefault"/>
|
2012-07-18 14:58:11 -05:00
|
|
|
</metal:search>
|