appypod-rattail/gen/ui/widgets/computed.pt

44 lines
2 KiB
Plaintext
Raw Normal View History

<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 type="text/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"/>
</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"/>
</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"/>
</metal:cell>
<tal:comment replace="nothing">Search macro for a Computed.</tal:comment>
<metal:search define-macro="search">
<label tal:attributes="for widgetName" tal:content="python: _(widget['labelId'])"></label><br>&nbsp;&nbsp;
<input type="text" tal:define="maxChars python: test(widget['maxChars'], widget['maxChars'], '')"
tal:attributes="name python: '%s*string' % widgetName;
maxlength maxChars; size widget/width;
value widget/sdefault"/>
</metal:search>