[Dev-flock] r287 - in huginmunin/trunk/web: . src/web_app/Main/media src/web_app/Main/templates src/web_app/Main/views
dan@thoughtandmemory.org
dan at thoughtandmemory.org
Mon Oct 8 08:33:49 EDT 2007
r305 at insignificant: dan | 2007-10-08 08:23:55 -0400
Added a few interesting things:
- to main.js, I added render() which takes a python-esque string (e.g. %s and %(blah)s placeholders) and merges either an Array or an Object into the string. This could be useful in making stuff work both with and without ajax? Also, I think it looks nicer.
- to views.py, I added get_type and get_item, which interfaces with ContentTypes, so instead of guessing the item_type for Argument, you can say get_type(Argument), and get_item is backwards of that.
- also to views.py, I added default_fields/get_field/get_data/get_json, which together let you specify the precise structure to be returned. Check it out in my_json_view_arguments and get_citations_per_argument. The rules are a little contrived, because I wanted to use only strings and arrays for structure (so it could work for requesting from client-side too) but, well, I like it. If you don't, feel free to revert it.
Changed some view methods to work with new model structure, and changed a few things in main.html (now user_centric.html) - loading the argument list now pulls down citation information all in one request.
Added 'return false' to the 'Add Argument' form so it actually has time to submit before the page turns.
Changed the 'k' in the Mochikit script tag to 'K' because my computer hates me if I don't.
Modified:
huginmunin/trunk/web/
huginmunin/trunk/web/src/web_app/Main/media/main.js
huginmunin/trunk/web/src/web_app/Main/templates/base.html
huginmunin/trunk/web/src/web_app/Main/templates/user_centric.html
huginmunin/trunk/web/src/web_app/Main/views/views.py
More information about the Dev-flock
mailing list