Skip to content

Commit

Permalink
Merge pull request #5732 from thelostone-mc/stb
Browse files Browse the repository at this point in the history
stable -> master
  • Loading branch information
thelostone-mc authored Jan 8, 2020
2 parents 36ab904 + 7565a3e commit acc0185
Show file tree
Hide file tree
Showing 22 changed files with 113 additions and 72 deletions.
1 change: 1 addition & 0 deletions app/assets/v2/css/grants/grant.css
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@
cursor: pointer;
}

.grant-partners .nav-link,
.grant-partners .nav-link:hover {
border: none;
}
Expand Down
2 changes: 1 addition & 1 deletion app/assets/v2/css/grants/new.css
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
}

.select2-container--default .select2-selection--multiple {
height: 2.75rem;
height: 2rem;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
Expand Down
28 changes: 25 additions & 3 deletions app/assets/v2/js/grants/new.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,27 @@ const init = () => {
$(this).select2();
});

$('#create-grant').validate({
$('#input-admin_address').on('change', function() {
$('.alert').remove();
const validator = $('#create-grant').validate();
let address = $(this).val();

if (isNaN(parseInt(address))) {
web3.eth.ens.getAddress(address).then(function(result) {
$('#input-admin_address').val(result);
return result;
}).catch(function() {
validator.showErrors({
'admin_address': 'Please check your address!'
});
return _alert({ message: gettext('Please check your address and try again.') }, 'error');
});
}
});

$('#create-grant').submit(function(e) {
e.preventDefault();
}).validate({
submitHandler: function(form) {
let data = {};

Expand Down Expand Up @@ -240,6 +260,7 @@ const init = () => {
});
});
});
return false;
}
});

Expand All @@ -259,7 +280,8 @@ const init = () => {
$('#js-token').select2();
$("#js-token option[value='0x0000000000000000000000000000000000000000']").remove();
$('#js-token').append("<option value='0x0000000000000000000000000000000000000000' selected='selected'>Any Token");
$('.select2-selection__rendered').hover(function() {
$(this).removeAttr('title');
});
});

$('.select2-selection__rendered').removeAttr('title');
};
6 changes: 3 additions & 3 deletions app/assets/v2/js/pages/quests.helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ var start_music_midi = function(name) {
if (!document.music_enabled) {
return;
}
if (!MIDIjs) {
if (typeof MIDIjs == 'undefined') {
return;
}
try {
Expand All @@ -116,14 +116,14 @@ var start_music_midi = function(name) {
};
var resume_music_midi = function(name) {
// get_audio('bossmusic.mid').play();
if (!MIDIjs) {
if (typeof MIDIjs == 'undefined') {
return;
}
MIDIjs.resume();
};
var pause_music_midi = function(name) {
// get_audio('bossmusic.mid').play();
if (!MIDIjs) {
if (typeof MIDIjs == 'undefined') {
return;
}
MIDIjs.pause();
Expand Down
2 changes: 1 addition & 1 deletion app/dashboard/templates/profiles/tab_grant_contribs.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ <h3 class="font-body mt-1 mb-1">Grants Created ({{profile.grant_admin.count}})</
{{ transaction.created_on|date:"Y-m-d" }}
</div>
<div class="col-2 col-md-2 justify-content-center special_tag">
<img class="avatar" style="max-width: 70px;" src="{% if transaction.logo %}{{ transaction.logo }}{% else %}{% with grant_logo='v2/images/grants/logos/' id=transaction.id|modulo:3 %} {% static grant_logo|addstr:id|add:'.png' %} {% endwith %} {% endif %}">
<img class="avatar" style="max-width: 70px;" src="{% if transaction.logo and transaction.logo.url %}{{ transaction.logo.url }}{% else %}{% with grant_logo='v2/images/grants/logos/' id=transaction.id|modulo:3 %} {% static grant_logo|addstr:id|add:'.png' %} {% endwith %} {% endif %}">
</div>
<div class="col-7 col-md-5 my-auto">
<div class="title font-body">
Expand Down
2 changes: 1 addition & 1 deletion app/grants/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class GrantAdmin(GeneralAdmin):
'team_member_list',
'subscriptions_links', 'contributions_links', 'link',
]
list_display =['pk', 'title', 'active','grant_type', 'link']
list_display =['pk', 'title', 'active','grant_type', 'link', 'hidden']
raw_id_fields = ['admin_profile']

# Custom Avatars
Expand Down
4 changes: 2 additions & 2 deletions app/grants/clr.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
from perftools.models import JSONStore

LOWER_THRESHOLD = 0.0
CLR_START_DATE = dt.datetime(2019, 9, 15, 0, 0)
CLR_START_DATE = dt.datetime(2020, 1, 6, 0, 0)


'''
Expand Down Expand Up @@ -226,7 +226,7 @@ def predict_clr(random_data=False, save_to_db=False, from_date=None, clr_type=No
if clr_type == 'tech':
grants = Grant.objects.filter(network=network, hidden=False, grant_type='tech')
elif clr_type == 'media':
grants = Grant.objects.filter(network=network, hidden=False, grant_type='tech')
grants = Grant.objects.filter(network=network, hidden=False, grant_type='media')
else:
grants = Grant.objects.filter(network=network, hidden=False)

Expand Down
18 changes: 9 additions & 9 deletions app/grants/templates/grants/activity.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
</p>
{% for subscription in subscriptions %}
<div class="py-3 mx-sm-0 row transaction-history">
<div class="col-2 font-subheader text-center text-md-left my-auto">
<div class="d-none d-sm-block col-2 font-subheader text-center text-md-left my-auto">
{{ subscription.created_on|date:"d M Y" }}
</div>
<div class="col-2 col-md-1 justify-content-center special_tag">
<div class="col-3 col-sm-2 col-md-1 justify-content-center special_tag">
<a href="{% url 'profile' subscription.contributor_profile.handle %}">
<img class="avatar rounded-circle" src="{{ subscription.contributor_profile.avatar_url }}">
</a>
</div>
<div class="col-4 my-auto">
<div class="col-5 col-sm-4 my-auto">
<div class="font-weight-semibold font-body">
<a href="{% url 'profile' subscription.contributor_profile.handle %}">
{{ subscription.contributor_profile }}
Expand Down Expand Up @@ -58,15 +58,15 @@
</p>
{% for transaction in contributions %}
<div class="py-3 mx-sm-0 row transaction-history">
<div class="col-2 font-subheader text-center text-md-left my-auto">
<div class="d-none d-sm-block col-2 font-subheader text-center text-md-left my-auto">
{{ transaction.created_on|date:"d M Y" }}
</div>
<div class="col-2 col-md-1 justify-content-center special_tag">
<div class="col-3 col-sm-2 col-md-1 justify-content-center special_tag">
<a href="{% url 'profile' transaction.subscription.contributor_profile.handle %}">
<img class="avatar rounded-circle" src="{{ transaction.subscription.contributor_profile.avatar_url }}">
</a>
</div>
<div class="col-4 my-auto">
<div class="col-5 col-sm-4 my-auto">
<div class="font-weight-bold font-body">
<a href="{% url 'profile' transaction.subscription.contributor_profile.handle %}">
{{ transaction.subscription.contributor_profile }}
Expand Down Expand Up @@ -115,15 +115,15 @@
</p>
{% for subscription in cancelled_subscriptions %}
<div class="py-3 mx-sm-0 row transaction-history">
<div class="col-2 font-subheader text-center text-md-left my-auto">
<div class="d-none d-sm-block col-2 font-subheader text-center text-md-left my-auto">
{{ subscription.created_on|date:"d M Y" }}
</div>
<div class="col-2 col-md-1 justify-content-center special_tag">
<div class="col-3 col-sm-2 col-md-1 justify-content-center special_tag">
<a href="{% url 'profile' subscription.contributor_profile.handle %}">
<img class="avatar rounded-circle" src="{{ subscription.contributor_profile.avatar_url }}">
</a>
</div>
<div class="col-4 my-auto">
<div class="col-5 col-sm-4 my-auto">
<div class="font-weight-semibold font-body">
<a href="{% url 'profile' subscription.contributor_profile.handle %}">
{{ subscription.contributor_profile }}
Expand Down
11 changes: 5 additions & 6 deletions app/grants/templates/grants/card/clr_estimate.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,39 +5,38 @@
Your contribution goes a long way!
<img class="float-right" src="{% static "v2/images/diamonds_high_fiving.gif" %}" >
</p>
{% if not show_only_estimate %}
<div class="row mx-1">
<div class="col-6 px-2 mb-2">
<p class="predict-label mb-0"><span class="font-weight-semibold">1 DAI</span> contribution</p>
<p class="amount mb-0">
<i class="fas fa-arrow-circle-right"></i>
<span class="font-weight-bold"> + {{ grant.clr_prediction_curve.1.2|floatformat:0|intcomma }} DAI</span> match
<span class="font-weight-bold"> + {{ grant.clr_prediction_curve.1.2|floatformat:0|intcomma|default:0 }} DAI</span> match
</p>
</div>

<div class="col-6 px-2 mb-2">
<p class="predict-label mb-0"><span class="font-weight-semibold">10 DAI</span> contribution</p>
<p class="amount mb-0">
<i class="fas fa-arrow-circle-right"></i>
<span class="font-weight-bold"> + {{ grant.clr_prediction_curve.2.2|floatformat:0|intcomma }} DAI</span> match
<span class="font-weight-bold"> + {{ grant.clr_prediction_curve.2.2|floatformat:0|intcomma|default:0 }} DAI</span> match
</p>
</div>

<div class="col-6 px-2 mb-2">
<p class="predict-label mb-0"><span class="font-weight-semibold">100 DAI</span> contribution</p>
<p class="amount mb-0">
<i class="fas fa-arrow-circle-right"></i>
<span class="font-weight-bold"> + {{ grant.clr_prediction_curve.3.2|floatformat:0|intcomma }} DAI</span> match
<span class="font-weight-bold"> + {{ grant.clr_prediction_curve.3.2|floatformat:0|intcomma|default:0 }} DAI</span> match
</p>
</div>

<div class="col-6 px-2 mb-2">
<p class="predict-label mb-0"><span class="font-weight-semibold">1,000 DAI</span> contribution</p>
<p class="amount mb-0">
<i class="fas fa-arrow-circle-right"></i>
<span class="font-weight-bold"> + {{ grant.clr_prediction_curve.4.2|floatformat:0|intcomma }} DAI</span> match
<span class="font-weight-bold"> + {{ grant.clr_prediction_curve.4.2|floatformat:0|intcomma|default:0 }} DAI</span> match
</p>
</div>
{% endif %}

</div>
</div>
4 changes: 2 additions & 2 deletions app/grants/templates/grants/card/clr_match.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

<div class="clr">
<h2 class="label font-caption font-weight-semibold mb-1 p-1 text-center">
CLR MATCH ROUND 3
CLR MATCH ROUND 4
</h2>

<h2 class="font-title font-weight-bold amount pt-1 mb-0">
{{ grant.clr_prediction_curve.0.1|floatformat:0|intcomma }} DAI
{{ grant.clr_prediction_curve.0.1|floatformat:0|intcomma|default:0 }} DAI
</h2>
<p class="amount mb-2 font-caption font-weight-semibold">ESTIMATED</p>
</div>
13 changes: 12 additions & 1 deletion app/grants/templates/grants/detail/info.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ <h6 class="modal-title text-center" id="changeLogoLabel">Change Grant Logo</h6>
</div>

<div>

<h1 class="font-title-xl my-4 font-weight-bold">
{% if is_team_member %}
<textarea id="form--input__title" class="p-0 m-0 inline-edit font-body" maxlength="150" disabled>{{ grant.title }}</textarea>
Expand All @@ -68,6 +67,18 @@ <h1 class="font-title-xl my-4 font-weight-bold">

<!-- SUMMARY INFO -->
<div class="summary-info mb-4 pb-1">

{% if grant.hidden %}
<div class="mb-2 font-smaller-2">
<i style="width: 14px; top:0.6rem" class="mb-2 mb-md-0 fas fa-eye-slash mr-2 text-center position-relative"></i>
<p class="d-md-inline">
<span>This grant is being reviewed by the Gitcoin team.</span> <br>
<span class="ml-4 pl-1">It will remain hidden from the explorer until then.</span>
</p>
</div>
{% endif %}


<div class="font-body mb-2">
{% if is_team_member %}
<textarea id="form--input__reference-url" class="p-0 m-0 inline-edit" disabled>{{ grant.reference_url }}</textarea>
Expand Down
2 changes: 1 addition & 1 deletion app/grants/templates/grants/fund.html
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ <h2 class="font-title-lg my-4">{% trans "Fund Grant" %}</h2>
<div class="row">
<div class="col-6 col-sm-8">
<label class="form__label" id="amount_label">{% trans "Amount Per Period" %}</label>
<input type="number" min="0.001" id="amount" name="amount_per_period" class="form__input" value="5" required />
<input type="number" min="0.001" step=".001" id="amount" name="amount_per_period" class="form__input" value="5" required />
</div>
<div class="col-6 col-sm-4">
<label class="form__label" id="token_label">{% trans "Token" %}</label>
Expand Down
47 changes: 24 additions & 23 deletions app/grants/templates/grants/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,23 +57,23 @@ <h1 class="font-title-xl font-weight-semibold">{% trans 'Get Substantial Sustain

<div class="container-fluid py-4 grants-results">
<div class="container">
<div class="col-12">
<p class="font-smaller-1">
<strong>Gitcoin Grants</strong> has facilitated the distribution of
<strong>${{grant_amount|floatformat:0}}k</strong> to projects since
its launch in January 2019.
<a href="/results">See more results</a>.
</p>
<img src="{% static 'v2/images/grants/robots.png' %}" style="max-width: 150px;" class="mt-1" />
</div>
<strong>Gitcoin Grants</strong> has facilitated the distribution of <strong>${{grant_amount|floatformat:0}}k</strong> to Open Source since it's launch in January 2019.
<a class="font-body" href="/results">See more results</a>.
<br>
<img src="{% static 'v2/images/grants/robots.png' %}" style="max-width: 100px;" class="pt-3" />

</div>
</div>

<div class="col-md-12 font-smaller-1 text-center mt-4">
<div class="container-fluid pt-0 pb-5 grants-matching">
<div class="container">
<div class="col-md-12 font-smaller-1 text-center pt-2">
<p class="mb-1 font-weight-semibold">
$100k Round 3 has closed!
$200k Round 4 is now live!!
</p>
<p class="mb-1">
From 9/16 through 10/2 we were matching contributions with quadratic
funding for which we've announced the winners
From <strong>1/6 through 1/21 at 16:59 PST</strong> we will be matching contributions with quadratic funding.
<a href="https://gitcoin.co/blog/gitcoin-grants-2020/">More details here</a>
</p>
<p>
Gitcoin Grants is the largest pilot for Quadratic Funding around!
Expand All @@ -85,11 +85,12 @@ <h1 class="font-title-xl font-weight-semibold">{% trans 'Get Substantial Sustain
{% trans 'Become a Matching Partner' %}
</a>
{% else %}
<div class="btn btn-gc-blue font-body font-weight-semibold" onclick="processPayment()">
{% trans 'Become a Matching Partner for Round 4' %}
<div class="btn btn-gc-blue font-subtitle font-weight-semibold" onclick="processPayment()">
{% trans 'Become a Matching Partner' %}
</div>
{% endif %}
</div>

</div>
</div>
</div>
Expand Down Expand Up @@ -138,7 +139,7 @@ <h1 class="font-title-xl font-weight-semibold">{% trans 'Get Substantial Sustain
<h2 class="text-uppercase font-weight-semibold font-bigger-3 pt-4 mt-2 px-4">
{{ type }} GRANTS CLR MATCHING ROUND 4
</h2>
<p class="px-4">Jan 2, 2020 - Feb 2, 2020</p>
<p class="px-4">Jan 6, 2020 - Jan 21, 2020</p>
</div>
<div class="col-12 col-md-3 total_active_fund">
<p class="pt-4 mb-0 font-weight-semibold">${{current_partners_fund|floatformat|intcomma}}</p>
Expand Down Expand Up @@ -227,12 +228,12 @@ <h2 class="text-uppercase font-weight-semibold font-bigger-3 pt-4 mt-2 px-4">
<div class="heading">{% trans "Sort by" %}</div>
<select name="sort_option" id="sort_option">
<option value="weighted_shuffle">{% trans "Weighted Shuffle" %}</option>
<option value="match_pledge_amount_1">{% trans "Round 3 - $1 Contrib Matching Amount" %}</option>
<option value="match_pledge_amount_10">{% trans "Round 3 - $10 Contrib Matching Amount" %}</option>
<option value="match_pledge_amount_100">{% trans "Round 3 - $100 Contrib Matching Amount" %}</option>
<option value="match_pledge_amount_1000">{% trans "Round 3 - $1k Contrib Matching Amount" %}</option>
<option value="-clr_prediction_curve__0__1">{% trans "Round 3 - CLR Match Estimate: Highest" %}</option>
<option value="clr_prediction_curve__0__1">{% trans "Round 3 - CLR Match Estimate: Lowest" %}</option>
<option value="match_pledge_amount_1">{% trans "Round 4 - $1 Contrib Matching Amount" %}</option>
<option value="match_pledge_amount_10">{% trans "Round 4 - $10 Contrib Matching Amount" %}</option>
<option value="match_pledge_amount_100">{% trans "Round 4 - $100 Contrib Matching Amount" %}</option>
<option value="match_pledge_amount_1000">{% trans "Round 4 - $1k Contrib Matching Amount" %}</option>
<option value="-clr_prediction_curve__0__1">{% trans "Round 4 - CLR Match Estimate: Highest" %}</option>
<option value="clr_prediction_curve__0__1">{% trans "Round 4 - CLR Match Estimate: Lowest" %}</option>
<option value="-clr_matching">{% trans "Rounds 1 & 2 - Total CLR Match: Highest" %}</option>
<option value="clr_matching">{% trans "Rounds 1 & 2 - Total CLR Match: Lowest" %}</option>
<option value="-created_on">{% trans "Created: Recent" %}</option>
Expand Down Expand Up @@ -264,7 +265,7 @@ <h2 class="text-uppercase font-weight-semibold font-bigger-3 pt-4 mt-2 px-4">
{% if grants.has_next %}
<p class="mb-0 text-center py-4">
<a class="infinite-more-link text-center text-black-70 cursor-pointer"
href="?network={{network}}&type={{type}}keyword={{keyword}}&sort_option={{sort}}&page={{ grants.next_page_number }}"
href="?network={{network}}&type={{type}}&keyword={{keyword}}&sort_option={{sort}}&page={{ grants.next_page_number }}"
>
<i class="fas fa-spinner fa-spin mr-2"></i>
Collecting more exciting grants
Expand Down
5 changes: 3 additions & 2 deletions app/grants/templates/grants/new.html
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ <h1 class="text-center font-title-xl">{% trans "Create a Grant" %}</h1>
<div class="row">
<div class="col-12 col-md-6">
<label class="font-body">{% trans "Monthly amount sought in DAI" %}</label>
<input type="number" id="amount_goal" name="amount_goal" class="form__input form__input-lg" min="0.001" required />
<input type="number" id="amount_goal" name="amount_goal" class="form__input form__input-lg" min="0.001" step=".001" required />
</div>
<div class="col-12 col-md-6">
<label class="font-body">{% trans "Required Token For Subscription" %}</label>
Expand All @@ -106,7 +106,7 @@ <h1 class="text-center font-title-xl">{% trans "Create a Grant" %}</h1>

<div class="form__group-horizontal pb-3">
<label class="font-body" for="input-admin_address">{% trans "Recipient Wallet Address" %}</label>
<input type="text" class="form__input form__input-lg " id="input-admin_address" value="" name="admin_address" required/>
<input type="text" class="form__input form__input-lg " id="input-admin_address" value="" name="admin_address" required placeholder="0x00... or domain.eth"/>
</div>


Expand All @@ -128,6 +128,7 @@ <h5 class="font-subheader pb-2">{% trans "Gas Settings" %}</h5>
</div>

<div class="form__footer text-center">
<p class="font-caption mb-3 text-black-60">* Grant will appear on the grants search only after being reviewed by the Gitcoin Team</p>
<button class="button button--primary button--full" id="new_button">{% trans "Create Grant" %}</button>
</div>

Expand Down
Loading

0 comments on commit acc0185

Please sign in to comment.