Fix non-image-based avatar display when replying to a review.
Review Request #11325 — Created Dec. 8, 2020 and submitted
When replying to a review, we generate HTML intended to appear exactly
like a comment would appear when loading the page, but with indications
that it's a draft. This generally works well, but one noticeable issue
had to do with avatars.If using the fallback avatar (or any custom avatar backend that used
HTML rather than images for display), the result would be a broken
image. This is because the HTML assumed the presence of image URLs for
avatars, rather than the empty strings that an HTML-only avatar would
return.Since HTML-based avatar rendering is the path forward, we now provide a
rendered avatar in the base template as part ofRB.UserSession
, and
provide a convenientRB.UserSession.getAvatarHTML()
as well. The reply
editor view uses this instead of URLs to do the rendering.
Tested a new reply with the HTML-only fallback avatar and with Gravatars.
In both cases, I got a proper avatar.Unit tests pass.
Summary | ID |
---|---|
a9c42f46f5ef72a71668f6929f6a204605d4938a |