mirror of
https://github.com/renbaoshuo/S2OJ.git
synced 2024-11-24 14:08:41 +00:00
This commit is contained in:
parent
8f95283b53
commit
bda7c96df6
@ -510,9 +510,9 @@ class HTML {
|
|||||||
'del' => [],
|
'del' => [],
|
||||||
'br' => [],
|
'br' => [],
|
||||||
'span' => [
|
'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-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 = [
|
public static $visibility_codes = [
|
||||||
'all' => [
|
'all' => [
|
||||||
'html' => '',
|
'html' => '',
|
||||||
@ -336,7 +346,7 @@ class UOJUser {
|
|||||||
$color = $cfg['color'] ? UOJUser::getUserColor($user) : '';
|
$color = $cfg['color'] ? UOJUser::getUserColor($user) : '';
|
||||||
|
|
||||||
return HTML::tag('span', [
|
return HTML::tag('span', [
|
||||||
'class' => "uoj-username uoj-username-{$color}",
|
'class' => "uoj-username",
|
||||||
'data-realname' => trim(HTML::escape($realname)),
|
'data-realname' => trim(HTML::escape($realname)),
|
||||||
'data-color' => $color,
|
'data-color' => $color,
|
||||||
], $user['username']);
|
], $user['username']);
|
||||||
|
Loading…
Reference in New Issue
Block a user