openlibrary
openlibrary copied to clipboard
Add user info tooltip to account icon
Closes #8708.
Feature. Uses an HTML title
attribute to show the user's username and joined date when they hover over the account icon.
Technical
Very simple! Used ctx.user
to get the relevant data, and replicated the joined date syntax from the view.html
page. There are definitely fancier ways of making the tooltip that would look more stylish, but for the purpose of simplicity and responsiveness -- and avoiding any awkward tooltip hanging around once the on-click menu is opened -- I figured the title
attribute would be the best way to go.
Testing
Hover over the account icon from any page. After a second or so, a tooltip should appear with the accurate username and user created date.
Screenshot
Stakeholders
@mekarpeles @Abhishektharu
Thank you! Looks good, adding to testing.openlibrary.org for QA