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

grant/cancel-contribute revamp #2946

Merged
merged 4 commits into from
Nov 26, 2018
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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%" />

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it worth DRYing this up a bit?

DRY = dont repeat yourself

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I should do that 🙌

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@owocki is there a specific place you see the need for DRY or just the file in general?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@captnseagraves I believe this was what @owocki was talking about
904a865

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@owocki is there a specific place you see the need for DRY or just the file in general?

the copy/pasted 'warning: were in alpha' warning

<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">

<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
2 changes: 1 addition & 1 deletion app/grants/templates/grants/detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<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 %}">
<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="row">
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/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