djaodjin/djaoapp

add picture in logged-in user menubar

Closed this issue · 0 comments

Currently the logged in user menu dropdown only shows names. :(

Screenshot 2023-08-31 at 1 50 08 PM

Example layout idea:

Screenshot 2023-08-31 at 1 57 19 PM

The HTML for the menu dropdown is in _menubar.html. The CSS is in djaodjin-menubar.scss. The CSS is explicitly self-contained (not using the Bootstrap css) so it can easily be integrated in any 3rd-party site.
The code in edition_tools.py will inject the _menubar.html HTML code into any HTML file by replacing the element node with class=='.header-menubar' before serving it to the browser client. That's where you will want to add the picture field from the Model into the context.

The default pictures are djaoapp/static/img/default-user.png and djaoapp/static/img/default-organization.png for user and organization accounts respectively.