chrisdickinson/plate — pull request #21 by eternicode (2014-04-16 05:09:05+00:00)
Title: New-style with-tag ({% with a=b x=y %})

Implements the new `with` tag syntax `{% with x=y %}` while keeping old-style syntax `{% with y as x %}` intact (since Django 1.3).

A lot of this (mainly the new `token_kwargs` utility function) has been ported straight from the appropriate [django sources](https://github.com/django/django/blob/1.6.2/django/template/base.py#L902).

Concerns:
* This may not be the correct place for `token_kwargs`; a new `tags/util.js` might make more sense, but the function is also only used in `tags/with.js`. Happy to move it if you have a preferred / more appropriate place for it.
* `WithNode.render` has lost a bit of code related to the second argument (`value`) and Promises. I'm not familiar enough with the codebase to say for sure, but looking through the rest of the code, I couldn't find any solid evidence that this second argument is ever actually passed in normal usage.

FWIW, this implementation works for my templates which, at the moment, use a combination of old-style and new-style `with` tags.

Also, concerning code style, I didn't see any style guide, and there is no linter config in the repo, so I may have botched some style :grin:. I tried to follow existing conventions, but I'm happy to tweak specific things if you'll point them out.