mozilla/openbadger — pull request #103 by toolness (2013-05-17 17:26:56+00:00)
Title: Added a rudimentary theming system.

This is based on the thing I did in mozilla/aestimia@57a8e75160f05468e0f8763cf7a6bc8330b027d0.

Themes are directories that contain `public` and `views` directories. The `public` directory is mounted at `/theme/`, and any templates in the `views` directory override Openbadger's standard templates. Theme views should use `{{ THEME_ROOT }}` instead of hard-coding `/theme/` into themselves, though, since this root dir might change, or be hosted on a separate static file server, etc.

**CAVEATS:**

One weirdness here is that `template.js` is responsible for theming, and since theming requires extra express.static middleware, `template.js` is now responsible for the serving of all static files--which sort of makes sense, since the only reason we need static files is because the templates reference them... But that might be silly reasoning on my part.

Also, this PR doesn't actually implement any themes... Refactoring the existing views into being theme-compatible (and separating the Webmaker look-and-feel of the index page into a separate theme) is a separate step.