From 1b43d822cce91422154d5935c189ac2147c98313 Mon Sep 17 00:00:00 2001 From: Sean Date: Mon, 19 Mar 2018 18:05:02 -0400 Subject: [PATCH] incorporate pr 846 --- static/js/taxbrain-tablebuilder.js | 58 ++++++++++++++++-------------- webapp/apps/taxbrain/views.py | 3 +- 2 files changed, 33 insertions(+), 28 deletions(-) diff --git a/static/js/taxbrain-tablebuilder.js b/static/js/taxbrain-tablebuilder.js index 08bc8396..cf45843b 100644 --- a/static/js/taxbrain-tablebuilder.js +++ b/static/js/taxbrain-tablebuilder.js @@ -103,35 +103,39 @@ $(function() { }, rowLabels: function() { + // TODO: retrieve labels from the context and display them instead of hardcode labels here if (this.get('grouping') == 'bin') { - return [ - '<$10K', - '$10-20K', - '$20-30K', - '$30-40K', - '$40-50K', - '$50-75K', - '$75-100K', - '$100-200K', - '$200-500K', - '$500-1000K', - '>$1000K', - 'All' - ]; + return ['<$0K', + '=$0K', + '$0-10K', + '$10-20K', + '$20-30K', + '$30-40K', + '$40-50K', + '$50-75K', + '$75-100K', + '$100-200K', + '$200-500K', + '$500-1000K', + '>$1000K', + 'ALL']; } else if (this.get('grouping') == 'dec') { - return [ - '0-10', - '10-20', - '20-30', - '30-40', - '40-50', - '50-60', - '60-70', - '70-80', - '80-90', - '90-100', - 'All' - ]; + return ['0-10n', + '0-10z', + '0-10p', + '10-20', + '20-30', + '30-40', + '40-50', + '50-60', + '60-70', + '70-80', + '80-90', + '90-100', + 'ALL', + '90-95', + '95-99', + 'Top 1%']; } } }); diff --git a/webapp/apps/taxbrain/views.py b/webapp/apps/taxbrain/views.py index 36e78457..b01725ab 100644 --- a/webapp/apps/taxbrain/views.py +++ b/webapp/apps/taxbrain/views.py @@ -717,7 +717,8 @@ def get_result_context(model, request, url): tables['cdf_bin'] = tables.pop('diff_comb_xbin') json_table = json.dumps(tables) - + # TODO: Add row labels for decile and income bin tables to the context here + # and display these instead of hardcode in the javascript context = { 'locals':locals(), 'unique_url':url,