Permalink
Browse files

Merge branch 'master' of git://github.com/graeme-f/eden

  • Loading branch information...
2 parents e42f471 + 032e4e8 commit f21ad7bcdc7089b7c633569068b435744afae0ab @flavour committed Oct 10, 2012
Showing with 19,485 additions and 19,656 deletions.
  1. +1 −1 VERSION
  2. +4 −2 controllers/vulnerability.py
  3. +0 −25 languages/en-gb.py
  4. +19 −20 modules/eden/stats.py
  5. +5 −1 modules/s3/s3utils.py
  6. +12 −6 private/templates/IFRC_Train/tasks.cfg
  7. +0 −1,269 private/templates/Vulnerability/demographic_data.csv
  8. +58 −0 private/templates/Vulnerability/demographic_data_fast.csv
  9. +5,868 −4,860 private/templates/Vulnerability/demographic_data_long.csv
  10. +259 −57 private/templates/Vulnerability/demographic_data_short.csv
  11. +0 −1,951 private/templates/Vulnerability/vulnerability_data.csv
  12. +0 −21 private/templates/Vulnerability/vulnerability_data_extra.csv
  13. +0 −21 private/templates/Vulnerability/vulnerability_data_extra_2.csv
  14. +141 −0 private/templates/Vulnerability/vulnerability_data_fast.csv
  15. +10,171 −9,731 ...ates/Vulnerability/{vulnerability_data_historical_B.csv → vulnerability_data_historical_long.csv}
  16. +839 −1,279 ...tes/Vulnerability/{vulnerability_data_historical_A.csv → vulnerability_data_historical_short.csv}
  17. +1,480 −0 private/templates/Vulnerability/vulnerability_data_long.csv
  18. +330 −140 private/templates/Vulnerability/vulnerability_data_short.csv
  19. +46 −10 static/scripts/S3/s3.dataTables.js
  20. +138 −135 static/scripts/S3/s3.dataTables.min.js
  21. +50 −66 static/scripts/S3/s3.vulnerability.js
  22. +60 −60 static/scripts/S3/s3.vulnerability.min.js
  23. +1 −1 static/themes/Vulnerability/eden.min.css
  24. +3 −0 static/themes/Vulnerability/style.css
View
@@ -1 +1 @@
-aa5a879 (2012-10-10 13:51:35)
+e42f471 (2012-10-10 14:03:53)
@@ -171,7 +171,8 @@ def index():
),
dt_action_col = -1,
dt_group_space = "true",
- dt_shrink_groups = "accordion"
+ dt_shrink_groups = "accordion",
+ dt_group_types = ["text", "none"],
)
s3.report = report
@@ -877,7 +878,8 @@ def action_repr(id):
),
dt_action_col = -1,
dt_group_space = "true",
- dt_shrink_groups = "accordion"
+ dt_shrink_groups = "accordion",
+ dt_group_types = ["text", "none"],
)
reportCount = T("%(count)s Entries Found") % dict(count=filteredrows)
report.append(INPUT(_type="hidden",
View
@@ -1,6 +1,5 @@
# coding: utf8
{
-'%Y-%m-%d %H:%M:%S': '%Y-%m-%d %H:%M:%S',
'Ability to customize the list of details tracked at a Shelter': 'Ability to customise the list of details tracked at a Shelter',
'Ability to customize the list of human resource tracked at a Shelter': 'Ability to customise the list of human resource tracked at a Shelter',
'Ability to customize the list of important facilities needed at a Shelter': 'Ability to customise the list of important facilities needed at a Shelter',
@@ -14,7 +13,6 @@
'Add Organization Domain': 'Add Organisation Domain',
'Add Organization to Project': 'Add Organisation to Project',
'Add Organization Type': 'Add Organisation Type',
-'Cannot be empty': 'Cannot be empty',
'Capturing the projects each organization is providing and where': 'Capturing the projects each organisation is providing and where',
'Catalog': 'Catalogue',
'Catalog added': 'Catalogue added',
@@ -27,17 +25,13 @@
'Catalog updated': 'Catalogue updated',
'Catalogs': 'Catalogues',
'Certifying Organization': 'Certifying Organisation',
-'Client IP': 'Client IP',
-'Comments': 'Comments',
'Competency Rating Catalog': 'Competency Rating Catalogue',
'Configure resources to synchronize, update methods and policies': 'Configure resources to synchronise, update methods and policies',
'Confirming Organization': 'Confirming Organization',
'Course Catalog': 'Course Catalogue',
'Create New Catalog': 'Create New Catalogue',
'Create New Catalog Item': 'Create New Catalogue Item',
'Create new Organization': 'Create new Organisation',
-'Created By': 'Created By',
-'Created On': 'Created On',
'Credentialling Organization': 'Credentialling Organisation',
'Current owning Organization': 'Current owning Organization',
'Delete Catalog': 'Delete Catalogue',
@@ -46,22 +40,17 @@
'Delete Organization Domain': 'Delete Organisation Domain',
'Delete Organization Type': 'Delete Organisation Type',
'Department Catalog': 'Department Catalogue',
-'Description': 'Description',
-'E-mail': 'E-mail',
'Edit Catalog': 'Edit Catalogue',
'Edit Catalog Item': 'Edit Catalogue Item',
'Edit Organization': 'Edit Organisation',
'Edit Organization Domain': 'Edit Organisation Domain',
'Edit Organization Type': 'Edit Organisation Type',
'Edit Project Organization': 'Edit Project Organisation',
'Edit Synchronization Settings': 'Edit Synchronisation Settings',
-'enter an integer between %(min)g and %(max)g': 'enter an integer between %(min)g and %(max)g',
'Enter your organization': 'Enter your organisation',
-'First name': 'First name',
'From Organization': 'From Organisation',
'Funding Organization': 'Funding Organisation',
'Funds Contributed by this Organization': 'Funds Contributed by this Organisation',
-'Group ID': 'Group ID',
'Hair Color': 'Hair Colour',
'Identifier which the repository identifies itself with when sending synchronization requests.': 'Identifier which the repository identifies itself with when sending synchronisation requests.',
"If this field is populated then a user who specifies this Organization when signing up will be assigned as a Staff of this Organization unless their domain doesn't match the domain field.": "If this field is populated then a user who specifies this Organisation when signing up will be assigned as a Staff of this Organisation unless their domain doesn't match the domain field.",
@@ -72,12 +61,10 @@
'In Catalogs': 'In Catalogues',
'Intergovernmental Organization': 'Intergovernmental Organisation',
'International Organization': 'International Organisation',
-'Is Active': 'Is Active',
'Item Catalog Details': 'Item Catalogue Details',
'Item Catalogs': 'Item Catalogues',
'Item Catalogues': 'Item Catalogues',
'Job Role Catalog': 'Job Role Catalogue',
-'Last name': 'Last name',
'Last Synchronization': 'Last Synchronisation',
'Last synchronized on': 'Last synchronised on',
'List All Organization Approvers & Whitelists': 'List All Organisation Approvers & Whitelists',
@@ -88,8 +75,6 @@
'Logo of the organization. This should be a png or jpeg file and it should be no larger than 400x400': 'Logo of the organisation. This should be a png or jpeg file and it should be no larger than 400x400',
'Manual Synchronization': 'Manual Synchronisation',
'Matching Catalog Items': 'Matching Catalogue Items',
-'Modified By': 'Modified By',
-'Modified On': 'Modified On',
'Monetization': 'Monetisation',
'Monetization Report': 'Monetisation Report',
'No Catalog Items currently registered': 'No Catalogue Items currently registered',
@@ -99,7 +84,6 @@
'No Organization Types currently registered': 'No Organisation Types currently registered',
'No Organizations currently registered': 'No Organisations currently registered',
'No Organizations for this Project': 'No Organisations for this Project',
-'Office/Warehouse/Facility': 'Office/Warehouse/Facility',
'Organization': 'Organisation',
'Organization added': 'Organisation added',
'Organization added to Project': 'Organisation added to Project',
@@ -124,19 +108,13 @@
'Organization/Supplier': 'Organisation/Supplier',
'Organizational Development': 'Organisational Development',
'Organizations': 'Organisations',
-'Origin': 'Origin',
-'Password': 'Password',
"Phone number to donate to this organization's relief efforts.": "Phone number to donate to this organisation's relief efforts.",
-'Please use this field to record any additional information, including a history of the record if it is updated.': 'Please use this field to record any additional information, including a history of the record if it is updated.',
'Position Catalog': 'Position Catalogue',
'Project Details including organizations': 'Project Details including organisations',
'Project Details including organizations and communities': 'Project Details including organisations and communities',
'Project Organization Details': 'Project Organisation Details',
'Project Organization updated': 'Project Organisation updated',
'Project Organizations': 'Project Organisations',
-'Registration key': 'Registration key',
-'Resource Management System': 'Resource Management System',
-'Role': 'Role',
'Schedule synchronization jobs': 'Schedule synchronisation jobs',
'Search by organization.': 'Search by organisation.',
'Search for an Organization by name or acronym': 'Search for an Organisation by name or acronym',
@@ -161,14 +139,11 @@
'The default Organization for whom you are acting.': 'The default Organisation for whom you are acting.',
'The Organization Registry keeps track of all the relief organizations working in the area.': 'The Organisation Registry keeps track of all the relief organisations working in the area.',
'The synchronization module allows the synchronization of data resources between Sahana Eden instances.': 'The synchronisation module allows the synchronisation of data resources between Sahana Eden instances.',
-'Timestamp': 'Timestamp',
'Transfer ownership to Organization': 'Transfer ownership to Organisation',
"Type the name of an existing catalog item OR Click 'Add New Item' to add an item which is not in the catalog.": "Type the name of an existing catalogue item OR Click 'Add New Item' to add an item which is not in the catalogue.",
'Under which condition a local record shall be updated if it also has been modified locally since the last synchronization': 'Under which condition a local record shall be updated if it also has been modified locally since the last synchronisation',
'Unique identifier which THIS repository identifies itself with when sending synchronization requests.': 'Unique identifier which THIS repository identifies itself with when sending synchronisation requests.',
'User Guidelines Synchronization': 'User Guidelines Synchronisation',
-'User ID': 'User ID',
-'UTC Offset': 'UTC Offset',
'Utilization Report': 'Utilisation Report',
'Year that the organization was founded': 'Year that the organisation was founded',
}
View
@@ -286,7 +286,6 @@ def stats_update_time_aggregate(cls, data_id=None):
query = (dtable.deleted != True) & \
(dtable.approved_by != None)
records = db(query).select()
- return
elif isinstance(data_id, Rows):
records = data_id
elif not isinstance(data_id, Row):
@@ -311,7 +310,7 @@ def stats_update_time_aggregate(cls, data_id=None):
parameter_id = record.parameter_id
# Exit if either the location or the parameter is not valid
if not location_id or not parameter_id:
- return
+ continue
(start_date, end_date) = stats_aggregated_period(record.date)
# Get all the stats_data records for this location and parameter
@@ -346,7 +345,7 @@ def stats_update_time_aggregate(cls, data_id=None):
# The newly added indicator is the one currently stored
# in data but a more recent value is held on the database
# This will not change any of the aggregated data
- return
+ break
if start_date < earliest_period:
earliest_period = start_date
# Store the record from the db in the data storage
@@ -530,23 +529,24 @@ def stats_update_time_aggregate(cls, data_id=None):
parents_data = {}
for (param_id, loc_dict) in param_location_dict.items():
for (loc_id, periods) in loc_dict.items():
- for p_loc_row in parents[loc_id]:
- p_loc_id = p_loc_row.id
- if param_id in parents_data:
- if p_loc_id in parents_data[param_id]:
- # store the older of the changed periods (the end will always be None)
- # Only need to check the start date of the first period
- if periods[0][0] < parents_data[param_id][p_loc_id][0][0][0]:
- parents_data[param_id][p_loc_id][0] = periods
+ if loc_id in parents: # There won't be a parent if this is a L0
+ for p_loc_row in parents[loc_id]:
+ p_loc_id = p_loc_row.id
+ if param_id in parents_data:
+ if p_loc_id in parents_data[param_id]:
+ # store the older of the changed periods (the end will always be None)
+ # Only need to check the start date of the first period
+ if periods[0][0] < parents_data[param_id][p_loc_id][0][0][0]:
+ parents_data[param_id][p_loc_id][0] = periods
+ else:
+ parents_data[param_id][p_loc_id] = [periods,
+ loc_level_list[loc_id]
+ ]
else:
- parents_data[param_id][p_loc_id] = [periods,
- loc_level_list[loc_id]
- ]
- else:
- parents_data[param_id] = {p_loc_id : [periods,
- loc_level_list[loc_id]
- ]
- }
+ parents_data[param_id] = {p_loc_id : [periods,
+ loc_level_list[loc_id]
+ ]
+ }
# OPTIMISATION step 2
@@ -570,7 +570,6 @@ def stats_update_time_aggregate(cls, data_id=None):
else:
resilence_parents[p_loc_id] = [periods, loc_level_list[loc_id], False]
- #print "%s %s %s %s" % (len(location_dict), len(parents), len(parents_data), len(resilence_parents))
# Now that the time aggregate types have been set up correctly,
# fire off requests for the location aggregates to be calculated
async = current.s3task.async
View
@@ -2953,7 +2953,10 @@ def htmlConfig(html,
"alert" : [2,10,13]}
dt_text_maximum_len: The maximum length of text before it is condensed
dt_text_condense_len: The length displayed text is condensed down to
- dt_shrink_groups: If true then the rows within a group will be hidden
+ dt_shrink_groups: If set then the rows within a group will be hidden
+ two types are supported, 'individulal' and 'accordion'
+ dt_group_types: The type of indicator for groups that can be 'shrunk'
+ Permitted valies are: 'icon' (the default) 'text' and 'none'
@global current.response.s3.actions used to get the RowActions
"""
@@ -3028,6 +3031,7 @@ def htmlConfig(html,
config.textMaxLength = attr.get("dt_text_maximum_len", 80)
config.textShrinkLength = attr.get("dt_text_condense_len", 75)
config.shrinkGroupedRows = attr.get("dt_shrink_groups", "false")
+ config.groupIcon = attr.get("dt_group_types", [])
# Wrap the table in a form and add some data in hidden fields
form = FORM()
if not s3.no_formats and len(html) > 0:
@@ -158,15 +158,21 @@ stats,group_type,Vulnerability/stats_group_type.csv,group_type.xsl
# Add sample locations, the indicators and data
vulnerability,aggregated_indicator,Vulnerability/aggregated_indicator.csv,aggregated_indicator.xsl
vulnerability,indicator,Vulnerability/indicator.csv,indicator.xsl
-vulnerability,data,Vulnerability/vulnerability_data_short.csv,data.xsl
-#vulnerability,data,Vulnerability/vulnerability_data.csv,data.xsl
-#vulnerability,data,Vulnerability/vulnerability_data_historical_A.csv,data.xsl
-#vulnerability,data,Vulnerability/vulnerability_data_historical_B.csv,data.xsl
+# The vulnerability data comes in three flavours:
+# * fast: which is a very small subset enabling to see the system without impacting on prepop times
+# * short: sufficient data to properly test the system, grab your coffee (5 minutes)
+# * long: lots of data, have lunch (40 minutes)
+# In addition there is a historical data set used for the analysis
+vulnerability,data,Vulnerability/vulnerability_data_fast.csv,data.xsl
+#vulnerability,data,Vulnerability/vulnerability_data_short.csv,data.xsl
+#vulnerability,data,Vulnerability/vulnerability_data_historical_short.csv,data.xsl
#vulnerability,data,Vulnerability/vulnerability_data_long.csv,data.xsl
+#vulnerability,data,Vulnerability/vulnerability_data_historical_long.csv,data.xsl
# Demographics (needs to be after Vulnerability)
+# Demographic flavours mirror the vulnerability ones
stats,demographic,IFRC/stats_demographic.csv,demographic.xsl
-stats,demographic_data,Vulnerability/demographic_data_short.csv,demographic_data.xsl
-#stats,demographic_data,Vulnerability/demographic_data.csv,demographic_data.xsl
+stats,demographic_data,Vulnerability/demographic_data_fast.csv,demographic_data.xsl
+#stats,demographic_data,Vulnerability/demographic_data_short.csv,demographic_data.xsl
#stats,demographic_data,Vulnerability/demographic_data_long.csv,demographic_data.xsl
#*,stats_rebuild_aggregates,
# END -------------------------------------------------------------------------
Oops, something went wrong.

0 comments on commit f21ad7b

Please sign in to comment.