core: ui: Add _match-ui-*_ templates

These are analaogus to the _match-*_ counterparts, but they convert @on@
into the question param and check against the applicability of the question.
master
Mike Gerwitz 2019-08-13 16:45:16 -04:00
parent 8005268a1b
commit ce0e31032b
1 changed files with 36 additions and 0 deletions

View File

@ -92,5 +92,41 @@
<t:match-class name="@__set_class@" value="@value@" />
</all>
</template>
The templates below are analogous to the generic match templates,
but they translate \tt{@on@} to the question param
and also check that the question is applicable (using
\ref{_match-ui-applicable_}).
<inline-template>
<for-each>
<set cmp="eq" />
<set cmp="ne" />
<set cmp="gt" />
<set cmp="gte" />
<set cmp="lt" />
<set cmp="lte" />
</for-each>
<template name="_match-ui-{@cmp@}_"
desc="Match UI value {@cmp@}">
<param name="@on@" desc="Question id" />
<!-- pick one -->
<param name="@value@" desc="Match against variable" />
<all>
<t:match-ui-applicable on="@on@" />
<match on="ui_q_{@on@}">
<dyn-node name="c:{@cmp@}">
<c:value-of name="@value@" />
</dyn-node>
</match>
</all>
</template>
</inline-template>
</section>
</package>