-
Notifications
You must be signed in to change notification settings - Fork 964
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
add avatar images to collaboration page #3047
Conversation
@lgh2 Looks pretty good! You're right that the user's full name is already there, so I would say that this PR definitely would fix #2875. One thing I'm noticing is that each avatar links to the user's profile, but the username does not currently. It would probably be nice if both linked to the user's profile. |
@di Thank you! I will see about adding links to the usernames and full names. |
42e9da2
to
73b8f60
Compare
<a href="{{ request.route_path('accounts.profile', username=role.user.username) }}" class="tooltipped tooltipped-e" aria-label="{{ role.user.username}}" data-original-label="{{ role.user.username}}"> | ||
<img src="{{ gravatar(role.user.email, size=50) }}" height="50" width="50" alt="{{ alt }}" title="{{ alt }}"> | ||
</a> | ||
<a href="{{ request.route_path('accounts.profile', username=role.user.username) }}"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like we're missing the closing tag for this <a>
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will add it, thank you!
73b8f60
to
4ce6dfe
Compare
Hi @di! When you have a moment, could you take a look at this? |
This LGTM, I think @nlhkabu will have some suggestions though (looks like the avatar needs some padding between it and the name) |
Yes, I would like to hear Nicole's thoughts. I think there is also an issue where a little line appears beside the avatar when the user hovers over them, and I'm not sure how to fix it. |
@lgh2 That's because there is a "whitespace-only text node" in between the end of the You'll need to put them all on one line with no whitespace in between. |
641f487
to
188064e
Compare
@nlhkabu I made the change Dustin suggested above and I think it fixed the issue. We discussed putting the username and the real name on two separate lines, and I think you were going to paste some code related to that? |
188064e
to
4add38b
Compare
hi @lgh2 - yes, but I'm having some trouble getting everything to align nicely. I'll post something once I can get CSS to behave :/ |
hi @lgh2 So, the only solution I could come up with here was to wrap the avatar and names in a container div, and use flexbox to align them. I also made the name and avatars have separate links, so we don't end up with ugly underlines in the middle of nowhere :) <td class="table__user">
<span class="table__user-details">
<a href="{{ request.route_path('accounts.profile', username=role.user.username) }}" class="table__user-gravatar">
{% set alt = "Avatar for {} from gravatar.com".format(role.user.username) %}
<img src="{{ gravatar(role.user.email, size=50) }}" height="50" width="50" alt="{{ alt }}" title="{{ alt }}">
</a>
<a href="{{ request.route_path('accounts.profile', username=role.user.username) }}">
<strong>{{ role.user.username }}</strong>
{% if role.user.name %}
<br>{{ role.user.name }}
{% endif %}
</a>
</span>
</td> This is the required CSS. The Then I've simply applied a right margin to the gravatar to space it out a little. .table__user-details {
display: flex;
align-items: center;
}
.table__user-gravatar {
margin-right: 10px;
} The result: This solution will need to be checked across different resolutions (desktop, tablet, mobile) to make sure it's working properly :) |
4add38b
to
f487733
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great!
Adds avatar images next to username on the page which allows a package owner to modify collaborators (Warehouse/manage/project//collaboration/).
From what I have seen, the existing code already displays real names, if they exist.
@nlhkabu Would it be possible for you to review the styling?
Partially addresses issue #2875.