diff options
author | Mike Gerwitz <mike.gerwitz@rtspecialty.com> | 2019-08-13 16:45:16 -0400 |
---|---|---|
committer | Mike Gerwitz <mike.gerwitz@rtspecialty.com> | 2019-08-13 16:46:06 -0400 |
commit | ce0e31032b0a0c4d6fc2cb5c837beb9d03afc69b (patch) | |
tree | 4c24c06dbb77ae9bb48ca40d020edf353f8d957a /core | |
parent | 8005268a1bd7813d9feee57d76f064f7607521e2 (diff) | |
download | tame-ce0e31032b0a0c4d6fc2cb5c837beb9d03afc69b.tar.gz tame-ce0e31032b0a0c4d6fc2cb5c837beb9d03afc69b.tar.bz2 tame-ce0e31032b0a0c4d6fc2cb5c837beb9d03afc69b.zip |
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.
Diffstat (limited to 'core')
-rw-r--r-- | core/ui.xml | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/core/ui.xml b/core/ui.xml index 6617526..fc61a31 100644 --- a/core/ui.xml +++ b/core/ui.xml @@ -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> |