Skip to content

Commit

Permalink
Merge pull request #2946 from thelostone-mc/grants
Browse files Browse the repository at this point in the history
grant/cancel-contribute revamp
  • Loading branch information
thelostone-mc authored Nov 26, 2018
2 parents 1c85b75 + 834f395 commit b41fd07
Show file tree
Hide file tree
Showing 15 changed files with 103 additions and 118 deletions.
5 changes: 3 additions & 2 deletions app/assets/v2/css/grants/fund.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.admin_profile a {
color: #43484D;
.admin_profile a,
.grant-link a {
color: #0D0764;
}

#grants_form input {
Expand Down
Binary file removed app/assets/v2/images/bitmap.png
Binary file not shown.
Binary file added app/assets/v2/images/grants/logos/0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/assets/v2/images/grants/logos/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/assets/v2/images/grants/logos/2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/assets/v2/images/grants/logos/3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed app/assets/v2/images/grants/logos/4.png
Binary file not shown.
37 changes: 37 additions & 0 deletions app/grants/templates/grants/banner.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{% load static humanize i18n grants_extra %}

<div class="col-12 grant-banner py-5 row mx-0">
<div class="col-12 offset-md-2 col-md-3 py-4 banner-img">
<img src="{% if grant.logo and grant.logo.url %}{{ grant.logo.url }}{% else %}{% with grant_logo='v2/images/grants/logos/' id=grant.id|modulo:3 %} {% static grant_logo|addstr:id|add:'.png' %} {% endwith %} {% endif %}">
</div>
<div class="col-12 offset-sm-1 col-sm-10 col-md-4 ml-md-5 py-4 my-auto">
<h1 class="font-title-xl grant-title mb-3">
<a href="{{ grant.reference_url }}" target="_blank">{{ grant.title }}</a>
</h1>

<div class="admin_profile">
{% trans "by" %}
<a href="{% url 'profile' grant.admin_profile.handle %}">
{{ grant.admin_profile }}
</a>
</div>

<div class="grant__progress mt-4">
<div class="progress">
<div class="progress-bar" style="width:{{ grant.percent_completed }}%"></div>
</div>
<div class="progress-text mt-2">
<div class="row">
<div class="col-6">
<span>{{ grant.amount_received|floatformat:2|intcomma }} DAI</span>
<p>Current</p>
</div>
<div class="col-6 text-right">
<span>{{ grant.amount_goal|floatformat:2|intcomma }} DAI</span>
<p>Goal</p>
</div>
</div>
</div>
</div>
</div>
</div>
113 changes: 46 additions & 67 deletions app/grants/templates/grants/cancel.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
<head>
{% include 'shared/head.html' %}
{% include 'shared/cards.html' %}
<link rel="stylesheet" href="{% static "v2/css/grants/fund.css" %}">
</head>
<body class="interior {{ active }} grant">
{% include 'shared/tag_manager_2.html' %}
Expand All @@ -35,86 +36,64 @@
</div>
</div>
</div>
<img src="{% static "v2/images/bitmap.png" %}" width="100%" />

<div class="alpha-warning font-caption">
<div>
{% trans "WARNING: Gitcoin Grants is in" %}
<span class="font-weight-bold">ALPHA</span>
{% trans "release." %}
</div>
<div>
{% trans "It has had inital audits done on it's smart contract and we are in the process of testing it holistically. Please, use caution and do not send high amounts of value." %}
</div>
</div>

<div class="row">
<div id="robot_error" class="hidden my-5">
<img src="{% static "v2/images/prime.png" %}">
</div>
</div>

<div id="grants_form">
<h2 class="my-5 text-center">
<div class="mb-2 font-title-lg">
{% trans "Cancel contribution for" %}
<a href="{{ grant.reference_url }}" target="_blank">
{{ grant.title }}
</a>
{% trans "Grant" %}
</div>
</h2>
<div class="row" id="grants_form">

<div class="container">
<div class="row mb-4">
<div class="col-6">
<div class="grant__progress mt-4 cancel">
<div class="progress">
<div class="progress-bar" style="width:{{ grant.percent_completed }}%"></div>
</div>
<div class="col-12 text-center mt-md-3">
<h2 class="font-title-lg my-4">{% trans "Cancel Contribution" %}</h2>
</div>

{% include 'grants/banner.html' %}

<div class="progress-text mt-2">
<div class="row">
<div class="col-6">
<span>{{ grant.amount_received }} ETH</span>
<p>Current</p>
</div>
<div class="col-6 text-right">
<span>{{ grant.amount_goal }} ETH</span>
<p>Goal</p>
</div>
</div>
</div>
</div>
<div class="col-12 offset-md-2 col-md-10 offset-lg-3 col-lg-5 mt-5 font-subheader mx-0 mx-md-auto row">

<div class="row dates">
<div class="col-6">
{% trans "Start date:" %} {{ subscription.created_on|date:"M d, Y" }}
</div>
<div class="col-6 text-right">
{% trans "Effective date of cancel:" %} {{ now|date:"M d, Y" }}
</div>
</div>
<div class="col-12 summary font-body my-4">
<p class="mb-2 font-weight-semibold">Summary</p>
<p>
<i class="fas fa-circle mr-2"></i>
{% trans "Your contribution will be cancelled from" %}
<span class="font-weight-semibold">{{ now|date:"M d, Y" }}</span>
</p>
</div>

<div class="row mt-4">
<div class="col-6">
<a href="{% url 'grants:details' grant.id grant.slug %}">
<button class="button button--cancel button--full">{% trans "Cancel" %}
</button>
</a>
</div>
<div class="col-6">
<form method="POST" id="js-cancelSubscription">
{% csrf_token %}
<button class="button button--primary button--full">{% trans "Cancel Contribution" %}
</button>
<input type="hidden" id="contract_address" name="contract_address" value="{{ grant.contract_address }}">
<input type="hidden" id="admin_address" name="admin_address" value="{{ grant.admin_address }}">
<input type="hidden" id="token_address" name="token_address" value="{{ subscription.token_address }}">
<input type="hidden" id="amount_per_period" name="amount_per_period" value="{{ subscription.amount_per_period }}">
<input type="hidden" id="real_period_seconds" name="real_period_seconds" value="{{ subscription.real_period_seconds }}">
<input type="hidden" id="signature" name="signature" value="{{ subscription.contributor_signature }}">
<input type="hidden" id="gas_price" name="gas_price" value="{{ subscription.gas_price }}">
</form>
</div>
</div>
</div>
<div class="col-12 my-4">
<form method="POST" id="js-cancelSubscription">
{% csrf_token %}
<button class="button button--primary button--warning button--full">{% trans "Cancel Contribution" %}
</button>
<input type="hidden" id="contract_address" name="contract_address" value="{{ grant.contract_address }}">
<input type="hidden" id="admin_address" name="admin_address" value="{{ grant.admin_address }}">
<input type="hidden" id="token_address" name="token_address" value="{{ subscription.token_address }}">
<input type="hidden" id="amount_per_period" name="amount_per_period" value="{{ subscription.amount_per_period }}">
<input type="hidden" id="real_period_seconds" name="real_period_seconds" value="{{ subscription.real_period_seconds }}">
<input type="hidden" id="signature" name="signature" value="{{ subscription.contributor_signature }}">
<input type="hidden" id="gas_price" name="gas_price" value="{{ subscription.gas_price }}">
</form>
</div>

<div class="col-6">
<p>
{{ grant.description }}
</p>
</div>
<div class="col-12 mt-3 mb-5 text-center grant-link font-body">
<a href="{% url 'grants:details' grant.id grant.slug %}">
{% trans "No I do not want to cancel my contribution" %}
</a>
</div>

</div>
</div>

Expand Down
2 changes: 1 addition & 1 deletion app/grants/templates/grants/card.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<div class="grant-item">
<a href="{% url 'grants:details' grant.id grant.slug %}">
<div class="grant-item__img">
<img src="{% if grant.logo and grant.logo.url %}{{ grant.logo.url }}{% else %}{% with grant_logo='v2/images/grants/logos/' id=grant.id|modulo:3|add:1 %} {% static grant_logo|addstr:id|add:'.png' %} {% endwith %} {% endif %}">
<img src="{% if grant.logo and grant.logo.url %}{{ grant.logo.url }}{% else %}{% with grant_logo='v2/images/grants/logos/' id=grant.id|modulo:3 %} {% static grant_logo|addstr:id|add:'.png' %} {% endwith %} {% endif %}">
</div>
<div class="grant-item__content py-4 px-3">
<h2 class="grant-item__title font-subheader"><a href="{% url 'grants:details' grant.id grant.slug %}">{{ grant.title|truncatechars:60 }}</a></h2>
Expand Down
17 changes: 9 additions & 8 deletions app/grants/templates/grants/detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@
<div class="grant__header py-5">
<div class="container">
<div class="row">
<div class="grant-banner col-12 col-lg-6 col-xl-5 p-0 mb-5 my-md-auto">
<img src="{% if grant.logo and grant.logo.url %}{{ grant.logo.url }}{% else %}{% with grant_logo='v2/images/grants/logos/' id=grant.id|modulo:3|add:1 %} {% static grant_logo|addstr:id|add:'.png' %} {% endwith %} {% endif %}">
<div class="grant-banner col-12 col-lg-6 pr-lg-5 p-0 mb-5 my-md-auto">
<img src="{% if grant.logo and grant.logo.url %}{{ grant.logo.url }}{% else %}{% with grant_logo='v2/images/grants/logos/' id=grant.id|modulo:3 %} {% static grant_logo|addstr:id|add:'.png' %} {% endwith %} {% endif %}">
</div>
<div class="col-12 col-lg-6 offset-xl-1 col-xl-5">
<div class="col-12 col-lg-6">
<div class="row">
<div class="col-12">
<div class="grant__specs">
Expand Down Expand Up @@ -155,6 +155,7 @@ <h5 class="font-body mt-2 font-weight-semibold">
<div class="container py-5">
<div class="row">
<div class="col-12 col-md-6 pl-lg-0">
<p class="font-body sub-title">{% trans "Description" %}</p>
<p class="grant__description font-subheader pr-lg-4 mb-5">
{% if is_admin %}
<textarea id="form--input__description" class="p-0 mt-2 inline-edit" disabled>{{ grant.description }}</textarea>
Expand All @@ -169,7 +170,7 @@ <h5 class="font-body mt-2 font-weight-semibold">
<div class="grant-item__member mb-4">
{% if is_admin %}
<div class="font-body">
<p class="font-body sub-title">Team Members</p>
<p class="font-body sub-title">{% trans "Team Members" %}</p>
<div class="form__select2">
<select id="grant-members" class="form__input" name="grant-members" name="members" multiple="multiple" disabled>
{% for team_member in grant.team_members.all %}
Expand All @@ -180,7 +181,7 @@ <h5 class="font-body mt-2 font-weight-semibold">
</div>
{% else %}
{% if grant.team_members %}
<p class="font-body sub-title">Team Members ({{ grant.team_members.all|length }})</p>
<p class="font-body sub-title">{% trans "Team Members" %} ({{ grant.team_members.all|length }})</p>
<div class="grant-item__members font-body">
{% for team_member in grant.team_members.all %}
<div class="grant-item__member mr-4">
Expand Down Expand Up @@ -219,7 +220,7 @@ <h5 class="font-body mt-2 font-weight-semibold">
<div class="update-milestone pt-4">
<div class="container mt-4">
<div class="row">
<div class="col-12 order-md-2 col-md-4">
<div class="col-12 order-md-2 col-md-6">
<p>
{% trans "Milestones" %}
{% if is_admin %}<a href="{% url 'grants:milestones' grant.id grant.slug %}" class="milestones-edit">{% trans "Edit Milestones" %}</a>{% endif %}
Expand All @@ -246,10 +247,10 @@ <h5 class="font-body mt-2 font-weight-semibold">
</div>
</div>

<div class="col-12 order-md-1 col-md-8 p-md-0">
<div class="col-12 order-md-1 col-md-6 p-md-0">
<div id="tabs">
<ul>
<li><a href="#all-updates">{% trans "Updates" %}</a></li>
<li><a href="#all-updates" class="pt-md-0">{% trans "Updates" %}</a></li>
</ul>
<div id="all-updates" class="p-0">
{% if is_admin %}
Expand Down
41 changes: 4 additions & 37 deletions app/grants/templates/grants/fund.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
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 static humanize i18n grants_extra %}
{% load static humanize i18n %}
<!DOCTYPE html>
<html lang="en">
<head>
Expand Down Expand Up @@ -56,44 +56,11 @@

<div class="row" id="grants_form">
<div class="col-12 text-center mt-md-3">
<h2 class="font-title-lg my-5">{% trans "Fund Grant" %}</h2>
<h2 class="font-title-lg my-4">{% trans "Fund Grant" %}</h2>
</div>
<div class="col-12 grant-banner py-5 row mx-0">
<div class="col-12 offset-md-2 col-md-3 py-4 banner-img">
<img src="{% if grant.logo and grant.logo.url %}{{ grant.logo.url }}{% else %}{% with grant_logo='v2/images/grants/logos/' id=grant.id|modulo:3|add:1 %} {% static grant_logo|addstr:id|add:'.png' %} {% endwith %} {% endif %}">
</div>
<div class="col-12 col-md-4 offset-md-1 ml-md-5 py-4 my-auto">
<h1 class="font-title-xl grant-title mb-3">
<a href="{{ grant.reference_url }}" target="_blank">{{ grant.title }}</a>
</h1>

<div class="admin_profile">
{% trans "by" %}
<a href="{% url 'profile' grant.admin_profile.handle %}">
{{ grant.admin_profile }}
</a>
</div>

<div class="grant__progress mt-4">
<div class="progress">
<div class="progress-bar" style="width:{{ grant.percent_completed }}%"></div>
</div>
<div class="progress-text mt-2">
<div class="row">
<div class="col-6">
<span>{{ grant.amount_received|floatformat:2|intcomma }} DAI</span>
<p>Current</p>
</div>
<div class="col-6 text-right">
<span>{{ grant.amount_goal|floatformat:2|intcomma }} DAI</span>
<p>Goal</p>
</div>
</div>
</div>
</div>

</div>
</div>
{% include 'grants/banner.html' %}

<div class="col-12 offset-md-2 col-md-10 offset-lg-3 col-lg-6 mt-5 font-subheader mx-0 mx-md-auto row">
<p class="col-12 font-weight-semibold my-4">
{{ grant.admin_profile }} {% trans "is accepting contributions in "%}
Expand Down
2 changes: 1 addition & 1 deletion app/grants/templates/grants/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ <h1 class="font-title-xl">{% trans 'Provide sustainable funding for Open Source
{% blocktrans %}
Gitcoin Grants, powered by the <a target="_blank" rel="noopener noreferrer" href="http://1337alliance.com/">EIP 1337 standard</a>
, are a fast, easy and secure way to provide recurring token contributions to your favorite OSS maintainers. <br/><br/>
Show your appreciation for maintainers in your dependancy tree with a Gitcoin Grant today.
Show your appreciation for maintainers in your dependency tree with a Gitcoin Grant today.
{% endblocktrans %}
</p>
<a class="btn btn-gc-blue" href="{% url 'grants:new' %}">
Expand Down
2 changes: 1 addition & 1 deletion app/retail/templates/emails/grants/new_grant.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ <h1>{% trans "New Grant Created" %}</h1>

<hr>

<img src="{% if grant.logo and grant.logo.url %}{{ grant.logo.url }}{% else %}{% with grant_logo='v2/images/grants/logos/' id=grant.id|modulo:3|add:1 %} {% static grant_logo|addstr:id|add:'.png' %} {% endwith %} {% endif %}" alt="grant logo" width="25%" >
<img src="{% if grant.logo and grant.logo.url %}{{ grant.logo.url }}{% else %}{% with grant_logo='v2/images/grants/logos/' id=grant.id|modulo:3 %} {% static grant_logo|addstr:id|add:'.png' %} {% endwith %} {% endif %}" alt="grant logo" width="25%" >

<p class="grant-email-name">{{ grant.title }}</p>
<p class="grant-email-subtitle">{{ grant.description }}</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ <h2 style="text-transform: none;">{% trans "The world of open source is a better
<hr>
<div class="grantInfo">
<a href="{% url 'grants:details' grant.id grant.slug %}">
<img src="{% if grant.logo and grant.logo.url %}{{ grant.logo.url }}{% else %}{% with grant_logo='v2/images/grants/logos/' id=grant.id|modulo:3|add:1 %} {% static grant_logo|addstr:id|add:'.png' %} {% endwith %} {% endif %}" width="50" height="50" />
<img src="{% if grant.logo and grant.logo.url %}{{ grant.logo.url }}{% else %}{% with grant_logo='v2/images/grants/logos/' id=grant.id|modulo:3 %} {% static grant_logo|addstr:id|add:'.png' %} {% endwith %} {% endif %}" width="50" height="50" />
</a>
<br>
<a class="grantInfoName" href="{% url 'grants:details' grant.id grant.slug %}">
Expand Down

0 comments on commit b41fd07

Please sign in to comment.