Add per-role badge colors
Role badges rendered gray for everything except admin, with no way to tell roles apart. Add an optional color per role, matching how statuses and types carry one: new roles.color column (migration 7d27_roles_color), color threaded through the role API and the user serializer, and a ColorSwatchPicker in the role editor. Badges use the role's color with contrast-aware text and fall back to the old admin/gray classes when unset.
This commit is contained in:
@@ -156,6 +156,7 @@ class Role(BaseModel):
|
||||
roleid = db.Column(db.Integer, primary_key=True)
|
||||
rolename = db.Column(db.String(50), unique=True, nullable=False)
|
||||
description = db.Column(db.Text)
|
||||
color = db.Column(db.String(20), comment='CSS color for the role badge')
|
||||
|
||||
# Permissions relationship
|
||||
permissions = db.relationship(
|
||||
|
||||
Reference in New Issue
Block a user