Skip to content

Commit

Permalink
feat: update grants landing page
Browse files Browse the repository at this point in the history
- new field added to grant model -> grant_type
- new field added to pledge model -> pledge_type
- admin view for tips + pledges + grants updated tabular
- view updated to distinguish between grant types
- fixed buggy search + shareable URI with filters
  • Loading branch information
thelostone-mc committed Dec 14, 2019
1 parent e048574 commit e0d626b
Show file tree
Hide file tree
Showing 9 changed files with 329 additions and 127 deletions.
127 changes: 98 additions & 29 deletions app/assets/v2/css/grants/grant.css
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,10 @@
}

#search_form button {
border-top-left-radius: 0;
border-bottom-left-radius: 0;
border: none;
background: transparent;
right: 1rem;
top: 0.5rem
}

#keyword {
Expand Down Expand Up @@ -151,6 +153,7 @@

.grants_landing .grants-search,
.grants_landing .grants-results,
.grants_landing .grants-matching,
.grants_landing .grants-container {
background-color: #F2F6F9;
}
Expand Down Expand Up @@ -201,10 +204,6 @@
background: transparent !important;
}

.order_by {
margin-top: 0;
}

#search_form .select2-container {
width: auto !important;
font-weight: normal;
Expand All @@ -214,27 +213,65 @@
}

#search_form .sort_container .select2-container {
width: 300px !important;
width: 270px !important;
}

#grants_nav{
border-bottom: 1px solid #333333;
text-align: left;
width: 100%;
#search_form .select2-network-container {
width: 5rem !important;
}

#search_form .network-container .select2-container {
min-width: 5rem;
}

#search_form .select2-selection {
background: #F2F6F9;
border: none !important;
color: var(--gc-blue);
}

#search_form .select2-selection span {
color: #3E00FF;
font-weight: bold;
}

#grants_nav a{
.grants_type_nav {
border-bottom: 1px solid #979797;
}

.grants_type_nav a.selected {
font-weight: bold;
border-bottom: 4px solid #3E00FF;
padding-bottom: 6px;
}

.grants_keyword_nav a:hover {
border-bottom: 1.5px solid black;
padding-bottom: 4px;
}

.grants_keyword_nav a.selected:hover {
border-color: #3E00FF;
}

.grants_nav a {
color: #333333;
margin-right: 30px;
cursor: pointer;
}

#grants_nav a:hover{
font-weight: 700;
.grants_nav a:hover {
text-shadow: 0 0 .01px black, 0 0 .01px black, 0 0 .01px black;
text-decoration: none;
}

#grants_nav .selected{
.select2-selection__arrow {
top: 0 !important;
}

.grants_nav .selected {
font-weight: 1000;
color: #3f24f9;
color: #3f24f9 !important;
}

.arrow_box {
Expand Down Expand Up @@ -269,27 +306,59 @@
margin-left: -33px;
}

.partners {
background: #0D0764;
border-radius: 3px;
}

.partners h2 {
letter-spacing: 3px;
}

.partners img {
border-radius: 50px;
width: 4rem;
}

.partners .nav-tabs {
border: none;

}

.partners .nav-link,
.nav-tabs .nav-line.active {
color: white;
cursor: pointer;
}

.partners .nav-link:hover{
border: none;
}

.nav-tabs .nav-line.active {
font-weight: 700;
}

.total_active_fund p {
color: #25E899;
font-size: 3rem;
font-weight: 650;
}

@media (min-width: 1200px) {
.header .container {
max-width: 1240px;
}
}

@media (max-width: 767.98px) {
.search {
margin-left: 0rem;
margin-right: 0rem;
}

.order_by {
margin-top: 1rem;
padding: 0;
.sort_container {
top: 0;
}
}

@media (max-width: 575.98px) {
.search {
margin-left: 1rem;

@media (max-width: 390px) {
#search_form .sort_container .select2-container {
width: 200px !important;
}
}

Expand Down
9 changes: 9 additions & 0 deletions app/assets/v2/js/grants/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,12 @@ const populateFilters = () => {
if (keyword)
$('#keyword').val(keyword);
};


$('.grants_nav a').on('click', function(event) {
event.preventDefault();
const queryParam = $(this).data('type');
const queryParamValue = $(this).data('value');

updateParams(queryParam, queryParamValue);
});
1 change: 1 addition & 0 deletions app/dashboard/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ class SearchHistoryAdmin(admin.ModelAdmin):


class TipAdmin(admin.ModelAdmin):
list_display = ['pk', 'created_on','sender_profile', 'recipient_profile', 'amount', 'tokenName', 'txid', 'receive_txid']
raw_id_fields = ['recipient_profile', 'sender_profile']
ordering = ['-id']
readonly_fields = ['resend', 'claim']
Expand Down
4 changes: 3 additions & 1 deletion app/grants/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class MatchPledgeAdmin(admin.ModelAdmin):

ordering = ['-id']
raw_id_fields = ['profile']
list_display =['pk', 'profile', 'active','pledge_type','amount']


class GrantAdmin(GeneralAdmin):
Expand All @@ -47,13 +48,14 @@ class GrantAdmin(GeneralAdmin):
'token_address', 'contract_address', 'contract_version', 'network', 'required_gas_price', 'logo_svg_asset',
'logo_asset', 'created_on', 'modified_on', 'team_member_list',
'subscriptions_links', 'contributions_links', 'logo', 'logo_svg', 'image_css',
'link', 'clr_matching', 'clr_prediction_curve', 'hidden'
'link', 'clr_matching', 'clr_prediction_curve', 'hidden', 'grant_type'
]
readonly_fields = [
'logo_svg_asset', 'logo_asset',
'team_member_list',
'subscriptions_links', 'contributions_links', 'link',
]
list_display =['pk', 'title', 'active','grant_type', 'link']
raw_id_fields = ['admin_profile']

# Custom Avatars
Expand Down
23 changes: 23 additions & 0 deletions app/grants/migrations/0035_auto_20191214_0736.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Generated by Django 2.2.4 on 2019-12-14 07:36

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('grants', '0034_contribution_normalized_data'),
]

operations = [
migrations.AddField(
model_name='grant',
name='grant_type',
field=models.CharField(choices=[('tech', 'tech'), ('media', 'media')], default='tech', help_text='Grant CLR category', max_length=15),
),
migrations.AddField(
model_name='matchpledge',
name='pledge_type',
field=models.CharField(choices=[('tech', 'tech'), ('media', 'media')], default='tech', help_text='CLR pledge type', max_length=15),
),
]
12 changes: 12 additions & 0 deletions app/grants/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,13 @@ class Meta:

ordering = ['-created_on']

GRANT_TYPES = [
('tech', 'tech'),
('media', 'media')
]

active = models.BooleanField(default=True, help_text=_('Whether or not the Grant is active.'))
grant_type = models.CharField(max_length=15, choices=GRANT_TYPES, default='tech', help_text=_('Grant CLR category'))
title = models.CharField(default='', max_length=255, help_text=_('The title of the Grant.'))
slug = AutoSlugField(populate_from='title')
description = models.TextField(default='', blank=True, help_text=_('The description of the Grant.'))
Expand Down Expand Up @@ -985,6 +991,11 @@ def __str__(self):
class MatchPledge(SuperModel):
"""Define the structure of a MatchingPledge."""

PLEDGE_TYPES = [
('tech', 'tech'),
('media', 'media')
]

active = models.BooleanField(default=False, help_text=_('Whether or not the MatchingPledge is active.'))
profile = models.ForeignKey(
'dashboard.Profile',
Expand All @@ -999,6 +1010,7 @@ class MatchPledge(SuperModel):
max_digits=50,
help_text=_('The matching pledge amount in DAI.'),
)
pledge_type = models.CharField(max_length=15, choices=PLEDGE_TYPES, default='tech', help_text=_('CLR pledge type'))
comments = models.TextField(default='', blank=True, help_text=_('The comments.'))
end_date = models.DateTimeField(null=False, default=next_month)
data = models.TextField(blank=True)
Expand Down
Loading

1 comment on commit e0d626b

@owocki
Copy link
Contributor

@owocki owocki commented on e0d626b Dec 28, 2019

Choose a reason for hiding this comment

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

one area we forgot to update is the infinite scroll link. i got it covered here tho! f2dff85

Please sign in to comment.