Add avatar color, initials structure, and admin nav dropdown
Lint / Python (flake8) (push) Failing after 1m7s
Lint / JS (eslint) (push) Successful in 10s
Security / Python Security (bandit) (push) Failing after 1m31s
Test / Python Tests (pytest) (push) Successful in 1m8s
Lint / Notify on failure (push) Successful in 2s
Lint / Deploy (push) Has been skipped
Lint / Python (flake8) (push) Failing after 1m7s
Lint / JS (eslint) (push) Successful in 10s
Security / Python Security (bandit) (push) Failing after 1m31s
Test / Python Tests (pytest) (push) Successful in 1m8s
Lint / Notify on failure (push) Successful in 2s
Lint / Deploy (push) Has been skipped
- app.py: avatar_color Jinja filter using deterministic hash → lt-avatar--orange/green/purple - base.html: proper lt-avatar--sm with lt-avatar-initials span and color class; multi-word initials support - base.html: admin users get lt-nav-dropdown for Suppressions; non-admins see flat link; mobile drawer hides Suppressions for non-admins Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -27,6 +27,12 @@ logger = logging.getLogger('gandalf.web')
|
||||
|
||||
app = Flask(__name__)
|
||||
|
||||
_AVATAR_COLORS = ['lt-avatar--orange', 'lt-avatar--green', 'lt-avatar--purple', '']
|
||||
|
||||
@app.template_filter('avatar_color')
|
||||
def avatar_color_filter(name: str) -> str:
|
||||
return _AVATAR_COLORS[abs(hash(name)) % len(_AVATAR_COLORS)]
|
||||
|
||||
_cfg = None
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user