diff --git a/app/app/settings.py b/app/app/settings.py index f5eb52aa893..503e2beb8a2 100644 --- a/app/app/settings.py +++ b/app/app/settings.py @@ -120,7 +120,7 @@ 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'app.middleware.drop_accept_langauge', - 'app.middleware.bleach_requests', + # 'app.middleware.bleach_requests', 'django.middleware.locale.LocaleMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', diff --git a/app/app/urls.py b/app/app/urls.py index 3f3ddcf1bab..7d20e47c436 100644 --- a/app/app/urls.py +++ b/app/app/urls.py @@ -112,6 +112,11 @@ dashboard.views.social_contribution_email, name='social_contribution_email' ), + url( + r'^api/v0.1/bulk_invite', + dashboard.views.bulk_invite, + name='bulk_invite' + ), url(r'^api/v0.1/bountydocument', dashboard.views.bounty_upload_nda, name='bounty_upload_nda'), url(r'^api/v0.1/faucet/save/?', faucet.views.save_faucet, name='save_faucet'), url(r'^api/v0.1/', include(dbrouter.urls)), diff --git a/app/assets/v2/js/users.js b/app/assets/v2/js/users.js index 8beaa3132b6..164c5a13412 100644 --- a/app/assets/v2/js/users.js +++ b/app/assets/v2/js/users.js @@ -120,6 +120,53 @@ Vue.mixin({ } }); }, + sendInviteAll: function(bountyUrl) { + let vm = this; + const apiUrlInvite = '/api/v0.1/bulk_invite/'; + const postInvite = fetchData( + apiUrlInvite, + 'POST', + { 'params': vm.params, 'bountyId': bountyUrl}, + {'X-CSRFToken': csrftoken} + ); + + $.when(postInvite).then((response) => { + console.log(response); + if (response.status !== 200) { + _alert(response.msg, 'error'); + + } else { + vm.$refs['user-modal'].closeModal(); + _alert('The invitation has been sent', 'info'); + } + }); + + }, + getIssueDetails: function(url) { + let vm = this; + const apiUrldetails = `/actions/api/v0.1/bounties/?github_url=${encodeURIComponent(url)}`; + + vm.errorIssueDetails = undefined; + + if (url.indexOf('github.com/') < 0) { + vm.issueDetails = null; + vm.errorIssueDetails = 'Please paste a github issue url'; + return; + } + vm.issueDetails = undefined; + const getIssue = fetchData(apiUrldetails, 'GET'); + + $.when(getIssue).then((response) => { + if (response[0]) { + vm.issueDetails = response[0]; + vm.errorIssueDetails = undefined; + } else { + vm.issueDetails = null; + vm.errorIssueDetails = 'This issue wasn\'t bountied yet.'; + } + }); + + }, closeModal() { this.$refs['user-modal'].closeModal(); }, @@ -187,7 +234,10 @@ if (document.getElementById('gc-users-directory')) { skills: document.keywords, selectedSkills: [], noResults: false, - isLoading: true + isLoading: true, + gitcoinIssueUrl: '', + issueDetails: undefined, + errorIssueDetails: undefined }, mounted() { this.fetchUsers(); diff --git a/app/assets/v2/js/vue-components.js b/app/assets/v2/js/vue-components.js index c2d8f8bdaab..9899c15c445 100644 --- a/app/assets/v2/js/vue-components.js +++ b/app/assets/v2/js/vue-components.js @@ -1,6 +1,6 @@ Vue.component('modal', { - props: [ 'user', 'size' ], - template: `