feat(web/problems): is_hidden badge

This commit is contained in:
Baoshuo Ren 2022-10-08 12:04:54 +08:00
parent b97d606b07
commit a90815b20c
Signed by: baoshuo
GPG Key ID: 00CB9680AB29F51A
4 changed files with 11 additions and 6 deletions

View File

@ -37,9 +37,6 @@
} else { } else {
echo '<td class="text-left">'; echo '<td class="text-left">';
} }
if ($problem['is_hidden']) {
echo ' <span class="text-danger">[隐藏]</span> ';
}
if ($problem['uploader'] == $myUser['username']) { if ($problem['uploader'] == $myUser['username']) {
echo ' <span class="text-info">[我的题目]</span> '; echo ' <span class="text-info">[我的题目]</span> ';
} }
@ -49,6 +46,10 @@
} }
echo ' href="/problem/', $problem['id'], '">', $problem['title'], '</a>'; echo ' href="/problem/', $problem['id'], '">', $problem['title'], '</a>';
if ($problem['is_hidden']) {
echo ' <span class="badge text-bg-danger"><i class="bi bi-eye-slash-fill"></i> ', UOJLocale::get('hidden'), '</span> ';
}
if (isset($_COOKIE['show_tags_mode'])) { if (isset($_COOKIE['show_tags_mode'])) {
echo ' <span class="text-info" style="font-size: 10px">' . $problem["uploader"] . '</span> '; echo ' <span class="text-info" style="font-size: 10px">' . $problem["uploader"] . '</span> ';

View File

@ -49,9 +49,6 @@
} else { } else {
echo '<td class="text-left">'; echo '<td class="text-left">';
} }
if ($problem['is_hidden']) {
echo ' <span class="text-danger">[隐藏]</span> ';
}
if ($problem['uploader'] == $myUser['username']) { if ($problem['uploader'] == $myUser['username']) {
echo ' <span class="text-info">[我的题目]</span> '; echo ' <span class="text-info">[我的题目]</span> ';
} }
@ -60,6 +57,11 @@
echo ' class="text-decoration-none" '; echo ' class="text-decoration-none" ';
} }
echo ' href="/problem/', $problem['id'], '">', $problem['title'], '</a>'; echo ' href="/problem/', $problem['id'], '">', $problem['title'], '</a>';
if ($problem['is_hidden']) {
echo ' <span class="badge text-bg-danger"><i class="bi bi-eye-slash-fill"></i> ', UOJLocale::get('hidden'), '</span> ';
}
if (isset($_COOKIE['show_tags_mode'])) { if (isset($_COOKIE['show_tags_mode'])) {
echo ' <span class="text-info" style="font-size: 10px">' . $problem["uploader"] . '</span> '; echo ' <span class="text-info" style="font-size: 10px">' . $problem["uploader"] . '</span> ';

View File

@ -39,6 +39,7 @@ return [
'sex' => 'Sex', 'sex' => 'Sex',
'motto' => 'Motto', 'motto' => 'Motto',
'view all' => 'View all', 'view all' => 'View all',
'hidden' => 'Hidden',
'appraisal' => 'Appraisal', 'appraisal' => 'Appraisal',
'submit' => 'Submit', 'submit' => 'Submit',
'browse' => 'Browse', 'browse' => 'Browse',

View File

@ -39,6 +39,7 @@ return [
'sex' => '性别', 'sex' => '性别',
'motto' => '格言', 'motto' => '格言',
'view all' => '查看全部', 'view all' => '查看全部',
'hidden' => '隐藏',
'appraisal' => '评价', 'appraisal' => '评价',
'submit' => '提交', 'submit' => '提交',
'browse' => '浏览', 'browse' => '浏览',