feat(web/problems): my_problem badge

This commit is contained in:
Baoshuo Ren 2022-10-08 12:07:49 +08:00
parent a90815b20c
commit a674a54e8b
Signed by: baoshuo
GPG Key ID: 00CB9680AB29F51A
4 changed files with 10 additions and 10 deletions

View File

@ -37,22 +37,21 @@
} else { } else {
echo '<td class="text-left">'; echo '<td class="text-left">';
} }
if ($problem['uploader'] == $myUser['username']) {
echo ' <span class="text-info">[我的题目]</span> ';
}
echo '<a '; echo '<a ';
if (isset($REQUIRE_LIB['bootstrap5'])) { if (isset($REQUIRE_LIB['bootstrap5'])) {
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['uploader'] == $myUser['username']) {
echo ' <span class="badge text-white bg-info">', UOJLocale::get('problems::my problem') ,'</span> ';
}
if ($problem['is_hidden']) { if ($problem['is_hidden']) {
echo ' <span class="badge text-bg-danger"><i class="bi bi-eye-slash-fill"></i> ', UOJLocale::get('hidden'), '</span> '; 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> ';
foreach (queryProblemTags($problem['id']) as $tag) { foreach (queryProblemTags($problem['id']) as $tag) {
if (isset($REQUIRE_LIB['bootstrap5'])) { if (isset($REQUIRE_LIB['bootstrap5'])) {
echo '<a class="uoj-problem-tag my-1">'; echo '<a class="uoj-problem-tag my-1">';

View File

@ -49,22 +49,21 @@
} else { } else {
echo '<td class="text-left">'; echo '<td class="text-left">';
} }
if ($problem['uploader'] == $myUser['username']) {
echo ' <span class="text-info">[我的题目]</span> ';
}
echo '<a '; echo '<a ';
if (isset($REQUIRE_LIB['bootstrap5'])) { if (isset($REQUIRE_LIB['bootstrap5'])) {
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['uploader'] == $myUser['username']) {
echo ' <span class="badge text-white bg-info">', UOJLocale::get('problems::my problem') ,'</span> ';
}
if ($problem['is_hidden']) { if ($problem['is_hidden']) {
echo ' <span class="badge text-bg-danger"><i class="bi bi-eye-slash-fill"></i> ', UOJLocale::get('hidden'), '</span> '; 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> ';
foreach (queryProblemTags($problem['id']) as $tag) { foreach (queryProblemTags($problem['id']) as $tag) {
if (isset($REQUIRE_LIB['bootstrap5'])) { if (isset($REQUIRE_LIB['bootstrap5'])) {
echo '<a class="uoj-problem-tag my-1">'; echo '<a class="uoj-problem-tag my-1">';

View File

@ -6,6 +6,7 @@ return [
'template problems' => 'Template Problems', 'template problems' => 'Template Problems',
'add new' => 'Add new problem', 'add new' => 'Add new problem',
'add new list' => 'Add new problem list', 'add new list' => 'Add new problem list',
'my problem' => 'My problem',
'title' => 'Title', 'title' => 'Title',
'total' => 'Total', 'total' => 'Total',
'ac' => 'AC', 'ac' => 'AC',

View File

@ -6,6 +6,7 @@ return [
'template problems' => '模板题库', 'template problems' => '模板题库',
'add new' => '添加新题', 'add new' => '添加新题',
'add new list' => '添加新题单', 'add new list' => '添加新题单',
'my problem' => '我的题目',
'title' => '标题', 'title' => '标题',
'total' => '总题数', 'total' => '总题数',
'ac' => 'AC', 'ac' => 'AC',