modilabs/nmis_ui — pull request #27 by dorey (2013-04-08 23:24:07+00:00)
Title: Numerous changes

* Moved all the templates into one common template file (dashboard_subtemplates.erb) This file can be transferred over to the similar file in the NMIS django repository
* Added missing static icon files for displaying status on map
* Removed unused modules (MapMgr, FacilitiesTables)
* Using NMIS.Env() Now, there is a callback that is triggered whenever the "environment" (accessed by NMIS.Env) changes. The callback has access to previous and next environments, as well as what is changing.
* Adding multi-line comments about individual NMIS modules.
* Added "DistrictSector" which is used internally to load sectors in and associate them with the district. (Note: Some districts might have different "sectors" defined to display.)
* Assigning sector, variable, and facility data to the LGA so that it does not get overwritten when changing from one LGA to another (also, does not assume variables are already loaded.) Previously, NMIS.Sectors was the recommended way to access sectors but going forward, it will be through the lga object's assigned "variableSet".
* Encouraging use of a "bounds" for each district so that we don't need to hard code a zoom level. Instead, we will be able to have any size map fit each LGA. (In cases where no bounds is set, it will make a small bounds around the district's lat_lng.)
* Using lga._fetchModuleOnce(...) internally to ensure that a district's modules are not loaded and processed multiple times per page load. (This speeds up navigation a lot.)
* Converted all Mustache templates over to Underscore templates. To avoid conflict with erb, all underscore templates use <{= x }> instead of <%= x %>
* Cleaned up "facilities" map view so that actions are only triggered when they are needed. This could be cleaned up more, but currently provides a better foundation.