added existential ? to template if statements, added replace \s to @model results for fix in jQuery 1.9