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

Feature/new look grants #7332

Closed
wants to merge 5 commits into from
Closed

Conversation

zoek1
Copy link
Contributor

@zoek1 zoek1 commented Sep 4, 2020

Description
  • star/unstar a grant using vue
  • list view of all the grants,
  • Fix grant nav sort issue

https://www.loom.com/share/8eec68f5f2d243c58968f9bd2db25a96

Refers/Fixes

#7163
#7166
#7190

Testing

@zoek1
Copy link
Contributor Author

zoek1 commented Sep 4, 2020

@thelostone-mc are you have some time to check this please? 🙂

Copy link
Contributor

@octavioamu octavioamu left a comment

Choose a reason for hiding this comment

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

Well done Zoek, I left just some few comments

{% include 'grants/card/index.html' %}
</div>
{% endfor %}
<div class="infinite-container row" v-if="grants">
Copy link
Contributor

Choose a reason for hiding this comment

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

I think scroll method is not being call here so probably pagination will not work you need to use the directive scroll.passive (check notifications.html)

<div class="col-12 col-lg-3 col-xl-2" id="sidebar_container">
{% include 'grants/shared/sidebar_search.html' %}
</div>
<div id="grants-showcase">
Copy link
Contributor

Choose a reason for hiding this comment

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

missing v-cloak to hide the vue components until data is loaded (avoid reflow)

<i class="fas fa-spinner fa-spin mr-2"></i>
</div>

<!--p class="mb-0 text-center py-4" v-if="has_next">
Copy link
Contributor

Choose a reason for hiding this comment

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

dead code

@thelostone-mc
Copy link
Member

thelostone-mc commented Sep 6, 2020

@zoek1 could you

<i class="fa fa-star" ></i><span class="ml-1 font-body">Following</span>
{% endif %}
</button>
{% endif %}
Copy link
Member

Choose a reason for hiding this comment

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

^ indent it right

{% if profile.user.is_authenticated %}
    ....
{% endif %}

Copy link
Member

Choose a reason for hiding this comment

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

Why are there changes in this file when this you've removed it's usage in
https://github.com/gitcoinco/web/pull/7332/files#diff-a9ea52761a5188515132b584f9014d16L9 ?

{% load i18n static humanize grants_extra %}
<grant-card inline-template :grant="grant" :cred="credentials" :view="view">
<div class="grant-item grant-item--list flex-md-row flex-column" v-if="view == 'list'">
<div class="grant-item__img col-md-1 d-md-block d-none">
Copy link
Member

Choose a reason for hiding this comment

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

^ 1 tab= 2 spaces indentation please

<div class="match__round pb-1 pt-2 mb-2">
<h2 class="title col-8 font-caption g-bold">
CLR MATCH ROUND 6
</h2>
Copy link
Member

Choose a reason for hiding this comment

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

^ why is this hardcoded ?
This is something which should be available from the backend API.


<div class="col-12 pb-3" v-if="grant.is_clr_eligible">
{# with short=True #}
{% include 'grants/card/clr_estimate.html' %}
Copy link
Member

Choose a reason for hiding this comment

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

shouldn't this be {% include 'grants/card/clr_estimate.html' with short=True %}

</div>
</a>
</div>
</grant-card>
Copy link
Member

Choose a reason for hiding this comment

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

^ could you redo the text and the conditions based on what's in front.html
this code seems a lil outdated

Copy link
Member

@thelostone-mc thelostone-mc left a comment

Choose a reason for hiding this comment

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

@zoek1 looking into this code ! A lot of things would break.
Looks like you started with an outdated branch (over a month old) and never rebased after that

I'd recommend taking the latest code and porting your css + model changes
and redoing the views + HTML changes with the latest code and ensuring you don't overwrite anything

{% if not is_team_member %}
<div class="pt-2 mb-1">
<div class="text-right">
<div>
Copy link
Member

Choose a reason for hiding this comment

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

why the extra div ? + indent fix needed

<i class="far fa-star" ></i><span class="ml-1 font-body">Follow</span>
{% else %}
<i class="fa fa-star" ></i><span class="ml-1 font-body">Following</span>
{% endif %}
Copy link
Member

Choose a reason for hiding this comment

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

^ can be taken outside the if check

{% endif %}
</button>
{% else %}
<span></span>
Copy link
Member

Choose a reason for hiding this comment

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

Is this needed?

{% elif type == 'about' %}
{% include 'grants/shared/landing_announce.html' %}
{% elif type == 'stats' %}
<div id="insert_iframe">
Copy link
Member

Choose a reason for hiding this comment

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

^ could we get this indented right

document.current_type = "{{ type|default:'all' }}";
document.selected_category = "{{ selected_category }}"
document.keyword = "{{ keyword }}"
document.following = "{{ following }}"
Copy link
Member

Choose a reason for hiding this comment

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

this would pop up sentry bugs
Let's wrap em in if checks and keep ; consistent

).keyword(keyword)

_grants = _grants.order_by(sort, 'pk')
____ = _grants.first()
Copy link
Member

Choose a reason for hiding this comment

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

what is this for ?

_grants = _grants.active()

if grant_type != 'all':
_grants = _grants.filter(grant_type=grant_type)
Copy link
Member

Choose a reason for hiding this comment

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

I don't this would works!
It would be grant_type__name

_grants = _grants.order_by(f"-{field_name}")

if category:
_grants = _grants.filter(Q(categories__category__icontains=category))
Copy link
Member

Choose a reason for hiding this comment

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

I don't think would work either as it's now from a table

# {'label': 'Health', 'keyword': 'health', 'count': health_grants_count},
{'label': 'Matic: Build-n-Earn', 'keyword': 'matic', 'count': matic_grants_count},
{'label': 'Crypto for Black Lives', 'keyword': 'change', 'count': change_count},
]
Copy link
Member

Choose a reason for hiding this comment

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

^outdated

<i class="fa fa-star" ></i><span class="ml-1 font-body">Following</span>
{% endif %}
</button>
{% endif %}
Copy link
Member

Choose a reason for hiding this comment

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

Why are there changes in this file when this you've removed it's usage in
https://github.com/gitcoinco/web/pull/7332/files#diff-a9ea52761a5188515132b584f9014d16L9 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants