27 | | == Design == |
| 28 | == Designs == |
| 29 | |
| 30 | === !SituationReport (!SitRep) Aggregation === |
| 31 | |
| 32 | We currently have a very basic !SitRep module in Eden where we can write a Rich Text report &/or add a file attachment. |
| 33 | |
| 34 | There are cases where the !SitReps for different Districts should be aggregated at the next higher level (e.g. Province or Division). |
| 35 | |
| 36 | For the Rich-Text, I see this as creating a section for each District with a Section Header added and all the Heading levels taken down a notch: H1s -> H2s, etc |
| 37 | |
| 38 | !SitReps can also include hard numbers though, like #affected, #dead, #wounded, #missing, #displaced, # staff, #volunteers, # vehicles, #shelters, etc then obviously these should be totalled in the aggregated report, so, we need a way to store these in the !SitRep. |
| 39 | |
| 40 | ==== Data Model ==== |
| 41 | I would suggest a Key-Value system in a new table: |
| 42 | * {{{doc_sitrep_tag}}} |
| 43 | |
| 44 | This would be like the ones for {{{gis_location}}} (amongst others): |
| 45 | * https://github.com/flavour/eden/blob/master/modules/s3db/gis.py#L1254 |
| 46 | Note how these are added to the parent resource as a [wiki:S3/S3Model/ComponentResources Component]: |
| 47 | * https://github.com/flavour/eden/blob/master/modules/s3db/gis.py#L386 |
| 48 | |
| 49 | This model should be added to the !SitRep class (I don't think we need a separate class here): |
| 50 | * https://github.com/flavour/eden/blob/master/modules/s3db/doc.py#L664 |
| 51 | |
| 52 | ==== UI ==== |
| 53 | For UI, this could be a Tab, as it is for {{{gis_location}}}, or could be an Inline form. I think the Inline form is better, generally better UX & works better for when the sitrep is itself on a tab (e.g. of the Event or Org) |
| 54 | |
| 55 | Inline form: |
| 56 | * https://github.com/flavour/eden/blob/master/modules/s3db/doc.py#L715 (Can add KV like Files) |
| 57 | |
| 58 | Tabs: |
| 59 | * https://github.com/flavour/eden/blob/master/modules/s3db/gis.py#L5427 (Need to add an rheader like this to !SitReps) |
| 60 | |
| 61 | |
| 62 | I have provided an initial UI for the aggregation: |
| 63 | * https://github.com/flavour/eden/blob/master/private/templates/ARC/config.py#L841 |
| 64 | i.e. there is a hook for a new 'consolidate' method which is called with the selected sitreps. |
| 65 | |
| 66 | The {{{consolidate}}} method needs writing. It would look something like this: |
| 67 | * https://github.com/flavour/eden/blob/master/modules/s3db/hrm.py#L3995 |
| 68 | |
| 69 | ==== XSLT Import ==== |
| 70 | XSLT should be provided to import the Tags: |
| 71 | * https://github.com/flavour/eden/blob/master/static/formats/s3csv/event/event.xsl [Example of a KV in an XSLT file] |
| 72 | * https://github.com/flavour/eden/blob/master/static/formats/s3csv/doc/sitrep.xsl [File which needs modifying] |