Added recipe editing pages.
authorW. Trevor King <wking@drexel.edu>
Thu, 22 Jul 2010 11:58:16 +0000 (07:58 -0400)
committerW. Trevor King <wking@drexel.edu>
Thu, 22 Jul 2010 15:49:03 +0000 (11:49 -0400)
commit20d3a594448e3e932fe935799be6db059d91f205
tree72a1aa6223937084c678c098c122914dbfdb931c
parenta2b08a880b4b8b1f224b69b12aa46fe496159abd
Added recipe editing pages.

Specifically:
* Added "add new recipe" link to recipes.html template.
* Added "edit recipe" link to recipe.html template.
* Added new template: edit-recipe.html
* Added new Server.edit() and sub-functions.
* Moved Cookbook's save dir definition to Cookbook.save_dir.
* Moved Recipe.path name generation to Cookbook._free_path().
* Cookbook.make_index() now adds paths to Recipes with .path == None.
* In-memory updates for everything.
* Add/remove ingredient blocks with index mapping.

Along the way, I fixed up some random bugs:
* recipe.html was failing if there were no ingredient_blocks or directions.
* Amount.__unicode__ was failing if some attributes were None.
* Ingredient.__unicode__ was failing if .amount was None.
* Allow printing of recipes when .directions == None.

I also made a few style fixes:
* Server.tag_regexp -> ._tag_regexp, since it's internal data.
cookbook/cookbook.py
cookbook/server.py
cookbook/template/edit-recipe.html [new file with mode: 0644]
cookbook/template/recipe.html
cookbook/template/recipes.html