diff --git a/app/app/tests/test_app_urls.py b/app/app/tests/test_app_urls.py
index 449c38a9be9..ba5ac8ed7b6 100644
--- a/app/app/tests/test_app_urls.py
+++ b/app/app/tests/test_app_urls.py
@@ -50,11 +50,11 @@ def test_sitemap_resolve(self):
def test_email_settings_reverse(self):
"""Test the email_settings url and check the reverse."""
priv_key = token_hex(16)[:29]
- self.assertEqual(reverse('email_settings', args=(priv_key, )), f'/email/settings/{priv_key}')
+ self.assertEqual(reverse('email_settings', args=(priv_key, )), f'/settings/email/{priv_key}')
def test_email_settings_resolve(self):
"""Test the email_settings url and check the resolution."""
- self.assertEqual(resolve('/email/settings/').view_name, 'email_settings')
+ self.assertEqual(resolve('/settings/email/').view_name, 'email_settings')
def test_leaderboard_reverse(self):
"""Test the leaderboard url and check the reverse."""
diff --git a/app/app/urls.py b/app/app/urls.py
index 3707570d0bd..c2deb279d4d 100644
--- a/app/app/urls.py
+++ b/app/app/urls.py
@@ -197,12 +197,11 @@
url(r'^_administration/process_faucet_request/(.*)$', faucet.views.process_faucet_request, name='process_faucet_request'),
# settings
- url(r'^email/settings/(.*)', marketing.views.email_settings, name='email_settings'),
- url(r'^settings/email/(.*)', marketing.views.email_settings, name='settings_email'),
- url(r'^settings/privacy/?', marketing.views.privacy_settings, name='privacy_settings'),
- url(r'^settings/matching/?', marketing.views.matching_settings, name='matching_settings'),
- url(r'^settings/feedback/?', marketing.views.feedback_settings, name='feedback_settings'),
- url(r'^settings/(.*)?', marketing.views.email_settings, name='feedback_settings'),
+ re_path(r'^settings/email/(.*)', marketing.views.email_settings, name='email_settings'),
+ re_path(r'^settings/privacy/?', marketing.views.privacy_settings, name='privacy_settings'),
+ re_path(r'^settings/matching/?', marketing.views.matching_settings, name='matching_settings'),
+ re_path(r'^settings/feedback/?', marketing.views.feedback_settings, name='feedback_settings'),
+ re_path(r'^settings/(.*)?', marketing.views.email_settings, name='feedback_settings'),
# marketing views
url(r'^leaderboard/(.*)', marketing.views.leaderboard, name='leaderboard'),
diff --git a/app/assets/v2/css/forms/input.css b/app/assets/v2/css/forms/input.css
index 7ce25d87636..8d0491f03d2 100644
--- a/app/assets/v2/css/forms/input.css
+++ b/app/assets/v2/css/forms/input.css
@@ -62,9 +62,10 @@
font-size: 12px;
font-family: 'Muli', sans-serif;
}
-
.form__input-help--dynamic {
- position: absolute;
- bottom: -20px;
- left: 0;
+ margin-top: 5px;
+ display: block;
}
+.amount_container{
+ height: 100px;
+}
\ No newline at end of file
diff --git a/app/assets/v2/js/amounts.js b/app/assets/v2/js/amounts.js
index 9b25ec0ab44..e7a18dccfbc 100644
--- a/app/assets/v2/js/amounts.js
+++ b/app/assets/v2/js/amounts.js
@@ -13,6 +13,25 @@ var estimate = function(amount, conv_rate) {
return gettext('Approx: Unknown amount');
};
+var get_rates_estimate = function(usd_amount) {
+ if (!usd_amount) {
+ return '';
+ }
+ var rates_addon = [];
+ var rates = [ 40, 80, 120 ];
+
+ for (var i = 0; i < rates.length; i++) {
+ var rate = rates[i];
+ var hours = usd_amount / rate;
+ var round_decimals = hours < 1 ? 2 : 1;
+
+ hours = Math.round(hours, round_decimals);
+ rates_addon.push('' + hours + ' hrs at $' + rate + '/hr');
+ }
+ rates_addon = rates_addon.join(', ');
+ return rates_addon;
+};
+
var getUSDEstimate = function(amount, denomination, callback) {
var conv_rate;
var eth_usd;
@@ -25,7 +44,12 @@ var getUSDEstimate = function(amount, denomination, callback) {
}
if (document.conversion_rates && document.conversion_rates[denomination]) {
conv_rate = document.conversion_rates[denomination];
- return callback(estimate(amount, conv_rate));
+ var usd_estimate = estimate(amount, conv_rate);
+
+ rate_estimate = get_rates_estimate(amount * conv_rate);
+ var return_text = usd_estimate + '
' + rate_estimate;
+
+ return callback(return_text);
}
var request_url = '/sync/get_amount?amount=' + amount + '&denomination=' + denomination;
@@ -38,7 +62,12 @@ var getUSDEstimate = function(amount, denomination, callback) {
document.conversion_rates = {};
}
document.conversion_rates[denomination] = conv_rate;
- return callback(estimate(amount, conv_rate));
+ var usd_estimate = estimate(amount, conv_rate);
+
+ rate_estimate = get_rates_estimate(amount * conv_rate);
+ var return_text = usd_estimate + '
' + rate_estimate;
+
+ return callback(return_text);
}).fail(function() {
return callback(new Error(gettext('Approx: Unknown amount')));
});
diff --git a/app/assets/v2/js/pages/fulfill_bounty.js b/app/assets/v2/js/pages/fulfill_bounty.js
index 7894c259e98..609d18c9a46 100644
--- a/app/assets/v2/js/pages/fulfill_bounty.js
+++ b/app/assets/v2/js/pages/fulfill_bounty.js
@@ -25,6 +25,13 @@ window.onload = function() {
$('#submitBounty').validate({
submitHandler: function(form) {
+ try {
+ bounty_address();
+ } catch (exception) {
+ _alert(gettext('You are on an unsupported network. Please change your network to a supported network.'));
+ return;
+ }
+
var data = {};
var disabled = $(form)
.find(':input:disabled')
diff --git a/app/assets/v2/js/pages/increase_bounty.js b/app/assets/v2/js/pages/increase_bounty.js
index 6bcf62d8a48..8fe2cb78eb6 100644
--- a/app/assets/v2/js/pages/increase_bounty.js
+++ b/app/assets/v2/js/pages/increase_bounty.js
@@ -21,6 +21,13 @@ $(document).ready(function() {
// submit bounty button click
$('#submitBounty').click(function(e) {
+ try {
+ bounty_address();
+ } catch (exception) {
+ _alert(gettext('You are on an unsupported network. Please change your network to a supported network.'));
+ return;
+ }
+
mixpanel.track('Increase Bounty Clicked (funder)', {});
// setup
diff --git a/app/assets/v2/js/pages/kill_bounty.js b/app/assets/v2/js/pages/kill_bounty.js
index 4a763b0a2cb..27d741d366f 100644
--- a/app/assets/v2/js/pages/kill_bounty.js
+++ b/app/assets/v2/js/pages/kill_bounty.js
@@ -17,6 +17,13 @@ window.onload = function() {
$('#submitBounty').validate({
submitHandler: function(form) {
+ try {
+ bounty_address();
+ } catch (exception) {
+ _alert(gettext('You are on an unsupported network. Please change your network to a supported network.'));
+ return;
+ }
+
var data = {};
var disabled = $(form)
.find(':input:disabled')
diff --git a/app/assets/v2/js/pages/new_bounty.js b/app/assets/v2/js/pages/new_bounty.js
index 2244d487428..34c1a97eadf 100644
--- a/app/assets/v2/js/pages/new_bounty.js
+++ b/app/assets/v2/js/pages/new_bounty.js
@@ -47,6 +47,7 @@ $(document).ready(function() {
$('input[name=amount]').blur(setUsdAmount);
$('select[name=deonomination]').change(setUsdAmount);
$('input[name=issueURL]').blur(retrieveIssueDetails);
+ setTimeout(setUsdAmount, 1000);
if ($('input[name=issueURL]').val() != '') {
retrieveIssueDetails();
@@ -73,6 +74,13 @@ $(document).ready(function() {
$('#submitBounty').validate({
submitHandler: function(form) {
+ try {
+ bounty_address();
+ } catch (exception) {
+ _alert(gettext('You are on an unsupported network. Please change your network to a supported network.'));
+ return;
+ }
+
var data = {};
var disabled = $(form)
.find(':input:disabled')
diff --git a/app/assets/v2/js/pages/process_bounty.js b/app/assets/v2/js/pages/process_bounty.js
index 1b29ca86315..30f54038c13 100644
--- a/app/assets/v2/js/pages/process_bounty.js
+++ b/app/assets/v2/js/pages/process_bounty.js
@@ -65,6 +65,13 @@ window.onload = function() {
});
$('#acceptBounty').click(function(e) {
+ try {
+ bounty_address();
+ } catch (exception) {
+ _alert(gettext('You are on an unsupported network. Please change your network to a supported network.'));
+ return;
+ }
+
mixpanel.track('Process Bounty Clicked', {});
e.preventDefault();
var whatAction = $(this).html().trim();
diff --git a/app/dashboard/models.py b/app/dashboard/models.py
index 9aae7ef1d8b..fc2087a88f5 100644
--- a/app/dashboard/models.py
+++ b/app/dashboard/models.py
@@ -1077,7 +1077,7 @@ def get_access_token(self, save=True):
return access_token
def get_profile_preferred_language(self):
- return settings.LANGUAGE_CODE if self.pref_lang_code is None else self.pref_lang_code
+ return settings.LANGUAGE_CODE if not self.pref_lang_code else self.pref_lang_code
@receiver(user_logged_in)
def post_login(sender, request, user, **kwargs):
@@ -1283,7 +1283,7 @@ class ToolVote(models.Model):
value = models.IntegerField(default=0)
@property
- def tool(self):
+ def tool(self):
try:
return Tool.objects.filter(votes__in=[self.pk]).first()
except:
diff --git a/app/dashboard/notifications.py b/app/dashboard/notifications.py
index 6477e8342f3..e595c7b81a9 100644
--- a/app/dashboard/notifications.py
+++ b/app/dashboard/notifications.py
@@ -263,7 +263,7 @@ def get_status_header(bounty):
else:
statuses.append('**Done**')
-
+
#1. Open | **2. Started** | 3. Submitted | 4. Done
status_bar = ""
for x, status in enumerate(statuses):
@@ -699,11 +699,11 @@ def maybe_warn_user_removed_github(bounty, username, last_heard_from_user_days):
return False
first_warning = 'x'
- second_warning = 'x' if last_heard_from_user_days > num_days_back_to_warn else ''
+ second_warning = 'x' if last_heard_from_user_days > num_days_back_to_warn else ' '
msg = f"""@{username} are you still working on this issue?
* [{first_warning}] warning 1 ({num_days_back_to_warn} days)
* [{second_warning}] warning 2 ({num_days_back_to_warn * 2} days)
-* [x] auto removal ({num_days_back_to_delete_interest} days)
+* [ ] auto removal ({num_days_back_to_delete_interest} days)
"""
post_issue_comment(bounty.org_name, bounty.github_repo_name, bounty.github_issue_number, msg)
diff --git a/app/dashboard/templates/increase_bounty.html b/app/dashboard/templates/increase_bounty.html
index b302739d608..1e2faaa0151 100644
--- a/app/dashboard/templates/increase_bounty.html
+++ b/app/dashboard/templates/increase_bounty.html
@@ -64,9 +64,9 @@