Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Beautify with automatic avatars #37

Merged
merged 2 commits into from
Mar 17, 2021
Merged

Beautify with automatic avatars #37

merged 2 commits into from
Mar 17, 2021

Conversation

lanjelot
Copy link
Collaborator

@lanjelot lanjelot commented Mar 17, 2021

Now pulls the user's avatar from gravatar (which is based on the user's email md5 hash). If gravatar doesn't have a match then we pull a colored image from https://eu.ui-avatars.com/ containing the first 2 letters of the user's username. Also you can now mouse-over the avatar image to display the full username (thx to the title attribute in the <img tag), so I removed the usernames from the podium since they looked a bit crooked anyway.

On the Player Ranking page I made the left hand side more compact by removing the second h5 header and card-body div, so now there's only one h5 the All Time Ranking h5, and the 2 tables are now inside the same card-body div. It works but tbh i have no idea what i'm doing when it comes to html/css.

<td>
<a href="{% url 'ctfpad:users-detail' member.id %}">{{member.username}}</a>
</td>
<td style="text-align: center;"><img height="20px" width="25px" src="{{member.country_flag_url}}" alt="{{member.country}}" class="rounded-circle"></td>
<td style="text-align: center;"><img height="25px" width="25px" src="{{member.country_flag_url}}" alt="{{member.country}}" class="rounded-circle"></td>
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the country flag image looked slightly oval before...

@hugsy hugsy merged commit 58f8005 into hugsy:master Mar 17, 2021
@lanjelot lanjelot deleted the auto-avatar branch March 17, 2021 17:43
@hugsy hugsy added this to the 0.1 milestone Jun 21, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants