From 9e704a0772b77750fc5d012b599f99831c6e1a85 Mon Sep 17 00:00:00 2001 From: owocki Date: Tue, 20 Oct 2020 13:06:28 -0600 Subject: [PATCH 1/2] migrates results page to consolidate the story --- app/assets/v2/css/results.css | 2 +- app/retail/templates/results.html | 9 +++------ app/retail/utils.py | 25 +++++++++++++------------ 3 files changed, 17 insertions(+), 19 deletions(-) diff --git a/app/assets/v2/css/results.css b/app/assets/v2/css/results.css index 79e2a24be35..0f953ec29c6 100644 --- a/app/assets/v2/css/results.css +++ b/app/assets/v2/css/results.css @@ -1,7 +1,7 @@ ..box { width: 20px; height: 20px; - margin-right: 10px; + margin-right: 5px; } .navbar { diff --git a/app/retail/templates/results.html b/app/retail/templates/results.html index 0a8ef5c07df..cf90ca33c95 100644 --- a/app/retail/templates/results.html +++ b/app/retail/templates/results.html @@ -59,12 +59,9 @@

{% trans "Broken Down by Month" %}

{% trans "and by Type" %}

-

   {% trans "Bounties" %}

-

   {% trans "Tips" %}

-

   {% trans "Grants" %}

-

   {% trans "Kudos" %}

-

   {% trans "Ads" %}

-

   {% trans "Ecosystem" %}

+

   {% trans "Hackathons" %}

+

   {% trans "Grants" %}

+

   {% trans "Other" %}

diff --git a/app/retail/utils.py b/app/retail/utils.py index b0654896873..716429dc172 100644 --- a/app/retail/utils.py +++ b/app/retail/utils.py @@ -92,12 +92,9 @@ def get_bounty_history_row(label, date, keyword): print(label, date, core_platform, keyword, bounties, tips, ecosystem) return [ label, - bounties, - tips, + bounties + tips, get_grants_history_at_date(date, keyword), - get_kudos_history_at_date(date, keyword), - codefund, - ecosystem, + codefund + ecosystem + get_kudos_history_at_date(date, keyword), ] @@ -356,14 +353,14 @@ def get_bounty_median_turnaround_time(func='turnaround_time_started', keyword=No def get_bounty_history(keyword=None, cumulative=True): bh = [ - ['', 'Bounties', 'Tips', 'Grants', 'Kudos', 'Ads', 'Ecosystem'], + ['', 'Hackathons', 'Grants', 'Old Products'], ] initial_stats = [ - ["December 2017", 5534, 2011, 0, 0, 0, 0], - ["January 2018", 15930, 5093, 0, 0, 0, 0], - ["February 2018", 16302, 7391, 0, 0, 0, 0], - ["March 2018", 26390, 8302, 0, 0, 0, 0], - ["April 2018", 37342, 10109, 0, 0, 0, 0], + ["December 2017", 5534 + 2011, 0, 0], + ["January 2018", 15930 + 5093, 0, 0], + ["February 2018", 16302 + 7391, 0, 0], + ["March 2018", 26390 + 8302, 0, 0], + ["April 2018", 37342 + 10109, 0, 0], ] if not keyword: bh = bh + initial_stats @@ -525,20 +522,24 @@ def get_kudos_leaderboard(key='kudos_token.artist'): # Bounties from marketing.models import ManualStat completion_rate = get_completion_rate(keyword) + pp.profile_time('completion_rate') funder_receiver_stats = get_funder_receiver_stats(keyword) + pp.profile_time('funder_receiver_stats') context['kudos_leaderboards'] = [ ['Top Kudos Artists 👩‍🎨', get_kudos_leaderboard('kudos_token.artist'), 'created'], ['Top Kudos Collectors 🖼', get_kudos_leaderboard('kudos_kudostransfer.username'), 'collected'], ['Top Kudos Senders 💌', get_kudos_leaderboard('kudos_kudostransfer.from_username'), 'sent'] ] + pp.profile_time('kudos_leaderboard') context['funders'] = funder_receiver_stats['funders'] context['avg_value'] = funder_receiver_stats['avg_value'] context['median_value'] = funder_receiver_stats['median_value'] context['transactions'] = funder_receiver_stats['transactions'] context['recipients'] = funder_receiver_stats['recipients'] + pp.profile_time('funder_receiver_stats2') context['mau'] = ManualStat.objects.filter(key='MAUs').order_by('-pk').values_list('val', flat=True)[0] context['audience'] = json.loads(context['members_history'])[-1][1] - pp.profile_time('completion_rate') + pp.profile_time('audience') bounty_abandonment_rate = round(100 - completion_rate, 1) total_bounties_usd = sum(base_bounties.exclude(idx_status__in=['expired', 'cancelled', 'canceled', 'unknown']).values_list('_val_usd_db', flat=True)) total_tips_usd = sum([ From 5ab46b52a2e5b09ec3266a6fd6473d1bc47882ff Mon Sep 17 00:00:00 2001 From: owocki Date: Tue, 20 Oct 2020 13:07:55 -0600 Subject: [PATCH 2/2] other --- app/retail/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/retail/utils.py b/app/retail/utils.py index 716429dc172..1f8c4e0def9 100644 --- a/app/retail/utils.py +++ b/app/retail/utils.py @@ -353,7 +353,7 @@ def get_bounty_median_turnaround_time(func='turnaround_time_started', keyword=No def get_bounty_history(keyword=None, cumulative=True): bh = [ - ['', 'Hackathons', 'Grants', 'Old Products'], + ['', 'Hackathons', 'Grants', 'Other'], ] initial_stats = [ ["December 2017", 5534 + 2011, 0, 0],