Skip to content

Commit

Permalink
Merge pull request #6594 from thelostone-mc/master
Browse files Browse the repository at this point in the history
stable -> master
  • Loading branch information
octavioamu authored May 5, 2020
2 parents fab46b4 + 0c3d685 commit 150bea9
Show file tree
Hide file tree
Showing 35 changed files with 53,709 additions and 67 deletions.
1 change: 1 addition & 0 deletions app/assets/v2/css/activity_stream.css
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
.status_background_container {
margin-top: 1em;
position: relative;
min-width: 100%;
}

.image-text-container {
Expand Down
5,288 changes: 5,288 additions & 0 deletions app/assets/v2/images/results/GMV.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5,286 changes: 5,286 additions & 0 deletions app/assets/v2/images/results/av-reward.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5,294 changes: 5,294 additions & 0 deletions app/assets/v2/images/results/avg-check.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5,419 changes: 5,419 additions & 0 deletions app/assets/v2/images/results/avg-contribution.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5,253 changes: 5,253 additions & 0 deletions app/assets/v2/images/results/hackathons.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5,523 changes: 5,523 additions & 0 deletions app/assets/v2/images/results/length.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5,325 changes: 5,325 additions & 0 deletions app/assets/v2/images/results/matching_rounds.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5,309 changes: 5,309 additions & 0 deletions app/assets/v2/images/results/no-contributions.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5,384 changes: 5,384 additions & 0 deletions app/assets/v2/images/results/no-contributors.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5,370 changes: 5,370 additions & 0 deletions app/assets/v2/images/results/no-f-hackers.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion app/assets/v2/js/pages/quests.helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ $(document).ready(function() {

$('.give_feedback').on('click', async function(e) {
e.preventDefault();
var feedback = prompt('Any comments for the quest author? (optional)', 'Feedback: ');
var feedback = prompt('Any comments for the quest author? (optional)', '');
var polarity = $(this).data('direction');

var params = {
Expand Down
2 changes: 1 addition & 1 deletion app/assets/v2/js/pages/results.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function drawChart() {
backgroundColor: 'transparent',
height: 400,
width: width,
vAxis: { title: 'USD', ticks: [ 0, 10000, 50000, 100000, 150000, 200000, 250000, 300000, 350000, document.max_bounty_history ], format: 'short', gridlines: { color: 'transparent' } }
vAxis: { title: 'USD', ticks: [ 0, 10000, 100000, 200000, 300000, 400000, 500000, 600000, document.max_bounty_history ], format: 'short', gridlines: { color: 'transparent' } }
};

var chart = new google.visualization.ColumnChart(document.getElementById('bounty_universe_chart'));
Expand Down
7 changes: 5 additions & 2 deletions app/dashboard/management/commands/send_bulk_tips.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def handle(self, *args, **options):
network = 'mainnet' if not settings.DEBUG else 'rinkeby'
actually_send = not settings.DEBUG
usernames = options['usernames'].split(",")
amount = options['amount']
_amount = options['amount']
DECIMALS = 18
from_address = settings.TIP_PAYOUT_ADDRESS
from_pk = settings.TIP_PAYOUT_PRIVATE_KEY
Expand Down Expand Up @@ -118,7 +118,7 @@ def handle(self, *args, **options):
contract = w3.eth.contract(Web3.toChecksumAddress(TOKEN_ADDRESS), abi=abi)
address = Web3.toChecksumAddress(address)

amount = int(amount * 10**DECIMALS)
amount = int(_amount * 10**DECIMALS)
tx_id = '0x0'
if actually_send:
tx = contract.functions.transfer(address, amount).buildTransaction({
Expand Down Expand Up @@ -172,6 +172,9 @@ def handle(self, *args, **options):
receive_tx_status='pending',
receive_txid=tx_id,
receive_address=profile.preferred_payout_address,
tx_time=timezone.now(),
receive_tx_time=timezone.now(),
received_on=timezone.now(),
)
tip.trigger_townsquare()
maybe_market_tip_to_github(tip)
Expand Down
2 changes: 1 addition & 1 deletion app/dashboard/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -4793,7 +4793,7 @@ class Earning(SuperModel):

from_profile = models.ForeignKey('dashboard.Profile', related_name='sent_earnings', on_delete=models.CASCADE, db_index=True, null=True)
to_profile = models.ForeignKey('dashboard.Profile', related_name='earnings', on_delete=models.CASCADE, db_index=True, null=True)
org_profile = models.ForeignKey('dashboard.Profile', related_name='org_earnings', on_delete=models.CASCADE, db_index=True, null=True)
org_profile = models.ForeignKey('dashboard.Profile', related_name='org_earnings', on_delete=models.CASCADE, db_index=True, null=True, blank=True)
value_usd = models.DecimalField(decimal_places=2, max_digits=50, null=True)
source_type = models.ForeignKey(ContentType, on_delete=models.CASCADE)
source_id = models.PositiveIntegerField()
Expand Down
6 changes: 6 additions & 0 deletions app/dashboard/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,14 @@ def _get_utm_from_cookie(request):
"""
utmDict = {}
utm_source = request.COOKIES.get('utm_source')
if not utm_source:
utm_source = request.GET.get('utm_source')
utm_medium = request.COOKIES.get('utm_medium')
if not utm_medium:
utm_medium = request.GET.get('utm_medium')
utm_campaign = request.COOKIES.get('utm_campaign')
if not utm_campaign:
utm_campaign = request.GET.get('utm_campaign')

if utm_source:
utmDict['utm_source'] = utm_source
Expand Down
5 changes: 2 additions & 3 deletions app/dashboard/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -2843,9 +2843,8 @@ def profile(request, handle, tab=None):
context['feedbacks_got'] = [fb.pk for fb in profile.feedbacks_got.all() if fb.visible_to(request.user)]
context['all_feedbacks'] = context['feedbacks_got'] + context['feedbacks_sent']
context['tags'] = [('#announce','bullhorn'), ('#mentor','terminal'), ('#jobs','code'), ('#help','laptop-code'), ('#other','briefcase'), ]

context['followers'] = TribeMember.objects.filter(org=request.user.profile) if request.user.is_authenticated and hasattr(request.user, 'profile') else []
context['following'] = TribeMember.objects.filter(profile=request.user.profile) if request.user.is_authenticated and hasattr(request.user, 'profile') else []
context['followers'] = TribeMember.objects.filter(org=request.user.profile) if request.user.is_authenticated else TribeMember.objects.none()
context['following'] = TribeMember.objects.filter(profile=request.user.profile) if request.user.is_authenticated else TribeMember.objects.none()
context['foltab'] = request.GET.get('sub', 'followers')

active_tab = 0
Expand Down
12 changes: 9 additions & 3 deletions app/grants/clr.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@
from marketing.models import Stat
from perftools.models import JSONStore

CLR_START_DATE = dt.datetime(2020, 3, 23, 0, 0)
CLR_START_DATE = dt.datetime(2020, 5, 6, 0, 0)

ROUND_5_5_GRANTS = [656, 493, 494, 502, 504, 662]

# TODO: MOVE TO DB
THRESHOLD_TECH = 20.0
Expand All @@ -40,7 +42,7 @@

TOTAL_POT_TECH = 101000.0
TOTAL_POT_MEDIA = 50120.0 #50k + 120 from negative voting per https://twitter.com/owocki/status/1249420758167588864
TOTAL_POT_HEALTH = 100000.0
TOTAL_POT_HEALTH = 50000.0

'''
Helper function that translates existing grant data structure
Expand Down Expand Up @@ -278,7 +280,11 @@ def populate_data_for_clr(clr_type=None, network='mainnet', mechanism='profile')
# get all the eligible contributions and calculate total
contributions = Contribution.objects.prefetch_related('subscription').filter(match=True, created_on__gte=CLR_START_DATE, created_on__lte=from_date, success=True)

if clr_type == 'tech':
if ROUND_5_5_GRANTS:
grants = Grant.objects.filter(id__in=ROUND_5_5_GRANTS)
threshold = THRESHOLD_HEALTH
total_pot = TOTAL_POT_HEALTH
elif clr_type == 'tech':
grants = Grant.objects.filter(network=network, hidden=False, active=True, grant_type='tech', link_to_new_grant=None)
threshold = THRESHOLD_TECH
total_pot = TOTAL_POT_TECH
Expand Down
12 changes: 11 additions & 1 deletion app/grants/templates/grants/card/clr_match.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,21 @@

<div class="clr">
<h2 class="label font-caption font-weight-semibold mb-1 p-1 text-center">
{% if is_round_5_5 %}
CLR MATCH ROUND 5.5
{% else %}
CLR MATCH ROUND 5
{% endif %}
</h2>

<h2 class="font-title font-weight-bold amount pt-1 mb-0">
{{ grant.clr_prediction_curve.0.1|floatformat:0|intcomma|default:0 }} DAI
</h2>
<p class="amount mb-2 font-caption font-weight-semibold">FINAL AMOUNT</p>
<p class="amount mb-2 font-caption font-weight-semibold">
{% if is_round_5_5 %}
CURRENT MATCH
{% else %}
FINAL AMOUNT
{% endif %}
</p>
</div>
14 changes: 12 additions & 2 deletions app/grants/templates/grants/card/front.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@ <h2 class="grant-item__title font-subheader"><a href="{% url 'grants:details' gr
<div class="clr mb-3">
<div class="match__round pb-1 pt-2 mb-2">
<h2 class="title col-8 font-caption g-bold">
CLR MATCH ROUND 5
{% if grant.id in round_5_5_grants %}
CLR MATCH ROUND 5.5
{% else %}
CLR MATCH ROUND 5
{% endif %}
</h2>
</div>
<div class="col-6 float-right">
Expand All @@ -69,7 +73,13 @@ <h2 class="font-title font-weight-bold amount pt-1 mb-2">
<h2 class="font-title font-weight-bold amount pt-1 mb-2">
{{ grant.clr_prediction_curve.0.1|floatformat:0|intcomma|default:0 }} DAI
</h2>
<p class="amount mb-2 font-caption font-weight-semibold">Final CLR Match</p>
<p class="amount mb-2 font-caption font-weight-semibold">
{% if grant.id in round_5_5_grants %}
Current Round 5.5 Match
{% else %}
Final CLR Match
{% endif %}
</p>
</div>
</div>
<div class="col-12 pb-4">
Expand Down
7 changes: 6 additions & 1 deletion app/grants/templates/grants/detail/info.html
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,12 @@ <h1 class="font-title-xl my-4 font-weight-bold">
</div>

<div class="col-6 text-center text-xl-left offset-xl-0 col-xl-6">
<p class="sub-title mb-1 font-weight-semibold font-caption mb-1 pt-1">ROUND 5</p>
<p class="sub-title mb-1 font-weight-semibold font-caption mb-1 pt-1">
{% if is_round_5_5 %}
ROUND 5.5
{% else %}
ROUND 5
{% endif %}</p>
<p class="font-subtitle mb-0">
<span class="font-weight-bold">
{{grant.amount_received_in_round|floatformat:0|intcomma}} DAI
Expand Down
21 changes: 12 additions & 9 deletions app/grants/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,14 @@
w3 = Web3(HTTPProvider(settings.WEB3_HTTP_PROVIDER))

clr_matching_banners_style = 'pledging'
matching_live = '(💰$250K Match LIVE!) '
live_now = '❇️ LIVE NOW! Up to $250k Matching Funding on Gitcoin Grants'
matching_live = '(💰$50K Match LIVE!) '
live_now = '❇️ LIVE NOW! Up to $50k Matching Funding on Gitcoin Grants'
matching_live_tiny = '💰'
total_clr_pot = 250000
clr_round = 5
clr_active = False
clr_active = True
show_clr_card = True
round_5_5_grants = [656, 493, 494, 502, 504, 662] # special grants for round 5.5
# Round Schedule
# from canonical source of truth https://gitcoin.co/blog/gitcoin-grants-round-4/
# Round 5 - March 23th — April 7th 2020
Expand Down Expand Up @@ -151,9 +152,9 @@ def get_stats(round_type):
'type': 'line',
'stacking': False
},
'terms':
'terms':
['val']

}],
chart_options =
{'title': {
Expand Down Expand Up @@ -223,7 +224,7 @@ def grants_addr_as_json(request):
@cache_page(60 * 60)
def grants_stats_view(request):
cht, chart_list = get_stats(request.GET.get('category'))
params = {
params = {
'cht': cht,
'chart_list': chart_list,
'round_types': round_types,
Expand Down Expand Up @@ -295,7 +296,7 @@ def grants(request):

if category:
_grants = _grants.filter(Q(categories__category__icontains = category))

_grants = _grants.prefetch_related('categories')
paginator = Paginator(_grants, limit)
grants = paginator.get_page(page)
Expand Down Expand Up @@ -329,7 +330,7 @@ def grants(request):
all_grants_count = Grant.objects.filter(
network=network, hidden=False
).count()


categories = [_category[0] for _category in basic_grant_categories(grant_type)]

Expand Down Expand Up @@ -387,7 +388,8 @@ def grants(request):
'clr_round': clr_round,
'show_past_clr': show_past_clr,
'is_staff': request.user.is_staff,
'selected_category': category
'selected_category': category,
'round_5_5_grants': round_5_5_grants
}

# log this search, it might be useful for matching purposes down the line
Expand Down Expand Up @@ -532,6 +534,7 @@ def grant_details(request, grant_id, grant_slug):
'is_team_member': is_team_member,
'voucher_fundings': voucher_fundings,
'is_unsubscribed_from_updates_from_this_grant': is_unsubscribed_from_updates_from_this_grant,
'is_round_5_5': grant.id in round_5_5_grants,
'options': [(f'Email Grant Funders ({grant.contributor_count})', 'bullhorn', 'Select this option to email your status update to all your funders.')] if is_team_member else [],
}

Expand Down
23 changes: 23 additions & 0 deletions app/kudos/migrations/0014_auto_20200505_1330.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Generated by Django 2.2.4 on 2020-05-05 13:30

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('kudos', '0013_bulktransfercoupon_make_paid_for_first_hours'),
]

operations = [
migrations.AddField(
model_name='token',
name='hidden_token_details_page',
field=models.BooleanField(default=False, help_text='Hide token details page'),
),
migrations.AlterField(
model_name='token',
name='hidden',
field=models.BooleanField(default=False, help_text='Hide from marketplace?'),
),
]
3 changes: 2 additions & 1 deletion app/kudos/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@ class Meta:
contract = models.ForeignKey(
'kudos.Contract', related_name='kudos_contract', on_delete=models.SET_NULL, null=True
)
hidden = models.BooleanField(default=False)
hidden = models.BooleanField(default=False, help_text=('Hide from marketplace?'))
hidden_token_details_page = models.BooleanField(default=False, help_text=('Hide token details page'))
send_enabled_for_non_gitcoin_admins = models.BooleanField(default=True)
preview_img_mode = models.CharField(max_length=255, default='png')
suppress_sync = models.BooleanField(default=False)
Expand Down
3 changes: 3 additions & 0 deletions app/kudos/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,9 @@ def details(request, kudos_id, name):
kudos = get_object_or_404(Token, pk=kudos_id)
num_kudos_limit = 100

if kudos.hidden_token_details_page:
raise Http404

context = {
'send_enabled': kudos.send_enabled_for(request.user),
'is_outside': True,
Expand Down
4 changes: 3 additions & 1 deletion app/marketing/mails.py
Original file line number Diff line number Diff line change
Expand Up @@ -1119,6 +1119,8 @@ def reject_faucet_request(fr):


def new_bounty_daily(bounties, old_bounties, to_emails=None):
from marketing.views import trending_quests

if not bounties:
return
max_bounties = 10
Expand Down Expand Up @@ -1152,7 +1154,7 @@ def new_bounty_daily(bounties, old_bounties, to_emails=None):
try:
setup_lang(to_email)
from_email = settings.CONTACT_EMAIL
html, text = render_new_bounty(to_email, bounties, old_bounties)
html, text = render_new_bounty(to_email, bounties, old_bounties, trending_quests=trending_quests())

if not should_suppress_notification_email(to_email, 'new_bounty_notifications'):
send_mail(from_email, to_email, subject, text, html, categories=['marketing', func_name()])
Expand Down
4 changes: 2 additions & 2 deletions app/perftools/management/commands/create_page_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,13 +260,13 @@ class Command(BaseCommand):
help = 'generates some /results data'

def handle(self, *args, **options):
create_top_grant_spenders_cache()
create_results_cache()
if not settings.DEBUG:
create_hidden_profiles_cache()
create_tribes_cache()
create_activity_cache()
create_post_cache()
create_results_cache()
create_top_grant_spenders_cache()
create_avatar_cache()
create_quests_cache()
create_grants_cache()
Expand Down
2 changes: 1 addition & 1 deletion app/quests/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def record_award_helper(qa, profile, layer=1, action='Beat', value_multiplier=1)
return

# record points
value = abs(value_multiplier * qa.quest.value/(2**(layer-1)))
value = abs(value_multiplier * qa.quest.value/(10**(layer-1)))
from quests.views import current_round_number
QuestPointAward.objects.create(
questattempt=qa,
Expand Down
20 changes: 5 additions & 15 deletions app/quests/templates/quests/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -138,22 +138,12 @@ <h2 style="margin-top: -50px; font-size: 20px;">
<h1 id=leaderboard style="margin-top: 100px;">Leaderboard</h1>
<div id="announce">
<img class="mr-1" data-src="{% static "v2/images/quests/enemies/samurai.svg" %}">
<h4><strong>Round 3 Challenge ended on 1/30!</strong></h4>
<p class="mb-0">Congratulations to</p>
<ol style='display: inline-block; margin: 0px auto;'>
{% for rw in latest_round_winners %}
<li>
<a href="/profile/@{{rw}}">
@{{rw}}
</a>
</li>
{% endfor %}
</ol>
<p>
They have <strong>a $60 prize</strong> and a <i>very special Kudos</i>.
<h4><strong>Round 4 Challenge ended on 4/30!</strong></h4>
<p class="mb-0">
Congrats to the winners, <a href="https://github.com/gitcoinco/web/issues/6574" target="new">announced here</a>
</p>
<h5 class="mt-1 pt-0"><strong>Round 4 Challenge is now Live!</strong></h5>
<p class="mb-3">Whomever is in the top 3 of the <a href="#leaderboard">leaderboard</a> at end of day on 4/30/2020 will <strong>win a special 60 DAI prize</strong> and a <i>very special Kudos</i>.
<h5 class="mt-1 pt-0"><strong>Round 5 Challenge is now Live!</strong></h5>
<p class="mb-3">Starting with round 5, we will have more advanced anti-cheating congrats + will no longer be rewarding referrals as much. Whomever is in the top 3 of the <a href="#leaderboard">leaderboard</a> at end of day on 7/30/2020 will <strong>win a special 60 DAI prize</strong> and a <i>very special Kudos</i>.
</div>

</div>
Expand Down
2 changes: 1 addition & 1 deletion app/quests/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

logger = logging.getLogger(__name__)

current_round_number = 4
current_round_number = 5


def next_quest(request):
Expand Down
Loading

0 comments on commit 150bea9

Please sign in to comment.