Avoid mixing Jinja2 logic in Handlebars templates

@rclough