diff --git a/app/assets/v2/js/base.js b/app/assets/v2/js/base.js index b7d856577e8..210dd45dc91 100644 --- a/app/assets/v2/js/base.js +++ b/app/assets/v2/js/base.js @@ -64,8 +64,10 @@ document.addEventListener('DOMContentLoaded', function() { } var force_no_www = function() { - if (document.location.href.indexOf('https://www.gitcoin.co') != -1) { - var new_url = document.location.href.replace('www.gitcoin.co', 'gitcoin.co'); + const url = new URL(document.location.href); + + if (url.host == 'www.gitcoin.co') { + const new_url = document.location.href.replace('www.gitcoin.co', 'gitcoin.co'); document.location.href = new_url; } diff --git a/app/assets/v2/js/pages/hackathon_new_bounty.js b/app/assets/v2/js/pages/hackathon_new_bounty.js index 110f19a6aa0..ef08a290076 100644 --- a/app/assets/v2/js/pages/hackathon_new_bounty.js +++ b/app/assets/v2/js/pages/hackathon_new_bounty.js @@ -17,14 +17,14 @@ Vue.mixin({ return vm.form.issueDetails; } - if (url.indexOf('github.com/') < 0) { + const ghIssueUrl = new URL(url); + + if (ghIssueUrl.host == 'github.com') { vm.form.issueDetails = null; vm.$set(vm.errors, 'issueDetails', 'Please paste a github issue url'); return; } - let ghIssueUrl = new URL(url); - vm.orgSelected = ''; const apiUrldetails = `/sync/get_issue_details?url=${encodeURIComponent(url.trim())}&hackathon_slug=${vm.hackathonSlug}`; diff --git a/app/assets/v2/js/pages/new_bounty.js b/app/assets/v2/js/pages/new_bounty.js index 576307aceeb..89a99c6efc4 100644 --- a/app/assets/v2/js/pages/new_bounty.js +++ b/app/assets/v2/js/pages/new_bounty.js @@ -22,18 +22,19 @@ Vue.mixin({ return vm.form.issueDetails; } - if (url.indexOf('github.com/') < 0) { + const ghIssueUrl = new URL(url); + + if (ghIssueUrl.host == 'github.com') { vm.form.issueDetails = undefined; vm.$set(vm.errors, 'issueDetails', 'Please paste a github issue url'); return; } - if (url.indexOf('/pull/') > 0) { + if (ghIssueUrl.pathname.contains('/pull/')) { vm.$set(vm.errors, 'issueDetails', 'Please paste a github issue url and not a PR'); return; } - let ghIssueUrl = new URL(url); vm.orgSelected = ghIssueUrl.pathname.split('/')[1].toLowerCase(); diff --git a/app/assets/v2/js/users-elastic.js b/app/assets/v2/js/users-elastic.js index 893a9f15aa8..f70d350cf64 100644 --- a/app/assets/v2/js/users-elastic.js +++ b/app/assets/v2/js/users-elastic.js @@ -174,7 +174,8 @@ Vue.mixin({ vm.errorIssueDetails = undefined; - if (url.indexOf('github.com/') < 0) { + url = new URL(url); + if (url.host == 'github.com') { vm.issueDetails = null; vm.errorIssueDetails = 'Please paste a github issue url'; return; diff --git a/app/assets/v2/js/users.js b/app/assets/v2/js/users.js index 9dc702defd8..d2ee0952b82 100644 --- a/app/assets/v2/js/users.js +++ b/app/assets/v2/js/users.js @@ -175,11 +175,12 @@ Vue.mixin({ vm.errorIssueDetails = undefined; - if (url.indexOf('github.com/') < 0) { + if (new URL(url).host == 'github.com') { vm.issueDetails = null; vm.errorIssueDetails = 'Please paste a github issue url'; return; } + vm.issueDetails = undefined; const getIssue = fetchData(apiUrldetails, 'GET'); diff --git a/app/assets/v2/js/wallet.js b/app/assets/v2/js/wallet.js index 39d7af1674b..87644da44ec 100644 --- a/app/assets/v2/js/wallet.js +++ b/app/assets/v2/js/wallet.js @@ -22,7 +22,8 @@ if (window.ethereum) { function initWallet() { // Determine if we're on prod or not - const isProd = document.location.href.startsWith('https://gitcoin.co'); + const url = new URL(document.location.href); + const isProd = url.host == 'gitcoin.co' && url.protocol == 'https:'; const formaticKey = isProd ? document.contxt['fortmatic_live_key'] : document.contxt['fortmatic_test_key']; const providerOptions = { authereum: { diff --git a/app/dashboard/templates/addinterest.html b/app/dashboard/templates/addinterest.html index 4f97e123849..8cc1a244d6f 100644 --- a/app/dashboard/templates/addinterest.html +++ b/app/dashboard/templates/addinterest.html @@ -98,7 +98,11 @@
{% trans "Submit a Plan" %}
{% elif is_registered and bounty.event %}

- This bounty is part of {{bounty.event.name}}, please read the rules to participate before you continue. + This bounty is part of {{bounty.event.name}}, please read the + + rules to participate + + before you continue.

diff --git a/app/dashboard/templates/bounty/details.html b/app/dashboard/templates/bounty/details.html index 171a3ccc3ca..0bafda1add8 100644 --- a/app/dashboard/templates/bounty/details.html +++ b/app/dashboard/templates/bounty/details.html @@ -218,7 +218,7 @@
{% trans "Projects" %}
{% endif %}
- {{project.name}} + {{project.name}}
Team Members
@@ -273,11 +273,11 @@
{% trans "Funder" %}
[[if pending_acceptance]] - + [[:text]] ( [[>pending_acceptance]] ) [[else]] - + [[:text]] [[/if]] @@ -294,7 +294,7 @@
{% trans "Funder" %}
@@ -341,7 +341,7 @@
{% trans "Funder" %}
[[>text]] [[if activity_type == 'worker_approved']] - + [[>worker_handle]] to work on the bounty [[/if]] @@ -388,7 +388,7 @@
{% trans "Funder" %}
@@ -398,7 +398,7 @@
{% trans "Funder" %}
[[>text]] [[if fulfiller_github_url]] - [{% trans "View Work" %}] + [{% trans "View Work" %}] [[/if]]
[[if slash_possible]] diff --git a/app/dashboard/templates/dashboard/hackathon/onboard.html b/app/dashboard/templates/dashboard/hackathon/onboard.html index c86da7d7441..208357765df 100644 --- a/app/dashboard/templates/dashboard/hackathon/onboard.html +++ b/app/dashboard/templates/dashboard/hackathon/onboard.html @@ -261,15 +261,13 @@

How does the Hackathon w
- bounty explorer + bounty explorer
- {% trans "Check out the Prizes" %} - -

- Visit the Prize Explorer to check out the prizes posted by our hackathon sponsors. Click each prize to show important details, including the submission requirements, submission deadline, etc. -

- + {% trans "Check out the Prizes" %} +

+ Visit the Prize Explorer to check out the prizes posted by our hackathon sponsors. Click each prize to show important details, including the submission requirements, submission deadline, etc. +

@@ -280,7 +278,10 @@

How does the Hackathon w {% trans " Join the Hackathons Chat Workspace" %} {% blocktrans %}

- Chat with other hackers, ask sponsors and the Gitcoin team questions, find or create a team, and communicate real-time. Click here to join the party!. + Chat with other hackers, ask sponsors and the Gitcoin team questions, find or create a team, and communicate real-time. + + Click here to join the party! +

{% endblocktrans %}

diff --git a/app/dashboard/templates/dashboard/hackathon/project_new.html b/app/dashboard/templates/dashboard/hackathon/project_new.html index e0f0b00769f..dbe9e8a0bec 100644 --- a/app/dashboard/templates/dashboard/hackathon/project_new.html +++ b/app/dashboard/templates/dashboard/hackathon/project_new.html @@ -40,7 +40,11 @@

Let's Get Started!

- This bounty is part of {{bounty.event.name}}, please read the rules to participate before you continue. + This bounty is part of {{bounty.event.name}}, please read the + + rules to participate + + before you continue.

{% if project_selected %} diff --git a/app/dashboard/templates/onepager/send2.html b/app/dashboard/templates/onepager/send2.html index d7fa29fa0c2..90469a0ca59 100644 --- a/app/dashboard/templates/onepager/send2.html +++ b/app/dashboard/templates/onepager/send2.html @@ -194,7 +194,11 @@

{% trans "Send Tip." %}

{% if profile %} {% endif %} {% endfor %} diff --git a/app/dashboard/templates/process_bounty.html b/app/dashboard/templates/process_bounty.html index af413fd45ba..cebf505b695 100644 --- a/app/dashboard/templates/process_bounty.html +++ b/app/dashboard/templates/process_bounty.html @@ -105,7 +105,7 @@

{% trans "Basic Payout" %}

Suggested Kudos

- What is kudos? + What is kudos?
diff --git a/app/dashboard/templates/profiles/tab_hackathons.html b/app/dashboard/templates/profiles/tab_hackathons.html index a7bcfa74907..660456fff30 100644 --- a/app/dashboard/templates/profiles/tab_hackathons.html +++ b/app/dashboard/templates/profiles/tab_hackathons.html @@ -71,7 +71,7 @@
{{ project.name }}
+ {% endif %}" target="_blank" rel="noopener noreferrer" class="font-weight-bold card-subtitle">{{ project.name }}

Project Summary

diff --git a/app/dashboard/templates/profiles/tribes-vue.html b/app/dashboard/templates/profiles/tribes-vue.html index 22a76a77983..0ac13387a38 100644 --- a/app/dashboard/templates/profiles/tribes-vue.html +++ b/app/dashboard/templates/profiles/tribes-vue.html @@ -960,12 +960,12 @@