Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: collect external funding on grants #8971

Merged
merged 3 commits into from
Jun 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion app/assets/v2/js/grants/_detail-component.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ Vue.mixin({
'polkadot_payout_address': vm.grant.polkadot_payout_address,
'kusama_payout_address': vm.grant.kusama_payout_address,
'rsk_payout_address': vm.grant.rsk_payout_address,
'region': vm.grant.region?.name || undefined
'region': vm.grant.region?.name || undefined,
'has_external_funding': vm.grant.has_external_funding
};

if (vm.logo) {
Expand Down Expand Up @@ -349,6 +350,9 @@ Vue.mixin({
if (vm.grant.description_rich_edited.length < 10) {
vm.$set(vm.errors, 'description', 'Please enter description for the grant');
}
if (vm.grant.has_external_funding == 'unknown') {
vm.$set(vm.errors, 'has_external_funding', 'Please select if your grant has had external funding');
}

if (!vm.$refs.formEditGrant.reportValidity()) {
return false;
Expand Down Expand Up @@ -536,6 +540,10 @@ Vue.component('grant-details', {
{ 'name': 'india', 'label': 'India'},
{ 'name': 'east_asia', 'label': 'East Asia'},
{ 'name': 'southeast_asia', 'label': 'Southeast Asia'}
],
externalFundingOptions: [
{'key': 'yes', 'value': 'Yes, this project has raised external funding.'},
{'key': 'no', 'value': 'No, this project has not raised external funding.'}
]
};
},
Expand Down
12 changes: 11 additions & 1 deletion app/assets/v2/js/grants/_new.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@ Vue.mixin({
if (vm.form.description_rich.length < 10) {
vm.$set(vm.errors, 'description', 'Please enter description for the grant');
}
if (!vm.form.has_external_funding) {
vm.$set(vm.errors, 'has_external_funding', 'Please select if grant has external funding');
}

if (Object.keys(vm.errors).length) {
return false; // there are errors the user must correct
Expand Down Expand Up @@ -176,7 +179,8 @@ Vue.mixin({
'grant_type': form.grant_type,
'categories[]': form.grant_categories,
'network': form.network,
'region': form.region
'region': form.region,
'has_external_funding': form.has_external_funding
};

console.log(params);
Expand Down Expand Up @@ -312,6 +316,11 @@ const grant_regions = [
{ 'name': 'southeast_asia', 'label': 'Southeast Asia'}
];

const externalFundingOptions = [
{'key': 'yes', 'value': 'Yes, this project has raised external funding.'},
{'key': 'no', 'value': 'No, this project has not raised external funding.'}
];

if (document.getElementById('gc-new-grant')) {
appFormBounty = new Vue({
delimiters: [ '[[', ']]' ],
Expand All @@ -324,6 +333,7 @@ if (document.getElementById('gc-new-grant')) {
chainId: '',
grant_types: document.grant_types,
grant_regions: grant_regions,
externalFundingOptions: externalFundingOptions,
usersOptions: [],
network: 'mainnet',
logo: null,
Expand Down
261 changes: 0 additions & 261 deletions app/assets/v2/js/grants/detail.js

This file was deleted.

5 changes: 0 additions & 5 deletions app/dashboard/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -2231,11 +2231,6 @@ def user_card(request, handle):
except (ProfileNotFoundException, ProfileHiddenException):
raise Http404

if not settings.DEBUG:
network = 'mainnet'
else:
network = 'rinkeby'

if request.user.is_authenticated:
is_following = True if TribeMember.objects.filter(profile=request.user.profile, org=profile).count() else False
else:
Expand Down
2 changes: 1 addition & 1 deletion app/grants/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class GrantAdmin(GeneralAdmin):
'metadata', 'twitter_handle_1', 'twitter_handle_2', 'view_count', 'in_active_clrs',
'last_update', 'funding_info', 'twitter_verified', 'twitter_verified_by', 'twitter_verified_at', 'stats_history',
'zcash_payout_address', 'celo_payout_address','zil_payout_address', 'harmony_payout_address', 'binance_payout_address',
'polkadot_payout_address', 'kusama_payout_address', 'rsk_payout_address', 'emails', 'admin_message'
'polkadot_payout_address', 'kusama_payout_address', 'rsk_payout_address', 'emails', 'admin_message', 'has_external_funding'
]
readonly_fields = [
'logo_svg_asset', 'logo_asset',
Expand Down
18 changes: 18 additions & 0 deletions app/grants/migrations/0118_grant_has_external_funding.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 2.2.20 on 2021-05-31 07:46

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('grants', '0117_subscription_visitorid'),
]

operations = [
migrations.AddField(
model_name='grant',
name='has_external_funding',
field=models.CharField(choices=[('yes', 'Yes'), ('no', 'No'), ('unknown', 'Unknown')], default='unknown', help_text='Does this grant have external funding', max_length=8),
),
]
Loading