mirror of
https://github.com/renbaoshuo/S2OJ.git
synced 2024-11-28 07:16:21 +00:00
This commit is contained in:
parent
8f95283b53
commit
bda7c96df6
@ -510,9 +510,9 @@ class HTML {
|
||||
'del' => [],
|
||||
'br' => [],
|
||||
'span' => [
|
||||
'class' => new CustomClassDef(['uoj-username'], ['uoj-username-']),
|
||||
'class' => 'Enum#uoj-username,' . implode(',', array_map(fn ($c) => "uoj-username-{$c}", UOJUser::AVAILABLE_COLORS)),
|
||||
'data-realname' => 'Text',
|
||||
'data-color' => 'Color',
|
||||
'data-color' => 'Enum#' . implode(',', UOJUser::AVAILABLE_COLORS),
|
||||
],
|
||||
];
|
||||
|
||||
|
@ -26,6 +26,16 @@ class UOJUser {
|
||||
],
|
||||
];
|
||||
|
||||
const AVAILABLE_COLORS = [
|
||||
'blue',
|
||||
'green',
|
||||
'pink',
|
||||
'red',
|
||||
'orange',
|
||||
'cyan',
|
||||
'purple',
|
||||
];
|
||||
|
||||
public static $visibility_codes = [
|
||||
'all' => [
|
||||
'html' => '',
|
||||
@ -336,7 +346,7 @@ class UOJUser {
|
||||
$color = $cfg['color'] ? UOJUser::getUserColor($user) : '';
|
||||
|
||||
return HTML::tag('span', [
|
||||
'class' => "uoj-username uoj-username-{$color}",
|
||||
'class' => "uoj-username",
|
||||
'data-realname' => trim(HTML::escape($realname)),
|
||||
'data-color' => $color,
|
||||
], $user['username']);
|
||||
|
Loading…
Reference in New Issue
Block a user