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

Enhancing user's profile #2760

Merged
merged 1 commit into from
Nov 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2088,4 +2088,4 @@



\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
27 changes: 27 additions & 0 deletions app/assets/v2/css/tag.css
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,33 @@
color: #fff;
}

.tag.warning {
background-color: #7E1518;
color: #fff;
}

.tag.warning:hover {
background-color: #D3696C;
}

.tag.success {
background-color: #216A12;
color: #fff;
}

.tag.success:hover {
background-color: #68B159;
}

.tag.in-progress {
background-color: #162955;
color: #fff;
}

.tag.in-progress:hover {
background-color: #4F628E;
}

.tag.token {
background-color: #e7f0fa;
color: var(--gc-blue);
Expand Down
14 changes: 14 additions & 0 deletions app/dashboard/templates/profiles/profile.html
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@
{% if group.activity_bounties %}
<div id="activity-tabs" class="tab-container mt-4 font-body">
<button type="button" id="all" class="section-tab">{% trans "All Activity" %} ({{ group.activity_bounties|length }})</button>
<button type="button" id="progress" class="section-tab">{% trans "Bounties In Progress" %} ({{ group.started_bounties_count }})</button>
<button type="button" id="funded" class="section-tab">{% trans "Bounties Funded" %} ({{ funded_bounties_count }})</button>
<button type="button" id="completed" class="section-tab">{% trans "Bounties Completed" %}</button>
<button type="button" id="tips" class="section-tab">{% trans "Tips Received" %}</button>
Expand All @@ -204,6 +205,19 @@
</div>
</div>
</div>
<div id="section-progress" class="tab-section">
<div class="container">
<div class="row mb-3 p-2">
<div class="col-12">
{% for activity in group.activity_bounties %}
{% if activity.activity_type == 'start_work' %}
{% include "shared/profile_activities_bounty.html" %}
{% endif %}
{% endfor %}
</div>
</div>
</div>
</div>
<div id="section-funded" class="tab-section">
<div class="container">
<div class="row mb-3 p-2">
Expand Down
77 changes: 57 additions & 20 deletions app/dashboard/templates/shared/profile_activities_bounty.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,18 @@
{% elif activity.bounty.github_url %} href="{{ activity.bounty.github_url }}"
{% endif %}>
<div class="avatar-container col-1 justify-content-center special_tag hide_min_viewport">
<img class="avatar" src="{% url 'org_avatar' activity.bounty.bounty_owner_github_username %}?repo=https://github.com/{{ activity.bounty.bounty_owner_github_username }}">
{% if activity.bounty.funding_organisation %}
<img class="avatar" src="{% url 'org_avatar' activity.bounty.funding_organisation %}">
{% else %}
<img class="avatar" src="{% url 'org_avatar' activity.bounty.bounty_owner_github_username %}">
{% endif %}
</div>
<div class="col-12 col-md-8 d-flex flex-column">
<div class="col-12 col-md-7 d-flex flex-column">
<div class="bounty-detail">
<div class="title font-subheader">
{{ activity.bounty.title }}
</div>

<div class="bounty-summary col-12">
<div class="info font-caption">
{% if activity.bounty.experience_level %}
Expand All @@ -19,29 +24,61 @@
{% if activity.bounty.status %}
{{ activity.bounty.status|title }}
{% endif %}
{% if activity.activity_type == 'new_bounty' %}
<span>&bull; {% trans "Funded a new issue " %}</span>
{% elif activity.activity_type == 'start_work' %}
<span>&bull; {% trans "Started work " %}</span>
{% elif activity.activity_type == 'stop_work' %}
<span>&bull; {% trans "Stopped work " %}</span>
{% elif activity.activity_type == 'work_submitted' %}
<span>&bull; {% trans "Submitted work " %}</span>
{% elif activity.activity_type == 'work_done' %}
<span>&bull; {% trans "Work done " %}</span>
{% elif activity.activity_type == 'killed_bounty' %}
<span>&bull; {% trans "Canceled bounty " %}</span>
{% elif activity.activity_type == 'increased_bounty' %}
<span>&bull; {% trans "Increased funding " %}</span>
{% elif activity.activity_type == 'worker_applied' %}
<span>&bull; {% trans "Applied for work " %}</span>
{% endif %}
&bull; {{ activity.created | naturaltime }}
</div>
</div>
</div>
</div>
<div class="col-12 col-md-3 tags font-caption align-items-center">
<div class="col-12 col-md-4 tags fixed font-caption align-items-center">
{% if activity.activity_type == 'new_bounty' %}
<div class="tag in-progress">
<p>
<span>{% trans "Funded a new issue " %}</span>
</p>
</div>
{% elif activity.activity_type == 'start_work' %}
<div class="tag in-progress">
<p>
<span>{% trans "Started work " %}</span>
</p>
</div>
{% elif activity.activity_type == 'stop_work' %}
<div class="tag warning">
<p>
<span>{% trans "Stopped work " %}</span>
</p>
</div>
{% elif activity.activity_type == 'work_submitted' %}
<div class="tag in-progress">
<p>
<span>{% trans "Submitted work " %}</span>
</p>
</div>
{% elif activity.activity_type == 'work_done' %}
<div class="tag success">
<p>
<span>{% trans "Work done " %}</span>
</p>
</div>
{% elif activity.activity_type == 'killed_bounty' %}
<div class="tag warning">
<p>
<span>{% trans "Canceled bounty " %}</span>
</p>
</div>
{% elif activity.activity_type == 'increased_bounty' %}
<div class="tag in-progress">
<p>
<span>{% trans "Increased funding " %}</span>
</p>
</div>
{% elif activity.activity_type == 'worker_applied' %}
<div class="tag in-progress">
<p>
<span>{% trans "Applied for work " %}</span>
</p>
</div>
{% endif %}
{% if activity.bounty.network != 'mainnet' %}
<div class="tag network_warning">
<p>
Expand Down
4 changes: 4 additions & 0 deletions app/dashboard/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1142,6 +1142,10 @@ def profile(request, handle):
profile = profile_helper(handle, current_user=request.user)

context = profile.to_dict()
for activity in context['activities']:
activity['started_bounties_count'] = activity['activity_bounties'].filter(
activity_type='start_work'
).count()
except (Http404, ProfileHiddenException):
status = 404
context = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ def test_default_ranks(self):
def test_bounty_index_terms(self):
"""Test bounty index terms list."""
index_terms = bounty_index_terms(self.bounty)

assert len(index_terms) == 15
assert 'USDT' in index_terms
assert set([self.bounty_payer_handle, self.bounty_earner_handle, 'gitcoinco']).issubset(set(index_terms))
Expand Down