-
-
Notifications
You must be signed in to change notification settings - Fork 775
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
Allow crowdfund issues #1597
Allow crowdfund issues #1597
Changes from 6 commits
9338faf
9082e33
9b22161
4ea1a4c
e1f7cf1
b2fe984
4822cc4
7e311ff
6b59bb3
9dc7a12
98016f7
6aa7e69
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -111,6 +111,12 @@ $(document).ready(function() { | |
mixpanel.track('Submit New Bounty Success', {}); | ||
document.location.href = '/funding/details/?url=' + issueURL; | ||
}, 1000); | ||
|
||
if (document.changePayoutAmount) { | ||
$.get('/issue/increase/changepayout/' + amount + '/?pk=' + bountyId + '&network=' + document.web3network) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing semicolon. (semi) |
||
.fail(function(error) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unexpected empty function. (no-empty-function) |
||
}); | ||
} | ||
} | ||
|
||
var bountyAmount = parseInt($('input[name=valueInToken]').val(), 10); | ||
|
@@ -123,9 +129,6 @@ $(document).ready(function() { | |
if (bountyAmount == 0 || open == false) { | ||
errormsg = gettext('No active funded issue found at this address on ' + document.web3network + '. Are you sure this is an active funded issue?'); | ||
} | ||
if (fromAddress != web3.eth.coinbase) { | ||
errormsg = gettext('Only the address that submitted this funded issue may increase the payout.'); | ||
} | ||
|
||
if (errormsg) { | ||
_alert({ message: errormsg }); | ||
|
@@ -134,17 +137,43 @@ $(document).ready(function() { | |
} | ||
|
||
function do_bounty() { | ||
bounty.increasePayout( | ||
bountyId, | ||
bountyAmount + amount, | ||
amount, | ||
{ | ||
from: account, | ||
value: ethAmount, | ||
gasPrice: web3.toHex($('#gasPrice').val() * Math.pow(10, 9)) | ||
}, | ||
web3Callback | ||
); | ||
if (document.isFunder) { | ||
if (document.changePayoutAmount) { | ||
bounty.changeBountyFulfillmentAmount( | ||
bountyId, | ||
bountyAmount + amount, | ||
{ | ||
from: account, | ||
value: 0, | ||
gasPrice: web3.toHex($('#gasPrice').val() + Math.pow(10, 9)) | ||
}, | ||
web3Callback | ||
); | ||
} else { | ||
bounty.increasePayout( | ||
bountyId, | ||
bountyAmount + amount, | ||
amount, | ||
{ | ||
from: account, | ||
value: ethAmount, | ||
gasPrice: web3.toHex($('#gasPrice').val() * Math.pow(10, 9)) | ||
}, | ||
web3Callback | ||
); | ||
} | ||
} else { | ||
bounty.contribute( | ||
bountyId, | ||
amount, | ||
{ | ||
from: account, | ||
value: ethAmount, | ||
gasPrice: web3.toHex($('#gasPrice').val() + Math.pow(10, 9)) | ||
}, | ||
web3Callback | ||
); | ||
} | ||
} | ||
|
||
do_bounty(); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,6 +25,7 @@ | |
from django.shortcuts import redirect | ||
from django.template.loader import render_to_string | ||
from django.template.response import TemplateResponse | ||
from django.urls import reverse | ||
from django.utils import timezone | ||
from django.utils.translation import gettext as _ | ||
|
||
|
@@ -588,6 +589,16 @@ def render_new_bounty_roundup(to_email): | |
return response_html, response_txt, subject | ||
|
||
|
||
def render_change_payout_amount(bounty, value): | ||
subject = 'Change payout amount' | ||
form_link = reverse('request_change_payout', kwargs={'value': value, 'pk': bounty.id, 'network': bounty.network}) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. F841 local variable 'form_link' is assigned to but never used |
||
|
||
response_text = "There is someone trying to increase the bounty on {value} on your issue," + | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. E999 SyntaxError: invalid syntax |
||
" can you change the payout amount of the bounty? The form to do it: {form_link}. You can " + | ||
"increase the payout amount in the value {value}." | ||
|
||
return response_text, subject | ||
|
||
# DJANGO REQUESTS | ||
|
||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
won't you need to update
show_increase_bounty
too?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it needed? what I change here is the argument from
enabled = increase_bounty_enabled;
toenabled = true;
, theshow_increase_bounty
is fine.