Update server side templates to use Jinja

Dokku: https://jinja.dokku.hypothes.is

Jinja[1] is a far more front-end friendly tempting system that is similar to the language that Django[2] uses, (it also has analogs in PHP[3] and Node[4]) so it's familiar to a lot of people.

This pull request...

* Swaps out chameleon for Jinja across the board.
* Moves angular templates, layouts and helpers into their own directories.
* Renames embed.txt to embed.js to avoid confusion around the content type.
* Includes a custom Jinja extension for including raw content (used for including Angular templates).

[1] http://jinja.pocoo.org/docs/dev/
[2] https://docs.djangoproject.com/en/dev/topics/templates/
[3] http://twig.sensiolabs.org
[4] https://mozilla.github.io/nunjucks/
https://github.com/webplatform/notes-server/blob/master/notes_server/__init__.py#L152

I thought it made some sense to add a layer of indirection through a meta
template that pulled in all the things possible to appear in the drop down
sheet.

In their case, I would have left out account altogether if I could have
easily removed it from our user menu.

So it's for that reason I'd rather not reference it directly in the app
template. But if you see better ideas and the motivation makes sense I'm
open to other solutions.

Just keep in mind that what's important is that for a simple customization
I don't have duplicate the app template to make the changes.
On Nov 4, 2014 8:29 AM, "Aron Carroll" <notifications@github.com> wrote:

> In h/subscribers.py:
>
> > @@ -15,7 +15,7 @@ def add_renderer_globals(event):
> >      event['service_url'] = request.route_url('api', subpath='')
> >
> >      # Set the blocks property to refer to the block helpers template
> > -    event['blocks'] = get_renderer('h:templates/blocks.pt').implementation()
> > +    # event['blocks'] = get_renderer('h:templates/blocks.pt').implementation()
>
> Could you link to the part of web platform that overrides it? From this
> description it would seem simpler to me for us to just set template paths
> here and then reference them directly in app.html.
>
> {% include auth_template %}
> {% include account_template %}
>
> Does that make sense?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/hypothesis/h/pull/1628/files#r19814460>.
>