Show badges on user profile page
This commit is contained in:
parent
a1c387f520
commit
83550b4cf7
2 changed files with 12 additions and 0 deletions
|
@ -56,6 +56,16 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
|
{% if badges %}
|
||||||
|
<h4>Badges</h4>
|
||||||
|
<div class="mb-3">
|
||||||
|
{% for badge in badges %}
|
||||||
|
<div class="ml-3 mb-1">
|
||||||
|
<img class="mr-2 gt-profile-badge" src="{{badge.img_url}}" width="24px" height="24px" align="baseline">{{badge.name}}
|
||||||
|
</div>
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
{% if teams %}
|
{% if teams %}
|
||||||
<h4>Teams</h4>
|
<h4>Teams</h4>
|
||||||
<ul>
|
<ul>
|
||||||
|
|
|
@ -65,10 +65,12 @@ def show_profile(request, user_id):
|
||||||
|
|
||||||
teams = user.memberships.all()
|
teams = user.memberships.all()
|
||||||
talks = Talk.objects.filter(speaker__user=user)
|
talks = Talk.objects.filter(speaker__user=user)
|
||||||
|
badges = user.user.account.badges.all()
|
||||||
context = {
|
context = {
|
||||||
'user': user,
|
'user': user,
|
||||||
'teams': teams,
|
'teams': teams,
|
||||||
'talks': talks,
|
'talks': talks,
|
||||||
|
'badges': badges,
|
||||||
}
|
}
|
||||||
|
|
||||||
return render(request, 'get_together/users/show_profile.html', context)
|
return render(request, 'get_together/users/show_profile.html', context)
|
||||||
|
|
Loading…
Reference in a new issue