Rank log: inactive ranks (Guardian) count as promotions to and from, demotion when lost; Guardian is staff

This commit is contained in:
Astra 2026-09-29 17:19:53 +01:00
parent 611b79cdba
commit 0af93d1eab
7 changed files with 76 additions and 24 deletions

View file

@ -142,6 +142,7 @@ type rankView struct {
Label string `json:"label"`
Color string `json:"color"`
Supporter bool `json:"supporter,omitempty"`
Inactive bool `json:"inactive,omitempty"`
}
func (s *Server) rankOf(x *staffIndex, steamid string) *rankView {
@ -154,7 +155,7 @@ func (s *Server) rankOf(x *staffIndex, steamid string) *rankView {
return &rankView{Label: "Staff", Color: "#8a91a0"}
}
r := s.site.rank(g, x.groupIndex(g))
return &rankView{Name: g, Label: r.Label, Color: r.Color, Supporter: r.Supporter}
return &rankView{Name: g, Label: r.Label, Color: r.Color, Supporter: r.Supporter, Inactive: r.Inactive}
}
// isStaff is true for admins whose rank isn't a supporter rank.