Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/gitcoinco/web into issue/…
Browse files Browse the repository at this point in the history
…6870
  • Loading branch information
developerfred committed Jun 29, 2020
2 parents 13439ba + af2efa3 commit 0dbd833
Show file tree
Hide file tree
Showing 103 changed files with 1,618 additions and 677 deletions.
2 changes: 1 addition & 1 deletion app/app/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,7 @@ def callback(request):
IPFS_API_ROOT = env('IPFS_API_ROOT', default='/api/v0')
IPFS_API_SCHEME = env('IPFS_API_SCHEME', default='https')

STABLE_COINS = ['DAI', 'SAI', 'USDT', 'TUSD', 'aDAI']
STABLE_COINS = ['DAI', 'SAI', 'USDT', 'TUSD', 'aDAI', 'USDC']

# Silk Profiling and Performance Monitoring
ENABLE_SILK = env.bool('ENABLE_SILK', default=False)
Expand Down
1 change: 1 addition & 0 deletions app/app/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,7 @@
path('_administration/email/wallpost', retail.emails.wallpost, name='wallpost_email'),
path('_administration/email/grant_update', retail.emails.grant_update, name='grant_update_email'),
path('_administration/email/grant_recontribute', retail.emails.grant_recontribute, name='grant_recontribute_email'),
path('_administration/email/grant_txn_failed', retail.emails.grant_txn_failed, name='grant_txn_failed_email'),
path(
'_administration/email/new_bounty_acceptance',
retail.emails.new_bounty_acceptance,
Expand Down
4 changes: 2 additions & 2 deletions app/assets/v2/css/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -969,8 +969,8 @@ input.is-invalid {
}

.alpha-warning {
background-color: #fb9470;
color: #fbe0d6;
background-color: #ada7d4;
color: white;
padding: 5px 10px;
border-radius: 2px;
margin-bottom: 15px;
Expand Down
8 changes: 8 additions & 0 deletions app/assets/v2/css/grants/grant.css
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,14 @@
color: white;
}

.grants-hero .amount-round{
color: #25E899;
}

.grants-hero .title-round{
font-size: 24px;
}

.grants-hero .font-header,
.grants-hero h1,
.explore_grants {
Expand Down
99 changes: 0 additions & 99 deletions app/assets/v2/css/quests.css
Original file line number Diff line number Diff line change
Expand Up @@ -216,56 +216,6 @@
width: 100%;
}

.card_head {
height: 140px;
}

.Example .card_head {
display: none;
}

.card_head span {
background-color: #e7f0fa;
color: var(--gc-blue);
font-size: 10px;
display: inline-block;
list-style: none;
padding: 5px;
transform: rotate(-15deg);
position: relative;
}

.card_head span.reward {
top: -45px;
left: -75px;
z-index: 999;
}

.card_head span.boss {
top: -50px;
left: -20px;
z-index: 999;
}

.card_img {
height: 120px;
width: 120px;
margin: 0px auto;
margin-bottom: 20px;
position: relative;
}

.card_img.reward {
width: 110px;
top: -120px;
right: -50px;
}

.card_img.boss {
top: 0px;
left: -50px;
}

.tags {
text-align: center;
margin-left: 0px;
Expand Down Expand Up @@ -407,18 +357,6 @@ body.quest_battle p {
border: 5px solid #0fce7c;
}

.quest-card.locked img {
filter: grayscale(1);
}

.quest-card .card_head img {
filter: grayscale(100%);
}

.quest-card:hover .card_head img {
filter: grayscale(0%);
}

#announce img {
margin: 0px auto;
margin-top: -150px;
Expand Down Expand Up @@ -519,47 +457,18 @@ body.quest_battle p {
right: 25%;
}

.quest-card.available:hover {
background-color: #aea0df !important;
cursor: pointer;
}

.quest-card.available:hover .pr-3 {
background-color: #4e40af !important;
border-top: 3px solid #2e208f !important;
}

.announce a:hover {
color: black;
font-weight: bold;
background-color: #f5d3d4;
}

.quest-card.locked div,
.quest-card.locked div a {
color: #aaa !important;
}

.quest-card.available:hover .pr-3,
.quest-card.available:hover .pr-3 a,
.quest-card.available:hover .pr-3 p {
color: white !important;
}

.quest-card.available:hover a.btn {
font-size: 18px;
}

.back_gradient {
background: linear-gradient(to right top, #0fce7c, #00a5a1, #0077b5, #0046a1, #0d0764) no-repeat;
animation: gradient 40s ease infinite;
background-size: 100% 400px !important;
}

.quest-card.available:hover .pr-3 p.desc {
border-top: 1px solid white !important;
}

#cta_button {
margin-top: 10%;
width: 60%;
Expand Down Expand Up @@ -717,14 +626,6 @@ body.quest_battle .bottom_notification {
color: red;
}

.quest-card.beaten div.pt-3 {
background-color: #c0eec0 !important;
}

.quest-card.cooldown div.pt-3 {
background-color: #aad4e5 !important;
}

#protagonist .flair div {
top: 35px;
}
Expand Down
6 changes: 1 addition & 5 deletions app/assets/v2/js/activity.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ $(document).ready(function() {
// inserts links into the text where there are URLS detected

function urlify(text) {
var urlRegex = /https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,4}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/g;
var urlRegex = /https?:\/\/(www\.)?[-a-zA-Z0-9@:;,%._\+~#=]{2,256}\.[a-z]{2,4}\b([-a-zA-Z0-9@:;,%_\+.~#?&//=]*)/g;

return text.replace(urlRegex, function(url) {
return '<a target=blank rel=nofollow href="' + url + '">' + url + '</a>';
Expand Down Expand Up @@ -396,10 +396,6 @@ $(document).ready(function() {
_alert('Please login first.', 'error');
return;
}
if (!web3) {
_alert('Please enable and unlock your web3 wallet.', 'error');
return;
}

if (!provider) {
return onConnect();
Expand Down
8 changes: 6 additions & 2 deletions app/assets/v2/js/amounts.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ var getUSDEstimate = function(amount, denomination, callback) {
}
var request_url = '/sync/get_amount?amount=' + amount + '&denomination=' + denomination;

jQuery.get(request_url, function(result) {
jQuery.get(request_url, function(results) {
const result = results[0];

amount_usdt = result['usdt'];
eth_amount = parseFloat(result['eth']);
conv_rate = amount_usdt / amount;
Expand Down Expand Up @@ -137,7 +139,9 @@ var getAmountEstimate = function(usd_amount, denomination, callback) {
}
var request_url = '/sync/get_amount?amount=' + amount + '&denomination=' + denomination;

jQuery.get(request_url, function(result) {
jQuery.get(request_url, function(results) {
const result = results[0];

amount_usdt = result['usdt'];
eth_amount = parseFloat(result['eth']);
conv_rate = amount_usdt / amount;
Expand Down
36 changes: 31 additions & 5 deletions app/assets/v2/js/cart-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,22 @@ class CartData {
const donations = this.loadCart();
let bulk_add_cart = 'https://gitcoin.co/grants/cart/bulk-add/';

let network = document.web3network;

if (!network) {
network = 'mainnet';
}

for (let i = 0; i < donations.length; i += 1) {
const donation = donations[i];
// eslint-disable-next-line no-loop-func
const token = tokens(network).filter(t => t.name === donation.grant_donation_currency);
let token_id = '';

bulk_add_cart += String(donation['grant_id']) + ',';
if (token.length) {
token_id = token[0].id;
}
bulk_add_cart += `${donation['grant_id']};${donation['grant_donation_amount']};${token_id},`;
}

if (document.contxt['github_handle']) {
Expand Down Expand Up @@ -50,19 +62,33 @@ class CartData {
let accptedTokenName;

try {
accptedTokenName = tokenAddressToDetailsByNetwork(grantData.grant_token_address, network).name;
const token = tokenAddressToDetailsByNetwork(grantData.grant_token_address, network);

grantData.token_local_id = token.id;
accptedTokenName = token.name;
} catch (e) {
// When numbers are too small toWei fails because there's too many decimal places
const dai = tokens(network).filter(t => t.name === 'DAI');

if (dai.length) {
grantData.token_local_id = dai[0].id;
}
accptedTokenName = 'DAI';
}

grantData.uuid = get_UUID();

if (acceptsAllTokens || 'DAI' == accptedTokenName) {
grantData.grant_donation_amount = 5;
grantData.grant_donation_currency = 'DAI';
if (!grantData.grant_donation_amount) {
grantData.grant_donation_amount = 5;
}
if (!grantData.grant_donation_currency) {
grantData.grant_donation_currency = 'DAI';
}
} else {
grantData.grant_donation_amount = 0.01;
if (!grantData.grant_donation_amount) {
grantData.grant_donation_amount = 0.01;
}
grantData.grant_donation_currency = 'ETH';
}

Expand Down
Loading

0 comments on commit 0dbd833

Please sign in to comment.