Skip to content

Commit 6ee3898

Browse files
authored
Add Github Link to repo on Grant Detail info (#7301)
* object github url * add view * form update * append github url * add migrations * template * github link on info * asterikx on required fields * added required badge * indent feedback lostone
1 parent 4cd3154 commit 6ee3898

File tree

7 files changed

+42
-4
lines changed

7 files changed

+42
-4
lines changed

app/assets/v2/js/grants/new.js

+1
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ const init = () => {
120120
formData.append('description', description.getText());
121121
formData.append('description_rich', JSON.stringify(description.getContents()));
122122
formData.append('reference_url', $('#input-url').val());
123+
formData.append('github_project_url', $('#github_project_url').val());
123124
formData.append('admin_address', $('#input-admin_address').val());
124125
formData.append('contract_owner_address', $('#contract_owner_address').val());
125126
if ($('#token_address').length) {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Generated by Django 2.2.4 on 2020-08-30 13:24
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('grants', '0068_auto_20200708_0906'),
10+
]
11+
12+
operations = [
13+
migrations.AddField(
14+
model_name='grant',
15+
name='github_project_url',
16+
field=models.URLField(blank=True, help_text='Grant Github Project URL'),
17+
),
18+
]

app/grants/forms.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class Meta:
3131

3232
model = Grant
3333
fields = (
34-
'title', 'description', 'reference_url', 'logo', 'logo_svg', 'admin_address', 'deploy_tx_id',
34+
'title', 'description', 'reference_url', 'github_project_url', 'logo', 'logo_svg', 'admin_address', 'deploy_tx_id',
3535
'cancel_tx_id', 'amount_received', 'token_address', 'contract_address', 'metadata', 'network',
3636
'required_gas_price', 'admin_profile', 'team_members'
3737
)

app/grants/models.py

+1
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ class Meta:
166166
description = models.TextField(default='', blank=True, help_text=_('The description of the Grant.'))
167167
description_rich = models.TextField(default='', blank=True, help_text=_('HTML rich description.'))
168168
reference_url = models.URLField(blank=True, help_text=_('The associated reference URL of the Grant.'))
169+
github_project_url = models.URLField(blank=True, help_text=_('Grant Github Project URL'))
169170
is_clr_eligible = models.BooleanField(default=True, help_text="Is grant eligible for CLR")
170171
link_to_new_grant = models.ForeignKey(
171172
'grants.Grant',

app/grants/templates/grants/detail/info.html

+12
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,18 @@ <h1 class="font-title-xl my-4 font-weight-bold">
101101
</p>
102102
</div>
103103
{% endif %}
104+
105+
{% if grant.github_project_url %}
106+
<div class="font-body mb-2">
107+
<i style="width: 14px;" class="fab fa-github-square mr-2 text-center"></i>
108+
<p class="d-inline-block mb-0">
109+
<a href="{{ grant.github_project_url }}" target="_blank" rel="" data-toggle="tooltip" data-html="true" data-placement="top" for="github_project_url"
110+
title="Project Github URL">
111+
{{ grant.github_project_url }}
112+
</a>
113+
</p>
114+
</div>
115+
{% endif %}
104116

105117
<div class="mb-2">
106118
<i style="width: 14px;" class="fab fa-ethereum mr-2 text-center"></i>

app/grants/templates/grants/new.html

+8-3
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ <h5 class="mt-4">Project Information</h5>
7676
</div>
7777

7878
<div class="form__group-horizontal pb-3">
79-
<label class="font-body" for="input_title">{% trans "Project Title" %}</label>
79+
<label class="font-body" for="input_title">{% trans "Project Title" %} <span class="badge badge-greylight text-capitalize">Required</span></label>
8080
<input class="form__input form__input-lg " maxlength="150" type="text" id="input_title" name="input_title" placeholder="The Human Fund" required />
8181
</div>
8282

@@ -87,7 +87,7 @@ <h5 class="mt-4">Project Information</h5>
8787
</div>
8888

8989
<div class="form__group-horizontal pb-3">
90-
<label class="font-body" for="input-url">{% trans "Project Website" %}</label>
90+
<label class="font-body" for="input-url">{% trans "Project Website" %} <span class="badge badge-greylight text-capitalize">Required</span></label>
9191
<input type="url" class="form__input form__input-lg " id="input-url" name="reference_url" placeholder="https://human.fund/" required/>
9292
</div>
9393

@@ -108,6 +108,11 @@ <h5 class="mt-4">Project Information</h5>
108108
<label class="font-body" for="input-handle2">{% trans "Your Twitter Handle" %}</label>
109109
<input type="text" class="form__input form__input-lg " id="input-handle2" name="handle2" placeholder="@georgecostanza"/>
110110
</div>
111+
112+
<div class="form__group-horizontal pb-3">
113+
<label class="font-body" for="github_project_url">{% trans "Github Project URL" %}</label>
114+
<input type="url" class="form__input form__input-lg " id="github_project_url" name="github_project_url" placeholder="https://github.com/human-fund"/>
115+
</div>
111116

112117
<h5 class="mt-4">Categorization Information</h5>
113118
<hr>
@@ -147,7 +152,7 @@ <h5 class="mt-4">Funding Information</h5>
147152
</div>
148153

149154
<div class="form__group-horizontal pb-3">
150-
<label class="font-body" for="input-admin_address">{% trans "Funding Recipient Wallet Address" %}</label>
155+
<label class="font-body" for="input-admin_address">{% trans "Funding Recipient Wallet Address" %} <span class="badge badge-greylight text-capitalize">Required</span></label>
151156
<input type="text" class="form__input form__input-lg " id="input-admin_address" value="" name="admin_address" required placeholder="0x00... or domain.eth"/>
152157
<label class="font-body" for="input-admin_address">{% trans "This is where funds from contributors to this grant will be sent." %}</label>
153158
<label class="font-body" for="input-admin_address"><i class="fas fa-exclamation-circle"></i> - {% trans "IMPORTANT NOTE - Contributions to this grant will be sent directly via the Ethereum blockchain to *this address*. Gitcoin does *not* escrow any funds. Gitcoin does *not* have the ability to reverse any transactions. As a preventative measure, please confirm that someone working on the project has access to funds that are sent to this address!" %}</label>

app/grants/views.py

+1
Original file line numberDiff line numberDiff line change
@@ -770,6 +770,7 @@ def grant_new(request):
770770
'description': request.POST.get('description', ''),
771771
'description_rich': request.POST.get('description_rich', ''),
772772
'reference_url': request.POST.get('reference_url', ''),
773+
'github_project_url': request.POST.get('github_project_url', ''),
773774
'admin_address': request.POST.get('admin_address', ''),
774775
'contract_owner_address': request.POST.get('contract_owner_address', ''),
775776
'token_address': request.POST.get('token_address', ''),

0 commit comments

Comments
 (0)