feat(user): more username colors
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Baoshuo Ren 2023-01-15 09:15:30 +08:00
parent c0b442ece0
commit 6dcd43b914
Signed by: baoshuo
GPG Key ID: 00CB9680AB29F51A
2 changed files with 6 additions and 4 deletions

View File

@ -254,13 +254,15 @@ EOD);
if (isSuperUser($user)) { if (isSuperUser($user)) {
$additional_colors['#9d3dcf'] = '紫色 - #9d3dcf'; $additional_colors['#9d3dcf'] = '紫色 - #9d3dcf';
$additional_colors['#fe4c61'] = '红色 - #fe4c61';
} }
$update_profile_form->addVSelect('username_color', $additional_colors + [ $update_profile_form->addVSelect('username_color', $additional_colors + [
'#0d6efd' => '蓝色 - #0d6efd', '#0d6efd' => '蓝色 - #0d6efd',
'#2da44e' => '绿色 - #2da44e', '#2da44e' => '绿色 - #2da44e',
'#f48fb1' => '粉色 - #f48fb1', '#e85aad' => '粉色 - #e85aad',
'#f32a38' => '红色 - #f32a38',
'#f57c00' => '橙色 - #f57c00',
'#00acc1' => '青色 - #00acc1',
], '用户名颜色', $extra['username_color']); ], '用户名颜色', $extra['username_color']);
} }
$update_profile_form->handle = function (&$vdata) use ($user) { $update_profile_form->handle = function (&$vdata) use ($user) {

View File

@ -229,8 +229,8 @@ class UOJUser {
return $custom_color ?: '#9d3dcf'; return $custom_color ?: '#9d3dcf';
} }
// 前管理员设置颜色为紫色、红色的,颜色改为蓝色 // 前管理员设置颜色为紫色的,颜色改为蓝色
if ($custom_color == '#9d3dcf' || $custom_color == '#fe4c61') { if ($custom_color == '#9d3dcf') {
return '#0d6efd'; return '#0d6efd';
} }