Skip to content

Commit

Permalink
Make active CLR rounds togglable
Browse files Browse the repository at this point in the history
  • Loading branch information
amustapha committed Dec 1, 2020
1 parent aba512e commit b8327dc
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 32 deletions.
1 change: 1 addition & 0 deletions app/assets/v2/js/grants/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ if (document.getElementById('grants-showcase')) {
data: {
grants: [],
page: 1,
show_active_clrs: true,
collectionsPage: 1,
limit: 6,
sort: 'weighted_shuffle',
Expand Down
74 changes: 42 additions & 32 deletions app/grants/templates/grants/shared/active_clr_round.html
Original file line number Diff line number Diff line change
@@ -1,35 +1,45 @@
<div class="container-fluid grants-container">
<div class="container">
{% for active_round in active_rounds %}
<a href="{% if active_round.sub_round_slug %}{% url 'grants:clr_grants' round_num=active_round.round_num sub_round_slug=active_round.sub_round_slug %}{% else %}{% url 'grants:clr_grants' round_num=active_round.round_num %}{% endif %}"
class="d-block text-decoration-none position-relative my-3 text-white"
style="background: url('{% if active_round.logo %} {{ active_round.logo.url }} {% endif %}') no-repeat center ">
<div class="position-absolute"
style="top: 0; right: 0; width: 100%; height: 100%; background: #0044e088; z-index: 5;"></div>
<div class="d-flex px-4 py-3 justify-content-between position-relative" style="z-index: 10">
<div class="d-flex">
<div class="bg-white mr-3 p-2 overflow-hidden" style="width: 56px; height: 56px; border-radius: 100px;">
<img class="img-responsive" style="width: 100%; height: 100%;"
src="/dynamic/avatar/{{ active_round.owner.handle | default:'gitcoinco'}}" />
</div>
<h5 class="font-weight-bold mb-0">
{% if active_round.display_text %}
{{ active_round.display_text }}
{% elif active_round.customer_name %}
{{ active_round.customer_name }} - {{ active_round.round_num }}
{% elif active_round.sub_round_slug %}
{{ active_round.sub_round_slug|title }} - {{ active_round.round_num }}
{% else %}
{{ active_round.round_num }}
{% endif %}
<br />
<small>{{active_round.start_date | date:'m/Y'}} - {{active_round.end_date | date:'m/Y'}}</small>
</h5>
</div>
<p>${{ active_round.total_pot }}</p>
{% load i18n static get_categories_from_list %}
<div class="container-fluid grants-container">
<div class="container">
<div class="subheading font-weight-bold d-flex justify-content-between" @click="show_active_clrs = !show_active_clrs">
<span>{% trans "Active CLR Rounds" as filts %}{{ filts|upper }}</span>
<span class=" fa fa-fw fa-chevron-down" v-if="!show_active_clrs"></span>
<span class=" fa fa-fw fa-chevron-up" v-if="show_active_clrs"></span>
</div>
<b-collapse :visible="show_active_clrs" id="active_clrs_collapse" >
<div>
{% for active_round in active_rounds %}
<a href="{% if active_round.sub_round_slug %}{% url 'grants:clr_grants' round_num=active_round.round_num sub_round_slug=active_round.sub_round_slug %}{% else %}{% url 'grants:clr_grants' round_num=active_round.round_num %}{% endif %}"
class="d-block text-decoration-none position-relative my-3 text-white"
style="background: url('{% if active_round.logo %} {{ active_round.logo.url }} {% endif %}') no-repeat center ">
<div class="position-absolute"
style="top: 0; right: 0; width: 100%; height: 100%; background: #0044e088; z-index: 5;"></div>
<div class="d-flex px-4 py-3 justify-content-between position-relative" style="z-index: 10">
<div class="d-flex">
<div class="bg-white mr-3 p-2 overflow-hidden" style="width: 56px; height: 56px; border-radius: 100px;">
<img class="img-responsive" style="width: 100%; height: 100%;"
src="/dynamic/avatar/{{ active_round.owner.handle | default:'gitcoinco'}}" />
</div>
<h5 class="font-weight-bold mb-0">
{% if active_round.display_text %}
{{ active_round.display_text }}
{% elif active_round.customer_name %}
{{ active_round.customer_name }} - {{ active_round.round_num }}
{% elif active_round.sub_round_slug %}
{{ active_round.sub_round_slug|title }} - {{ active_round.round_num }}
{% else %}
{{ active_round.round_num }}
{% endif %}
<br />
<small>{{active_round.start_date | date:'m/Y'}} - {{active_round.end_date | date:'m/Y'}}</small>
</h5>
</div>
<p>${{ active_round.total_pot }}</p>

</div>
</a>
{% endfor %}
</div>
</a>
{% endfor %}
</div>
</b-collapse>
</div>
</div>

0 comments on commit b8327dc

Please sign in to comment.