Hello,
I just committed a rather big change to the template syntax and filters. When you use filters as "|not" or "|add" then you will need to edit your templates.
SHORT VERSION
The templates support now infix expressions, the operator filters (like ne, eq, not, add, etc.) are removed.
LONG VERSION
Previously we used a Django compatible template syntax. This syntax did not allow expressions, and had limited support for boolean expressions in combination with the {% if %} tag. To support a richer expression language we added extra filters for simple calculations and comparisons.
This has now completely changed.
You can now use expression where you could use a value:
{{ a + 2 }}
and also complicated expressions with the {% if %} tag:
{% if a > b / 2 + 4 and not c %}
or use an expression as a value for a scomp or tag argument:
{% button text="hello" disabled=not allow_hello %}
or use an expression as a filter argument, here you need to add parentheses around the expression:
{{ a|default:(b+3)|format_integer }}
SUPPORTED OPERATORS
The following operators are supported, in ascending priority:
or
xor
and
== /= < > >= =<
+ -
* / %
unary-minus (-a) unary-not (not a)
So the expression:
a+2 > 3 or c < d and enabled
Is similar to:
((a+2) > 3) or ((c < d) and enabled)
There are also some alternative representations for some comparison operators, to make it easier for non-Erlang templates builders:
/= has as alias: !=
=< has as alias: <=
Please post any questions.
Kind Regards,
Marc Worrell