Skip to content

Commit 84a55e1

Browse files
committed
Merge remote-tracking branch 'upstream/master' into stable
2 parents f45c662 + b95f441 commit 84a55e1

File tree

12 files changed

+106
-93
lines changed

12 files changed

+106
-93
lines changed

app/assets/v2/js/grants/matching_funds.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,10 @@ Vue.mixin({
145145

146146
const chainId = Number(web3.eth.currentProvider.chainId);
147147

148-
if (chainId < 1 || chainId > 5) {
148+
// At this moment claims can only be completed on mainnet
149+
if (chainId !== 1) {
149150
waitingState(false);
150-
_alert('Please connect to a valid Ethereum network', 'danger');
151+
_alert('Please connect to Ethereum mainnet.', 'danger');
151152
return;
152153
}
153154

app/assets/v2/js/wallet.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,11 @@ async function fetchAccountData(provider) {
112112
// Load chain information over an HTTP API
113113
// const chainData = await EvmChains.getChain(chainId);
114114

115-
document.querySelector('.network-name').textContent = networkName;
116-
document.querySelector('.wallet-network').classList.remove('rinkeby', 'mainnet');
117-
document.querySelector('.wallet-network').classList.add(networkName.split(' ').join('-'));
115+
if (networkName) {
116+
document.querySelector('.network-name').textContent = networkName;
117+
document.querySelector('.wallet-network').classList.remove('rinkeby', 'mainnet');
118+
document.querySelector('.wallet-network').classList.add(networkName.split(' ').join('-'));
119+
}
118120

119121
document.querySelector('#wallet-btn').innerText = 'Change Wallet';
120122

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Generated by Django 2.2.24 on 2022-05-06 18:19
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('dashboard', '0201_merge_20220427_1416'),
10+
]
11+
12+
operations = [
13+
migrations.AddField(
14+
model_name='hackathonevent',
15+
name='discord_server',
16+
field=models.URLField(blank=True, help_text='Link to Discord server for Hackathon', null=True),
17+
),
18+
]

app/dashboard/models.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5071,6 +5071,7 @@ class HackathonEvent(SuperModel):
50715071
use_circle = models.BooleanField(help_text=_('Use circle for the Hackathon'), default=False)
50725072
visible = models.BooleanField(help_text=_('Can this HackathonEvent be seeing on /hackathons ?'), default=True)
50735073
total_prize = models.CharField(max_length=255, null=True, blank=True, help_text='extra text to display next the event dates on the hackathon list page')
5074+
discord_server = models.URLField(blank=True, null=True, help_text=_('Link to Discord server for Hackathon'))
50745075

50755076
default_channels = ArrayField(models.CharField(max_length=255), blank=True, default=list)
50765077
objects = HackathonEventQuerySet.as_manager()
@@ -5095,6 +5096,15 @@ def relative_url(self):
50955096
def town_square_link(self):
50965097
return f'townsquare/?tab=hackathon:{self.pk}'
50975098

5099+
def is_expired(self):
5100+
"""Check if Hackathon is active
5101+
5102+
Returns:
5103+
boolean: Whether or not hackathon is expired
5104+
"""
5105+
now = timezone.now()
5106+
return self.end_date < now
5107+
50985108
def get_absolute_url(self):
50995109
"""Get the absolute URL for the HackathonEvent.
51005110

app/dashboard/templates/dashboard/hackathon/onboard.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,16 @@ <h1 class="text-uppercase gc-letter-spacing font-weight-bold">
133133
{% elif is_registered and hackathon.start_date|timesince >= "1 min"%}
134134
<a class="btn btn-primary col-12" href="{% url 'hackathon' hackathon.slug %}">See Prizes</a>
135135
{% endif %}
136+
{% if hackathon.discord_server is not None %}
137+
<a
138+
type="button"
139+
class="btn btn-outline-primary col-12 mt-2"
140+
href="{{ hackathon.discord_server }}"
141+
target="_blank"
142+
>
143+
<i class="fab fa-discord mr-1"></i>Join Discord
144+
</a>
145+
{% endif %}
136146
{% endif %}
137147
</div>
138148
</div>

app/dashboard/templates/dashboard/index-vue.html

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -732,7 +732,20 @@ <h4 class="font-bigger-1 font-weight-bold mb-3">[[hackathon.name]] Wall of Fame<
732732
</div>
733733
<div class="d-none d-xl-block col-xl-2">
734734
<div id="sponsor_sidebar" class="font-body">
735-
<div class="sponsor-top"></div>
735+
<div class="sponsor-top">
736+
{% if hackathon.discord_server is not None %}
737+
<div class="d-flex align-items-center justify-content-center col-12">
738+
<a
739+
type="button"
740+
class="btn btn-primary"
741+
href="{{ hackathon.discord_server }}"
742+
target="_blank"
743+
>
744+
<i class="fab fa-discord mr-1"></i>Join Discord
745+
</a>
746+
</div>
747+
{% endif %}
748+
</div>
736749
<sponsor-tribes-widget v-if="hackathonSponsors.length > 0" inline-template>
737750
<div class="p-xl-2 p-4">
738751
<div class="offset-1 subheading left-ribbon">

app/dashboard/views.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4311,6 +4311,9 @@ def new_hackathon_bounty(request, hackathon=''):
43114311
except HackathonEvent.DoesNotExist:
43124312
return redirect(reverse('get_hackathons'))
43134313

4314+
if hackathon_event.is_expired():
4315+
return redirect(reverse('hackathon_onboard', args=(hackathon_event.slug,)))
4316+
43144317
bounty_params = {
43154318
'newsletter_headline': _('Be the first to know about new funded issues.'),
43164319
'issueURL': clean_bounty_url(request.GET.get('source') or request.GET.get('url', '')),

app/grants/serializers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class CLRMatchSerializer(FlexFieldsModelSerializer):
5353
class Meta:
5454
model = CLRMatch
5555
fields = (
56-
'pk', 'amount', 'round_number', 'claim_tx', 'grant_payout', 'ready_for_payout', 'merkle_claim'
56+
'pk', 'amount', 'token_amount', 'round_number', 'claim_tx', 'grant_payout', 'ready_for_payout', 'merkle_claim'
5757
)
5858

5959

@@ -65,7 +65,7 @@ class GrantSerializer(FlexFieldsModelSerializer):
6565
admin_profile = ProfileSerializer()
6666
team_members = ProfileSerializer(many=True)
6767
clr_matches = CLRMatchSerializer(
68-
fields=['pk', 'amount', 'round_number', 'claim_tx', 'grant_payout', 'ready_for_payout', 'merkle_claim'],
68+
fields=['pk', 'amount', 'token_amount', 'round_number', 'claim_tx', 'grant_payout', 'ready_for_payout', 'merkle_claim'],
6969
many=True
7070
)
7171

app/grants/templates/grants/_new.html

Lines changed: 39 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -279,14 +279,14 @@
279279
<div class="mb-3">
280280
<template v-if="chainId == 'eth'">
281281
<label class="font-subheader font-weight-light letter-spacing" for="eth_payout_address">
282-
Add ETH Recipient Wallet Address
282+
Add ETH Recipient's Wallet Address
283283
</label>
284284
<span class="font-smaller-2 py-1 font-weight-normal badge badge-greylight ml-2">required</span>
285285

286286
<p class="text-black-60 font-caption mb-2">
287287
IMPORTANT: This is the wallet address where contributions to this grant will be sent.<br>
288-
DO NOT use an exchange address — use a self-custody wallet address such as Metamask.<br>
289-
Adding an incorrect wallet address could mean that you dont receive your funds.
288+
DO NOT use an exchange address — use a self-custody wallet address such as MetaMask.<br>
289+
Adding an incorrect wallet address could mean that you don't receive your funds.
290290
</p>
291291

292292
<input id="eth_payout_address" v-model="form.eth_payout_address" name="eth_payout_address" class="form__input form__input-lg" maxlength="50" placeholder="0x0" required/>
@@ -315,12 +315,14 @@
315315

316316
<template v-if="chainId == 'celo'">
317317
<label class="font-subheader font-weight-light letter-spacing" for="celo_payout_address">
318-
Add CELO Recipient Wallet Address
318+
Add CELO Recipient's Wallet Address
319319
</label>
320320
<span class="font-smaller-2 py-1 font-weight-normal badge badge-greylight ml-2">required</span>
321321

322322
<p class="text-black-60 font-caption mb-2">
323-
This is where funds from contributors to this grant will be sent
323+
IMPORTANT: This is the wallet address where contributions to this grant will be sent.<br>
324+
DO NOT use an exchange address — use a self-custody wallet address such as MetaMask.<br>
325+
Adding an incorrect wallet address could mean that you don't receive your funds.
324326
</p>
325327

326328
<input id="celo_payout_address" v-model="form.celo_payout_address" name="celo_payout_address" class="form__input form__input-lg" maxlength="50" placeholder="0x0" required/>
@@ -332,12 +334,14 @@
332334

333335
<template v-if="chainId == 'zilliqa'">
334336
<label class="font-subheader font-weight-light letter-spacing" for="zil_payout_address">
335-
Add Zilliqa Recipient Wallet Address
337+
Add Zilliqa Recipient's Wallet Address
336338
</label>
337339
<span class="font-smaller-2 py-1 font-weight-normal badge badge-greylight ml-2">required</span>
338340

339341
<p class="text-black-60 font-caption mb-2">
340-
This is where funds from contributors to this grant will be sent
342+
IMPORTANT: This is the wallet address where contributions to this grant will be sent.<br>
343+
DO NOT use an exchange address — use a self-custody wallet address such as MetaMask.<br>
344+
Adding an incorrect wallet address could mean that you don't receive your funds.
341345
</p>
342346

343347
<input id="zil_payout_address" v-model="form.zil_payout_address" name="zil_payout_address" class="form__input form__input-lg" maxlength="50" placeholder="0x0" required/>
@@ -349,12 +353,14 @@
349353

350354
<template v-if="chainId == 'harmony'">
351355
<label class="font-subheader font-weight-light letter-spacing" for="harmony_payout_address">
352-
Add Harmony Recipient Wallet Address
356+
Add Harmony Recipient's Wallet Address
353357
</label>
354358
<span class="font-smaller-2 py-1 font-weight-normal badge badge-greylight ml-2">required</span>
355359

356360
<p class="text-black-60 font-caption mb-2">
357-
This is where funds from contributors to this grant will be sent
361+
IMPORTANT: This is the wallet address where contributions to this grant will be sent.<br>
362+
DO NOT use an exchange address — use a self-custody wallet address such as MetaMask.<br>
363+
Adding an incorrect wallet address could mean that you don't receive your funds.
358364
</p>
359365

360366
<input id="harmony_payout_address" v-model="form.harmony_payout_address" name="harmony_payout_address" class="form__input form__input-lg" maxlength="50" placeholder="0x0" required/>
@@ -366,12 +372,14 @@
366372

367373
<template v-if="chainId == 'binance'">
368374
<label class="font-subheader font-weight-light letter-spacing" for="binance_payout_address">
369-
Add Binance Recipient Wallet Address
375+
Add Binance Recipient's Wallet Address
370376
</label>
371377
<span class="font-smaller-2 py-1 font-weight-normal badge badge-greylight ml-2">required</span>
372378

373379
<p class="text-black-60 font-caption mb-2">
374-
This is where funds from contributors to this grant will be sent
380+
IMPORTANT: This is the wallet address where contributions to this grant will be sent.<br>
381+
DO NOT use an exchange address — use a self-custody wallet address such as MetaMask.<br>
382+
Adding an incorrect wallet address could mean that you don't receive your funds.
375383
</p>
376384

377385
<input id="binance_payout_address" v-model="form.binance_payout_address" name="binance_payout_address" class="form__input form__input-lg" maxlength="50" placeholder="0x0" required/>
@@ -383,12 +391,14 @@
383391

384392
<template v-if="chainId == 'polkadot'">
385393
<label class="font-subheader font-weight-light letter-spacing" for="polkadot_payout_address">
386-
Add Polkadot Recipient Wallet Address
394+
Add Polkadot Recipient's Wallet Address
387395
</label>
388396
<span class="font-smaller-2 py-1 font-weight-normal badge badge-greylight ml-2">required</span>
389397

390398
<p class="text-black-60 font-caption mb-2">
391-
This is where funds from contributors to this grant will be sent
399+
IMPORTANT: This is the wallet address where contributions to this grant will be sent.<br>
400+
DO NOT use an exchange address — use a self-custody wallet address such as MetaMask.<br>
401+
Adding an incorrect wallet address could mean that you don't receive your funds.
392402
</p>
393403

394404
<input id="polkadot_payout_address" v-model="form.polkadot_payout_address" name="polkadot_payout_address" class="form__input form__input-lg" maxlength="50" placeholder="0x0" required/>
@@ -400,12 +410,14 @@
400410

401411
<template v-if="chainId == 'kusama'">
402412
<label class="font-subheader font-weight-light letter-spacing" for="kusama_payout_address">
403-
Add Kusama Recipient Wallet Address
413+
Add Kusama Recipient's Wallet Address
404414
</label>
405415
<span class="font-smaller-2 py-1 font-weight-normal badge badge-greylight ml-2">required</span>
406416

407417
<p class="text-black-60 font-caption mb-2">
408-
This is where funds from contributors to this grant will be sent
418+
IMPORTANT: This is the wallet address where contributions to this grant will be sent.<br>
419+
DO NOT use an exchange address — use a self-custody wallet address such as MetaMask.<br>
420+
Adding an incorrect wallet address could mean that you don't receive your funds.
409421
</p>
410422

411423
<input id="kusama_payout_address" v-model="form.kusama_payout_address" name="kusama_payout_address" class="form__input form__input-lg" maxlength="50" placeholder="0x0" required/>
@@ -417,12 +429,14 @@
417429

418430
<template v-if="chainId == 'rsk'">
419431
<label class="font-subheader font-weight-light letter-spacing" for="rsk_payout_address">
420-
Add RSK Recipient Wallet Address
432+
Add RSK Recipient's Wallet Address
421433
</label>
422434
<span class="font-smaller-2 py-1 font-weight-normal badge badge-greylight ml-2">required</span>
423435

424436
<p class="text-black-60 font-caption mb-2">
425-
This is where funds from contributors to this grant will be sent
437+
IMPORTANT: This is the wallet address where contributions to this grant will be sent.<br>
438+
DO NOT use an exchange address — use a self-custody wallet address such as MetaMask.<br>
439+
Adding an incorrect wallet address could mean that you don't receive your funds.
426440
</p>
427441

428442
<input id="rsk_payout_address" v-model="form.rsk_payout_address" name="rsk_payout_address" class="form__input form__input-lg" maxlength="50" placeholder="0x0" required/>
@@ -434,12 +448,14 @@
434448

435449
<template v-if="chainId == 'algorand'">
436450
<label class="font-subheader font-weight-light letter-spacing" for="algorand_payout_address">
437-
Add Algorand Recipient Wallet Address
451+
Add Algorand Recipient's Wallet Address
438452
</label>
439453
<span class="font-smaller-6 badge badge-greylight text-capitalize ml-2">required</span>
440454

441455
<p class="text-black-60 font-caption mb-2">
442-
This is where funds from contributors to this grant will be sent
456+
IMPORTANT: This is the wallet address where contributions to this grant will be sent.<br>
457+
DO NOT use an exchange address — use a self-custody wallet address such as MetaMask.<br>
458+
Adding an incorrect wallet address could mean that you don't receive your funds.
443459
</p>
444460

445461
<input id="algorand_payout_address" v-model="form.algorand_payout_address" name="algorand_payout_address" class="form__input form__input-lg" maxlength="58" placeholder="0x0" required/>
@@ -451,12 +467,14 @@
451467

452468
<template v-if="chainId == 'cosmos'">
453469
<label class="font-subheader font-weight-light letter-spacing" for="cosmos_payout_address">
454-
Add Cosmos Recipient Wallet Address
470+
Add Cosmos Recipient's Wallet Address
455471
</label>
456472
<span class="font-smaller-2 py-1 font-weight-normal badge badge-greylight ml-2">required</span>
457473

458474
<p class="text-black-60 font-caption mb-2">
459-
This is where funds from contributors to this grant will be sent
475+
IMPORTANT: This is the wallet address where contributions to this grant will be sent.<br>
476+
DO NOT use an exchange address — use a self-custody wallet address such as MetaMask.<br>
477+
Adding an incorrect wallet address could mean that you don't receive your funds.
460478
</p>
461479

462480
<input id="cosmos_payout_address" v-model="form.cosmos_payout_address" name="cosmos_payout_address" class="form__input form__input-lg" maxlength="50" placeholder="0x0" required/>

app/grants/templates/grants/components/historical_claim.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<span class="font-bigger-1 text-grey-500">[[ stringifyClrs(match.grant_payout.grant_clrs) ]] (GR[[ match.round_number ]])</span>
55
</b-col>
66
<b-col lg="2" sm="12" class="pt-2 pt-lg-0">
7-
<h4 class="d-lg-block d-none font-weight-bold font-bigger-1 gc-font-base">[[ match.amount | decimals | formatNumber ]] [[ payoutToken ]]</h4>
7+
<h4 class="d-lg-block d-none font-weight-bold font-bigger-1 gc-font-base">[[ match.token_amount | decimals | formatNumber ]] [[ payoutToken ]]</h4>
88
<span class="d-lg-none d-inline font-weight-bold font-subheader">[[ match.amount | decimals | formatNumber ]] [[ payoutToken ]]</span>
99
<span class="font-body text-grey-500 ml-2 ml-lg-0">$[[ match.amount | decimals | formatNumber ]]</span>
1010
</b-col>

0 commit comments

Comments
 (0)