Skip to content

Commit

Permalink
Fix "no avatar" displays in new ui
Browse files Browse the repository at this point in the history
  • Loading branch information
ffont committed Nov 8, 2023
1 parent 9d64ffc commit 95d2de4
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 7 deletions.
9 changes: 4 additions & 5 deletions accounts/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,11 +241,10 @@ def locations_static(user_id, has_avatar):
l_avatar = settings.AVATARS_URL + "%s/%d_L.jpg" % (id_folder, user_id)
xl_avatar = settings.AVATARS_URL + "%s/%d_XL.jpg" % (id_folder, user_id)
else:
# NOTE: this images are no longer used in the new UI, this might be refactored
s_avatar = static(f'bw-frontend/public/32x32_avatar.png')
m_avatar = static(f'bw-frontend/public/40x40_avatar.png')
l_avatar = static(f'bw-frontend/public/70x70_avatar.png')
xl_avatar = static(f'bw-frontend/public/100x100_avatar.png')
s_avatar = None
m_avatar = None
l_avatar = None
xl_avatar = None
return dict(
avatar=dict(
S=dict(
Expand Down
Binary file not shown.
Binary file removed freesound/static/bw-frontend/public/32x32_avatar.png
Binary file not shown.
Binary file removed freesound/static/bw-frontend/public/40x40_avatar.png
Binary file not shown.
Binary file removed freesound/static/bw-frontend/public/70x70_avatar.png
Binary file not shown.
1 change: 0 additions & 1 deletion general/templatetags/bw_templatetags.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ def bw_user_avatar(avatar_url, username, size=40, extra_class=''):

return {
'size': size,
'has_avatar': '_avatar.png' not in avatar_url,
'avatar_url':avatar_url,
'username': username,
'font_size': int(size * 0.4),
Expand Down
2 changes: 1 addition & 1 deletion templates/atoms/avatar.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% if has_avatar %}
{% if avatar_url is not None %}
<div class="avatar" style="width:{{ size }}px;height:{{ size }}px;">
<img src="{{ avatar_url }}" class="avatar {{ extra_class }}" style="width:{{ size }}px;height:{{ size }}px;" />
</div>
Expand Down

0 comments on commit 95d2de4

Please sign in to comment.