Skip to content
Luke Swart edited this page Aug 4, 2016 · 2 revisions

The view that loads our "add a new place" form is under src/sa_web/static/js/views/place-form-view.js, which loads templates from src/sa_web/jstemplates/place-form.html. You can find all of our existing view and templates in those folders as well.

If it helps, you can see that our client side application start loading from src/flavors/duwamish_flavor/templates/index.html, which extends src/sa_web/templates/base.html. The script tags that load our views and configurations are in that base.html file.

The configuration file is under src/flavors/duwamish_flavor/config.yml, which stores our place configuration under the place key: https://github.com/smartercleanup/duwamish/blob/master/src/flavors/duwamish_flavor/config.yml#L459

Here are the config loading details, if interested: The config file is parsed by our Django application here: https://github.com/smartercleanup/duwamish/blob/master/src/sa_web/config.py#L95 which is called from here: https://github.com/smartercleanup/duwamish/blob/master/src/sa_web/views.py#L65 which gets loaded into a Python dict object, passed into a context variable and loaded into our html here: https://github.com/smartercleanup/duwamish/blob/master/src/sa_web/views.py#L124 The request is rendered using Django's render shortcut to render our src/flavors/duwamish_flavor/templates/index.html file, which extends our src/sa_web/templates/base.html file that passes the config to our views.

You can see our place config get passed here: https://github.com/smartercleanup/duwamish/blob/master/src/sa_web/templates/base.html#L294 which gets loaded into our router, which loads our app-view here: https://github.com/smartercleanup/duwamish/blob/master/src/sa_web/static/js/routes.js#L57 which loads our place-form-view here: https://github.com/smartercleanup/duwamish/blob/master/src/sa_web/static/js/views/app-view.js#L360 and our place-form-view loads the context in its render() method here: https://github.com/smartercleanup/duwamish/blob/master/src/sa_web/static/js/views/place-form-view.js#L23 Hopefully that helps!

Clone this wiki locally