Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Added support for EIP-1102 #2548

Merged
merged 19 commits into from
Nov 10, 2018
Merged
Prev Previous commit
Next Next commit
Changed faucet to use latest banners and fixed tips
Muhammad Usman committed Nov 8, 2018
commit 949e86b0a20e51ef208d4dc0342f149284c21f4a
2 changes: 2 additions & 0 deletions app/assets/onepager/js/web3alert.js
Original file line number Diff line number Diff line change
@@ -29,6 +29,8 @@ var metaMaskWarning = function() {
_alert({ message: gettext('You must install <a href=https://metamask.io/>Metamask</a> to use this tool.') }, 'info');
}
return true;
} else if (is_metamask_unlocked && !is_metamask_approved) {
_alert({ message: gettext('Please connect to Metamask.') }, 'info');
} else if (web3.eth.accounts.length == 0) {
_alert({ message: gettext('Please unlock Metamask.') }, 'info');
return true;
2 changes: 2 additions & 0 deletions app/assets/v2/js/shared.js
Original file line number Diff line number Diff line change
@@ -787,11 +787,13 @@ var trigger_faucet_form_web3_hooks = function() {
$('#no_metamask_error').css('display', 'none');
$('#unlock_metamask_error').css('display', 'none');
$('#connect_metamask_error').css('display', 'block');
$('#over_balance_error').css('display', 'none');
$('#faucet_form').addClass('hidden');
} else if (!web3.eth.coinbase) {
$('#no_metamask_error').css('display', 'none');
$('#unlock_metamask_error').css('display', 'block');
$('#connect_metamask_error').css('display', 'none');
$('#over_balance_error').css('display', 'none');
$('#faucet_form').addClass('hidden');
return;
} else if (balance >= faucet_amount) {
5 changes: 3 additions & 2 deletions app/faucet/templates/faucet_form.html
Original file line number Diff line number Diff line change
@@ -32,9 +32,10 @@
<div class="col body">
<div class="container-fluid no-gutter">
<div class="form-container" id="form_container">
{% include 'shared/faucet_no_metamask_error.html' %}
{% include 'shared/no_metamask_error.html' %}
{% include 'shared/unlock_metamask.html' %}
{% include 'shared/connect_metamask.html' %}
{% include 'shared/faucet_over_balance_error.html' %}
{% include 'shared/faucet_unlock_metamask.html' %}
<div id="faucet_form">
<div class="faucet-form" id="primary_form">
<h3>{% trans "Faucet Request" %} <span id="alpha">{% trans "Alpha" %}</span></h3>
58 changes: 35 additions & 23 deletions app/faucet/templates/shared/faucet_over_balance_error.html
Original file line number Diff line number Diff line change
@@ -1,29 +1,41 @@
{% comment %}
Copyright (C) 2018 Gitcoin Core
Copyright (C) 2018 Gitcoin Core

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
{% endcomment %}
{% load i18n static %}
<div id="over_balance_error" class="blocking_error" style="display: none">
<img src="{% static "v2/images/prime.png" %}" style="max-height: 100px;">
<br>
<h3>{% trans "You Appear to Have Ether!" %}</h3>
<p>
{% trans "Thank you for your interest in receiving a faucet distribution." %}
</p>
<p>
{% trans "You have more ether currently in your wallet than the distribution would provide. Please use that ether to pay the transaction cost." %}
</p>
</div>
<div id="over_balance_error" class="submit-notification metamask-error container-fluid" style="display: none;">
<div class="row align-items-center px-4 py-2 text-center text-lg-left">
<div class="col-lg-10 col-sm-12 py-2 px-5">
<h3>{% trans "You Appear to Have Ether!" %}</h3>
<p>
{% trans "Thank you for your interest in receiving a faucet distribution." %}
</p>
<p>
{% trans "You have more ether currently in your wallet than the distribution would provide. Please use that ether to pay the transaction cost." %}
</p>
<div class="col-lg-2 col-sm-12">
<img id="metamask_logo" src="{% static "v2/images/metamask.svg" %}" alt="Metamask Logo">
</div>
</div>
</div>
<style type="text/css">
@media only screen and (min-width: 992px) {
#metamask_logo {
position: absolute;
left: 650%;
top: -100px;
}
}
</style>