I'd like a Scala condition inside the "class" HTML attribute to be parsed, but the Scala Template isn't playing ball:
@priceTag(amount: Currency) = @{
<div class='priceTag {if(amount.toDouble == 0.0d) "FREE"}'>
{if(amount.toDouble > 0.0d) {amount.format("¤#")} else {"FREE"}}
</div>
}
Yields:
<div class="priceTag {if(amount.toDouble == 0.0d) "FREE"}">
£1
</div>
And I'd like it to yield:
<div class="priceTag">
£1
</div>
Suggestions gratefully appreciated