Skip to content

Commit

Permalink
Merge branch 'master' into create-work
Browse files Browse the repository at this point in the history
  • Loading branch information
octavioamu authored May 28, 2019
2 parents 22661c1 + c5809b9 commit 5385d53
Show file tree
Hide file tree
Showing 14 changed files with 238 additions and 111 deletions.
60 changes: 35 additions & 25 deletions app/assets/v2/css/bounty.css
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,41 @@ body {
padding-top: 3em;
}

.invite-user .avatar {
width: 5.5rem;
height: 5.5rem;
}

.quote-container {
width: 55%;
z-index: 2;
}

.quote-container img {
top: 3rem;
left: -2rem;
position: relative;
}

.quote-container .quote_text {
font-size: 1.1rem;
color: #4A4A4A;
}

.quote-container .quote_author {
color: #4A4A4A;
font-size: 1rem;
font-style: italic;
}

.bounty_details .avatar {
width: 50px;
height: 50px;
margin: 0px auto;
border-radius: 50px;
margin-top: 0px;
}

.bounty_details .avatar.Azure-Samples {
border-radius: 0px;
}
Expand Down Expand Up @@ -478,7 +506,10 @@ a.btn {
font-weight: 600;
}

.username, .contributor-position, .in-progress, .current_status {
.contributor-position,
.username,
.current_status,
.in-progress {
color: #0D0764;
}

Expand All @@ -487,11 +518,13 @@ a.btn {
font-size: 10px;
line-height: 11px;
}

.completed-bounties {
color: #05B66A;
}

.abandoned-bounties, .removed-bounties {
.abandoned-bounties,
.removed-bounties {
color: #F5A623;
}

Expand Down Expand Up @@ -682,7 +715,6 @@ a.btn {
width: auto;
}


.btn-interested,
.btn-extend,
.btn-cancel {
Expand Down Expand Up @@ -727,28 +759,6 @@ a.btn {
text-align: center;
}

.bounty_details .quote-container,
.grant_waiting .quote-container {
width: 55%;
margin: 4rem auto;
font-weight: 700;
z-index: 2;
}

.bounty_details .quote_text,
.grant_waiting .quote_text {
margin-top: 50px;
font-size: 1.1rem;
color: #4A4A4A;
}

.bounty_details .quote_author,
.grant_waiting .quote_author {
color: #4A4A4A;
margin: 1rem auto;
font-size: 1rem;
}

.ethereum-issue {
width:100%;
color: #ffffff;
Expand Down
63 changes: 62 additions & 1 deletion app/assets/v2/js/pages/bounty_details.js
Original file line number Diff line number Diff line change
Expand Up @@ -501,9 +501,9 @@ var showWarningMessage = function(txid) {

$('.left-rails').hide();
$('#bounty_details').hide();
$('#bounty_detail').hide();

waitingStateActive();
show_invite_users();
};

// refresh page if metamask changes
Expand Down Expand Up @@ -1564,6 +1564,67 @@ const is_bounty_expired = function(bounty) {
return now.getTime() >= expires_date.getTime();
};

/**
* Checks sessionStorage to toggle to show the quote
* container vs showing the list of fulfilled users to be
* invite.
*/
const show_invite_users = () => {

if (sessionStorage['fulfillers']) {
const users = sessionStorage['fulfillers'].split(',');

if (users.length == 1) {

let user = users[0];
const title = `Work with <b>${user}</b> again on your next bounty ?`;
const invite = `
<div class="invite-user">
<img class="avatar" src="/dynamic/avatar/${users}" />
<p class="mt-4">
<a target="_blank" class="btn btn-gc-blue shadow-none py-2 px-4" href="/users?invite=${user}">
Yes, invite to one of my bounties
</a>
</p>
</div>`;

$('#invite-header').html(title);
$('#invite-users').html(invite);
} else {

let invites = [];
const title = 'Work with these contributors again on your next bounty?';

users.forEach(user => {
const invite = `
<div class="invite-user mx-3">
<img class="avatar" src="/dynamic/avatar/${user}"/>
<p class="my-2">
<a target="_blank" class="font-subheader blue" href="/profile/${user}">
${user}
</a>
</p>
<a target="_blank" class="btn btn-gc-blue shadow-none px-4 font-body font-weight-semibold" href="/users?invite=${user}">
Invite
</a>
</div>`;

invites.push(invite);
});

$('#invite-users').addClass('d-flex justify-content-center');
$('#invite-header').html(title);
$('#invite-users').html(invites);
}
delete sessionStorage['fulfillers'];
$('.invite-user-container').removeClass('hidden');
$('.quote-container').addClass('hidden');
} else {
$('.invite-user-container').addClass('hidden');
$('.quote-container').removeClass('hidden');
}
};

var main = function() {
const moderatorAndAdminActions = $('#moderator-admin-actions');
const scrollHeight = 150;
Expand Down
14 changes: 14 additions & 0 deletions app/assets/v2/js/pages/bulk_payout.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ $(document).ready(function($) {

$('#acceptBounty').on('click', function(e) {
e.preventDefault();
getFulfillers();
update_registry();

if (!$('#terms').is(':checked')) {
Expand Down Expand Up @@ -346,6 +347,19 @@ var update_registry = function(coinbase) {
document.transactions = transactions;
};

/**
* stores fulfillers in sessionStorage on
* triggering advanced payout
*/
const getFulfillers = () => {
let fulfillers = [];
const users = $('.new-user option');

for (let i = 0; i < users.length; i++) {
fulfillers.push($('.new-user option')[i].innerHTML);
}
sessionStorage['fulfillers'] = fulfillers;
};

$(document).on('click', '.user-fulfiller', function(event) {
let elem = $('.username-search');
Expand Down
24 changes: 11 additions & 13 deletions app/assets/v2/js/shared.js
Original file line number Diff line number Diff line change
Expand Up @@ -281,20 +281,18 @@ var waitingStateActive = function() {
};

const notify_funder = (network, std_bounties_id, data) => {
var request_url = '/actions/bounty/' + network + '/' + std_bounties_id + '/notify/funder_payout_reminder/';
var request_url = '/actions/bounty/' + network + '/' + std_bounties_id + '/notify/funder_payout_reminder/';

showBusyOverlay();
$.post(request_url, data).then(result => {
hideBusyOverlay();

_alert({message: gettext('Sent payout reminder')}, 'success');
$('#notifyFunder a').addClass('disabled');
return true;
}).fail(result => {
hideBusyOverlay();

_alert({ message: gettext('got an error. please try again, or contact [email protected]') }, 'error');
});
showBusyOverlay();
$.post(request_url, data).then(() => {
hideBusyOverlay();
_alert({message: gettext('Sent payout reminder')}, 'success');
$('#notifyFunder a').addClass('disabled');
return true;
}).fail(() => {
hideBusyOverlay();
_alert({ message: gettext('got an error. please try again, or contact [email protected]') }, 'error');
});
};

/** Add the current profile to the interested profiles list. */
Expand Down
26 changes: 17 additions & 9 deletions app/assets/v2/js/users.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,22 +87,15 @@ Vue.mixin({
let getBounties = fetchData(apiUrlBounties, 'GET');

$.when(getBounties).then((response) => {
// response.data.forEach(function(item) {
// console.log(item)
// });
vm.isFunder = response.is_funder
vm.funderBounties = response.data;
console.log(vm.funderBounties);
});

},
openBounties: function(user) {
let vm = this;

console.log(user);
vm.userSelected = user;
vm.showModal = true;

},
sendInvite: function(bounty, user) {
let vm = this;
Expand Down Expand Up @@ -130,9 +123,24 @@ Vue.mixin({
},
closeModal() {
this.$refs['user-modal'].closeModal();
},
inviteOnMount: function() {
let vm = this;
let contributor = getURLParams('invite');

if (contributor) {
let api = `/api/v0.1/users_fetch/?search=${contributor}`;
let getUsers = fetchData (api, 'GET');

$.when(getUsers).then(function(response) {
if (response && response.data) {
vm.openBounties(response.data[0]);
$('#userModal').bootstrapModal('show');
}
});
}
}
}

});

if (document.getElementById('gc-users-directory')) {
Expand Down Expand Up @@ -170,6 +178,7 @@ if (document.getElementById('gc-users-directory')) {
},
created() {
this.fetchBounties();
this.inviteOnMount();
},
beforeMount() {
window.addEventListener('scroll', () => {
Expand All @@ -183,4 +192,3 @@ if (document.getElementById('gc-users-directory')) {
}
});
}

19 changes: 18 additions & 1 deletion app/assets/v2/js/vue-components.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
Vue.component('modal', {
props: [ 'user', 'size' ],
template: '#modal-template',
template: `<div class="vue-modal modal fade" id="userModal" tabindex="-1" role="dialog" aria-labelledby="userModalLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" :class="size" role="document">
<div class="modal-content">
<div class="modal-header border-0">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body pt-0 ">
<slot name="header"></slot>
<slot name="body"></slot>
</div>
<div class="modal-footer border-0">
<slot name="footer"></slot>
</div>
</div>
</div>
</div>`,
data() {
return {
jqEl: null
Expand Down
13 changes: 2 additions & 11 deletions app/dashboard/templates/bounty/details.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
</div>

<div class="col-12 offset-md-1 col-md-10 offset-lg-1 col-lg-8 body">
{% include 'shared/bounty_waiting_state.html' with can_close=True %}
{% include 'shared/waiting_state.html' %}

<div class="row nonefound" style="display:none;">
<img src="{% static "v2/images/shrug_bot.png" %}">
<h3>{% trans "No funded issue found." %}</h3>
Expand All @@ -40,16 +41,6 @@ <h6>{% trans "Be the OSS Funding you wish to see in the world." %}</h6>
<p id='submitsolicitation'>{% url 'new_funding' as new_fundingurl %}{% blocktrans %} Looking to fund some work? You can submit a new Funded Issue <a href="{{ new_fundingurl }}">here</a>.{% endblocktrans %}</p>
</div>

<div class="row ml-2 mr-2 pl-4 pr-4 waiting_room_entertainment" style="display: none;">
{% include 'shared/rain.html' with class="color" %}
<div class="quote-container">
<img src="{% static "v2/images/quotes.png" %}" style="float: left; max-width: 22px;" />
<div class="quote_text"></div>
<div class="quote_author"></div>
<input id="quoteRefresh" class="button button--primary" name="refresh" type='submit' onclick='javascript:waitingRoomEntertainment()' value="Refresh Quote" >
</div>
</div>

<div class="col-12" id="moderator-admin-actions"></div>
<div class="col-12" id="bounty_details">
<div class="row font-body">
Expand Down
Loading

0 comments on commit 5385d53

Please sign in to comment.