Add a fallback avatar service for when other services aren't available.
Review Request #10443 — Created March 12, 2019 and submitted
With the existing avatar implementation, users that don't have a usable
avatar service (such as when Gravatars are used but the user has opted
out) would result in an empty space where the avatar would otherwise go.
This could lead to display inconsistencies, unwanted logging, or other
problems.This change adds a new avatar service that's used as a fallback when no
other service is available. This will show the first two letters of the
username, overlayed on top of a colored background. The background color
is based on the username, helping to provide different visuals for
different users.Consumers can replace the fallback with some other service by overriding
fallback_service_class
on the registry.To help with styling, both the existing avatars and the new ones have
new namespaced CSS classes (.djblets-o-avatar
), which are meant to
replace the.avatar
class (though this is still used).
Unit tests pass.
Tested various avatar sizes, making sure the fonts are in proportion.
Summary | ID |
---|---|
43639974c112234e27e6681eab5d145cfa595646 |
Description | From | Last Updated |
---|---|---|
From the comments it looks like your intent was to use the initials if the user has first and last … |
david | |
W391 blank line at end of file |
reviewbot | |
Can we use the full name if it exists? |
david | |
W391 blank line at end of file |
reviewbot | |
These don't impact the result now that it's definitely username-only, so they can be removed. |
david |
- Change Summary:
-
Fixed the description of
FallbackService
to not incorrectly claim that the user's full name's initials are used. - Commits:
-
Summary ID 46e1d0bfa72f0f2bae73b76ecccb5cfa8524921b e351471795341f25beb63eb23a750ae28221c754
- Change Summary:
-
Removed the fallback from the registered service list. It now exists outside it, meaning it will no longer show up in any lists of available services, and will truly exist as a fallback.
- Commits:
-
Summary ID e351471795341f25beb63eb23a750ae28221c754 b9f1f64f22aa7d3735c55ca07af013244b550109