Skip to content

Commit

Permalink
Merge branch 'feature/cards' of github.com:zoek1/web-1 into HEAD
Browse files Browse the repository at this point in the history
  • Loading branch information
androolloyd committed Apr 27, 2020
2 parents 2024dd9 + 712f575 commit 25d97df
Show file tree
Hide file tree
Showing 4 changed files with 192 additions and 10 deletions.
45 changes: 45 additions & 0 deletions app/assets/v2/css/town_square.css
Original file line number Diff line number Diff line change
Expand Up @@ -1049,3 +1049,48 @@ body.green.offer_view .announce {
.promo .close-promo i {
font-weight: 100;
}

.new_grant {
border-top: 6px solid rgba(13, 7, 100, 0.25);
}

.new_kudos {
border-top: 6px solid rgba(0, 163, 255, 0.25);
}

.new_bounty {
border-top: 6px solid rgba(62, 0, 255, 0.4);
}

.new_hackathon_project {
border-top: 6px solid rgba(15, 206, 124, 0.25);
}

.bg-gc-blue {
background-color: var(--gc-blue);
}

.bg-gc-green {
background-color: var(--gc-green);
}

.bg-light-blue {
background-color: #00A3FF;
}

.bg-gc-dark-blue {
background-color: #0D0764;
}

.card-ribbon {
margin-top: -14px;
right: -10px;
width: 110px;
margin-bottom: 10px;
position: absolute;
}

.logo-metacard {
max-height: 4rem;
max-width: 4rem;
}
24 changes: 24 additions & 0 deletions app/dashboard/migrations/0102_auto_20200423_1227.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Generated by Django 2.2.4 on 2020-04-23 12:27

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

dependencies = [
('dashboard', '0101_auto_20200420_1427'),
]

operations = [
migrations.AddField(
model_name='activity',
name='project',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='projects_activities', to='dashboard.HackathonProject'),
),
migrations.AlterField(
model_name='activity',
name='activity_type',
field=models.CharField(blank=True, choices=[('wall_post', 'Wall Post'), ('status_update', 'Update status'), ('new_bounty', 'New Bounty'), ('start_work', 'Work Started'), ('stop_work', 'Work Stopped'), ('work_submitted', 'Work Submitted'), ('work_done', 'Work Done'), ('worker_approved', 'Worker Approved'), ('worker_rejected', 'Worker Rejected'), ('worker_applied', 'Worker Applied'), ('increased_bounty', 'Increased Funding'), ('killed_bounty', 'Canceled Bounty'), ('new_tip', 'New Tip'), ('receive_tip', 'Tip Received'), ('bounty_abandonment_escalation_to_mods', 'Escalated checkin from @gitcoinbot about bounty status'), ('bounty_abandonment_warning', 'Checkin from @gitcoinbot about bounty status'), ('bounty_removed_slashed_by_staff', 'Dinged and Removed from Bounty by Staff'), ('bounty_removed_by_staff', 'Removed from Bounty by Staff'), ('bounty_removed_by_funder', 'Removed from Bounty by Funder'), ('new_crowdfund', 'New Crowdfund Contribution'), ('new_grant', 'New Grant'), ('update_grant', 'Updated Grant'), ('killed_grant', 'Cancelled Grant'), ('negative_contribution', 'Negative Grant Contribution'), ('new_grant_contribution', 'Contributed to Grant'), ('new_grant_subscription', 'Subscribed to Grant'), ('killed_grant_contribution', 'Cancelled Grant Contribution'), ('new_kudos', 'New Kudos'), ('created_kudos', 'Created Kudos'), ('receive_kudos', 'Receive Kudos'), ('joined', 'Joined Gitcoin'), ('played_quest', 'Played Quest'), ('beat_quest', 'Beat Quest'), ('created_quest', 'Created Quest'), ('updated_avatar', 'Updated Avatar'), ('mini_clr_payout', 'Mini CLR Payout'), ('leaderboard_rank', 'Leaderboard Rank'), ('consolidated_leaderboard_rank', 'Consolidated Leaderboard Rank'), ('consolidated_mini_clr_payout', 'Consolidated CLR Payout'), ('new_hackathon_project', 'New Hackathon Project'), ('hackathon_registration', 'Hackathon Registration'), ('flagged_grant', 'Flagged Grant')], db_index=True, max_length=50),
),
]
7 changes: 7 additions & 0 deletions app/dashboard/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2081,6 +2081,7 @@ class Activity(SuperModel):
('consolidated_leaderboard_rank', 'Consolidated Leaderboard Rank'),
('consolidated_mini_clr_payout', 'Consolidated CLR Payout'),
('hackathon_registration', 'Hackathon Registration'),
('new_hackathon_project', 'New Hackathon Project'),
('flagged_grant', 'Flagged Grant'),
]

Expand Down Expand Up @@ -2133,6 +2134,12 @@ class Activity(SuperModel):
on_delete=models.CASCADE,
blank=True, null=True
)
project = models.ForeignKey(
'dashboard.HackathonProject',
related_name='hackathon_projects',
on_delete=models.CASCADE,
blank=True, null=True
)

created = models.DateTimeField(auto_now_add=True, blank=True, null=True, db_index=True)
activity_type = models.CharField(max_length=50, choices=ACTIVITY_TYPES, blank=True, db_index=True)
Expand Down
126 changes: 116 additions & 10 deletions app/retail/templates/shared/activity.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.

{% endcomment %}
{% load humanize i18n static %}
{% load humanize i18n static grants_extra %}
<div class="box bg-white d-block m-0 mb-3 activity {{ row.activity_type }} infinite-item px-sm-3 py-4" data-pk="{{row.pk}}">
{% if row.activity_type == 'new_bounty' %}
<div class="align-items-baseline d-flex font-weight-bold justify-content-between mb-2 mt-n3">
<b>New Bounty</b>
<i class="fad fa-sparkles" style="right: 0.2em; color: #3e00ff;"></i>
</div>
{% endif %}
<div class="activity_main row">
<div class="col-2 p-0">
<div class="activity-avatar">
Expand Down Expand Up @@ -365,8 +359,29 @@

</div>
</div>
<div class="d-none d-sm-inline col-sm-2 pl-0">
<div class="activity_time font-smaller-5 text-right">
<div class="d-none d-sm-inline col-sm-2 pl-0 position-relative">
{% if row.activity_type == 'new_bounty' %}
<div class="bg-gc-blue card-ribbon px-2 text-center">
<i style="font-size: 14px" class="text-white fas fa-tools"></i>
<span class="text-white font-weight-bold font-smaller-2 text-capitalize">New bounty</span>
</div>
{% elif row.activity_type == 'new_kudos' %}
<div class="bg-light-blue card-ribbon px-2 text-center">
<img height="15" src="{% static 'v2/images/top-bar/kudos_symbol_dark.svg' %}" alt="">
<span class="text-white font-weight-bold font-smaller-2 text-capitalize">New kudos</span>
</div>
{% elif row.activity_type == 'new_hackathon_project' %}
<div class="bg-gc-green card-ribbon px-2 text-center">
<img height="15" src="{% static 'v2/images/Lightbulb.svg' %}" alt="">
<span class="text-white font-weight-bold font-smaller-2 text-capitalize">New Project</span>
</div>
{% elif row.activity_type == 'new_grant' %}
<div class="bg-gc-dark-blue card-ribbon px-2 text-center">
<img height="15" src="{% static 'v2/images/products/grants-logo.svg' %}" alt="">
<span class="text-white font-weight-bold font-smaller-2 text-capitalize">New Grant</span>
</div>
{% endif %}
<div class="activity_time font-smaller-5 mt-4 text-right">
{% if not hide_date %}
{{ row.created_human_time }}
{% endif %}
Expand All @@ -388,7 +403,98 @@
</div>
</div>
</div>
{% if row.metadata.poll_choices %}
{% if row.activity_type == 'new_bounty' %}
<div class="mt-1 mb-2">
<div class="row align-items-center bg-light content py-3">
<div class="col-12 col-md-2 text-center">
{% if row.bounty.funding_organisation %}
<img class="logo-metacard rounded-circle" src="{% url 'org_avatar' row.bounty.funding_organisation %}">
{% else %}
<img class="logo-metacard rounded-circle" src="{% url 'org_avatar' row.bounty.bounty_owner_github_username %}">
{% endif %}
</div>
<div class="col-12 col-md-7 d-flex flex-column">
<div class="bounty-detail">
<div class="title font-subheader font-weight-bold">
{{ row.bounty.title }}
</div>

<div class="bounty-summary p-0 col-12">
<div class="info font-caption">
{% if row.bounty.funding_organisation %}
{{ row.bounty.funding_organisation }}
{% else %}
{{ row.bounty.bounty_owner_github_username }}
{% endif %}
</div>
</div>
</div>
</div>
<div class="col-12 col-md-3 tags fixed font-caption justify-content-end text-right">
<div class="tag token">
<p>
{{ row.bounty.value_true }}
<span>{{ row.bounty.token_name }}</span>
</p>
</div>
{% if row.bounty.value_in_usdt_now %}
<div class="tag usd">
<p>
{{ row.bounty.value_in_usdt_now }}
<span>USD</span>
</p>
</div>
{% endif %}
</div>
</div>
{% elif row.activity_type == 'new_kudos' %}
<div class="mt-1 mb-2">
<div class="row align-items-center bg-light content py-3">
<div class="col-12 col-md-3 text-center">
<img class="logo-metacard" src="{{ row.kudos.img_url }}">
</div>
<div class="col-12 col-md-9 text-left">
<p class="mt-2 mb-1 font-weight-bold" style="font-size: 1.2em;">{{ row.kudos.ui_name }}</p>
<p class="small">{{ row.kudos.description|truncatechars:200}}</p>
</div>
</div>
</div>
{% elif row.activity_type == 'new_hackathon_project' %}
<div class="mt-1 mb-2">
<div class="row align-items-center bg-light content py-3">
<div class="col-12 col-md-2 text-center">
{% if row.project.logo %}
<img class="logo-metacard rounded-circle" src="{{MEDIA_URL}}{{row.project.logo}}" alt="Hackathon logo" />
{% else %}
<img class="logo-metacard rounded-circle" src="{{ row.project.bounty.avatar_url }}" alt="{{row.project.bounty.org_name}}" />
{% endif %}
</div>
<div class="col-12 col-md-6 text-left">
<p class="mt-2 mb-1 font-weight-bold" style="font-size: 1.2em;">{{ row.project.name }}</p>
<p class="small">for {% if row.project.bounty.funding_organisation %}
<img class="rounded-circle" height="20" src="{% url 'org_avatar' row.project.bounty.funding_organisation %}"> {{ row.project.bounty.funding_organisation }}
{% else %}
<img class="rounded-circle" height="20" src="{% url 'org_avatar' row.project.bounty.bounty_owner_github_username %}"> {{ row.project.bounty.bounty_owner_github_username }}
{% endif %} on <span class="font-weight-bold">{{ row.project.hackathon.name }}</span></p>
</div>
<div class="col-12 col-md-3 text-left d-flex">
<i class="fas fa-wrench gc-text-blue mr-2 mt-4"></i> <p class="gc-text-blue text-capitalize font-smaller-1"> Looking for<br> team members</p>
</div>
</div>
</div>
{% elif row.activity_type == 'new_grant' %}
<div class="mt-1 mb-2">
<div class="row align-items-center bg-light content py-3">
<div class="col-12 col-md-2 text-center">
<img class="logo-metacard rounded-circle" src="{% if row.grant.logo and row.grant.logo.url %}{{ row.grant.logo.url }}{% else %}{% with grant_logo='v2/images/grants/logos/' id=row.grant.id|modulo:3 %}{% static grant_logo|addstr:id|add:'.png' %}{% endwith %}{% endif %}">
</div>
<div class="col-12 col-md-9 text-left">
<p class="mt-2 mb-1 font-weight-bold" style="font-size: 1.2em;">{{ row.grant.title }}</p>
<p class="small">{{ row.grant.description|truncatechars:200}}</p>
</div>
</div>
</div>
{% elif row.metadata.poll_choices %}
<div class="poll_choices {% if row.metadata.poll_answered %}answered{%endif%}">
{% for ele in row.metadata.poll_choices %}
<div data-vote="{{ forloop.counter0 }}" class=" vote {% if row.metadata.poll_answered == ele.i %}answer{%endif%}">
Expand Down

0 comments on commit 25d97df

Please sign in to comment.