Skip to content

Commit

Permalink
chore: cross-chain improvs
Browse files Browse the repository at this point in the history
- remove unused admin methods
- add activity on close bounty
- fixed broken fa icons
- updated tooltip design
- added icon for expired fulfillment to inform user
  • Loading branch information
thelostone-mc committed Apr 19, 2020
1 parent b6b38df commit 78bf123
Show file tree
Hide file tree
Showing 10 changed files with 62 additions and 119 deletions.
2 changes: 1 addition & 1 deletion app/assets/onepager/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ input[type='checkbox']:checked + label::before,
input[type='radio']:checked + label::before {
color: #ff7496;
content: '\f00c';
font-family: "Font Awesome 5 free", sans-serif;
font-family: "Font Awesome 5 Pro", sans-serif;
font-weight: 900;
}

Expand Down
4 changes: 4 additions & 0 deletions app/assets/v2/css/bounty.css
Original file line number Diff line number Diff line change
Expand Up @@ -761,6 +761,10 @@ a.btn {
margin: 0;
}

.bounty_details .tooltip-inner {
max-width: 500px !important;
}

@media (max-width: 575.98px) {

#timer {
Expand Down
6 changes: 4 additions & 2 deletions app/assets/v2/css/gitcoin.css
Original file line number Diff line number Diff line change
Expand Up @@ -546,13 +546,15 @@ div.button-pink {

.accordion:after {
/* stylelint-disable-next-line */
font-family: 'Font Awesome 5 Free';
font-family: 'Font Awesome 5 Pro';
content: '\f107';
font-size: 1.2em;
font-size: 1em;
margin-right: auto;
margin-top: auto;
float: right;
font-weight: 600;
top: 1px;
position: relative;
}

.accordion.active:after {
Expand Down
49 changes: 1 addition & 48 deletions app/assets/v2/js/pages/bounty_details2.js
Original file line number Diff line number Diff line change
Expand Up @@ -254,33 +254,6 @@ Vue.mixin({
}
}
},
contactFunder: function() {
let vm = this;
let text = window.prompt('What would you like to say to the funder?', '');

if (text === null) {
return;
}
document.location.href = `${vm.bounty.url}?admin_contact_funder=${text}`;
},
snoozeeGitbot: function() {
let vm = this;
let text = window.prompt('How many days do you want to snooze?', '');

if (text === null) {
return;
}
document.location.href = `${vm.bounty.url}?snooze=${text}`;
},
overrideStatus: function() {
let vm = this;
let text = window.prompt('What new status (valid choices: "open", "started", "submitted", "done", "expired", "cancelled", "" to remove override )?', '');

if (text === null) {
return;
}
document.location.href = `${vm.bounty.url}?admin_override_satatus=${text}`;
},
hasAcceptedFulfillments: function() {
let vm = this;

Expand Down Expand Up @@ -370,13 +343,6 @@ Vue.mixin({
activities.forEach(activity => {
if (activity.metadata) {
if (activity.metadata.new_bounty) {
// ETH
activity.metadata.new_bounty['token_value'] = activity.metadata.new_bounty.value_in_token / 10 ** decimals;
if (activity.metadata.old_bounty) {
activity.metadata.old_bounty['token_value'] = activity.metadata.old_bounty.value_in_token / 10 ** decimals;
}
} else {
// cross-chain
activity.metadata['token_value'] = activity.metadata.value_in_token / 10 ** decimals;
}
}
Expand Down Expand Up @@ -579,17 +545,4 @@ const promisify = (inner) =>
resolve(res);
}
})
);

// async function waitBlock(txid) {
// while (true) {
// let receipt = web3.eth.getTransactionReceipt(txid);
// if (receipt && receipt.contractAddress) {
// console.log("Your contract has been deployed at http://testnet.etherscan.io/address/" + receipt.contractAddress);
// console.log("Note that it might take 30 - 90 sceonds for the block to propagate befor it's visible in etherscan.io");
// break;
// }
// console.log("Waiting a mined block to include your contract... currently in block " + web3.eth.blockNumber);
// await sleep(4000);
// }
// }
);
26 changes: 15 additions & 11 deletions app/dashboard/templates/bounty/details2.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@
Admin Actions
</span>
<a v-for="link in quickLinks" class="btn btn-outline-gc-blue px-2 mx-2 font-smaller-4" :href="[[link.href]]" :title="[[ link.title ]]">[[ link.label ]]</a>
<button class="btn btn-outline-gc-blue px-2 mx-2 font-smaller-4" @click="contactFunder()">Contact Funder</button>
<button class="btn btn-outline-gc-blue px-2 mx-2 font-smaller-4" @click="overrideStatus()">Override Status</button>
<button class="btn btn-outline-gc-blue px-2 mx-2 font-smaller-4" @click="snoozeeGitbot()">Snooze Gitcoinbot</button>
</div>
<div class="col-12" v-if="loadingState === 'resolved'">
{% if event_tag %}
Expand Down Expand Up @@ -310,9 +307,19 @@ <h5 class="font-body font-weight-semibold">{% trans "SUBMISSIONS" %}</h5>
</p>
</template>

<button v-else data-toggle="modal" :data-target="`#payoutModal${fulfillment.pk}`" class="btn btn-sm btn-gc-blue my-auto px-3 font-smaller-2 font-weight-semibold">
<i class="fas fa-money-check-alt mr-2 font-caption"></i>Payout Bounty
</button>
<template v-else>
<template v-if="fulfillment.payout_status == 'expired'">
<span class="font-smaller-1 position-relative" style="top: 2px" data-html="true" data-toggle="tooltip"
title="<div class='tooltip-info text-left'><p class='font-smaller-1 font-weight-semibold mb-1'>We couldn't find the transaction on chain</p><p class='mb-0 font-smaller-2'>Please ensure the payment has been made and click on payout bounty </p></div>">
<i class="fas fa-exclamation-triangle text-danger mr-3"></i>
</span>
</template>

<button data-toggle="modal" :data-target="`#payoutModal${fulfillment.pk}`" class="btn btn-sm btn-gc-blue my-auto px-3 font-smaller-2 font-weight-semibold">
<i class="fas fa-money-check-alt mr-2 font-caption"></i>Payout Bounty
</button>
</template>

</template>

<template v-else>
Expand Down Expand Up @@ -664,17 +671,14 @@ <h3>{{ noscript.keywords }}</h3>
<script>
$('body').bootstrapTooltip({
selector: '[data-toggle="tooltip"]',
template: '<div class="no-tooltip" role="tooltip"><div class="tooltip-inner"></div></div>'
template: '<div class="no-tooltip" role="tooltip"><div class="tooltip-inner font-smaller-2"></div></div>'
});

$('[data-toggle="popover"]').popover()
$('body').on('mouseover', '[data-username]', function(e) {
openContributorPopOver($(this).data('username'), $(this));
});

// $('body').on('mouseout', '[data-username]', function(e) {
// $(this).popover('dispose');
// });

$('body').on('show.bs.popover', '[data-username]', function () {
$('body [data-username]').not(this).popover('hide');
})
Expand Down
19 changes: 6 additions & 13 deletions app/dashboard/templates/shared/organization_tooltip.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,9 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
{% endcomment %}
{% load i18n %}
<div class="tooltip-info">
<p class="font-subheader">{% trans "Tribe Name" %}</p>
<div class="font-body">
<div class="row">
<div class="col-12">
<strong>{% trans "Search by tribe name" %}:</strong>

{% trans "ex. gitcoinco, ethereum" %}

</div>
</div>
</div>
</div>
<div class="tooltip-info text-left">
<p class="font-smaller-1 font-weight-semibold">Tribe Name</p>
<p class="mb-0 font-smaller-2">
<span class="font-weight-bold">Search by tribe name</span> like gitcoinco, ethereum
</p>
</div>
16 changes: 6 additions & 10 deletions app/dashboard/templates/shared/permissions_type_tooltip.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,10 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
{% endcomment %}
{% load i18n %}
<div class="tooltip-info">
<p class="font-subheader">{% trans "Permissions" %}</p>
<div class="font-body">
<div class="row">
<ol class="pl-3">
<li class="mb-2"><strong>{% trans "Permissionless" %}:</strong> {% trans "Anyone can start work" %}</li>
<li class="mb-2"><strong>{% trans "Approval Required" %}:</strong> {% trans "Submitter will approve bounty hunters can start work." %}</li>
</ol>
</div>
</div>
<div class="tooltip-info text-left">
<p class="font-smaller-1 font-weight-semibold">Permissions</p>
<ol class="pl-3 mb-0 font-smaller-2">
<li class="mb-2"><strong>{% trans "Permissionless" %}:</strong> {% trans "Anyone can start work" %}</li>
<li class="mb-2"><strong>{% trans "Approval Required" %}:</strong> {% trans "Submitter will approve bounty hunters can start work." %}</li>
</ol>
</div>
20 changes: 8 additions & 12 deletions app/dashboard/templates/shared/project_type_tooltip.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,11 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
{% endcomment %}
{% load i18n %}
<div class="tooltip-info">
<p class="font-subheader">{% trans "Project Types" %}</p>
<div class="font-body">
<div class="row">
<ol class="pl-3">
<li class="mb-2"><strong>{% trans "Traditional" %}:</strong> {% trans "1 worker at a time, 1 is paid out" %}</li>
<li class="mb-2"><strong>{% trans "Contest" %}:</strong> {% trans "many workers at a time, 1 is paid out" %}</li>
<li class="mb-2"><strong>{% trans "Cooperative" %}:</strong> {% trans "many workers at a time, many are paid out" %}</li>
</ol>
</div>
</div>
</div>
<div class="tooltip-info text-left">
<p class="font-smaller-1 font-weight-semibold">{% trans "Project Types" %}</p>
<ol class="pl-3 mb-0 font-smaller-2">
<li class="mb-2"><strong>{% trans "Traditional" %}:</strong> {% trans "1 worker at a time, 1 is paid out" %}</li>
<li class="mb-2"><strong>{% trans "Contest" %}:</strong> {% trans "many workers at a time, 1 is paid out" %}</li>
<li class="mb-2"><strong>{% trans "Cooperative" %}:</strong> {% trans "many workers at a time, many are paid out" %}</li>
</ol>
</div>
36 changes: 14 additions & 22 deletions app/dashboard/templates/shared/status_tooltip.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,19 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
{% endcomment %}
{% load i18n %}
<div class="tooltip-info">
<p class="font-subheader">{% trans "Possible Status" %}</p>
<div class="font-body">
<div class="row">
<ol class="pl-3">
<li class="mb-2"><strong>{% trans "Open" %}:</strong> {% trans "A funded bounty is available for anyone to work on." %}</li>
<li class="mb-2"><strong>{% trans "Work Started" %}:</strong> {% trans "Work has been started by at least one person." %}</li>
<li class="mb-2"><strong>{% trans "Work Submitted" %}:</strong> {% trans "Completed work has been submitted by for review." %}</li>
<li class="mb-2"><strong>{% trans "Work Done" %}:</strong> {% trans "The submitted project has been accepted and the funds have been paid." %}</li>
</ol>
</div>
<div class="tooltip-info text-left">
<p class="font-smaller-1 font-weight-semibold">Possible Status</p>
<ol class="pl-3 mb-2 font-smaller-2">
<li class="mb-2"><strong>{% trans "Open" %}:</strong> {% trans "A funded bounty is available for anyone to work on." %}</li>
<li class="mb-2"><strong>{% trans "Work Started" %}:</strong> {% trans "Work has been started by at least one person." %}</li>
<li class="mb-2"><strong>{% trans "Work Submitted" %}:</strong> {% trans "Completed work has been submitted by for review." %}</li>
<li class="mb-2"><strong>{% trans "Work Done" %}:</strong> {% trans "The submitted project has been accepted and the funds have been paid." %}</li>
</ol>

<p class="font-smaller-1 font-weight-semibold">Possible Status</p>
<ol class="pl-3 mb-0 font-smaller-2">
<li class="mb-2"><strong>{% trans "Expired" %}:</strong> {% trans "Work was not completed by the expiration date." %}</li>
<li class="mb-2"><strong>{% trans "Canceled" %}:</strong> {% trans "A funded bounty was cancelled by the owner of the project" %}</li>
</ol>

</div>
<p class="font-subheader">{% trans "Cancellation Status" %}</p>
<div class="font-body">
<div class="row">
<ol class="pl-3">
<li class="mb-2"><strong>{% trans "Expired" %}:</strong> {% trans "Work was not completed by the expiration date." %}</li>
<li class="mb-2"><strong>{% trans "Canceled" %}:</strong> {% trans "A funded bounty was cancelled by the owner of the project" %}</li>
</ol>
</div>
</div>
</div>
</div>
3 changes: 3 additions & 0 deletions app/dashboard/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -5121,6 +5121,9 @@ def close_bounty_v1(request, bounty_id):
response['message'] = 'error: cannot close a bounty without making a payment'
return JsonResponse(response)

event_name = 'work_done'
record_bounty_activity(bounty, user, event_name)

bounty.bounty_state = 'done'
bounty.idx_status = 'done' # TODO: RETIRE
bounty.is_open = False # TODO: fixup logic in status calculated property on bounty model
Expand Down

0 comments on commit 78bf123

Please sign in to comment.