mde/geddy — pull request #358 by ben-ng (2013-05-15 20:48:16+00:00)
Title: Display flash messages in templates

Would appreciate a sanity check with these changes

The first issue I encountered is that the flash types (success, alert, info) don't match up with the bootstrap classes (alert-success, alert-warning, alert-danger, alert-info).

So I added an additional [config var](https://github.com/ben-ng/geddy/blob/8a10ee6adaccadfce8377821929a09e1578b30d8/gen/base/environment.js) that maps flash types to CSS classes to avoid polluting the templates with switch statements.

The second issue was that moustache is logicless which means I couldn't look up the display classes from the template file. It was also pretty verbose putting logic like checking if flash messages had an associated CSS class or not in the template files. So I modified the `flash.messages` object to store the CSS classes alongside the message text, [taking care to keep the API the same](https://github.com/ben-ng/geddy/blob/8a10ee6adaccadfce8377821929a09e1578b30d8/lib/sessions/flash.js). This made the templates a hell of a lot cleaner.

Anyway, I hope this is the *least stupid way* of doing this.