moved event templating to javascript; resolves #33